From adec87cf5d2141ba780cf45aa480b8178aafb773 Mon Sep 17 00:00:00 2001 From: matthieu Date: Fri, 7 Jun 2013 17:28:45 +0000 Subject: [PATCH] Update to X server 1.14.1. Tested by many during t2k13. Thanks. --- xserver/COPYING | 2 +- xserver/ChangeLog | 12742 +++++++++++++++- xserver/Makefile.am | 7 + xserver/Makefile.bsd-wrapper | 12 +- xserver/Makefile.in | 27 +- xserver/Xext/Makefile.am | 42 +- xserver/Xext/Makefile.in | 139 +- xserver/Xext/bigreq.c | 19 +- xserver/Xext/dpms.c | 67 +- xserver/Xext/geext.c | 21 +- xserver/Xext/geext.h | 2 - xserver/Xext/hashtable.c | 295 + xserver/Xext/hashtable.h | 137 + xserver/Xext/panoramiX.c | 106 +- xserver/Xext/panoramiXprocs.c | 47 +- xserver/Xext/saver.c | 66 +- xserver/Xext/security.c | 44 +- xserver/Xext/shape.c | 83 +- xserver/Xext/shm.c | 93 +- xserver/Xext/sync.c | 376 +- xserver/Xext/syncsrv.h | 56 +- xserver/Xext/xace.c | 12 +- xserver/Xext/xcmisc.c | 46 +- xserver/Xext/xf86bigfont.c | 52 +- xserver/Xext/xf86bigfontsrv.h | 1 - xserver/Xext/xres.c | 905 +- xserver/Xext/xselinux_ext.c | 46 +- xserver/Xext/xtest.c | 51 +- xserver/Xext/xvdisp.c | 186 +- xserver/Xext/xvdix.h | 8 +- xserver/Xext/xvmain.c | 35 +- xserver/Xext/xvmc.c | 135 +- xserver/Xext/xvmcext.h | 4 +- xserver/Xi/Makefile.am | 2 + xserver/Xi/Makefile.in | 21 +- xserver/Xi/chgdctl.c | 31 +- xserver/Xi/chgptr.h | 6 - xserver/Xi/exevents.c | 496 +- xserver/Xi/extinit.c | 105 +- xserver/Xi/getbmap.c | 16 +- xserver/Xi/getdctl.c | 12 +- xserver/Xi/getfctl.c | 14 +- xserver/Xi/getfocus.c | 12 +- xserver/Xi/getkmap.c | 14 +- xserver/Xi/getmmap.c | 16 +- xserver/Xi/getprop.c | 14 +- xserver/Xi/getselev.c | 16 +- xserver/Xi/getvers.c | 19 +- xserver/Xi/grabdev.c | 12 +- xserver/Xi/grabdevb.c | 15 +- xserver/Xi/grabdevk.c | 15 +- xserver/Xi/gtmotion.c | 22 +- xserver/Xi/listdev.c | 13 +- xserver/Xi/opendev.c | 17 +- xserver/Xi/queryst.c | 16 +- xserver/Xi/setbmap.c | 14 +- xserver/Xi/setdval.c | 14 +- xserver/Xi/setmmap.c | 12 +- xserver/Xi/setmode.c | 12 +- xserver/Xi/xibarriers.c | 919 ++ xserver/Xi/xibarriers.h | 48 + xserver/Xi/xichangehierarchy.c | 20 +- xserver/Xi/xigetclientpointer.c | 16 +- xserver/Xi/xigrabdev.c | 14 +- xserver/Xi/xipassivegrab.c | 26 +- xserver/Xi/xiproperty.c | 367 +- xserver/Xi/xiquerydevice.c | 19 +- xserver/Xi/xiquerypointer.c | 34 +- xserver/Xi/xiqueryversion.c | 49 +- xserver/Xi/xiselectev.c | 95 +- xserver/Xi/xisetdevfocus.c | 12 +- xserver/aclocal.m4 | 46 +- xserver/autogen.sh | 4 +- xserver/compile | 142 - xserver/composite/Makefile.in | 16 +- xserver/composite/compalloc.c | 9 +- xserver/composite/compext.c | 63 +- xserver/composite/compinit.c | 4 +- xserver/composite/compint.h | 11 +- xserver/composite/compositeext.h | 2 + xserver/composite/compwindow.c | 32 +- xserver/config.guess | 13 +- xserver/config.h.in | 0 xserver/config.sub | 33 +- xserver/config/Makefile.in | 16 +- xserver/config/config-backends.h | 2 + xserver/config/config.c | 65 + xserver/config/udev.c | 151 +- xserver/config/wscons.c | 18 +- xserver/configure | 623 +- xserver/configure.ac | 153 +- xserver/damageext/Makefile.am | 1 - xserver/damageext/Makefile.in | 17 +- xserver/damageext/damageext.c | 33 +- xserver/damageext/damageextint.h | 1 - xserver/dbe/Makefile.in | 16 +- xserver/dbe/dbe.c | 47 +- xserver/dbe/dbestruct.h | 2 - xserver/depcomp | 11 +- xserver/dix/Makefile.in | 16 +- xserver/dix/Xserver-dtrace.h.in | 7 +- xserver/dix/Xserver.d | 2 + xserver/dix/colormap.c | 48 +- xserver/dix/devices.c | 316 +- xserver/dix/dispatch.c | 462 +- xserver/dix/dixfonts.c | 44 +- xserver/dix/dixutils.c | 16 +- xserver/dix/enterleave.c | 251 +- xserver/dix/enterleave.h | 13 +- xserver/dix/eventconvert.c | 49 +- xserver/dix/events.c | 353 +- xserver/dix/extension.c | 22 +- xserver/dix/gc.c | 140 +- xserver/dix/getevents.c | 296 +- xserver/dix/globals.c | 3 +- xserver/dix/grabs.c | 12 +- xserver/dix/inpututils.c | 64 +- xserver/dix/main.c | 26 +- xserver/dix/pixmap.c | 153 +- xserver/dix/privates.c | 414 +- xserver/dix/property.c | 76 +- xserver/dix/ptrveloc.c | 46 +- xserver/dix/registry.c | 4 +- xserver/dix/resource.c | 381 +- xserver/dix/selection.c | 19 +- xserver/dix/swaprep.c | 88 +- xserver/dix/swapreq.c | 2 +- xserver/dix/tables.c | 955 +- xserver/dix/touch.c | 170 +- xserver/dix/window.c | 302 +- xserver/doc/Makefile.in | 16 +- xserver/doc/Xserver-spec.xml | 61 +- xserver/doc/c-extensions | 19 +- xserver/doc/dtrace/Makefile.in | 16 +- xserver/doc/dtrace/Xserver-DTrace.xml | 153 +- xserver/exa/Makefile.in | 16 +- xserver/exa/exa.c | 40 +- xserver/exa/exa.h | 8 +- xserver/exa/exa_glyphs.c | 6 +- xserver/exa/exa_mixed.c | 33 + xserver/exa/exa_offscreen.c | 4 +- xserver/exa/exa_priv.h | 23 +- xserver/exa/exa_unaccel.c | 16 +- xserver/fb/Makefile.in | 16 +- xserver/fb/fb.h | 29 +- xserver/fb/fballpriv.c | 29 +- xserver/fb/fbblt.c | 12 +- xserver/fb/fbbltone.c | 8 +- xserver/fb/fbgc.c | 4 +- xserver/fb/fboverlay.c | 6 +- xserver/fb/fboverlay.h | 2 +- xserver/fb/fbpict.c | 153 +- xserver/fb/fbscreen.c | 7 +- xserver/fb/fbseg.c | 18 +- xserver/fb/fbwindow.c | 2 +- xserver/fb/wfbrename.h | 4 - xserver/glx/Makefile.am | 2 - xserver/glx/Makefile.in | 18 +- xserver/glx/clientinfo.c | 66 +- xserver/glx/createcontext.c | 312 +- xserver/glx/extension_string.c | 36 +- xserver/glx/extension_string.h | 6 +- xserver/glx/glapi.c | 2 +- xserver/glx/glxcmds.c | 220 +- xserver/glx/glxcmdsswap.c | 18 +- xserver/glx/glxcontext.h | 18 + xserver/glx/glxdri.c | 30 +- xserver/glx/glxdri2.c | 282 +- xserver/glx/glxdricommon.c | 2 - xserver/glx/glxdriswrast.c | 12 +- xserver/glx/glxext.c | 23 +- xserver/glx/glxext.h | 2 +- xserver/glx/glxscreens.c | 9 +- xserver/glx/glxscreens.h | 7 +- xserver/glx/glxserver.h | 6 +- xserver/glx/indirect_program.c | 2 +- xserver/glx/indirect_texture_compression.c | 4 +- xserver/glx/indirect_util.c | 8 +- xserver/glx/renderpixswap.c | 20 +- xserver/glx/single2.c | 20 +- xserver/glx/single2swap.c | 18 +- xserver/glx/singlepix.c | 18 +- xserver/glx/singlepixswap.c | 18 +- xserver/glx/unpack.h | 12 +- xserver/glx/xfont.c | 2 +- xserver/hw/Makefile.in | 16 +- xserver/hw/dmx/Makefile.in | 16 +- xserver/hw/dmx/config/Canvas.c | 4 +- xserver/hw/dmx/config/Makefile.in | 18 +- xserver/hw/dmx/config/man/Makefile.in | 16 +- xserver/hw/dmx/config/xdmxconfig.c | 3 - xserver/hw/dmx/dmx.c | 263 +- xserver/hw/dmx/dmx.h | 2 + xserver/hw/dmx/dmx_glxvisuals.c | 4 +- xserver/hw/dmx/dmxcursor.c | 2 + xserver/hw/dmx/dmxextension.c | 2 +- xserver/hw/dmx/dmxinit.c | 24 +- xserver/hw/dmx/dmxlog.c | 3 - xserver/hw/dmx/dmxscrinit.c | 26 +- xserver/hw/dmx/dmxscrinit.h | 4 +- xserver/hw/dmx/dmxwindow.c | 2 +- xserver/hw/dmx/doc/DMXSpec-v1.txt | 2 +- xserver/hw/dmx/doc/DMXSpec.txt | 2 +- xserver/hw/dmx/doc/Makefile.in | 16 +- xserver/hw/dmx/doc/dmx.xml | 12 +- xserver/hw/dmx/doxygen/Makefile.in | 16 +- xserver/hw/dmx/examples/Makefile.in | 16 +- xserver/hw/dmx/examples/xinput.c | 4 +- xserver/hw/dmx/glxProxy/Makefile.in | 16 +- xserver/hw/dmx/glxProxy/glxcmds.c | 165 +- xserver/hw/dmx/glxProxy/glxcmdsswap.c | 45 +- xserver/hw/dmx/glxProxy/glxext.c | 12 +- xserver/hw/dmx/glxProxy/glxext.h | 2 - xserver/hw/dmx/glxProxy/glxscreens.c | 4 +- xserver/hw/dmx/glxProxy/glxsingle.c | 62 +- xserver/hw/dmx/glxProxy/glxvendor.c | 16 +- xserver/hw/dmx/glxProxy/renderpixswap.c | 304 +- xserver/hw/dmx/glxProxy/unpack.h | 12 +- xserver/hw/dmx/input/Makefile.in | 16 +- xserver/hw/dmx/input/dmxconsole.c | 4 +- xserver/hw/dmx/input/dmxevents.c | 24 +- xserver/hw/dmx/input/dmxsigio.c | 22 - xserver/hw/dmx/input/dmxsigio.h | 2 - xserver/hw/dmx/man/Makefile.in | 16 +- xserver/hw/kdrive/Makefile.in | 16 +- xserver/hw/kdrive/ephyr/Makefile.am | 1 - xserver/hw/kdrive/ephyr/Makefile.in | 17 +- xserver/hw/kdrive/ephyr/XF86dri.c | 18 +- xserver/hw/kdrive/ephyr/ephyr.c | 119 +- xserver/hw/kdrive/ephyr/ephyrdriext.c | 152 +- xserver/hw/kdrive/ephyr/ephyrglxext.c | 267 +- xserver/hw/kdrive/ephyr/ephyrhostglx.c | 131 +- xserver/hw/kdrive/ephyr/ephyrhostglx.h | 9 +- xserver/hw/kdrive/ephyr/ephyrhostproxy.c | 2 +- xserver/hw/kdrive/ephyr/ephyrhostvideo.c | 4 +- xserver/hw/kdrive/ephyr/ephyrinit.c | 2 - xserver/hw/kdrive/ephyr/ephyrproxyext.c | 2 +- xserver/hw/kdrive/ephyr/ephyrvideo.c | 2 +- xserver/hw/kdrive/ephyr/hostx.c | 40 +- xserver/hw/kdrive/ephyr/hostx.h | 10 +- xserver/hw/kdrive/ephyr/man/Makefile.in | 16 +- xserver/hw/kdrive/fake/Makefile.in | 16 +- xserver/hw/kdrive/fbdev/Makefile.in | 16 +- xserver/hw/kdrive/linux/Makefile.in | 16 +- xserver/hw/kdrive/openbsd/Makefile.in | 16 +- xserver/hw/kdrive/openbsd/openbsd.c | 2 +- xserver/hw/kdrive/src/Makefile.in | 16 +- xserver/hw/kdrive/src/kdrive.c | 28 +- xserver/hw/kdrive/src/kdrive.h | 14 +- xserver/hw/kdrive/src/kinput.c | 50 +- xserver/hw/kdrive/src/kxv.c | 16 +- xserver/hw/kdrive/wscons/Makefile.in | 16 +- xserver/hw/vfb/InitInput.c | 1 - xserver/hw/vfb/InitOutput.c | 39 +- xserver/hw/vfb/Makefile.am | 2 - xserver/hw/vfb/Makefile.in | 18 +- xserver/hw/vfb/man/Makefile.in | 16 +- xserver/hw/xfree86/Makefile.am | 37 +- xserver/hw/xfree86/Makefile.in | 55 +- xserver/hw/xfree86/common/Makefile.am | 21 +- xserver/hw/xfree86/common/Makefile.in | 65 +- xserver/hw/xfree86/common/compiler.h | 17 + .../{dixmods/extmod => common}/dgaproc.h | 6 +- xserver/hw/xfree86/common/vidmodeproc.h | 2 +- xserver/hw/xfree86/{xaa => common}/xaarop.h | 43 - xserver/hw/xfree86/common/xf86.h | 44 +- xserver/hw/xfree86/common/xf86AutoConfig.c | 16 +- xserver/hw/xfree86/common/xf86Bus.c | 68 +- xserver/hw/xfree86/common/xf86Bus.h | 1 + xserver/hw/xfree86/common/xf86Config.c | 31 +- xserver/hw/xfree86/common/xf86Configure.c | 32 +- xserver/hw/xfree86/common/xf86Cursor.c | 34 +- xserver/hw/xfree86/common/xf86DGA.c | 1192 +- xserver/hw/xfree86/common/xf86DPMS.c | 61 +- xserver/hw/xfree86/common/xf86Events.c | 62 +- xserver/hw/xfree86/common/xf86Extensions.c | 142 + xserver/hw/xfree86/common/xf86Extensions.h | 55 + xserver/hw/xfree86/common/xf86Globals.c | 11 +- xserver/hw/xfree86/common/xf86Helper.c | 148 +- xserver/hw/xfree86/common/xf86Init.c | 122 +- xserver/hw/xfree86/common/xf86Mode.c | 4 +- xserver/hw/xfree86/common/xf86Module.h | 23 +- xserver/hw/xfree86/common/xf86Opt.h | 2 +- xserver/hw/xfree86/common/xf86Option.c | 4 +- xserver/hw/xfree86/common/xf86PM.c | 26 +- xserver/hw/xfree86/common/xf86Priv.h | 6 +- xserver/hw/xfree86/common/xf86Privstr.h | 2 + xserver/hw/xfree86/common/xf86RandR.c | 23 +- xserver/hw/xfree86/common/xf86VGAarbiter.c | 62 +- .../hw/xfree86/common/xf86VGAarbiterPriv.h | 28 +- xserver/hw/xfree86/common/xf86VidMode.c | 8 +- xserver/hw/xfree86/common/xf86Xinput.c | 16 +- xserver/hw/xfree86/common/xf86Xinput.h | 9 +- xserver/hw/xfree86/common/xf86cmap.c | 74 +- xserver/hw/xfree86/common/xf86fbBus.c | 4 + xserver/hw/xfree86/common/xf86fbman.c | 8 +- xserver/hw/xfree86/common/xf86pciBus.c | 115 +- xserver/hw/xfree86/common/xf86pciBus.h | 10 + xserver/hw/xfree86/common/xf86platformBus.c | 501 + xserver/hw/xfree86/common/xf86platformBus.h | 64 + xserver/hw/xfree86/common/xf86sbusBus.c | 4 +- xserver/hw/xfree86/common/xf86str.h | 39 +- .../{dixmods/extmod => common}/xf86vmode.c | 305 +- xserver/hw/xfree86/common/xf86xv.c | 59 +- xserver/hw/xfree86/common/xf86xv.h | 4 - xserver/hw/xfree86/common/xf86xvmc.c | 24 +- xserver/hw/xfree86/common/xf86xvmc.h | 3 - xserver/hw/xfree86/common/xf86xvpriv.h | 6 +- xserver/hw/xfree86/ddc/Makefile.in | 16 +- xserver/hw/xfree86/ddc/ddc.c | 25 +- xserver/hw/xfree86/ddc/xf86DDC.h | 8 +- xserver/hw/xfree86/dixmods/Makefile.am | 45 +- xserver/hw/xfree86/dixmods/Makefile.in | 289 +- xserver/hw/xfree86/dixmods/dbemodule.c | 45 - xserver/hw/xfree86/dixmods/extmod/Makefile.am | 30 - xserver/hw/xfree86/dixmods/extmod/Makefile.in | 863 -- xserver/hw/xfree86/dixmods/extmod/modinit.c | 177 - xserver/hw/xfree86/dixmods/extmod/modinit.h | 49 +- xserver/hw/xfree86/dixmods/extmod/xf86dga2.c | 1029 -- xserver/hw/xfree86/dixmods/extmod/xvmod.c | 22 - xserver/hw/xfree86/dixmods/extmod/xvmodproc.h | 13 - xserver/hw/xfree86/dixmods/glxmodule.c | 15 +- xserver/hw/xfree86/dixmods/recordmod.c | 43 - xserver/hw/xfree86/doc/Makefile.in | 16 +- xserver/hw/xfree86/doc/README.modes | 9 +- xserver/hw/xfree86/doc/ddxDesign.xml | 126 +- xserver/hw/xfree86/doc/exa-driver.txt | 9 +- xserver/hw/xfree86/dri/Makefile.am | 29 +- xserver/hw/xfree86/dri/Makefile.in | 190 +- xserver/hw/xfree86/dri/dri.c | 34 +- xserver/hw/xfree86/dri/dri.h | 14 +- xserver/hw/xfree86/dri/drimodule.c | 93 - xserver/hw/xfree86/dri/xf86dri.c | 164 +- xserver/hw/xfree86/dri2/Makefile.am | 12 +- xserver/hw/xfree86/dri2/Makefile.in | 164 +- xserver/hw/xfree86/dri2/dri2.c | 499 +- xserver/hw/xfree86/dri2/dri2.h | 63 +- xserver/hw/xfree86/dri2/dri2ext.c | 190 +- .../mibstore.c => hw/xfree86/dri2/dri2int.h} | 23 +- xserver/hw/xfree86/exa/Makefile.am | 4 +- xserver/hw/xfree86/exa/Makefile.in | 23 +- xserver/hw/xfree86/exa/examodule.c | 21 +- xserver/hw/xfree86/exa/man/Makefile.in | 16 +- xserver/hw/xfree86/exa/man/exa.man | 6 +- xserver/hw/xfree86/fbdevhw/Makefile.am | 2 +- xserver/hw/xfree86/fbdevhw/Makefile.in | 18 +- xserver/hw/xfree86/fbdevhw/fbdevhw.c | 25 +- xserver/hw/xfree86/fbdevhw/fbdevhw.h | 12 +- xserver/hw/xfree86/fbdevhw/fbdevhwstub.c | 10 +- xserver/hw/xfree86/fbdevhw/man/Makefile.in | 16 +- xserver/hw/xfree86/fbdevhw/man/fbdevhw.man | 2 +- xserver/hw/xfree86/i2c/Makefile.am | 16 +- xserver/hw/xfree86/i2c/Makefile.in | 34 +- xserver/hw/xfree86/i2c/fi1236.c | 10 +- xserver/hw/xfree86/i2c/tda9850.c | 2 +- xserver/hw/xfree86/i2c/xf86i2c.c | 1 + xserver/hw/xfree86/i2c/xf86i2c.h | 2 + xserver/hw/xfree86/int10/Makefile.in | 16 +- xserver/hw/xfree86/int10/generic.c | 24 +- xserver/hw/xfree86/int10/helper_exec.c | 18 +- xserver/hw/xfree86/int10/helper_mem.c | 8 +- xserver/hw/xfree86/int10/xf86int10.c | 42 +- xserver/hw/xfree86/int10/xf86int10.h | 4 +- xserver/hw/xfree86/loader/Makefile.am | 3 +- xserver/hw/xfree86/loader/Makefile.in | 22 +- xserver/hw/xfree86/loader/loader.c | 21 +- xserver/hw/xfree86/loader/loader.h | 1 + xserver/hw/xfree86/loader/loaderProcs.h | 1 - xserver/hw/xfree86/loader/loadext.c | 440 - xserver/hw/xfree86/loader/loadmod.c | 34 +- xserver/hw/xfree86/man/Makefile.in | 16 +- xserver/hw/xfree86/man/Xorg.man | 118 +- xserver/hw/xfree86/man/xorg.conf.man | 181 +- xserver/hw/xfree86/modes/Makefile.in | 16 +- xserver/hw/xfree86/modes/xf86Crtc.c | 110 +- xserver/hw/xfree86/modes/xf86Crtc.h | 48 +- xserver/hw/xfree86/modes/xf86Cursors.c | 10 +- xserver/hw/xfree86/modes/xf86DiDGA.c | 10 +- xserver/hw/xfree86/modes/xf86DisplayIDModes.c | 171 +- xserver/hw/xfree86/modes/xf86EdidModes.c | 122 +- xserver/hw/xfree86/modes/xf86Modes.c | 15 + xserver/hw/xfree86/modes/xf86RandR12.c | 207 +- xserver/hw/xfree86/modes/xf86Rotate.c | 51 +- xserver/hw/xfree86/os-support/Makefile.in | 16 +- xserver/hw/xfree86/os-support/bsd/Makefile.in | 16 +- .../hw/xfree86/os-support/bsd/alpha_video.c | 222 +- xserver/hw/xfree86/os-support/bsd/arm_video.c | 119 +- xserver/hw/xfree86/os-support/bsd/bsd_agp.c | 2 +- xserver/hw/xfree86/os-support/bsd/bsd_apm.c | 26 +- xserver/hw/xfree86/os-support/bsd/bsd_init.c | 466 +- .../xfree86/os-support/bsd/bsd_kqueue_apm.c | 26 +- .../hw/xfree86/os-support/bsd/hp300_video.c | 2 +- .../hw/xfree86/os-support/bsd/hppa_video.c | 2 +- .../hw/xfree86/os-support/bsd/i386_video.c | 140 +- xserver/hw/xfree86/os-support/bsd/ppc_video.c | 19 +- .../hw/xfree86/os-support/bsd/sparc64_video.c | 34 +- xserver/hw/xfree86/os-support/bus/Makefile.in | 16 +- xserver/hw/xfree86/os-support/bus/Sbus.c | 20 +- xserver/hw/xfree86/os-support/bus/nobus.c | 2 +- .../hw/xfree86/os-support/hurd/Makefile.in | 16 +- .../hw/xfree86/os-support/linux/Makefile.am | 2 +- .../hw/xfree86/os-support/linux/Makefile.in | 35 +- .../hw/xfree86/os-support/linux/int10/linux.c | 29 +- .../os-support/linux/int10/vm86/linux_vm86.c | 16 +- .../hw/xfree86/os-support/linux/lnx_acpi.c | 9 +- xserver/hw/xfree86/os-support/linux/lnx_apm.c | 31 +- .../hw/xfree86/os-support/linux/lnx_init.c | 34 +- .../xfree86/os-support/linux/lnx_platform.c | 179 + .../hw/xfree86/os-support/linux/lnx_video.c | 89 +- .../hw/xfree86/os-support/misc/Makefile.in | 16 +- .../hw/xfree86/os-support/shared/agp_noop.c | 2 +- .../xfree86/os-support/shared/ioperm_noop.c | 4 +- .../xfree86/os-support/shared/platform_noop.c | 23 + .../hw/xfree86/os-support/shared/posix_tty.c | 54 +- xserver/hw/xfree86/os-support/shared/sigio.c | 28 +- xserver/hw/xfree86/os-support/shared/vidmem.c | 13 - .../hw/xfree86/os-support/solaris/Makefile.in | 16 +- .../hw/xfree86/os-support/solaris/sun_apm.c | 26 +- .../hw/xfree86/os-support/stub/Makefile.in | 16 +- .../hw/xfree86/os-support/stub/stub_init.c | 6 +- xserver/hw/xfree86/os-support/xf86_OSlib.h | 2 +- xserver/hw/xfree86/os-support/xf86_OSproc.h | 8 +- xserver/hw/xfree86/parser/Device.c | 2 - xserver/hw/xfree86/parser/Files.c | 2 - xserver/hw/xfree86/parser/Flags.c | 2 - xserver/hw/xfree86/parser/Input.c | 2 - xserver/hw/xfree86/parser/InputClass.c | 2 - xserver/hw/xfree86/parser/Layout.c | 2 - xserver/hw/xfree86/parser/Makefile.in | 16 +- xserver/hw/xfree86/parser/Module.c | 2 - xserver/hw/xfree86/parser/Monitor.c | 2 - xserver/hw/xfree86/parser/Pointer.c | 2 - xserver/hw/xfree86/parser/Screen.c | 2 - xserver/hw/xfree86/parser/Vendor.c | 2 - xserver/hw/xfree86/parser/Video.c | 2 - xserver/hw/xfree86/parser/read.c | 2 - xserver/hw/xfree86/parser/scan.c | 2 - xserver/hw/xfree86/parser/write.c | 2 - xserver/hw/xfree86/ramdac/Makefile.am | 11 +- xserver/hw/xfree86/ramdac/Makefile.in | 32 +- xserver/hw/xfree86/ramdac/xf86Cursor.c | 57 +- xserver/hw/xfree86/ramdac/xf86CursorPriv.h | 4 +- xserver/hw/xfree86/ramdac/xf86HWCurs.c | 11 +- xserver/hw/xfree86/ramdac/xf86RamDacCmap.c | 2 +- xserver/hw/xfree86/sdksyms.sh | 38 +- xserver/hw/xfree86/shadowfb/Makefile.am | 3 +- xserver/hw/xfree86/shadowfb/Makefile.in | 22 +- xserver/hw/xfree86/shadowfb/shadow.c | 30 +- xserver/hw/xfree86/utils/Makefile.in | 16 +- xserver/hw/xfree86/utils/cvt/Makefile.in | 16 +- xserver/hw/xfree86/utils/gtf/Makefile.in | 16 +- xserver/hw/xfree86/utils/man/Makefile.in | 16 +- xserver/hw/xfree86/utils/man/cvt.man | 6 +- xserver/hw/xfree86/utils/man/gtf.man | 8 +- xserver/hw/xfree86/vbe/Makefile.am | 5 +- xserver/hw/xfree86/vbe/Makefile.in | 21 +- xserver/hw/xfree86/vbe/vbe.c | 24 +- xserver/hw/xfree86/vbe/vbe.h | 2 +- xserver/hw/xfree86/vgahw/Makefile.in | 16 +- xserver/hw/xfree86/vgahw/vgaCmap.c | 7 +- xserver/hw/xfree86/vgahw/vgaHW.c | 4 +- xserver/hw/xfree86/x86emu/Makefile.in | 16 +- xserver/hw/xfree86/xaa/Makefile.am | 78 - xserver/hw/xfree86/xaa/Makefile.in | 990 -- xserver/hw/xfree86/xaa/XAA.HOWTO | 1427 -- xserver/hw/xfree86/xaa/xaa.h | 1038 -- xserver/hw/xfree86/xaa/xaaBitBlt.c | 229 - xserver/hw/xfree86/xaa/xaaBitOrder.c | 16 - xserver/hw/xfree86/xaa/xaaBitmap.c | 477 - xserver/hw/xfree86/xaa/xaaCpyArea.c | 409 - xserver/hw/xfree86/xaa/xaaCpyPlane.c | 204 - xserver/hw/xfree86/xaa/xaaCpyWin.c | 78 - xserver/hw/xfree86/xaa/xaaDashLine.c | 353 - xserver/hw/xfree86/xaa/xaaFallback.c | 281 - xserver/hw/xfree86/xaa/xaaFillArc.c | 202 - xserver/hw/xfree86/xaa/xaaFillPoly.c | 991 -- xserver/hw/xfree86/xaa/xaaFillRect.c | 1101 -- xserver/hw/xfree86/xaa/xaaGC.c | 564 - xserver/hw/xfree86/xaa/xaaGCmisc.c | 412 - xserver/hw/xfree86/xaa/xaaImage.c | 534 - xserver/hw/xfree86/xaa/xaaInit.c | 637 - xserver/hw/xfree86/xaa/xaaInitAccel.c | 1571 -- xserver/hw/xfree86/xaa/xaaLine.c | 422 - xserver/hw/xfree86/xaa/xaaLineMisc.c | 149 - xserver/hw/xfree86/xaa/xaaNonTEGlyph.c | 192 - xserver/hw/xfree86/xaa/xaaNonTEText.c | 591 - xserver/hw/xfree86/xaa/xaaOffscreen.c | 163 - xserver/hw/xfree86/xaa/xaaOverlay.c | 122 - xserver/hw/xfree86/xaa/xaaOverlayDF.c | 906 -- xserver/hw/xfree86/xaa/xaaPCache.c | 2527 --- xserver/hw/xfree86/xaa/xaaPict.c | 654 - xserver/hw/xfree86/xaa/xaaROP.c | 182 - xserver/hw/xfree86/xaa/xaaRect.c | 121 - xserver/hw/xfree86/xaa/xaaSpans.c | 876 -- xserver/hw/xfree86/xaa/xaaStateChange.c | 1665 -- xserver/hw/xfree86/xaa/xaaStipple.c | 915 -- xserver/hw/xfree86/xaa/xaaTEGlyph.c | 1083 -- xserver/hw/xfree86/xaa/xaaTEText.c | 295 - xserver/hw/xfree86/xaa/xaaTables.c | 152 - xserver/hw/xfree86/xaa/xaaWideLine.c | 924 -- xserver/hw/xfree86/xaa/xaacexp.h | 126 - xserver/hw/xfree86/xaa/xaalocal.h | 1437 -- xserver/hw/xfree86/xaa/xaawrap.h | 75 - xserver/hw/xnest/Init.c | 2 +- xserver/hw/xnest/Makefile.am | 1 - xserver/hw/xnest/Makefile.in | 17 +- xserver/hw/xnest/Screen.c | 7 +- xserver/hw/xnest/Screen.h | 4 +- xserver/hw/xnest/Visual.c | 1 - xserver/hw/xnest/man/Makefile.in | 16 +- xserver/hw/xquartz/GL/Makefile.in | 16 +- xserver/hw/xquartz/GL/capabilities.c | 4 + xserver/hw/xquartz/GL/indirect.c | 10 +- xserver/hw/xquartz/GL/visualConfigs.c | 210 +- xserver/hw/xquartz/Makefile.in | 16 +- xserver/hw/xquartz/X11Application.h | 3 + xserver/hw/xquartz/X11Application.m | 48 + xserver/hw/xquartz/X11Controller.m | 62 +- xserver/hw/xquartz/applewm.c | 10 +- xserver/hw/xquartz/bundle/Info.plist.cpp | 6 +- xserver/hw/xquartz/bundle/Makefile.in | 16 +- .../English.lproj/Localizable.strings | Bin 4410 -> 5454 bytes xserver/hw/xquartz/console_redirect.c | 28 +- xserver/hw/xquartz/darwin.c | 29 +- xserver/hw/xquartz/mach-startup/Makefile.in | 16 +- xserver/hw/xquartz/mach-startup/bundle-main.c | 17 + xserver/hw/xquartz/man/Makefile.in | 16 +- xserver/hw/xquartz/pbproxy/Makefile.in | 16 +- xserver/hw/xquartz/pbproxy/x-selection.m | 2 +- xserver/hw/xquartz/pseudoramiX.c | 90 +- xserver/hw/xquartz/pseudoramiX.h | 1 - xserver/hw/xquartz/quartz.c | 26 + xserver/hw/xquartz/xpr/Makefile.in | 16 +- xserver/hw/xquartz/xpr/appledri.c | 14 +- xserver/hw/xquartz/xpr/dri.c | 12 +- xserver/hw/xquartz/xpr/xprEvent.c | 22 + xserver/hw/xquartz/xpr/xprFrame.c | 28 + xserver/hw/xquartz/xpr/xprScreen.c | 5 + xserver/hw/xwin/InitOutput.c | 59 +- xserver/hw/xwin/Makefile.am | 15 +- xserver/hw/xwin/Makefile.in | 73 +- xserver/hw/xwin/README | 141 - xserver/hw/xwin/ddraw.h | 4 + xserver/hw/xwin/glx/Makefile.am | 7 +- xserver/hw/xwin/glx/Makefile.in | 23 +- xserver/hw/xwin/glx/gen_gl_wrappers.py | 24 +- xserver/hw/xwin/glx/glwrap.c | 2 +- xserver/hw/xwin/glx/indirect.c | 140 +- xserver/hw/xwin/man/Makefile.in | 16 +- xserver/hw/xwin/man/XWin.man | 38 +- xserver/hw/xwin/propertystore.h | 83 + xserver/hw/xwin/win.h | 46 +- xserver/hw/xwin/winSetAppUserModelID.c | 110 + xserver/hw/xwin/winallpriv.c | 2 +- xserver/hw/xwin/winblock.c | 47 +- xserver/hw/xwin/winclipboard.h | 10 +- xserver/hw/xwin/winclipboardinit.c | 2 +- xserver/hw/xwin/winclipboardtextconv.c | 10 +- xserver/hw/xwin/winclipboardthread.c | 16 +- xserver/hw/xwin/winclipboardunicode.c | 65 - xserver/hw/xwin/winclipboardwndproc.c | 36 +- xserver/hw/xwin/winclipboardwrappers.c | 19 +- xserver/hw/xwin/winclipboardxevents.c | 56 +- xserver/hw/xwin/winconfig.c | 2 +- xserver/hw/xwin/wincreatewnd.c | 93 +- xserver/hw/xwin/wincursor.c | 9 +- xserver/hw/xwin/windialogs.c | 8 +- xserver/hw/xwin/winengine.c | 8 +- xserver/hw/xwin/winerror.c | 42 +- xserver/hw/xwin/wingc.c | 9 +- xserver/hw/xwin/winglobals.c | 2 +- xserver/hw/xwin/winglobals.h | 4 + xserver/hw/xwin/winkeybd.c | 55 +- xserver/hw/xwin/winkeyhook.c | 18 - xserver/hw/xwin/winlayouts.h | 10 +- xserver/hw/xwin/winmonitors.c | 13 +- xserver/hw/xwin/winmonitors.h | 29 + xserver/hw/xwin/winms.h | 5 +- xserver/hw/xwin/winmsg.c | 6 +- xserver/hw/xwin/winmsg.h | 30 +- xserver/hw/xwin/winmultiwindowicons.c | 416 +- xserver/hw/xwin/winmultiwindowicons.h | 42 + xserver/hw/xwin/winmultiwindowshape.c | 2 +- xserver/hw/xwin/winmultiwindowwindow.c | 18 +- xserver/hw/xwin/winmultiwindowwm.c | 439 +- xserver/hw/xwin/winmultiwindowwndproc.c | 59 +- xserver/hw/xwin/winnativegdi.c | 4 +- xserver/hw/xwin/winpfbdd.c | 14 +- xserver/hw/xwin/winpixmap.c | 2 +- xserver/hw/xwin/winprefs.c | 71 +- xserver/hw/xwin/winprefs.h | 2 +- xserver/hw/xwin/winprefslex.l | 7 +- xserver/hw/xwin/winprefsyacc.y | 10 +- xserver/hw/xwin/winprocarg.c | 28 +- xserver/hw/xwin/winregistry.c | 65 - xserver/hw/xwin/winscrinit.c | 26 +- xserver/hw/xwin/winsetsp.c | 4 +- xserver/hw/xwin/winshaddd.c | 46 +- xserver/hw/xwin/winshadddnl.c | 94 +- xserver/hw/xwin/winshadgdi.c | 23 +- xserver/hw/xwin/wintaskbar.c | 92 + xserver/hw/xwin/wintrayicon.c | 2 +- xserver/hw/xwin/winvalargs.c | 2 - xserver/hw/xwin/winwakeup.c | 8 +- xserver/hw/xwin/winwin32rootless.c | 10 +- xserver/hw/xwin/winwin32rootlesswindow.c | 31 - xserver/hw/xwin/winwin32rootlesswndproc.c | 6 +- xserver/hw/xwin/winwindow.c | 6 - xserver/hw/xwin/winwindow.h | 23 +- xserver/hw/xwin/winwindowswm.c | 15 +- xserver/hw/xwin/winwndproc.c | 16 +- xserver/include/Makefile.am | 3 +- xserver/include/Makefile.in | 33 +- xserver/include/dix-config.h.in | 15 + xserver/include/dix.h | 23 +- xserver/include/dixevents.h | 7 - xserver/include/dixfont.h | 52 +- xserver/include/dixfontstubs.h | 45 + xserver/include/dixstruct.h | 39 +- xserver/include/do-not-use-config.h.in | 21 +- xserver/include/eventconvert.h | 2 - xserver/include/events.h | 1 + xserver/include/eventstr.h | 24 +- xserver/include/exevents.h | 7 - xserver/include/extension.h | 42 +- xserver/include/extinit.h | 158 +- xserver/include/globals.h | 80 +- xserver/include/glx_extinit.h | 34 + xserver/include/hotplug.h | 42 + xserver/include/input.h | 26 +- xserver/include/inputstr.h | 36 +- xserver/include/inpututils.h | 1 + xserver/include/list.h | 27 +- xserver/include/misc.h | 42 +- xserver/include/opaque.h | 1 + xserver/include/os.h | 43 +- xserver/include/pixmap.h | 23 +- xserver/include/pixmapstr.h | 30 + xserver/include/privates.h | 56 +- xserver/include/protocol-versions.h | 6 +- xserver/include/ptrveloc.h | 15 +- xserver/include/resource.h | 59 +- xserver/include/screenint.h | 27 +- xserver/include/scrnintstr.h | 52 +- xserver/include/servermd.h | 19 +- xserver/include/window.h | 8 +- xserver/include/windowstr.h | 4 +- xserver/include/xkbsrv.h | 26 +- xserver/include/xorg-config.h.in | 3 + xserver/include/xorg-server.h.in | 5 +- xserver/include/xserver-properties.h | 3 + xserver/include/xwin-config.h.in | 3 + xserver/m4/xorg-tls.m4 | 2 +- xserver/man/Makefile.in | 16 +- xserver/man/Xserver.man | 7 + xserver/mi/Makefile.am | 3 +- xserver/mi/Makefile.in | 23 +- xserver/mi/mibitblt.c | 6 +- xserver/mi/mibstore.h | 23 - xserver/mi/midispcur.c | 211 +- xserver/mi/mieq.c | 29 +- xserver/mi/miexpose.c | 13 +- xserver/mi/miinitext.c | 491 +- xserver/mi/mioverlay.c | 6 +- xserver/mi/mipointer.c | 65 +- xserver/mi/mipointer.h | 3 +- xserver/mi/miscrinit.c | 4 +- xserver/mi/mispans.c | 4 - xserver/mi/misprite.c | 13 +- xserver/miext/Makefile.am | 5 +- xserver/miext/Makefile.in | 26 +- xserver/miext/cw/Makefile.am | 11 - xserver/miext/cw/Makefile.in | 763 - xserver/miext/cw/cw.c | 524 - xserver/miext/cw/cw.h | 173 - xserver/miext/cw/cw_ops.c | 477 - xserver/miext/cw/cw_render.c | 383 - xserver/miext/damage/Makefile.in | 16 +- xserver/miext/damage/damage.c | 37 +- xserver/miext/rootless/Makefile.in | 16 +- xserver/miext/rootless/rootlessScreen.c | 4 +- xserver/miext/shadow/Makefile.in | 16 +- xserver/miext/shadow/shadow.c | 4 +- xserver/miext/shadow/shrotpackYX.h | 3 - xserver/miext/sync/Makefile.in | 16 +- xserver/miext/sync/misync.c | 4 +- xserver/os/Makefile.in | 16 +- xserver/os/WaitFor.c | 2 +- xserver/os/access.c | 12 +- xserver/os/backtrace.c | 49 +- xserver/os/connection.c | 95 +- xserver/os/io.c | 34 +- xserver/os/log.c | 238 +- xserver/os/osdep.h | 19 +- xserver/os/osinit.c | 62 +- xserver/os/strndup.c | 4 + xserver/os/utils.c | 293 +- xserver/os/xdmcp.c | 14 +- xserver/os/xsha1.c | 72 + xserver/randr/Makefile.am | 2 + xserver/randr/Makefile.in | 31 +- xserver/randr/randr.c | 95 +- xserver/randr/randrstr.h | 172 +- xserver/randr/rrcrtc.c | 448 +- xserver/randr/rrdispatch.c | 25 +- xserver/randr/rrinfo.c | 7 +- xserver/randr/rrmode.c | 23 +- xserver/randr/rroutput.c | 90 +- xserver/randr/rrproperty.c | 105 +- xserver/randr/rrprovider.c | 418 + xserver/randr/rrproviderproperty.c | 730 + xserver/randr/rrscreen.c | 369 +- xserver/randr/rrtransform.h | 7 + xserver/randr/rrxinerama.c | 113 +- xserver/record/Makefile.in | 16 +- xserver/record/record.c | 52 +- xserver/render/Makefile.in | 16 +- xserver/render/animcur.c | 13 +- xserver/render/filter.c | 5 +- xserver/render/glyph.c | 34 +- xserver/render/glyphstr.h | 6 + xserver/render/picture.c | 41 +- xserver/render/picturestr.h | 15 +- xserver/render/render.c | 27 +- xserver/test/Makefile.am | 21 +- xserver/test/Makefile.in | 91 +- xserver/test/ddxstubs.c | 2 +- xserver/test/fixes.c | 26 + xserver/test/hashtabletest.c | 162 + xserver/test/input.c | 36 +- xserver/test/list.c | 4 +- xserver/test/os.c | 166 + xserver/test/signal-logging.c | 313 + xserver/test/touch.c | 5 + xserver/test/xi2/Makefile.am | 2 +- xserver/test/xi2/Makefile.in | 18 +- xserver/test/xi2/protocol-common.c | 14 + xserver/test/xi2/protocol-common.h | 4 +- xserver/test/xi2/protocol-eventconvert.c | 222 +- .../test/xi2/protocol-xipassivegrabdevice.c | 7 +- xserver/test/xi2/protocol-xiquerydevice.c | 18 +- xserver/test/xi2/protocol-xiquerypointer.c | 7 +- xserver/test/xi2/protocol-xiqueryversion.c | 118 +- xserver/test/xi2/protocol-xiselectevents.c | 13 +- .../test/xi2/protocol-xisetclientpointer.c | 1 + xserver/test/xi2/protocol-xiwarppointer.c | 3 +- xserver/test/xi2/xi2.c | 6 + xserver/test/xtest.c | 16 +- xserver/xfixes/Makefile.in | 16 +- xserver/xfixes/cursor.c | 408 +- xserver/xfixes/region.c | 6 +- xserver/xfixes/select.c | 23 +- xserver/xfixes/xfixes.c | 15 +- xserver/xfixes/xfixes.h | 17 +- xserver/xfixes/xfixesint.h | 7 +- xserver/xkb/Makefile.am | 3 +- xserver/xkb/Makefile.in | 23 +- xserver/xkb/XKBGAlloc.c | 129 - xserver/xkb/ddxList.c | 310 - xserver/xkb/ddxLoad.c | 75 - xserver/xkb/maprules.c | 1 + xserver/xkb/xkb.c | 466 +- xserver/xkb/xkb.h | 2 - xserver/xkb/xkbAccessX.c | 45 +- xserver/xkb/xkbActions.c | 136 +- xserver/xkb/xkbEvents.c | 57 +- xserver/xkb/xkbPrKeyEv.c | 4 +- xserver/xkb/xkbUtils.c | 10 +- xserver/xkb/xkbgeom.h | 17 - xserver/xkb/xkbout.c | 2 +- xserver/xkb/xkbtext.c | 91 +- xserver/xkb/xkmread.c | 2 - xserver/xorg-server.m4 | 6 +- xserver/xorg-server.pc.in | 2 +- 774 files changed, 36970 insertions(+), 44455 deletions(-) create mode 100644 xserver/Xext/hashtable.c create mode 100644 xserver/Xext/hashtable.h create mode 100644 xserver/Xi/xibarriers.c create mode 100644 xserver/Xi/xibarriers.h delete mode 100644 xserver/compile create mode 100644 xserver/config.h.in rename xserver/hw/xfree86/{dixmods/extmod => common}/dgaproc.h (96%) rename xserver/hw/xfree86/{xaa => common}/xaarop.h (79%) create mode 100644 xserver/hw/xfree86/common/xf86Extensions.c create mode 100644 xserver/hw/xfree86/common/xf86Extensions.h create mode 100644 xserver/hw/xfree86/common/xf86platformBus.c create mode 100644 xserver/hw/xfree86/common/xf86platformBus.h rename xserver/hw/xfree86/{dixmods/extmod => common}/xf86vmode.c (92%) delete mode 100644 xserver/hw/xfree86/dixmods/dbemodule.c delete mode 100644 xserver/hw/xfree86/dixmods/extmod/Makefile.am delete mode 100644 xserver/hw/xfree86/dixmods/extmod/Makefile.in delete mode 100644 xserver/hw/xfree86/dixmods/extmod/modinit.c delete mode 100644 xserver/hw/xfree86/dixmods/extmod/xf86dga2.c delete mode 100644 xserver/hw/xfree86/dixmods/extmod/xvmod.c delete mode 100644 xserver/hw/xfree86/dixmods/extmod/xvmodproc.h delete mode 100644 xserver/hw/xfree86/dixmods/recordmod.c delete mode 100644 xserver/hw/xfree86/dri/drimodule.c rename xserver/{mi/mibstore.c => hw/xfree86/dri2/dri2int.h} (66%) delete mode 100644 xserver/hw/xfree86/loader/loadext.c create mode 100644 xserver/hw/xfree86/os-support/linux/lnx_platform.c create mode 100644 xserver/hw/xfree86/os-support/shared/platform_noop.c delete mode 100644 xserver/hw/xfree86/xaa/Makefile.am delete mode 100644 xserver/hw/xfree86/xaa/Makefile.in delete mode 100644 xserver/hw/xfree86/xaa/XAA.HOWTO delete mode 100644 xserver/hw/xfree86/xaa/xaa.h delete mode 100644 xserver/hw/xfree86/xaa/xaaBitBlt.c delete mode 100644 xserver/hw/xfree86/xaa/xaaBitOrder.c delete mode 100644 xserver/hw/xfree86/xaa/xaaBitmap.c delete mode 100644 xserver/hw/xfree86/xaa/xaaCpyArea.c delete mode 100644 xserver/hw/xfree86/xaa/xaaCpyPlane.c delete mode 100644 xserver/hw/xfree86/xaa/xaaCpyWin.c delete mode 100644 xserver/hw/xfree86/xaa/xaaDashLine.c delete mode 100644 xserver/hw/xfree86/xaa/xaaFallback.c delete mode 100644 xserver/hw/xfree86/xaa/xaaFillArc.c delete mode 100644 xserver/hw/xfree86/xaa/xaaFillPoly.c delete mode 100644 xserver/hw/xfree86/xaa/xaaFillRect.c delete mode 100644 xserver/hw/xfree86/xaa/xaaGC.c delete mode 100644 xserver/hw/xfree86/xaa/xaaGCmisc.c delete mode 100644 xserver/hw/xfree86/xaa/xaaImage.c delete mode 100644 xserver/hw/xfree86/xaa/xaaInit.c delete mode 100644 xserver/hw/xfree86/xaa/xaaInitAccel.c delete mode 100644 xserver/hw/xfree86/xaa/xaaLine.c delete mode 100644 xserver/hw/xfree86/xaa/xaaLineMisc.c delete mode 100644 xserver/hw/xfree86/xaa/xaaNonTEGlyph.c delete mode 100644 xserver/hw/xfree86/xaa/xaaNonTEText.c delete mode 100644 xserver/hw/xfree86/xaa/xaaOffscreen.c delete mode 100644 xserver/hw/xfree86/xaa/xaaOverlay.c delete mode 100644 xserver/hw/xfree86/xaa/xaaOverlayDF.c delete mode 100644 xserver/hw/xfree86/xaa/xaaPCache.c delete mode 100644 xserver/hw/xfree86/xaa/xaaPict.c delete mode 100644 xserver/hw/xfree86/xaa/xaaROP.c delete mode 100644 xserver/hw/xfree86/xaa/xaaRect.c delete mode 100644 xserver/hw/xfree86/xaa/xaaSpans.c delete mode 100644 xserver/hw/xfree86/xaa/xaaStateChange.c delete mode 100644 xserver/hw/xfree86/xaa/xaaStipple.c delete mode 100644 xserver/hw/xfree86/xaa/xaaTEGlyph.c delete mode 100644 xserver/hw/xfree86/xaa/xaaTEText.c delete mode 100644 xserver/hw/xfree86/xaa/xaaTables.c delete mode 100644 xserver/hw/xfree86/xaa/xaaWideLine.c delete mode 100644 xserver/hw/xfree86/xaa/xaacexp.h delete mode 100644 xserver/hw/xfree86/xaa/xaalocal.h delete mode 100644 xserver/hw/xfree86/xaa/xaawrap.h delete mode 100644 xserver/hw/xwin/README create mode 100644 xserver/hw/xwin/propertystore.h create mode 100644 xserver/hw/xwin/winSetAppUserModelID.c delete mode 100644 xserver/hw/xwin/winclipboardunicode.c create mode 100644 xserver/hw/xwin/winmultiwindowicons.h delete mode 100644 xserver/hw/xwin/winregistry.c create mode 100644 xserver/hw/xwin/wintaskbar.c create mode 100644 xserver/include/dixfontstubs.h create mode 100644 xserver/include/glx_extinit.h delete mode 100644 xserver/mi/mibstore.h delete mode 100644 xserver/miext/cw/Makefile.am delete mode 100644 xserver/miext/cw/Makefile.in delete mode 100644 xserver/miext/cw/cw.c delete mode 100644 xserver/miext/cw/cw.h delete mode 100644 xserver/miext/cw/cw_ops.c delete mode 100644 xserver/miext/cw/cw_render.c create mode 100644 xserver/randr/rrprovider.c create mode 100644 xserver/randr/rrproviderproperty.c create mode 100644 xserver/test/hashtabletest.c create mode 100644 xserver/test/os.c create mode 100644 xserver/test/signal-logging.c delete mode 100644 xserver/xkb/ddxList.c diff --git a/xserver/COPYING b/xserver/COPYING index cd9e80a48..7aa0df080 100644 --- a/xserver/COPYING +++ b/xserver/COPYING @@ -1788,7 +1788,7 @@ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -Copyright (c) 1989, 1990, 1993, 1994 +Copyright (c) 1987, 1990, 1993 The Regents of the University of California. All rights reserved. This code is derived from software contributed to Berkeley by diff --git a/xserver/ChangeLog b/xserver/ChangeLog index d97f82ac6..eda3cd544 100644 --- a/xserver/ChangeLog +++ b/xserver/ChangeLog @@ -1,12 +1,8395 @@ -commit 60e0d205666c1fc0c818b9430c1e20428c9d3808 +commit f5796f98dadccf67c04f601178966614dd51a1b4 Author: Peter Hutterer -Date: Mon Jul 9 10:44:01 2012 +1000 +Date: Wed Apr 17 16:12:00 2013 +1000 - configure.ac: Bump to Version 1.12.3 + xserver 1.14.1 Signed-off-by: Peter Hutterer -commit 738e55ebbdf516a45b95761b815bed4e697dc726 +commit aac2d9d09c73fa2b9d02d8446718aa6ccd7e894a +Author: Dave Airlie +Date: Wed Apr 10 16:09:01 2013 +1000 + + xf86: fix flush input to work with Linux evdev devices. + + So when we VT switch back and attempt to flush the input devices, + we don't succeed because evdev won't return part of an event, + since we were only asking for 4 bytes, we'd only get -EINVAL back. + + This could later cause events to be flushed that we shouldn't have + gotten. + + This is a fix for CVE-2013-1940. + + Signed-off-by: Dave Airlie + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + (cherry picked from commit 6ca03b9161d33b1d2b55a3a1a913cf88deb2343f) + +commit 2eec013569f6daa952482ac5d9db8acc71fe01aa +Author: Peter Hutterer +Date: Mon Feb 25 11:13:52 2013 +1000 + + dix: fix a comment + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + (cherry picked from commit 11bead1fa205a1353e6a33c6024c7e8ace80be7c) + +commit bce06afc99ce1d948f9002e0c5c7bc29d66425da +Author: Peter Hutterer +Date: Thu Feb 28 10:43:05 2013 +1000 + + Xi: add a comment to make a condition a bit clearer + + The commit message to 676447190190d8546165e21be242cf16dd69f5ae explains it, + but that doesn't stop the WTF moment when reading the code. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + (cherry picked from commit 2967391c6d35f03121afa8003e0fb94b62495129) + +commit 8e16c2e3038c1c17cae73d8d9681dccce0fd402a +Author: Robert Morell +Date: Tue Mar 12 09:40:16 2013 -0700 + + list.h: Make xorg_list_init inline + + Otherwise this file is emitted in every unit that includes it. + + Signed-off-by: Robert Morell + Reviewed-by: Jamey Sharp + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + (cherry picked from commit 7050aae69c2a55dfdbb5c6af7882307e90ba4275) + +commit 44def3caf002f9fc53b971014e4e2d62afe39435 +Author: Robert Morell +Date: Tue Mar 12 09:37:43 2013 -0700 + + configure.ac: Require inputproto 2.3 + + This picks up support for Xi pointer barriers in the protocol. + + Signed-off-by: Robert Morell + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + (cherry picked from commit 31595b528645a7e4903eb81da0fc332d78407f25) + +commit 27a49db31a146b8e2f1133c23262ecadc5ff4157 +Author: Peter Hutterer +Date: Sat Mar 9 17:12:53 2013 +1000 + + xfixes: ifdef PanoramiXFixes* (#62015) + + Fixes build failure with --disable-xinerama introduced by + 482e0cb cursor: Move pointer barrier code over to XI + + Reason is new include order: sdksyms.sh includes xfixes.h, which previously + did not include xfixesint.h. + + As of 482e0cb xfixes.h includes xibarriers.h which includes xfixesint.h + + X.Org Bug 62015 + + Signed-off-by: Peter Hutterer + Tested-by: Daniel Martin + (cherry picked from commit 3ac2e61705432951f9e1b96b42b4214e7f748f94) + +commit 103b77c59e3638a45179bf6d7908f5c738d2d872 +Author: Keith Packard +Date: Tue Mar 5 22:31:17 2013 -0800 + + Version bumped to 1.14 + + Signed-off-by: Keith Packard + +commit 6238bd68bd71323f8b4f1808f34dabe2ae447fe3 +Author: Aaron Plattner +Date: Tue Mar 5 13:04:46 2013 -0800 + + DPMS: include GPU screens in DPMS code + + Otherwise, displays driven by GPU screens remain on all the time. + + Signed-off-by: Aaron Plattner + Reviewed-by: Alex Deucher + Signed-off-by: Keith Packard + +commit dd4ab8b572956f9457616869d6e383c8ed964c73 +Author: Peter Hutterer +Date: Tue Mar 5 10:14:29 2013 +1000 + + Xi: force dtime to 0 on the first BarrierHit + + dtime to the previous event is 0 on the first BarrierHit event. + + Signed-off-by: Peter Hutterer + Reviewed-by: Jasper St. Pierre + Signed-off-by: Keith Packard + +commit 604169af8b67afc74a292cdb9070a3a1f2d7c536 +Merge: 8f4640b 6ea59dc +Author: Keith Packard +Date: Mon Mar 4 21:09:59 2013 -0800 + + Merge commit '6ea59dc2d8887102bfd8d7c838d2e7ab17645aec' + +commit 6ea59dc2d8887102bfd8d7c838d2e7ab17645aec +Author: Jasper St. Pierre +Date: Sun Mar 3 04:50:55 2013 -0500 + + xibarriers: Remove accidental use of the comma operator + + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 8f4640bdb9d3988148e09a08d2c7e3bab1d538d6 +Author: Dave Airlie +Date: Wed Jan 9 12:58:28 2013 +1000 + + randr: cleanup provider properly + + So in the cold plug server shutdown case, we reap the resources + before we call CloseScreen handlers, so the config->randr_provider + is a dangling pointer when the xf86CrtcCloseScreen handler is called, + + however in the hot screen unplug case, we can't rely on automatically + reaped resources, so we need to clean up the provider in the xf86CrtcCloseScreen + case. + + This patch provides a cleanup callback from the randr provider removal + into the DDX so it can cleanup properly, this then gets called by the automatic + code for cold plug, or if hot unplug it gets called explicitly. + + Fixes a number of random server crashes on shutdown + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58174 + Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=891140 + + Reviewed-by: Peter Hutterer + Signed-off-by: Dave Airlie + +commit 3ec35c45ca17f5ed6fd02c50fc49ae7b8d128dcb +Author: Dave Airlie +Date: Wed Jan 9 12:53:14 2013 +1000 + + xf86: actually set the compat output in the failure case + + The previous fix for the previous fix, didn't fully work, + + If we don't set compat_output we end up doing derferences + of arrays with -1, leading to valgrind warnings. + + Reviewed-by: Chris Wilson + Reviewed-by: Peter Hutterer + Signed-off-by: Dave Airlie + +commit da8ee26023fc2868fe970471195a5f3c86fb574b +Author: Dave Airlie +Date: Wed Jan 9 12:51:45 2013 +1000 + + xfree86/hotplug: cleanup properly if the screen fails to initialise + + Due to another bug, the modesetting/udl driver would fail to init properly + on hotplug, when it did the code didn't clean up properly, and on removing + the device the server could crash. + + Found in F18 testing. + + Signed-off-by: Dave Airlie + Reviewed-by: Aaron Plattner + +commit 90642948cc78834d95f7a3bddaac7ff77b68ed7e +Merge: 9a35d42 eda7dbf +Author: Keith Packard +Date: Thu Feb 14 11:05:48 2013 -0800 + + Merge remote-tracking branch 'jeremyhu/master' + +commit 9a35d4240e2aa91ac104f0f9f86f83ff9a2d3d04 +Author: Peter Hutterer +Date: Thu Feb 14 16:31:13 2013 +1000 + + os: fix pnprintf OOB buffer read for unterminated length modifiers + + Format strings with length modifiers but missing format specifier like "%0" + will read one byte past the array size. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit eda7dbff5a9f35fefe1e3dedacb82daadbf5945e +Author: Jeremy Huddleston Sequoia +Date: Sat Feb 9 20:53:02 2013 -0800 + + XORG_TLS: Pick the first option that works (ie: prefer __thread) + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 5da82f872daf25939a8fa04f1561b01f0315a623 +Author: Jeremy Huddleston Sequoia +Date: Sat Feb 9 20:40:10 2013 -0800 + + os: Ensure is included in strndup.c + + Signed-off-by: Jeremy Huddleston Sequoia + Reviewed-by: Alan Coopersmith + +commit 67eaf4b46f678bc904f47dfcab6655e170d843e0 +Author: Jeremy Huddleston Sequoia +Date: Sat Feb 9 20:34:33 2013 -0800 + + XQuartz: Ensure is included in capabilities.c + + Signed-off-by: Jeremy Huddleston Sequoia + Reviewed-by: Alan Coopersmith + +commit 955d434f4d755d00a24ae4068b9957765989d672 +Author: Keith Packard +Date: Wed Feb 13 21:39:37 2013 -0800 + + Update to version 1.3.99.902 (1.14 RC2) + + Signed-off-by: Keith Packard + +commit 7115f6c709898a5124b67e19c61dc01334471358 +Author: Aaron Plattner +Date: Wed Jan 23 16:58:47 2013 -0800 + + randr: unref the provider shared pixmap the appropriate number of times + + When an RandR shared pixmap is created in rrCreateSharedPixmap, it has a refcnt + of 1. Then, PixmapShareToSlave bumps the refcnt to 2. However, there's no + corresponding PixmapUnshareFromSlave where the refcnt can be decreased again, + and there's no convenient common place where the refcnt can be decremented when + the slave pixmap is destroyed. + + Fix this by just unreffing the pixmap twice in RRCrtcDetachScanoutPixmap. + + Signed-off-by: Aaron Plattner + Reviewed-by: Dave Airlie + Signed-off-by: Keith Packard + +commit da92690107d90061205340d4cdc98b73b59db9b2 +Author: Aaron Plattner +Date: Mon Feb 11 14:31:56 2013 -0800 + + xf86: use nt_list_for_each_entry_safe to walk InputHandlers in xf86Wakeup + + This is necessary when the input handler deletes itself from the + list. Bug found by Maarten Lankhorst, this patch uses the list macros + instead of open-coding the fix. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + +commit d0a14877872b6a33172fb8c8f335792a28b9499b +Author: Bryce Harrington +Date: Fri Feb 8 15:56:02 2013 -0800 + + xfree86: Man page shouldn't say Device is mandatory anymore + + man xorg.conf states that the 'Device' identifier is required in the + 'Screen' section, yet current xserver defaults properly and boots up + fine without it. + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=20742 + Signed-off-by: Bryce Harrington + Signed-off-by: Keith Packard + +commit 5e91054aa070ea09b61325b7ec479d767b02730e +Author: Bryce Harrington +Date: Fri Feb 8 15:56:01 2013 -0800 + + xfree86: Use fbdev/vesa driver on Oaktrail, Medfield, CDV rather than -intel + + Instead of defaulting to -intel for Oaktrail, Medfield, and CDV chips, + default to -fbdev. For Poulsbo (only), attempt to use -psb if it's + installed, and fallback to fbdev otherwise. All other Intel chips + should use -intel. + + This fixed an issue where -intel would load on these chips and cause a + boot failure. Newer -intel drivers avoid the boot hang, but it's still + the wrong driver to load, so why take chances. + + The patch was originally created by Stefan Dirsch for OpenSUSE. We have + included it in our stable release (Ubuntu "quantal" 12.10) since + December. + + ref: https://bugzilla.novell.com/show_bug.cgi?id=772279 + ref: https://bugs.launchpad.net/ubuntu/+bug/1069031 + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=60514 + Signed-off-by: Bryce Harrington + Signed-off-by: Keith Packard + +commit c1602d1c17967bdd4db9db19b3a9c0dfca6a58aa +Author: Dave Airlie +Date: Tue Feb 5 07:46:06 2013 -0800 + + randr: bump advertised RandR version to 1.4 + + Signed-off-by: Dave Airlie + Reviewed-by: Aaron Plattner + Tested-by: Aaron Plattner + Signed-off-by: Keith Packard + +commit 9f79e93b6b3416055d08a0e8f9f16d5fd0649e36 +Author: Peter Hutterer +Date: Wed Jan 30 03:20:07 2013 +0000 + + Short-cut the input device cleanup process during AbortServer() + + If we're about to abort, we're already in the signal handler and cannot call + down to the default device cleanup routines (which reset, free, alloc, and + do a bunch of other things). + + Add a new DEVICE_ABORT mode to signal a driver's DeviceProc that it must + reset the hardware if needed but do nothing else. An actual HW reset is only + required for some drivers dealing with the HW directly. + + This is largely backwards-compatible, hence the input ABI minor bump only. + + Drivers we care about either return BadValue on a mode that's not + DEVICE_{INIT|ON|OFF|CLOSE} or print an error and return BadValue. Exception + here is vmmouse, which currently ignores it and would not reset anything. + This should be fixed if the reset is required. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit b58221f9da8c549d979215271359c6cd88b5568a +Author: Peter Hutterer +Date: Fri Feb 8 14:52:02 2013 +1000 + + dix: support the transformation matrix for relative devices. + + The transformation matrix we previously stored was a scaled matrix based on + the axis ranges of the device. For relative movements, the scaling is not + required (or desired). + + Store two separate matrices, one as requested by the client, one as the + product of [scale . matrix . inv_scale]. Depending on the type of movement, + apply the respective matrix. + + For relative movements, also drop the translation component since it doesn't + really make sense to use that bit. + + Input ABI 19 + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit b173eb2ae3349c557db1ff9e424fa540b8289bb2 +Author: Keith Packard +Date: Fri Feb 8 08:57:43 2013 -0800 + + os: Round fraction in pnprintf %f format + + Truncating the fraction part leads to a test failure where -1203.30 is + printed as -1203.29. Round this to the nearest value instead by adding + 0.5 before converting to an integer + + Signed-off-by: Keith Packard + +commit 509b3c3dc82e7abce1900d5e1cddd90f23be5a87 +Author: Carlos Garnacho +Date: Wed Feb 6 14:07:22 2013 +0100 + + dix: Set focus field on XI2 crossing events + + Set on DeviceEnterLeaveEvent() the xXIEnterEvent->focus field + similarly to how the CoreEnterLeaveEvent() function above does + for core events. + + This fixes bug https://bugzilla.gnome.org/show_bug.cgi?id=677329 + reported to GTK+, where focus handling on window managers with + sloppy focus or no window manager present was broken due to this + field being always set to FALSE. + + Signed-off-by: Carlos Garnacho + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 3e4be4033aed78b2bb3a18d51f0963989efd1af3 +Author: Peter Hutterer +Date: Fri Jan 25 11:47:32 2013 +1000 + + dix: when shutting down slave devices, shut down xtest devices last + + XTest devices are the first ones in the list, being initialised together + with the master devices. If we disable the devices in-order and a device has + a button down when being disabled, the XTest device is checked for a + required button release (xkbAccessX.c's ProcessPointerEvent). This fails if + the device is already NULL. + + Instead of putting the check there, disable the devices in the reverse order + they are initialised. Disable physical slaves first, then xtest devices, + then the master devices. + + Testcase: shut down server with a button still held down on a physical + device + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit 0d5bb882600ee7734af034fbea935a79d21d1e70 +Merge: b33fcb1 61a99af +Author: Peter Hutterer +Date: Fri Feb 8 14:10:52 2013 +1000 + + Merge branch 'ptraccel-fixes' into for-keith + +commit 61a99aff9d33728a0b67920254d2d4d79f80cf39 +Author: Peter Hutterer +Date: Fri Jan 11 14:22:07 2013 +1000 + + dix: pre-scale relative events from abs devices to desktop ratio (#31636) + + Absolute devices may send relative events depending on the mode (synaptics + by default, wacom per option). The relative events are added to the previous + position, converted into device coordinates and then scaled into desktop + coordinates for pointer movement. + + Because the device range must be mapped into the desktop coordinate range, + this results in uneven scaling depending dimensions, e.g. on a setup with + width == 2 * height, a relative movement of 10/10 in device coordinates + results in a cursor movement of 20/10 (+ acceleration) + + Other commonly user-visible results: + * the touchpad changing acceleration once an external monitor as added. + * drawing a circle on a wacom tablet in relative mode gives an ellipsis in + the same ratio as the desktop dimensions. + + Solution: pre-scale the incoming relative x/y coordinates by width/height + ratio of the total desktop size. Then add them to the previous + coordinates and scale back with the previous mapping, which will undo the + pre-scaling and give us the right movement. + + X.Org Bug 31636 + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit a6ba2b79ae8ad0fdee3f208d5e030b012df48785 +Author: Peter Hutterer +Date: Fri Jan 11 08:53:24 2013 +1000 + + dix: unify prefix for ptraccel debugging in DebugAccelF macro + + If we're already using our own custom macro, might as well use it properly. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit 0d7d79406011169ad95e23c6e937f6d15a5ec3cc +Author: Peter Hutterer +Date: Fri Jan 11 08:52:08 2013 +1000 + + dix: use BUG_RETURN_VAL for an error message + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit a0c38ea6cbad61edcfefff0e5dd6330edb706f13 +Author: Peter Hutterer +Date: Fri Jan 11 08:49:15 2013 +1000 + + dix: add some more info to a ptraccel debug msg + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit 95125a7c0cbbbae40216a0497acdd863ddc645ed +Author: Peter Hutterer +Date: Thu Jan 10 13:19:27 2013 +1000 + + dix: fix ptraccel debugging printfs + + This is mostly sigsafe code, so use sigsave printf. And update some fields + to double that used to be int. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit b33fcb149710a28fd8767b2307a97bf367de695e +Author: Andreas Wettstein +Date: Tue Jan 29 21:49:20 2013 +0100 + + xkb: Fix repeat behaviour of redirect and message actions + + The redirect and the message action filter functions implicitly assumed that + when they receive an event for the same keycode they were activated for, that + this is the a release of the key that activated the filter. This is not true + if the key autorepeats. Due to the incorrect assumption, the effective key + repeat rate was effectively halved. + + Signed-off-by: Andreas Wettstein + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 8571c648a79444bcee9a0fe6e395129116372f49 +Author: Peter Hutterer +Date: Sat Jan 26 15:53:08 2013 +1000 + + Xext: if a root window is given in XTestFakeInput, move to that + + For absolute events, if the client specifies a screen number offset the + coordinates by that. And add a new flag so we know when _not_ to add the + screen offset in GPE. + + Without this offset and the flag, GPE would simply add the offset of the + current screen if POINTER_SCREEN is set. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit 9fd6cb89539fde44a41ae5183c89ef9c8831c8dd +Author: Peter Hutterer +Date: Tue Jan 29 15:13:44 2013 +1000 + + Xext: pass the current screen to miProcessDeviceEvent() from xtest calls + + Not passing in a screen means we skip the screen crossing updates, so a + xtest event that changes between ScreenRecs won't do so until the next + physical event comes in or never, whichever comes earlier. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit a191dbfe850ed9c6440346f59cb0078e0e844edc +Author: Sybren van Elderen +Date: Tue Jan 29 15:43:57 2013 +1000 + + dix: when scaling from desktop coord, take the total desktop size (#51904) + + Scaled is already in desktop coordinates, take the total width into account, + not just the current screen's width. + + Fixes Xdmx pointer position calculation. + + X.Org Bug 51904 + + Signed-off-by: Sybren van Elderen + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 1cb19803f0f8dfd1e0fb9d189afe2262e24a0be5 +Author: Peter Hutterer +Date: Tue Jan 29 12:51:15 2013 +1000 + + include: fix typo in list description + + Signed-off-by: Peter Hutterer + +commit 3d35dfcf5bad1b0a028fbecd65cb6cf6ebf12503 +Author: Ted Felix +Date: Tue Jan 29 16:36:48 2013 +1000 + + xfree86: bail on misformed acpi strings (#73227) + + If acpid sends a string in a format that we can't parse, bail out instead of + potentially dereferencing a NULL-pointer. + + X.Org Bug 73227 + + Signed-off-by: Ted Felix + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit fdc451588816c4bc798d54e56316530e9066be80 +Author: Peter Hutterer +Date: Tue Jan 29 11:01:29 2013 +1000 + + Xi: limit valuator copy to valuator array size (#59939) + + mask[(MAX_VALUATORS + 7)/8] is larger than data[MAX_VALUATORS], so static + code checkers think we may be running OOB on the data array. Mask is + initialized to 0, so this should not happen, but change it anyway to shut up + code analyzer noise. + + X.Org Bug 59939 + + Signed-off-by: Peter Hutterer + Reviewed-by: Alan Coopersmith + +commit 48bc30c5413a1be0039fa77affcbbb4fe677479f +Author: Alan Coopersmith +Date: Tue Jan 29 10:24:32 2013 +1000 + + Xext: avoid null-pointer dereference in XTestFakeInput (#59937) + + dv is still NULL at this point, so return firstValuator instead (which is + the same value dv->firstValuator would be once initialized) + + X.Org Bug 59937 + + Signed-off-by: Alan Coopersmith + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 1058fcf57fdcb94d92e7b5f4483b347853d5f8e6 +Author: Peter Hutterer +Date: Sat Jan 26 14:13:33 2013 +1000 + + dmx: don't include dmx-config.h from xdmxconfig (#37502) + + dmx-config.h is a server header which includes dix-config.h. That again + defines a bunch of server-specifics, including setting the size of XID to + 32 bit. + + libX11 uses unsigned long (8 bits on x86_64). XGCValues thus ends up being + 16 bytes smaller in xdmxconfig than in the library, causing garbage to be + sent to the server. + + X.Org Bug 37502 + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit 7fe5e6dfa5c1e71d8b7540b28c1d508687a2fbee +Author: Jasper St. Pierre +Date: Wed Jan 23 13:11:55 2013 -0500 + + protocol-versions: Bump minor version of XI + + This was accidentally excluded when we added barriers. + + Reviewed-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 70b127c9f1c53bdb42f078265e67f76b464deae2 +Author: Aaron Plattner +Date: Thu Jan 10 17:01:17 2013 -0800 + + config/udev: fix "removing GPU device" format string mistake + + udev.c: In function 'device_removed': + udev.c:270:9: warning: format '%d' expects argument of type 'int', but argument 3 has type 'const char *' [-Wformat] + + Signed-off-by: Aaron Plattner + Reviewed-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 605dfc6804a05ff2bda5692fec26c37344fd95cb +Author: Dave Airlie +Date: Tue Jan 22 07:39:53 2013 +1000 + + xserver: fix build regression since 91ab237358c6e33da854914d3de493a9cbea7637 + + inputstr, double defines TouchListener typedef, maybe some gcc handles it, + but not all. + + fixes tinderbox + + Reported-by: Jon TURNEY + Signed-off-by: Dave Airlie + Reviewed-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 069d8ed3eb659c48dd2b0f8b7b8c11f092fdb362 +Merge: 591c062 d6dcde7 +Author: Keith Packard +Date: Sun Jan 20 15:58:38 2013 -0800 + + Merge remote-tracking branch 'jturney/xserver-next' + +commit 591c06277bb120ab9615633f2d28addbd3a2aa5f +Merge: 6703a7c fa6ab7d +Author: Keith Packard +Date: Sun Jan 20 15:52:26 2013 -0800 + + Merge remote-tracking branch 'whot/for-keith' + +commit cde7cbe9674e8a771f9a4e646c1772a46a8230fb +Author: Peter Hutterer +Date: Thu Jan 10 13:20:12 2013 +1000 + + os: add support for %f to pnprintf + + This is the lazy man's %f support. Print the decimal part of the number, + then append a decimal point, then print the first two digits of the + fractional part. So %f in sigsafe printing is really %.2f. + + No boundary checks in place here. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit 20def57632583aef095ca18792c7fce16d2d9004 +Author: Peter Hutterer +Date: Thu Jan 10 13:24:05 2013 +1000 + + os: silently ignore length modifiers in pnprintf + + Until we have support for them, ignore any length modifiers so we don't need + to update all callers. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit f53b2012f39085d866f267dda1442a48ace3c5a5 +Author: Peter Hutterer +Date: Thu Jan 17 16:19:51 2013 +1000 + + test/signal-logging: simplify tests using sprintf + + Ever looked at your own code and thought 'WTF was I thinking?'. yeah, that. + + Instead of passing in the expected string just use sprintf to print the + number for us and compare. In the end we're just trying to emulate printf + behaviour anyway. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit d6dcde7a03bb38c17ffc4ec5f0ca1c161e54569f +Author: Jon TURNEY +Date: Sat Feb 11 12:22:17 2012 +0000 + + hw/xwin: Stop assuming WS_EX_APPWINDOW style in WM_SHOWWINDOW + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 56e94403f8f9182e05428d895a983371c7737d2a +Author: Jon TURNEY +Date: Wed Jan 9 20:15:01 2013 +0000 + + hw/xwin: Use ITaskBarList interface to ensure show-on-taskbar state is updated correctly + + Use ITaskBarList interface to ensure that the taskbar notices if the window has + changed it's style in a way which affects if the taskbar shows it or not. + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit c94d1cb0a49106f44714f4511720a197cc549164 +Author: Jon TURNEY +Date: Thu Jan 10 14:35:56 2013 +0000 + + hw/xwin: Ensure full styling is applied when the window is mapped + + Move styling update code from WM_WM_HINTS_EVENT to a function UpdateStyle(), + which is also invoked from WM_WM_MAP3, so everything which needs to be done + to style the window happens when it is mapped + + (Otherwise, the appearance of the window is sensitive to the timing of the + notification of the windows appearance hint properties being set relative to + window creation. e.g. see [1]) + + [1] http://sourceware.org/ml/cygwin-xfree/2012-06/msg00004.html + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit ef61f8cacc84080c9156675f9ce26a27e8a90ac1 +Author: Jon TURNEY +Date: Sat Mar 31 18:45:28 2012 +0100 + + hw/xwin: Make sure that WM_WM_HINTS_EVENT does nothing for override-redirect windows + + Future work: It looks like this code could be rationalized quite a lot: It might + make sense to pull the checking for override-redirect up out of UpdateIcon() and + UpdateName() and consolidate WM_WM_MAP2 and WM_WM_MAP3 + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 3628559e594fcbdfcc14b1e8fa60aa841f184e19 +Author: Jon TURNEY +Date: Sun Feb 5 11:25:39 2012 +0000 + + hw/xwin: Add a new WM_WM_HINTS_EVENT event to update window style + + Add a new WM_WM_HINTS_EVENT event to update window style if any of the + properties which affect window style change + + Check PropertyNotify events for any of the window properties which we consider + to decide on the window style, and update the window style by sending a + WM_WM_HINTS_EVENT message to the WM. + + This allows the styling of the window to change during it's lifetime. + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 066ecbd11d516ea68d7ebc7470232d01c5717546 +Author: Jon TURNEY +Date: Thu Jan 10 14:37:45 2013 +0000 + + hw/xwin: Move reshape code from winUpdateWindowPosition() to the map event handler + + Move reshape code, which was only used when handling a map event, from + winUpdateWindowPosition(), to put it explicitly in the map event handler. + + Remove 'reshape' parameter from winUpdatePosition(). + + (Note that there's no handling of the ShapeNotify event to notice when the + window shape changes, instead we hook the screen SetShape procedure and reshape + the native window then) + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 852d1fb042f4160fe023a015f1c9a34126bf911a +Author: Ryan Pavlik +Date: Sat Dec 1 16:58:40 2012 +0000 + + hw/xwin: Add missing include xwin-config.h to winglobals.h + + winglobals.h checks if RELOCATE_PROJECTROOT is defined to see if a declaration + of g_fLogFileChanged is needed, so must include xwin-config.h + + Signed-off-by: Ryan Pavlik + Reviewed-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit ab686ce029208abf970a4bcd1435bf8411a44de9 +Author: Ryan Pavlik +Date: Wed Oct 26 17:03:25 2011 -0500 + + include: Add RELOCATE_PROJECTROOT to xwin-config.h header + + RELOCATE_PROJECTROOT is AC_DEFINED in configure.ac, but currently has no effect + as it doesn't appear in any AC_CONFIG_HEADER header. + + When packaged for Windows, we do not have a unix-style filesystem tree, where + file needed by the X server can be found in fixed, absolute paths under the + prefix (PROJECTROOT). + + Instead, the filesystem tree containing files needed by the X server and clients + will be installed with the directory containing the X server executable as the + root directory of that tree. + + (Typically, this will be in the Program Files directory, which does not have a + fixed name, as it can be moved, localized, or added to to indicate x86 or x64 + binaries) + + So, RELOCATE_PROJECTROOT is used to make a native Windows build of the X server + look for various files (fonts, xkb data) in locations relative to the X server + rather than at absolute paths, by translating those paths at run-time. + + Additionally the XKEYSYMDB, XERRORDB, XLOCALEDIR env vars checked by libX11 are + set appropriately for clients started by the X server. + + Signed-off-by: Ryan Pavlik + Reviewed-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit fa6ab7d9b2d7fd8184f1e068360607845f5c33ab +Merge: adde4e6 0e1ab43 +Author: Peter Hutterer +Date: Fri Jan 11 14:58:17 2013 +1000 + + Merge branch 'pointer-emulation-fixes-56558-v2' into for-keith + +commit adde4e64480315dc5b47a727ee37d86f5cd8584f +Author: Peter Hutterer +Date: Thu Jan 10 10:33:05 2013 +1000 + + dix: typo fix in comment + + Signed-off-by: Peter Hutterer + +commit 05ed095dd8d6cf939b4ebd9a59d70ce32705df7c +Author: Benjamin Tissoires +Date: Wed Jan 9 19:32:19 2013 +0100 + + dix: fix error logging occuring in signal context of GetTouchEvents + + GetTouchEvents is usually called in a signal context. + Calling ErrorF for the error messages leads to X complaining about log: + + (EE) BUG: triggered 'if (inSignalContext)' + (EE) BUG: log.c:484 in LogVMessageVerb() + (EE) Warning: attempting to log data in a signal unsafe manner while in signal context. + Please update to check inSignalContext and/or use LogMessageVerbSigSafe() or ErrorFSigSafe(). + The offending log format message is: + %s: Attempted to start touch without x/y (driver bug) + + Signed-off-by: Benjamin Tissoires + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit f4a58469a298c226668fd8dce375bf22331c902d +Author: Peter Hutterer +Date: Wed Jan 9 13:58:56 2013 +1000 + + xfree86: don't access the old input handler after freeing it + + Introduced in 323869f3298cbbfe864af9404a8aed1bf7995d79 + + Signed-off-by: Peter Hutterer + Reviewed-by: Dave Airlie + +commit 205cfbd6d9824fb9a67c21b19bc8f1e66c9df4d2 +Author: Dave Airlie +Date: Sat Jan 5 18:35:42 2013 +1000 + + xf86: bump input ABI version to 19 + + The changes to miPointerSetPosition interface from int->double breaks + the SIS driver build, so time to bump this. + + Signed-off-by: Dave Airlie + Signed-off-by: Peter Hutterer + +commit ad3bc571348a7007a2960bf87ae739397c5511ee +Author: Peter Hutterer +Date: Tue Jan 8 11:19:09 2013 +1000 + + xfree86: update the device state for all DGA events (#59100) + + DGA only handles master devices but it does intercept slave device events as + well (since the event handlers are per event type, not per device). + + The DGA code must thus call into UpdateDeviceState to reset the button/key + state on the slave device before it discards the remainder of the event. + + Test case: + - Passive GrabModeSync on VCP + - Press button + - Enable DGA after ButtonPress + - AllowEvents(SyncPointer) + - Release button + + The button release is handled by DGAProcessPointerEvent but the device state + is never updated, so the slave ends up with the button permanently down. + And since the master's button state is the union of the slave states, the + master has the button permanently down. + + X.Org Bug 59100 + + Reported-by: Steven Elliott + Signed-off-by: Peter Hutterer + Reviewed-by: Dave Airlie + +commit c5f2818edbec2f87383baa6c6be5c389b73ca6f9 +Author: Peter Hutterer +Date: Tue Jan 8 10:13:53 2013 +1000 + + xfree86: set event->detail for DGA pointer events + + Reported-by: Steven Elliott + Signed-off-by: Peter Hutterer + Reviewed-by: Dave Airlie + +commit 519d183d78e0b0eaf47a473e94f5d8611baf8463 +Author: Peter Hutterer +Date: Mon Jan 7 10:44:33 2013 +1000 + + Fix two typos "requires an string value" + + Signed-off-by: Peter Hutterer + +commit 4e13dd90144dde47550aceea4db4b4329e531279 +Author: Peter Hutterer +Date: Wed Aug 22 10:34:07 2012 +1000 + + dix: don't filter RawEvents if the grab window is not the root window (#53897) + + If a XI2.1+ client has a grab on a non-root window, it must still receive + raw events on the root window. + + Test case: register for XI_ButtonPress on window and XI_RawMotion on root. + No raw events are received once the press activates an implicit grab on the + window. + + X.Org Bug 53897 + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit a2037d7080ae64ea55f7d76971716346aa3ec6d3 +Author: Jon TURNEY +Date: Wed Nov 28 22:25:35 2012 +0000 + + hw/xwin: Fix MinGW build of winSetAppModelID.c + + Add missing #include + + In file included from /jhbuild/checkout/xorg/xserver/hw/xwin/winSetAppUserModelID.c:31:0: + /jhbuild/checkout/xorg/xserver/hw/xwin/winwindow.h:140:11: error: expected declaration specifiers or ‘...’ before ‘pthread_t’ + /jhbuild/checkout/xorg/xserver/hw/xwin/winwindow.h:141:11: error: expected declaration specifiers or ‘...’ before ‘pthread_t’ + /jhbuild/checkout/xorg/xserver/hw/xwin/winwindow.h:142:11: error: expected declaration specifiers or ‘...’ before ‘pthread_mutex_t’ + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit f57100bb36eae3b4d75f3c315973405f705b8de6 +Author: Jon TURNEY +Date: Tue Feb 23 13:38:48 2010 +0000 + + hw/xwin: Process one Windows message per wakeup, rather than all of them. + + De-queuing Windows messages and X events happens in the same thread of + execution. Draining the windows message queue can lead to the X event queue + overflowing if lots of those windows messages cause X events (e.g. if a keyboard + macro program has just dumped thousands of keypresses into the Windows message + queue). See the mailing list thread [1] for more details. + + Processing one Windows message per wakeup, rather than all of them gives the X + server a chance to do stuff as well after each message. + + [1] http://cygwin.com/ml/cygwin-xfree/2010-01/msg00056.html + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit e30e1ea98720acc583f34c830a1c1b7e3e88f694 +Author: Jon TURNEY +Date: Mon Dec 17 22:38:25 2012 +0000 + + hw/xwin: Fix some comments in winkeybd.c + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 6f4a48f8a55bc54b6d3e9d80734be05750c024de +Author: Jon TURNEY +Date: Thu Apr 1 15:08:26 2010 +0100 + + hw/xwin: Bring the X screen window to the front on a single left-click on the tray icon + + Bring the X screen window to the front on a single left click on the tray icon, + like the comment says we do + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 6703a7c7cf1a349c137e247a0c8eb462ff7b07be +Author: Keith Packard +Date: Tue Jan 8 20:24:32 2013 -0800 + + hw/xfree86: Require only one working CRTC to start the server. + + Instead of requiring every mode set to complete successfully, start up + as long as at least one CRTC is working. This avoids failures when one + or more CRTCs can't start due to mode setting conflicts. + + Signed-off-by: Keith Packard + Reviewed-by: Dave Airlie + +commit 0e1ab433f4048b3367bb2f01d16cd00502538e4d +Author: Peter Hutterer +Date: Fri Jan 4 12:26:58 2013 +1000 + + dix: remove already-moved hunk + + Should've been removed in bc1f90a615018c05994fae3e678dd2341256cd82a, but got + left here due to a botched rebase. + + Fixes stray button events sent to clients after deactivating an async + pointer grab on a pointer-emulating-touch. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit 32a6d8a6b59c42f8d65002d7ca1cafb1957b656f +Author: Peter Hutterer +Date: Thu Dec 20 16:25:43 2012 +1000 + + dix: check for the right device's xi2 mask + + events.c: In function 'DeactivatePointerGrab': + events.c:1524:51: warning: 'dev' may be used uninitialized in this function + [-Wuninitialized + + dev is unset when we get here, the device to check is "mouse". + Introduced in ece8157a59751b3ed492fb2e1eb8d5f20221e195. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit f59499b5d05fde83813709e9848152951592120d +Author: Peter Hutterer +Date: Tue Oct 30 12:44:08 2012 +1000 + + dix: add resource type to touch listeners + + Instead of guessing what resource type the listener is and what property to + retrieve, store the resource type in the listener directly. + + Breaks XIT test cases: + TouchGrabTestMultipleTaps.PassiveGrabPointerEmulationMultipleTouchesFastSuccession + + Fixes https://bugs.freedesktop.org/show_bug.cgi?id=56557 + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + Reviewed-by: Chase Douglas + +commit 9ad0fdb135a1c336771aee1f6eab75a6ad874aff +Author: Keith Packard +Date: Tue Nov 27 11:21:17 2012 -0800 + + input: Record grab pointer in TouchListener + + This places a pointer to the grab related to a TouchListener directly + in the TouchListener structure rather than hoping to find the grab + later on using the resource ID. + + Passive grabs have resource ID in the resource DB so they can be + removed when a client exits, and those resource IDs get copied when + activated, but implicit grabs are constructed on-the-fly and have no + resource DB entry. + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 91ab237358c6e33da854914d3de493a9cbea7637 +Author: Keith Packard +Date: Tue Nov 27 11:21:16 2012 -0800 + + input: Pull TouchListener declaration to top-level + + No reason to have a struct declared inside another struct + + Signed-off-by: Keith Packard + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 3578cc3c2e1b5cb8eb191e2d12ad88e1bc9e6e1e +Author: Andreas Wettstein +Date: Wed Dec 19 18:13:21 2012 +0100 + + xkb: Do not use base group as an array index. + + The base group is not brought into range and, therefore, using it as an array + index crashed the X server. Also, at this place, we should ignore locked + groups, but not latched groups. Therefore, use sum of base and latched groups, + brought into range. + + Reproducible with: + key { + type= "ONE_LEVEL", + symbols[Group1]= [ NoSymbol ], + actions[Group1]= [ LatchGroup(group=-1, clearLocks) ] + }; + + And hitting F7 will exceed the group level and access arbitrary memory. + + Signed-off-by: Andreas Wettstein + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit df746a73410b892a4d41a2934cf9cd2e8ad7ba51 +Author: Carlos Garnacho +Date: Wed Dec 19 18:42:39 2012 +0100 + + render: Unwrap early on the animated cursor BlockHandler + + The loop above the previous call may end up triggering other + handlers attaching to the same function slot, so unwrapping + the handler after that could leave the just attached handler + in a dangling but not unset state. + + This issue was most visible on the XO, where destroying a + window with an animated cursor set and running would trigger + this inconsistent state, never calling the miSpriteBlockHandler + again after the animated cursor is unset. + + Signed-off-by: Carlos Garnacho + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 0fbd779a82919d5dbf8776be9b57a76c0eae6b14 +Author: Carlos Garnacho +Date: Wed Dec 19 18:42:38 2012 +0100 + + mi: Ensure pointer emulating touch events update the sprite + + Different miPointerSpriteFuncRec implementations do a varying + business at ultimately calling miPointerUpdateSprite(), this + particularly fails when using the plain mi sprite on touch events, + where the sprite is just moved/updated on cursor changes. + + So, ensure miPointerUpdateSprite() is called generically for + pointer emulating touch events as with regular motion events. + + Signed-off-by: Carlos Garnacho + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 8b328d4ee3873bc0a7a34f2cb9d301827244b98c +Author: Aaron Plattner +Date: Fri Dec 21 07:37:33 2012 -0800 + + dix: Make small bitfields that store enums unsigned + + Commit 31bf81772e146af79b0c456aae2159eba8b0280f changed the clientState field + from a signed int to a signed int 2-bit bitfield. The ClientState enum that is + expected to be assigned to this field has four values: ClientStateInitial (0), + ClientStateRunning (1), ClientStateRetained (2), and ClientStateGone (3). + However, because this bitfield is signed, ClientStateRetained becomes -2 when + assigned, and ClientStateGone becomes -1. This causes warnings: + + test.c:54:10: error: case label value exceeds maximum value for type [-Werror] + test.c:55:10: error: case label value exceeds maximum value for type [-Werror] + + The code here is a switch statement: + + 53 switch (client->clientState) { + 54 case ClientStateGone: + 55 case ClientStateRetained: + 56 [...] + 57 break; + 58 + 59 default: + 60 [...] + 61 break; + 62 } + + It also causes bizarre problems like this: + + client->clientState = ClientStateGone; + assert(client->clientState == ClientStateGone); // this assert fails + + Also change the signedness of nearby bitfields to match. + + Signed-off-by: Aaron Plattner + Reviewed-by: Alex Deucher + Reviewed-by: Colin Harrison + Signed-off-by: Keith Packard + +commit 8f4820be7a2e0f6e286ddc85c4b75bccdbe8a730 +Author: Peter Hutterer +Date: Thu Dec 20 12:44:16 2012 +1000 + + test/xi2: fix compiler warning + + protocol-xiwarppointer.c: In function ‘ScreenSetCursorPosition’: + protocol-xiwarppointer.c:71:53: warning: declaration of ‘screen’ shadows a + global declaration [-Wshadow] + + Signed-off-by: Peter Hutterer + +commit bd91b05b631f13afd1f7a9d6cbc4f0c5408b523a +Author: Keith Packard +Date: Wed Dec 19 12:47:35 2012 -0800 + + Update to version 1.13.99.901 (1.14 RC1) + + Signed-off-by: Keith Packard + +commit 2a0b544f5c09f79e4ab04ea8103a5ecf59ee2e7b +Merge: 0eb1559 ba4bb3b +Author: Keith Packard +Date: Wed Dec 19 12:26:00 2012 -0800 + + Merge remote-tracking branch 'jeremyhu/master' + +commit 0eb1559eb29d11e63c2b33e317590a88d86fe313 +Merge: 386e4d7 ea1d76d +Author: Keith Packard +Date: Wed Dec 19 12:21:31 2012 -0800 + + Merge remote-tracking branch 'yselkowitz/master' + + I checked this patch with diff -w to check that it only affected + whitespace. + +commit 386e4d76baaffe226d2d561ff936509454eb0ac2 +Merge: 014a5c8 9ff2e83 +Author: Keith Packard +Date: Wed Dec 19 12:17:59 2012 -0800 + + Merge remote-tracking branch 'alanc/master' + +commit 014a5c8a9d86f2f992183bff9106354fac2c3b0e +Merge: f793b5f 2eefa5d +Author: Keith Packard +Date: Wed Dec 19 12:09:31 2012 -0800 + + Merge remote-tracking branch 'whot/barriers' + + Conflicts: + Xi/xichangehierarchy.c + + Small conflict with the patch from + + Xi: don't use devices after removing them + + Was easily resolved by hand. + + Signed-off-by: Keith Packard + +commit 9ff2e831517875f96477862f979abff394e8d551 +Author: Alan Coopersmith +Date: Tue Dec 18 00:41:08 2012 -0800 + + EnableDisableExtensionError: Use ARRAY_SIZE rather than sentinel + + d785368e0e converted the other miinitext functions to use ARRAY_SIZE, + and removed the sentinel, but missed EnableDisableExtensionError so + passing an invalid extension name could cause the server to walk off + the end off the list looking for a sentinel that wasn't there. + + Signed-off-by: Alan Coopersmith + Reviewed-by: Peter Hutterer + +commit ba4bb3bc1b87eb57cc34d2ad1f302c9d2a15c847 +Author: Jeremy Huddleston Sequoia +Date: Tue Dec 18 01:29:12 2012 -0800 + + XQuartz: Don't add the 15bit visual any more + + Mountain Lion only supports 32bit backing stores, so don't use 15bit visuals until libXplugin adapts + + Signed-off-by: Jeremy Huddleston Sequoia + +commit c298f9c42ec05486ac88fc91a84739d7c3e3ea9e +Author: Jeremy Huddleston Sequoia +Date: Tue Dec 18 01:28:02 2012 -0800 + + XQuartz: Revert some unfortunate auto-indenting mishaps with our super-nested for-loops + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 07a91fa6c6d535f3f05d4c3bd9c4d2b8c382c475 +Author: Rob Clark +Date: Wed Dec 5 23:21:27 2012 +0000 + + hw/dmx: fix build without GLX + + Fixes this compile break that showed up on arm recently: + + dmxinit.c:746:26: error: 'glxSupported' undeclared (first use in this function) + dmxinit.c:746:26: note: each undeclared identifier is reported only once for each function it appears in + + Signed-off-by: Rob Clark + Reviewed-by: Alex Deucher + +commit 5692a1e8f5befd3698134b1a5516a4dadda00115 +Author: Alan Coopersmith +Date: Thu Dec 6 16:15:50 2012 -0800 + + Support compilers with alternate spellings of typeof + + The AC_C_TYPEOF adds a #undef typeof to its autogenerated config.h.in + template, but b8ab93dfbc7f292 didn't copy that to dix-config.h.in + when HAVE_TYPEOF was, so the macro could claim typeof support but not + make it work, when used with compilers like Solaris Studio 12.1 which + only recognize it as __typeof__. + + Signed-off-by: Alan Coopersmith + Acked-by: Peter Hutterer + +commit f793b5fd3eb16a2ada130367c2ffebeede69a322 +Author: Peter Hutterer +Date: Tue Dec 11 13:36:02 2012 +1000 + + dix: don't copy the wrong event mask when activating a passive grab + + GrabMask is a union of core, XI1 and XI2 masks. If a XI2 grab is activated, + the value is a random pointer value, using it as mask has unpredictable + effects. + + Signed-off-by: Peter Hutterer + Reviewed-by: Jasper St. Pierre + Reviewed-by: Keith Packard + +commit dd3242c87a0a58cba055eb99c0c3fcf03153e4b8 +Author: Peter Hutterer +Date: Fri Dec 14 11:34:15 2012 +1000 + + dix: don't allow overriding a grab with a different type of grab (#58255) + + If a client has a core grab, don't allow re-grabbing with type XI2, etc. + This was the intent of the original commit + xorg-server-1.5.99.1-782-g09f9a86, but ineffective. + + X.Org Bug 58255 + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit 2eefa5d6e870c57ac6a5930883d8cfe3a3882a43 +Author: Peter Hutterer +Date: Thu Dec 13 14:42:32 2012 +1000 + + Xi: if a MD is removed, send a barrier leave event (if applicable) + + Signed-off-by: Peter Hutterer + Reviewed-by: Jasper St. Pierre + +commit e2423b627ef7e4d08ea0685af5e771ddd2b511ce +Author: Peter Hutterer +Date: Thu Dec 13 14:04:13 2012 +1000 + + Xi: don't store the window pointer in barriers, store the window ID + + When a client shuts down and resources are being freed, the window may have + been freed already, so accessing it to get the window ID is bad. Plus, we + never care about the window anyway other than for stuffing it into the + event. + + Signed-off-by: Peter Hutterer + Reviewed-by: Jasper St. Pierre + +commit f71c2f895c9e2f9d0d42feaac2a3e1d2deb71f67 +Author: Peter Hutterer +Date: Wed Dec 12 15:41:32 2012 +1000 + + Xi: fix per-device barrier handling + + Signed-off-by: Peter Hutterer + Reviewed-by: Jasper St. Pierre + +commit 58bff17e43a80eb21b3ff6d4bb1596230e61f707 +Author: Peter Hutterer +Date: Thu Dec 13 11:49:54 2012 +1000 + + Xi: don't use devices after removing them + + RemoveDevice() frees the DeviceIntPtr, we shouldn't use the pointer after + that + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit 3420a7778c7d5eaa638327f31dd460554c257bb1 +Author: Peter Hutterer +Date: Wed Dec 12 11:02:19 2012 +1000 + + xfree86: print message to the log when zapping the server + + Signed-off-by: Peter Hutterer + Reviewed-by: Aaron Plattner + Signed-off-by: Keith Packard + +commit 6d508b81857edaed03c7ee06410434ea56d9b701 +Merge: d982d87 bb6f351 +Author: Keith Packard +Date: Mon Dec 17 11:45:45 2012 -0800 + + Merge remote-tracking branch 'whot/for-keith' + + I've looked at these patches, but I can't say I've actually + reviewed them... + +commit d982d877436377597b8ed04bca1438d2edaf53ee +Merge: da3eaf6 6b4aa8a +Author: Keith Packard +Date: Mon Dec 17 10:56:12 2012 -0800 + + Merge remote-tracking branch 'airlied/for-keithp' + +commit da3eaf6bdbd7ce3bebf2c490cbe2448b4c402dba +Author: Dave Airlie +Date: Mon Dec 17 15:40:17 2012 +1000 + + glx/dri2: initialise api to avoid indirect rendering failing randomly + + Running glxinfo under indirect rendering would randomly fail against the + intel driver, as it would create a context with no attribs, and then the + api value would be passed to the driver uninitialised. + + Signed-off-by: Dave Airlie + Reviewed-by: Keith Packard + Reviewed-by: Ian Romanick + Signed-off-by: Keith Packard + +commit cc10ac8f0e07854647e1fd7cc70b7e9f8d919fd1 +Author: Peter Hutterer +Date: Mon Dec 10 11:00:46 2012 +1000 + + Xi: fix swapping for barrier events + + Protocol events don't contain pointers, so it's easier to copy everything + over, then swap in-place. + + Signed-off-by: Peter Hutterer + Reviewed-by: Jasper St. Pierre + +commit 151d44149a09dd125e25b3d94f22a609f0221548 +Author: Peter Hutterer +Date: Mon Dec 10 10:53:49 2012 +1000 + + Xi: swap sequence number and evtype in barrier events + + Signed-off-by: Peter Hutterer + Reviewed-by: Jasper St. Pierre + +commit d4065493b211e90b46f9d4178f23f347afd8043f +Author: Peter Hutterer +Date: Mon Dec 10 11:02:32 2012 +1000 + + tests/xi2: at protocol conversion test for barrier events + + Signed-off-by: Peter Hutterer + Reviewed-by: Jasper St. Pierre + +commit 938187f2fec006daf4cc677df26d5b0b6999b54b +Author: Peter Hutterer +Date: Fri Dec 7 15:55:59 2012 +1000 + + Require inputproto 2.2.99.1 + + Signed-off-by: Peter Hutterer + Reviewed-by: Jasper St. Pierre + +commit 78376a9217058aa66e52a0399fc2be469d70ce32 +Author: Peter Hutterer +Date: Fri Dec 7 09:26:13 2012 +1000 + + mi: rename mipointer's internal event list + + Avoid name shadowing warnings, change the event list to a more specific + name. + + Signed-off-by: Peter Hutterer + Reviewed-by: Jasper St. Pierre + +commit 88a2cccc37cac4e171f9bfc020017ddfa66ae417 +Author: Peter Hutterer +Date: Fri Dec 7 09:11:13 2012 +1000 + + Xi: if the device is currently grabbed, flag the barrier event + + Signed-off-by: Peter Hutterer + Reviewed-by: Jasper St. Pierre + +commit 353aa515922e1095047161ec47a2722772218f20 +Author: Peter Hutterer +Date: Thu Dec 6 15:09:27 2012 +1000 + + Xi: deliver barrier events as grabbed events where necessary + + If the grab_window is the barrier window and the client owns the grab, + deliver as normal grabbed event (respecting owner_events). Otherwise, + deliver as usual. + + Signed-off-by: Peter Hutterer + Reviewed-by: Jasper St. Pierre + +commit 3b161401700a2d916da0f81f99b39e75fdbe78df +Author: Peter Hutterer +Date: Thu Dec 6 14:13:26 2012 +1000 + + dix: ignore barrier events in FixUpEventFromWindow + + Signed-off-by: Peter Hutterer + Reviewed-by: Jasper St. Pierre + +commit a1eeb6fbecf0bd9665a9158b27c273e83b3ab351 +Author: Peter Hutterer +Date: Thu Dec 6 13:25:29 2012 +1000 + + dix: handle barrier events properly when converting to core/XI 1.x + + Signed-off-by: Peter Hutterer + Reviewed-by: Jasper St. Pierre + +commit 1b83775f6712a7e48c49a3411a87103e8e906e67 +Author: Peter Hutterer +Date: Thu Dec 6 12:39:04 2012 +1000 + + dix: skip delivery if it's not the right pointer barrier client + + Only deliver to the client that created the barrier, not to other clients. + + Signed-off-by: Peter Hutterer + Reviewed-by: Jasper St. Pierre + +commit c50db6faba4ee1c27b735c6e9c98a4276ba3c7ff +Author: Peter Hutterer +Date: Thu Dec 6 12:58:55 2012 +1000 + + Xi: fill in barrier root x/y after clamping to RandR outputs + + x/y for barrier events should contain the actual pointer position. + + Signed-off-by: Peter Hutterer + Reviewed-by: Jasper St. Pierre + +commit 21a15f9a04ec0a6c8f654eef943561e98db2475d +Author: Peter Hutterer +Date: Mon Dec 3 10:41:16 2012 +1000 + + Pass the event list through to the pointer barrier code to return it + + Instead of having the pointer barrier code enqueue events separately from + GetPointerEvents, pass the event list through and let it add to it. + + Signed-off-by: Peter Hutterer + Reviewed-by: Jasper St. Pierre + +commit 707b4dc61f18960611409ef5ad8947be189f7296 +Author: Jasper St. Pierre +Date: Tue Nov 27 15:31:52 2012 -0500 + + barriers: Support line and ray barriers + + This allows clients to add barriers that extend to the edge of the + screen. Clients are encouraged to use these instead of precise coordinates + in these cases to help prevent pointer leaks. + + Signed-off-by: Jasper St. Pierre + Reviewed-by: Peter Hutterer + +commit 0a5a0d7c242add4d79721c1b90073b603a475534 +Author: Jasper St. Pierre +Date: Tue Nov 27 14:29:52 2012 -0500 + + barriers: Replace complex intersection test with simpler math + + Since barriers are axis-aligned, we can do the intersection test with + simple interpolation rather than line-segment intersection. This also + helps us out in the future when we want the barriers to extend to be + rays and lines rather than just segments. + + Signed-off-by: Jasper St. Pierre + Reviewed-by: Peter Hutterer + +commit 6401317bdcf58b2717214ac65c8f47b0c384a7db +Author: Jasper St. Pierre +Date: Sun Dec 9 19:45:48 2012 -0500 + + barriers: Send an XI_BarrierLeave event when a barrier is destroyed + + This ensures that we always complete an event sequence. + + Signed-off-by: Jasper St. Pierre + Reviewed-by: Peter Hutterer + +commit 207e8dee00dd26ff4363edb72058b48b8a76b824 +Author: Jasper St. Pierre +Date: Sun Dec 9 19:44:13 2012 -0500 + + barriers: Clean up code + + Rename a variable. This is to make the diff in the next commit cleaner. + + Signed-off-by: Jasper St. Pierre + Reviewed-by: Peter Hutterer + +commit 7fabecd8e3efe76caeb740d905a02ae4256e3246 +Author: Jasper St. Pierre +Date: Wed Dec 5 19:58:05 2012 -0500 + + barriers: Send a BarrierLeave event when we leave the hitbox + + Additionally, add flags when the pointer is released. + + Signed-off-by: Peter Hutterer + Reviewed-by: Jasper St. Pierre + +commit dac9e13a6c874f3b99ba4cf9085ed0e63beb0871 +Author: Jasper St. Pierre +Date: Mon Nov 26 20:37:56 2012 -0500 + + barriers: Increment event ID on hit box leave + + We eventually want to send a new notify event on hitbox leave, + which signifies the dawn of a new barrier event ID, so it's + convenient if we can put the code here. + + Signed-off-by: Jasper St. Pierre + Reviewed-by: Jasper St. Pierre + +commit e3a734d081ebda4460e6c1eb7dcdd0f7c10ba9b4 +Author: Jasper St. Pierre +Date: Sat Nov 24 21:42:56 2012 -0500 + + barriers: Add a couple pixels of elbow room for the hit detection + + Pointers (and the hands that drive them) aren't very precise, and the + slightest amount of nudging to either side might be enough to reset + the event ID, making clients think they have an entirely new hit. Allow + for a slightly bigger "hit box" before these barriers get reset. + + Signed-off-by: Jasper St. Pierre + Reviewed-by: Jasper St. Pierre + +commit 3b2fbcfa6c75ab072926ab9659adf785b324ce28 +Author: Jasper St. Pierre +Date: Thu Nov 8 01:17:40 2012 -0500 + + barriers: Add support for edge cases when releasing barriers + + If we release a barrier, we want to ensure that we block all + other barriers afterwards, rather than capping the limit to + the two nearest barriers. + + Signed-off-by: Jasper St. Pierre + Reviewed-by: Jasper St. Pierre + +commit a1ee26e624e6a7030ecb37a608190cb8e3d1f65b +Author: Peter Hutterer +Date: Thu Dec 6 12:06:28 2012 +1000 + + barriers: Don't allow releasing the pointer on other client's barriers + + Signed-off-by: Peter Hutterer + Reviewed-by: Jasper St. Pierre + +commit 2884b249294e3e8fc749bbb81e2a897314fa0818 +Author: Peter Hutterer +Date: Thu Dec 6 11:59:53 2012 +1000 + + barriers: Don't allow destroying other client's barriers + + Signed-off-by: Peter Hutterer + Reviewed-by: Jasper St. Pierre + +commit e130a46ab45839f91b29ee75bf19a597dfe3da28 +Author: Jasper St. Pierre +Date: Thu Nov 1 16:06:40 2012 -0400 + + Add support for XI2.3: Pointer barrier events and releases. + + This adds support for clients that would like to get a notification + every time a barrier is hit, and allows clients to temporarily release + a barrier so that pointers can go through them, without having to + destroy and recreate barriers. + + Based on work by Chris Halse Rogers + + Signed-off-by: Jasper St. Pierre + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 85a37ddcc2ff49adaec4075532b60e7d015f901c +Author: Jasper St. Pierre +Date: Sun Dec 9 22:48:18 2012 -0500 + + barriers: Reindent the constrainment hook + + This is to make future diffs much cleaner. Best viewed with -w. + + Signed-off-by: Jasper St. Pierre + Reviewed-by: Peter Hutterer + +commit 97da74c80e8b8eb03f7c1e34180cf5cd343bd608 +Author: Jasper St. Pierre +Date: Sun Dec 9 22:19:14 2012 -0500 + + barriers: Switch to finding the nearest barrier client + + When we add events, we eventually want to add more state to the + PointerBarrierClient, so return one of these instead of the dummy + public structure that's not very interesting. + + Signed-off-by: Jasper St. Pierre + Reviewed-by: Peter Hutterer + +commit 7e16dd3628334a5991b6713d778a46c1ce3b8b78 +Author: Jasper St. Pierre +Date: Sat Nov 24 19:39:47 2012 -0500 + + barriers: Switch to an explicit hook for barrier constrainment + + Rather than riding on the ConstrainCursorHarder hook, which has + several issues, move to an explicit hook, which will help us with + some RANDR interaction issues. + + Signed-off-by: Jasper St. Pierre + Reviewed-by: Peter Hutterer + +commit 2868a93945f043e1efd897d56543fe673e341faf +Author: Jasper St. Pierre +Date: Sun Dec 9 18:41:52 2012 -0500 + + barriers: Don't loop over the server to destroy a barrier + + This is completely pointless as far as I can tell. + + Signed-off-by: Jasper St. Pierre + Reviewed-by: Peter Hutterer + +commit 482e0cb35225dc3b0664f9429db19c61b0c98ef6 +Author: Jasper St. Pierre +Date: Thu Nov 1 14:14:13 2012 -0400 + + cursor: Move pointer barrier code over to XI + + In order to send events to specific windows associated with the barrier, + we need to move the code that handles barriers to somewhere where it's + easier to construct and send events. Rather than duplicating XSync with + its XSyncSelectAlarm, re-use the existing XI infrastructure. + + For now, just move a bunch of code over, rename some things, and initialize + the new structures, but still consider it a separate codebase. Pointer barrier + requests are still handled by XFixes, so this is a weird intermediate state. + It's unknown whether we'll add explicit requests to pointer barriers inside + XI. + + Signed-off-by: Jasper St. Pierre + Reviewed-by: Peter Hutterer + +commit bb6f3514ca17d993c1af380e8d4480d61e5bbcae +Merge: f961c3a 08da994 +Author: Peter Hutterer +Date: Wed Dec 12 17:25:28 2012 +1000 + + Merge branch 'stack-smash-on-touchpoint' into for-keith + +commit f961c3a3b9dfbe1201da317c24797ba7f979731e +Merge: 36740d0 39f19b3 +Author: Peter Hutterer +Date: Wed Dec 12 17:25:23 2012 +1000 + + Merge branch 'touch-selection-conflict-fixes' into for-keith + +commit 39f19b3f3b8c9b714e70e339dfb0083ff629ab2a +Author: Peter Hutterer +Date: Tue Nov 20 11:48:31 2012 +1000 + + Xi: fix touch event selction conflicts (#57301) + + There are limits on which client may select for touch events on a given + window, with restrictions being that no two clients can select on the same + device, but narrower selections are allowed, i.e. if one client has + XIAllDevices, a second client may still select for device X. + + The current code had a dependency on which client selected first and which + device, resulting in inconsistencies when selecting for events. Fix that, + responding with the right errors regardless of who selected what first. + + X.Org Bug 57301 + + Signed-off-by: Peter Hutterer + +commit a7c97d737ef0d14ec97869082decd049637cfe7a +Author: Peter Hutterer +Date: Tue Nov 20 11:38:39 2012 +1000 + + dix: split xi2_mask_isset into a per-device function + + For touch selection conflicts, we need to check not only if the mask is set + for the device, but if it is set for only that specific device (regardless + of XIAll*Devices) + + Signed-off-by: Peter Hutterer + +commit 08da994a08bb74afae81176c56fb525d0439274b +Author: Peter Hutterer +Date: Mon Nov 26 12:33:29 2012 +1000 + + dix: add FIXME, TouchRemovePointerGrab does nothing + + Signed-off-by: Peter Hutterer + +commit 00def5144557cfe8bf535f926212a8e084dc7cf6 +Author: Peter Hutterer +Date: Mon Nov 26 14:55:13 2012 +1000 + + Xi: if a TouchEnd appears on a actively grabbing client, always accept + + Once the TouchEnd appears on the device, the touch is done. If the client + still has a pointer grab, accept it to avoid clients with TouchOwnership + selections to wait indefinitely for the actual touch event. + + Signed-off-by: Peter Hutterer + +commit ece8157a59751b3ed492fb2e1eb8d5f20221e195 +Author: Peter Hutterer +Date: Mon Nov 26 15:14:19 2012 +1000 + + dix: when deactivating pointer-only grabs, don't emulate TouchEnd events + + A client with a pointer grab on a touch device must reject the touch when + detactivating the grab while the touch is active. However, such a rejecting + must not trigger a ButtonRelease event to be emulated and sent to the + client. + Set the grabbing listener's state to HAS_END, so we simply skip delivery to + that client. + + Signed-off-by: Peter Hutterer + +commit bc1f90a615018c05994fae3e678dd2341256cd82 +Author: Peter Hutterer +Date: Mon Nov 26 12:23:54 2012 +1000 + + dix: only reject active grabs on ungrab and do it before actually ungrabbing + + An active grab ungrabbing is the same as rejecting the grab, since the + client is no longer interested in those events. So reject any touch grab, + but do so before actually deactivating since we're interested in the + TouchEnd for the current grabbing client. + + A passive grab otoh is _not_ like rejecting a grab, since it deactivates + automatically when the touch ends. + + Signed-off-by: Peter Hutterer + +commit 146f48c2934fc85ec095496da5c8f0102bc7f5b5 +Author: Peter Hutterer +Date: Thu Nov 22 13:49:34 2012 +1000 + + dix: don't call ProcessInputEvents() when accepting/rejecting touches + + TouchListenerAcceptReject may be called during normal event processing, but + ProcessInputEvents is not reentrant and calling it here smashes the event + queue. + + Signed-off-by: Peter Hutterer + +commit ead21f9426122536adfb4787ac181008ae83cd4b +Author: Peter Hutterer +Date: Mon Nov 19 16:16:10 2012 +1000 + + Xi: fix typo "mechansims" → "mechanisms" + + Signed-off-by: Peter Hutterer + +commit 6b4aa8a359822cc70666de3b18744f05dd9b5f45 +Author: Dave Airlie +Date: Wed Dec 12 12:56:46 2012 +1000 + + Revert "xf86: Fix non-PCI configuration-less setups" + + This reverts commit 76d9c62eb2be2010a19bf36285012d086cdd180b. + + This breaks multi-GPU setups here, so lets drop it for now. + + Signed-off-by: Dave Airlie + +commit 785af88ab0120036e0ce3d0139f3c560ff71e10b +Author: Dave Airlie +Date: Wed Sep 26 16:16:40 2012 +1000 + + dri1: fix dri1 startup since 459c6da0f907ba33d733c7e62a116184ba2f14e5 + + This commit regresses dri1 since it moves the drmSetServerInfo from being + called at module load time to extension init time. However DRIScreenInit + relies on this being called before it gets control. + + This patches moves the call into DRIScreenInit and seems to work here. + + Signed-off-by: Dave Airlie + +commit 36740d02b9ca117f1404e077367fbbbe271a17d6 +Author: Daniel Martin +Date: Fri Dec 7 19:38:55 2012 +0100 + + xfixes: Fix minor number in QueryVersion + + Due to a typo the major version number was passed as minor version to + version_compare(). + + Regression-from: ffd4874798ba54f86acac75779a15b4babeaa5f3 + + Signed-off-by: Daniel Martin + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit b34cffd27b9ef46e1dd477219cbb90e36d5609e3 +Author: Peter Hutterer +Date: Mon Dec 3 11:39:08 2012 +1000 + + include: fix comment + + Signed-off-by: Peter Hutterer + +commit ea1d76d1b68c7cbcedcaa1f967c5027e0cc1c7a2 +Author: Yaakov Selkowitz +Date: Mon Nov 5 23:50:58 2012 -0600 + + Fix formatting of address operators + + The formatter confused address operators preceded by casts with + bitwise-and expressions, placing spaces on either side of both. + That syntax isn't used by ordinary address operators, however, + so fix them for consistency. + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Peter Hutterer + +commit 5daa442fe15d9a87112a2def673c99a5f2506dcf +Author: Peter Hutterer +Date: Tue Dec 4 15:28:14 2012 +1000 + + xkb: only post a XTest release if the XTest device has the button down + + Signed-off-by: Peter Hutterer + +commit c4fee9d2ecd6fdd4c05b04c9f02b23f10f2938b8 +Author: Peter Hutterer +Date: Tue Dec 4 15:03:37 2012 +1000 + + xkb: always post XTest button up when the physical button released (#28808) + + Regression introduced by commit 2decff6393a44b56d80d53570718f95354fde454 + xkb: ProcesssPointerEvent must work on the VCP if it gets the VCP + + XTest buttons must be released when a physical button is released. This was + fixed in 14327858391ebe929b806efb53ad79e789361883, but + 2decff6393a44b56d80d53570718f95354fde454 changed a condition that this code + didn't get triggered anymore. + + "dev" for pointer events is now always the VCP which doesn't have a xkbi + struct. So move this condition out and always trigger the XTest released for + button events. + + Signed-off-by: Peter Hutterer + Tested-by: Frank Roscher + +commit b51a1bd2766e7dc975ca8f1cacc3f8bd0e1a68a3 +Merge: e9ea96d ce6b652 +Author: Keith Packard +Date: Fri Nov 30 09:31:46 2012 -0800 + + Merge remote-tracking branch 'whot/for-keith' + +commit e9ea96d6a88f197928c82b008953f1810de6f792 +Author: Dave Airlie +Date: Fri Nov 30 20:54:38 2012 +1000 + + randr: call RRProviderInit in the proper place. + + No idea where this got lost across development cycles, but its + definitely missing. + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=57448 + + Signed-off-by: Dave Airlie + Reviewed-by: Alex Deucher + Signed-off-by: Keith Packard + +commit ce6b6529290f7d42717aad3fd8a83aaaaf8962de +Merge: 6e18599 3b9f1c7 +Author: Peter Hutterer +Date: Thu Nov 29 14:49:22 2012 +1000 + + Merge branch 'high-resolution-touch-devices' into for-keith + +commit 6e18599d691036eca6ff082c17727d9ffb926984 +Author: Sybren van Elderen +Date: Tue Nov 27 19:27:10 2012 +0100 + + hw/dmx: add update_desktop_dimensions() call + + The Xdmx server did not update the desktop dimensions when computing screen + origins. + + Signed-off-by: Sybren van Elderen + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 59d70b30e93f8be93db9e873423353f7e4419811 +Author: Peter Hutterer +Date: Fri Nov 23 10:05:02 2012 +1000 + + dix: use pixman for fp1616 conversions + + Signed-off-by: Peter Hutterer + Reviewed-by: Søren Sandmann > + +commit 2c4388a00ec308bc2d48ba751ff510cd5c1b2384 +Author: Peter Hutterer +Date: Tue Jun 26 10:30:35 2012 +1000 + + xkb: fill in keycode and event type for slow keys enablement + + eventType is set for the type that triggered a XkbControlsNotify event. + Technically, SlowKeys is triggered by a timer which doesn't have a matching + core event type. So we used to use 0 here. + + Practically, the timer is triggered by a key press + hold and cancelled when + the key is released before the timeout expires. So we might as well set + KeyPress (keycode) in the ControlsNotify to give clients a chance to differ + between timer-triggered SlowKeys and client-triggered ones. + + This is a chance in behaviour, though I suspect with little impact. + + Signed-off-by: Peter Hutterer + Acked-by: Daniel Stone + +commit 2dc6d9228456cbc274a1fcea478258e5ae4dc629 +Author: Peter Hutterer +Date: Thu Nov 15 14:00:57 2012 +1000 + + When resetting device idle time, reset XIAll(Master)Devices too (#56649) + + When the screen saver is forcibly deactivated, the idle time counter is + reset for all devices but not for the fake XIAllDevices and + XIAllMasterDevices. XScreenSaverQueryInfo uses XIAlldevices to fill the + "idle" field, thus returning the wrong value. + + Regression introduced in + commit 6aef209ebc2e54f5465da505a780f7b4cc273ee0 + Author: Peter Hutterer + Date: Mon Mar 12 13:51:02 2012 +1000 + + Change lastDeviceIdleTime to be per-device + + X.Org Bug 56649 + + Signed-off-by: Peter Hutterer + Tested-by: Giacomo Perale + Reviewed-by: Keith Packard + +commit a51b2c3913fc8556f6bd1c76805d045fc424c4bb +Author: Jasper St. Pierre +Date: Tue Nov 20 14:50:41 2012 -0500 + + cursor: Revise edge cases for the pointer moving towards barriers + + Since barriers block the invisible line between pixels, that means + that we need to explicitly check the boundaries, or else we'll have + a potential off-by-one error. This fixes issues when trying to move + down or right across a barrier and having the pointer visibly bounce. + + Signed-off-by: Jasper St. Pierre + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 1712a45422a63f11b2146541279616fcfda09ec6 +Merge: e54f71a 338bec3 +Author: Keith Packard +Date: Wed Nov 28 07:54:13 2012 -0800 + + Merge remote-tracking branch 'jturney/mingw-patches' + +commit 338bec30054bb5d41cb6fdb5d37439f3c8124cad +Author: Yaakov Selkowitz +Date: Fri Nov 9 12:19:31 2012 -0600 + + hw/xwin: Fix for MinGW-w64 DirectDraw headers + + mingw-w64 headers handle NONAMELESSUNION earlier than mingw.org's, so it must be + defined before including any headers. It also provides a ddraw.h, so use it. + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Jon TURNEY + Reviewed-by: Keith Packard + +commit fb170498abc746a850864b59db2ddcba7ee29215 +Author: Jon TURNEY +Date: Tue Nov 13 13:22:44 2012 +0000 + + dix/dispatch.c, os/utils.c: Disable smart scheduler on WIN32 + + setitimer() and SIGALRM aren't available on WIN32, so smart scheduler + code cannot be built. Provide only stubs for smart scheduler timer + code, and disable smart scheduler by default. + + Signed-off-by: Ryan Pavlik + Reviewed-by: Jon TURNEY + Tested-by: Yaakov Selkowitz + Reviewed-by: Keith Packard + +commit b20d2998cd9a1320ef0e45ab6b741c7e25f646e0 +Author: Ryan Pavlik +Date: Thu Nov 3 19:25:57 2011 -0500 + + os/osinit.c: no getpgrp() and setpgrp() on WIN32 + + Signed-off-by: Ryan Pavlik + Reviewed-by: Jon TURNEY + Tested-by: Yaakov Selkowitz + Reviewed-by: Keith Packard + +commit 2c712d094a49de0b96e2e9f5bcc1043b54ad0f61 +Author: Yaakov Selkowitz +Date: Sun Oct 14 23:05:30 2012 -0500 + + hw/xwin: use raise() instead of kill() + + MinGW doesn't have kill(), so use raise() instead + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Jon TURNEY + Reviewed-by: Keith Packard + +commit 98d5acc1213b2ec71c2a7bd3a3b77a1b5536e963 +Author: Jon TURNEY +Date: Fri Aug 17 13:43:29 2012 +0100 + + os/utils.c: Fix compilation of OsBlockSIGIO when SIGIO isn't defined + + Fix compilation of OsBlockSIGIO with -Werror=return-type when SIGIO isn't + defined. + + /jhbuild/checkout/xorg/xserver/os/utils.c: In function 'OsBlockSIGIO': + /jhbuild/checkout/xorg/xserver/os/utils.c:1248:1: error: control reaches end of non-void function [-Wreturn-type] + + v2: Shuffle around to avoid writing unreachable code + + Signed-off-by: Jon TURNEY + Tested-by: Yaakov Selkowitz + Reviewed-by: Keith Packard + +commit 8e2bac0a69173b51e17a39d70e1d154b47fd0139 +Author: Ryan Pavlik +Date: Fri Apr 20 13:46:21 2012 +0100 + + os/osinit.c, os/utils.c: Exclude sigaction code when building for MinGW + + MinGW doesn't have sigaction, so this patch is needed for building. + + No attempt is made to actually install the fatal error signal handler, as MinGW + will simply terminate the process rather than deliver a fatal signal. + + Also avoid using strsignal + + Signed-off-by: Ryan Pavlik + Reviewed-by: Jon TURNEY + Tested-by: Yaakov Selkowitz + Reviewed-by: Keith Packard + +commit e54f71a2c7a1677a5c5032d1e7dc099d5204144b +Author: Chris Wilson +Date: Sat Nov 10 10:26:08 2012 +0000 + + xf86: select a fake output for headless servers + + Following commit 37d956e3ac9513b74078882dff489f9b0a7a5a28 + Author: Keith Packard + Date: Mon Sep 10 11:14:20 2012 +1000 + + xf86: fix compat output selection for no output GPUs + + headless servers can no longer startup as we no longer select a compat + output for the fake framebuffer. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56343 + Signed-off-by: Chris Wilson + Reviewed-by: Dave Airlie + Signed-off-by: Keith Packard + +commit 76d9c62eb2be2010a19bf36285012d086cdd180b +Author: Thierry Reding +Date: Wed Oct 17 12:06:47 2012 +0200 + + xf86: Fix non-PCI configuration-less setups + + For non-PCI video devices, such as those found on many ARM embedded + systems, the X server currently requires the BusID option to specify the + full path to the DRM device's sysfs node in order to properly match it + against the probed platform devices. + + In order to allow X to start up properly if either the BusID option was + omitted or no configuration is present at all, the first video device is + used by default. + + Signed-off-by: Thierry Reding + Reviewed-by: Dave Airlie + Signed-off-by: Keith Packard + +commit d50a94568e06a06df682a0028579d37a7b209d15 +Merge: 87b60ef cf05db8 +Author: Keith Packard +Date: Tue Nov 27 15:14:26 2012 -0800 + + Merge remote-tracking branch 'daniels/master' + +commit 87b60efb859d86fd9e96306112bc5453a549fa69 +Author: Colin Harrison +Date: Sun Sep 2 22:39:32 2012 +0100 + + hw/xwin: Don't spam MotionNotify events when the mouse hasn't moved + + Don't spam MotionNotify events when the mouse hasn't moved, when polling the + mouse position outside any X window + + (Test with 'xev -root' after mouse polling has started.) + + Signed-off-by: Colin Harrison + Reviewed-by: Jon TURNEY + +commit 886f4c389266bf759414f15a5e25e50b5935dc9d +Author: Jon TURNEY +Date: Mon Jun 25 15:58:21 2012 +0100 + + hw/xwin: Don't log all fbConfigs and GL/WGL extensions + + Don't log all fbConfigs and GL/WGL extensions, unless verbose logging + is requested + Log the number of pixelFormats which gave rise to the fbConfigs + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 9b10f20f472e6b0d6114fb61c88906e349e47f2b +Author: Jon TURNEY +Date: Fri Feb 10 13:36:46 2012 +0000 + + hw/xwin: Use pre-computed extent of damage for creating GDI region + + When -clipupdates option is specified, use the pre-computed extent of damage, + rather than computing a GDI region which combines all the individual boxes in + the damage. + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 3ab95a2a5c848e8ce4c39be243fd5e2ac6bb1c1a +Author: Jon TURNEY +Date: Fri Feb 24 15:32:26 2012 +0000 + + hw/xwin: Ensure we own the clipboard before checking the format of it's contents + + Ensure we own the clipboard before checking the format of it's contents, this + prevents the contents from changing underneath us. + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit a4f357c620ae9e2270316197a61fb8e1d5183a51 +Author: Colin Harrison +Date: Mon Apr 9 15:48:08 2012 +0100 + + hw/xwin: Disable minimize button on window with skip-taskbar state + + If a window has had its taskbar button removed, disable its minimize + button to prevent it becoming lost + + Signed-off-by: Colin Harrison + Reviewed-by: Jon TURNEY + +commit a2983452ee1e2051ab54cded7a3a7735be020db6 +Author: Jon TURNEY +Date: Wed Jul 8 17:48:03 2009 +0100 + + hw/xwin: Process _NET_WM_STATE_SKIP_TASKBAR hint in multiwindow mode. + + Set WS_EX_TOOLWINDOW style to hide window from Alt-Tab switcher + + Use ITaskBarList interface to ensure that the taskbar notices if the window has + changed it's style in a way which affects if the taskbar shows it or not + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit de759cc38ccc8a7811923eb9620f01301aedc10e +Author: Jon TURNEY +Date: Sun Feb 5 17:57:04 2012 +0000 + + hw/xwin: Add a simple interface to the ITaskbarList COM interface + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 19d875187a113ca7772a770767ea2ceb2ade5a43 +Author: Jon TURNEY +Date: Wed Jan 4 17:40:14 2012 +0000 + + hw/xwin: Enable RANDR resize by default + + Also fix erroneous use of '--resize' not '-resize', and document '-noresize' in man page + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 444580673221bf3f89dfa3cbc518b5ed4ecabc23 +Author: Yaakov Selkowitz +Date: Sat Dec 31 22:11:18 2011 -0600 + + hw/xwin: Enable AIGLX by default + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 11bb32e561b3f1c657a99b3902f9beea786babbb +Author: Oliver Schmidt +Date: Sun Jan 8 20:30:02 2012 +0000 + + hw/xwin: Restore non-latching modifier key state when an X window gains focus + + In multiwindow mode, the state of the modifier keys was lost when a window is + created (or raised) and focus moved to that window. + + For example: In window A Ctrl + some key opens a window B, then in window B Ctrl + + some other key triggers the next action. However after the opening of window B + the Ctrl key has to be released and pressed again. If the user keeps the Ctrl + key held down when the window B is opened, the next key press X will be + interpreted as X and not as Ctrl+X. + + Extended the function winRestoreModeKeyStates in winkeybd.c to consider not only + the latching modifier keys but also the modifiers Ctrl, Shift, Alt/AltGr by + using the Windows function GetAsyncKeyState. + + A combined Ctrl+AltGr modifier state cannot be restored correctly, as Windows + always fakes a Ctrl-L when AltGr is pressed. + + Signed-off-by: Oliver Schmidt + Reviewed-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 47291d0b7d7bfee74156f83badae15a0818c68ad +Author: Jon TURNEY +Date: Mon Nov 5 14:54:51 2012 +0000 + + hw/xwin: Give our logical xor operator a more logical name + + Also, rather than a comment about why we need a logical operator, let's have a + comment about what we are doing to the keyboard state... + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 8aa27ae82109e4fab0ff3ed86ad1d152438a2585 +Author: Tobias Häußler +Date: Mon Jul 18 14:48:23 2011 +0100 + + hw/xwin: Add correct taskbar grouping of X windows on Windows 7 + + I created a small patch for XWin that adds correct grouping of taskbar icons + when 'Always combine, hide labels' is set in the taskbar properties. It uses the + new taskbar APIs introduced in Windows 7 to set an application id for each + window. The id is based on the X11 class hints. + + v2: Add file to _SOURCES to fix distcheck + + v3 : Fix compilation with mingw-w64 w32api headers + Include propkey.h, propsys.h rather than defining necessary stuff ourselves + + v4: Fix up names taskbar->propertystore, AppID->AppUserModelID, etc. + Link directly with ole32 for PropVariantClear(), prototyping it if neccessary. + + v5: Put winSetAppUserModelID()-related code in a separate file. + Drop a superfluous assign to hr of ignored HRESULT of SetValue() + + Signed-off-by: Tobias Häußler + Reviewed-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit f3aef7f9561d2723da0d1438a8b276b77a1e672e +Author: Jon TURNEY +Date: Sun Sep 2 16:04:25 2012 +0100 + + hw/xwin: Fix function name in log message + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 127a7068b75258d396776cc101aba0bef10a5cef +Author: Jon TURNEY +Date: Thu Apr 14 23:10:23 2011 +0100 + + hw/xwin: Allow XScreenSaverSuspend() to effect Windows screen saver or monitor power off + + Reset the idle timer in the block handler if screenSaverSuspended is set. + + This isn't quite a complete solution. We should also set the block timeout to + something less than the idle timer timeout to ensure we will reset the idle + timer before it times out if we are blocking. + + The idle timer timeout is presumably the first one to expire of the screen saver + activation or monitor low power or power down timeout, depending on + configuration. + + Unfortunately this is probably not straightforward to do. Whilst + SystemParametersInfo(SPI_GETSCREENSAVETIMEOUT) is portable, apparently + SPI_GETLOWPOWERTIMEOUT and SPI_GETPOWEROFFTIMEOUT are not supported by Windows + versions 6.0 or later, and the interface for discovering equivalent value is + complex. + + This doesn't matter in the case where a media player or similar application is + the one making the XScreenSaverSuspend() requests, as it will be continuously + drawing, causing the X server to become unblocked often. + + In the case where slide show presentation application or similar is the one + making the XScreenSaverSuspend() request, this might be a problem. + + Since "Powerpoint is Evil" [1], I think we'll leave it like this till someone + complains :-) + + [1] http://www.edwardtufte.com/tufte/books_pp + + v2: conditionalize on SCREENSAVER + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 190f165317c4a58adf38e3e32acfe7cf04850e91 +Author: Jon TURNEY +Date: Mon Nov 5 13:02:46 2012 +0000 + + hw/xwin: Avoid logging an extra blank line if BUILDERSTRING is empty + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit ef9dbea24f5ce7e1e400463ab2a333076d98a28e +Author: Jon TURNEY +Date: Wed Aug 31 20:57:05 2011 +0100 + + hw/xwin: Report which drawing engines are being enabled when checking for support + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 5824166256c8e96c91e225f4ccb2b094b8fb045b +Author: Jon TURNEY +Date: Fri Mar 12 14:38:51 2010 +0000 + + hw/xwin: Show any fatal error message + + Report the fatal error message in the dialog we pop up, rather than just + referring the user to the logfile. + + v2: Do this a better way since the "Pass the FatalError message to + OsVendorFatalError" patch has landed, and OsVendorFatalError() now gets passed + the fatal error message + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit cf05db8ddec948d907915e1c9569d743e8771def +Author: Sjoerd Simons +Date: Tue Oct 30 17:02:58 2012 +0100 + + Ephyr: Find the right host screen when embedded + + When Xephyr is embedded into another application (e.g. in xoo), the + input events may come from the parent Window instead of our own. So make + sure we find the host screen in that case as well instead of crashing. + + Signed-off-by: Sjoerd Simons + Reviewed-by: Daniel Stone + +commit ac1a60e7b6f06fd075cc5bf55d6bc67206a01d29 +Author: Raphael Kubo da Costa +Date: Fri Nov 16 19:51:58 2012 +0200 + + vfb: Initialize the GLX extension again. + + This should fix a regression in the 1.13.0 release: commit + 5f5bbbe543f65c48ecbb5cce80116a86ca3fbe86 removed a code path used by Xvfb + and made it use the default one when initializing extensions. However, this + meant the GLX extension was not initialized anymore since it is not part of + the `staticExtensions' array. + + Since it is not possible to just add it to that array after commit + aad428b8e21c77397c623b78706eb64b1fea77c9, adopt an approach similar to + xwin's and xquartz's and initialize the extension from vfb's `InitOutput'. + + Signed-off-by: Raphael Kubo da Costa + Reviewed-by: Daniel Stone + +commit 353b14ea77324b3f7b3ea29d6f03618fd9916d5f +Author: Daniel Stone +Date: Mon Nov 19 15:00:22 2012 +1100 + + DMX: Add DMX and GLX extensions + + Unfortunately this also got lost in the extmod fallout, leaving the DMX + server not exposing the DMX or GLX extensions. + + Signed-off-by: Daniel Stone + Reviewed-by: Peter Hutterer + +commit 3556d43010f0a37bf30aa2e0ceee9a8bbcad311d +Author: Daniel Stone +Date: Mon Nov 19 15:29:34 2012 +1100 + + Constify extensions in LoadExtension users + + Signed-off-by: Daniel Stone + Reviewed-by: Peter Hutterer + +commit db83830eef38a86a471378121213162da180537d +Author: Daniel Stone +Date: Mon Nov 19 15:28:07 2012 +1100 + + Constify argument to LoadExtension + + Since we never modify it. + + Signed-off-by: Daniel Stone + Reviewed-by: Peter Hutterer + +commit 3b9f1c701787965246638c1a6fd99fb2b6078114 +Author: Yuly Novikov +Date: Mon Nov 19 21:04:57 2012 -0500 + + dix: Save touchpoint last coordinates before transform. #49347 + + DDXTouchPointInfoRec.valuators used to store axis values after transform. + This resulted in Coordinate Transformation Matrix + being applied multiple times to the last coordinates, + in the case when only pressure changes in the last touch event. + + Changed DDXTouchPointInfoRec.valuators to store values before transform. + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=49347 + + Signed-off-by: Yuly Novikov + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit d0fd592fc7be1706084923f43fa057e50122562c +Author: Thomas Jaeger +Date: Sat Oct 13 23:18:50 2012 -0400 + + Simplify GetTouchEvents + + With only one callee left, we are free to assume that + !(flags & TOUCH_CLIENT_ID) + + Signed-off-by: Thomas Jaeger + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit fe59774c55e5d423633405e0869c22f4ce382548 +Author: Thomas Jaeger +Date: Sat Oct 13 23:08:27 2012 -0400 + + Don't use GetTouchEvents in EmitTouchEnd + + As before GetTouchEvents causes unwanted side effects. Add a new + function GetDixTouchEnd, which generates a touch event from the touch + point. We fill in the event's screen coordinates from the MD's current + sprite position. + + Signed-off-by: Thomas Jaeger + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit cc79107a5b60d2926e16ddbee04149e8d5acc969 +Author: Thomas Jaeger +Date: Sat Oct 13 22:51:24 2012 -0400 + + Don't use GetTouchEvents when replaying events + + GetTouchEvents has plenty of side effects such as moving the pointer or + updating the master device, which we don't want to happen when + replaying. The only reason for calling it was to generate a DCCE event, + but GetTouchEvents doesn't even do that right (we might need a DCCE + event even when replaying a master event, or clients could interpret + valuator data incorrectly). + + This discussion is moot at the moment anyway, since DeliverTouchEvents + doesn't appear to deliver DCCE events. + + Signed-off-by: Thomas Jaeger + Reviewed-by: Peter Hutterer + + [Added call to processInputProc instead of direct call to DeliverTouchEvents] + + Signed-off-by: Peter Hutterer + +commit 90b177e5cbb9047453af426d2abfe9c0514fe866 +Author: Thomas Jaeger +Date: Sat Oct 13 22:43:26 2012 -0400 + + Update the MD's position when a touch event is received + + Signed-off-by: Thomas Jaeger + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 6a6c3afe71ac82a93d9fd0034dd5bbdcf0eae1ea +Merge: 14c9e24 6f14508 +Author: Keith Packard +Date: Sun Nov 18 21:50:20 2012 -0800 + + Merge remote-tracking branch 'whot/for-keith' + +commit 6f145084d5b9ca4a023dfc538a69bbf30edeac4a +Author: Adam Jackson +Date: Fri Nov 16 13:46:32 2012 -0500 + + linux: Prefer ioctl(KDSKBMUTE, 1) over ioctl(KDSKBMODE, K_OFF) + + K_OFF is a slightly broken interface, since if some other process + (cough, systemd) sets the console state to K_UNICODE then it undoes + K_OFF, and now Alt-F2 will switch terminals instead of summoning the + Gnome "run command" dialog. + + KDSKBMUTE separates the "don't enqueue events" logic from the keymap, so + doesn't have this problem. Try it first, then continue falling back to + older methods. + + Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=859485 + Tested-by: Josh Boyer + Signed-off-by: Adam Jackson + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 0ff1c77b17062a3a3ff520709ef719316bc1d8bb +Author: Peter Hutterer +Date: Fri Nov 16 14:21:47 2012 +1000 + + xfixes: let PointerBarrierClient->device_ids point to allocated memory + + "Fixed" up Jasper's original patch [1] to use pointers instead of + zero-length arrays but didn't actually set the pointer to anywhere. + + [1] 9a536820f6174befb22431bab375ef1af0a1ec29 + + Signed-off-by: Peter Hutterer + Reviewed-By: Jasper St. Pierre + +commit aa9a9ad08b8a6e7e95de7c2bf45d93dd50f9ca87 +Author: Daniel Martin +Date: Wed Nov 7 11:31:01 2012 +0100 + + Xi: Fix modifier swapping in XIPassiveGrabDevice + + XIPassiveGrabDevice uses a list of uint32_t as modifier sets. + + The ModifierInfo struct represents the current modifier states and is + therefor used in XIQueryPointer and various events. + + Signed-off-by: Daniel Martin + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit aa9da5eae109154edf740a5c1eee4bf98e8fbd4f +Author: Thomas Jaeger +Date: Sat Oct 13 22:39:27 2012 -0400 + + remove init_event + + The function is identical to init_device_event from inpututils.c with + the first two arguments swapped. + + Signed-off-by: Thomas Jaeger + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 710065da37b68a9ec7a0c9dc995247f39e3d01e9 +Author: Daniel Stone +Date: Mon Nov 5 15:58:25 2012 +1100 + + XKB: Remove component listing support + + No-one uses this - not xkbcomp, not GNOME, not KDE. The preferred way + to deal with component listing (which gives you RMLVO rather than + KcCGST) is to use the XML files on the client side. + + Indeed, a couple of hours after making this commit, it emerged that all + *.dir files built with xkbcomp 1.1.1 (released two years ago) and later + have been catastrophically broken and nearly empty. So I think that's + reasonable proof that no-one uses them. + + Signed-off-by: Daniel Stone + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit fd214aabf77c44ba0ca3fd438f0c3c8eb22c7211 +Author: Peter Hutterer +Date: Tue Nov 6 10:27:25 2012 +1000 + + input: drop FP1616 macro + + The double_to_f1616() functions do the same thing, and they're tested. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit 14c9e245bae2447f0e57a3ea4daa8d2085fa8b8f +Author: Jeremy Huddleston Sequoia +Date: Sat Nov 17 11:52:10 2012 -0500 + + XQuartz: Opt-in to NSSupportsAutomaticGraphicsSwitching + + http://xquartz.macosforge.org/trac/ticket/668 + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 011f8458805e443ac9130865d2840a929a00cabf +Merge: 54ba26c b4e44b2 +Author: Keith Packard +Date: Mon Nov 5 17:16:07 2012 -0800 + + Merge remote-tracking branch 'whot/for-keith' + +commit b4e44b285ed0eee1d06514215a4b01d54f40094b +Author: Carlos Garnacho +Date: Wed Oct 31 19:29:45 2012 +0100 + + Xi: Set modifier mask on touch events + + Button mask should be out-of-band with the emulated + pointer events as touch devices don't truly have + "buttons". Even though, it's handy to have the modifier + mask from the paired keyboard on touch events. + + Signed-off-by: Carlos Garnacho + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 863f32c930d71073ee5f78452b78bd459d024867 +Author: Carlos Garnacho +Date: Wed Oct 31 19:32:57 2012 +0100 + + Xi: Update the device after delivering the emulated pointer event(#56558) + + Ensure emulated pointer events contain the state that applies before the + event was processed, so the device state must be updated after delivering + such emulated events. + + Co-authored-by: Peter Hutterer + Signed-off-by: Carlos Garnacho + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 9a536820f6174befb22431bab375ef1af0a1ec29 +Author: Jasper St. Pierre +Date: Sat Nov 3 20:23:46 2012 -0400 + + cursor: Fix up implementation for per-device barriers + + Support multiple mast devices being specified as a parameter to the + barrier. This should implement all parts of the XFixes specification, + minus the existing non-specification detail where specifying no devices + is the same as specifying XIAllDevices. + + Signed-off-by: Jasper St. Pierre + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 944213bbc7099f1e0238f39973653d459efdc2c9 +Author: Jasper St. Pierre +Date: Sat Nov 3 20:23:45 2012 -0400 + + cursor: Clean up barrier finding code a bit + + The current code manually unrolls the loop, by finding a barrier, + clamping it, and then repeaing the code. Since we want to modify + both passes of the loop to support device-specific barriers, make + it into an actual loop. + + Signed-off-by: Jasper St. Pierre + Signed-off-by: Peter Hutterer + +commit 1536bc2d213713af45541a15b5e49c552d8d0592 +Author: Jasper St. Pierre +Date: Sat Nov 3 20:23:44 2012 -0400 + + cursor: Clean up pointer barrier creation code a tiny bit + + This will make it much simpler when we add more error paths to the code + that constructs pointer barrier clients. + + Signed-off-by: Jasper St. Pierre + Signed-off-by: Peter Hutterer + +commit 04c885de715a7c989e48fc8cf2e61db2b401de2d +Author: Jasper St. Pierre +Date: Sat Nov 3 20:23:43 2012 -0400 + + cursor: CreatePointerBarrier has a variable request length + + Support this, and swap the devices in the SProc as well. Don't + actually do anything with the devices just yet -- specifying any + should still emit a BadImplementation. + + Based on a patch by Peter Hutterer + + Signed-off-by: Jasper St. Pierre + Signed-off-by: Peter Hutterer + +commit d74b63f95fc622afe83c53580f1b55346d55fa7a +Author: Jasper St. Pierre +Date: Sat Nov 3 20:23:42 2012 -0400 + + cursor: Fix a minor unused variable warning + + Signed-off-by: Jasper St. Pierre + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit aad65415bff12c6860c19beac42e4165e598a40f +Author: Peter Hutterer +Date: Thu Oct 11 13:02:27 2012 +1000 + + dix: don't allow disabling XTest devices + + Disabling a XTest device followed by an XTest API call crashes the server. + This could be fixed elsewhere but disabled devices must not send events + anyway. The use-case for disabled XTest devices is somewhat limited, so + simply disallow disabling the devices. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit 5b7384a3154a95a805b040e1910e276b52aada96 +Author: Alexey Ten (Lynn) +Date: Tue Oct 23 12:32:31 2012 +0400 + + Apply partial matches for option (#25873) + + Rules which match star (*) and option, like one below, should be applied + + layout[2] option = symbols + * misc:typo = +typo(base) + + This is port of patch from #19563 (https://bugs.freedesktop.org/19563) + because here we have own copy of maprules.c + + X.Org Bug 25873 + + Signed-off-by: Alexey Ten (Lynn) + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 54ba26cb1f9c59559cc3c449abeb31b2ce23bdba +Author: Yaakov Selkowitz +Date: Mon Oct 29 22:37:37 2012 -0500 + + os: Add libnettle as a choice of SHA1 implementation + + libnettle is smaller than libgcrypt, currently being released more + frequently, and has replaced the latter in gnutls-3.x (which is used + by TigerVNC, so they can avoid pulling in two crypto libraries + simultaneously). + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Julien Cristau + +commit 2ff56033de2b493a11d2bdf411b7057b1b3a22d7 +Author: Yaakov Selkowitz +Date: Tue Oct 16 02:11:59 2012 -0500 + + Xi: fix fprint format warning + + exevents.c: In function 'ProcessTouchEvent': + exevents.c:1601:20: warning: too many arguments for format + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Peter Hutterer + +commit d631dbe9b6a1faa4cd18ab7a4a0276db02b84b77 +Author: Yaakov Selkowitz +Date: Sat Oct 27 21:50:01 2012 -0500 + + Xext: fix shadow warnings + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Peter Hutterer + +commit 20cf7918ed954a932a4cc404b3d0c4ca87a6ae16 +Author: Yaakov Selkowitz +Date: Tue Oct 16 21:08:52 2012 -0500 + + Xext: fix redundant redeclaration warnings + + panoramiX.c:595:13: warning: redundant redeclaration of 'CreateConnectionBlock' + ../include/dix.h:167:23: note: previous declaration of 'CreateConnectionBlock' was here + xres.c:193:13: warning: redundant redeclaration of 'ResExtensionInit' + ../include/extinit.h:109:13: note: previous declaration of 'ResExtensionInit' + xtest.c:60:12: warning: redundant redeclaration of 'DeviceValuator' + ../Xi/exglobals.h:61:12: note: previous declaration of 'DeviceValuator' was here + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Peter Hutterer + +commit 89447e1b50d2fb0e046102664045d1f9d4efc542 +Author: Yaakov Selkowitz +Date: Mon Oct 15 01:33:05 2012 -0500 + + Xext: fix unused variable warnings in xf86bigfont.c + + These were rendered unused by commit 2c7c520cfe0df30f4bc3adba59d9c62582823bf8. + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Peter Hutterer + +commit 344eea237fc07dedfd733d14f95ed0ad26bb5f81 +Author: Yaakov Selkowitz +Date: Tue Oct 16 02:04:34 2012 -0500 + + xkb: fix shadow warnings + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Peter Hutterer + +commit 7f1d74e8a906210eafc637df81ded62c3adff748 +Author: Yaakov Selkowitz +Date: Tue Oct 16 02:06:54 2012 -0500 + + render: fix shadow warnings + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Peter Hutterer + +commit 8e86123998d26d26f0f60dcbb9836c38e5a4c3a5 +Author: Yaakov Selkowitz +Date: Tue Oct 16 01:19:12 2012 -0500 + + randr: export more provider property symbols + + These were added as part of commit 66d92afeaeed9f4a19267d95a1f81b9bf27162a5 + but never declared or exported. Fixes warnings: + + rrproviderproperty.c:255:1: warning: no previous prototype for 'RRPostProviderPendingProperties' + rrproviderproperty.c:327:1: warning: no previous prototype for 'RRConfigureProviderProperty' + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Dave Airlie + Reviewed-by: Peter Hutterer + +commit f02e27e4fcc34413b2051e5a01edc92172fa8612 +Author: Yaakov Selkowitz +Date: Tue Oct 16 02:16:17 2012 -0500 + + mi: fix shadow warnings + + mibitblt.c: In function 'miGetImage': + mibitblt.c:617:20: warning: declaration of 'pt' shadows a previous local + mibitblt.c:609:17: warning: shadowed declaration is here + mispans.c: In function 'miFillUniqueSpanGroup': + mispans.c:456:33: warning: declaration of 'i' shadows a previous local + mispans.c:382:9: warning: shadowed declaration is here + mispans.c:488:17: warning: declaration of 'i' shadows a previous local + mispans.c:382:9: warning: shadowed declaration is here + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Peter Hutterer + +commit 1fe30c00679bd36a6355b48b94b87564d528ff28 +Author: Yaakov Selkowitz +Date: Tue Oct 16 02:21:04 2012 -0500 + + fb: fix shadow warnings + + fbblt.c: In function 'fbBlt': + fbblt.c:76:16: warning: declaration of 'src' shadows a previous local + fbblt.c:52:13: warning: shadowed declaration is here + fbblt.c:77:16: warning: declaration of 'dst' shadows a previous local + fbblt.c:52:19: warning: shadowed declaration is here + fbbltone.c: In function 'fbBltPlane': + fbbltone.c:742:13: warning: declaration of 'w' shadows a previous local + fbbltone.c:725:9: warning: shadowed declaration is here + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Peter Hutterer + +commit e8d45f301845f70b76407577b92363934ca4f19e +Author: Yaakov Selkowitz +Date: Tue Oct 16 20:54:56 2012 -0500 + + dix: fix shadow warnings + + dispatch.c: In function 'ProcCopyArea': + dispatch.c:1608:5: warning: declaration of 'rc' shadows a previous local + dispatch.c:1604:9: warning: shadowed declaration is here + dispatch.c: In function 'ProcCopyPlane': + dispatch.c:1647:5: warning: declaration of 'rc' shadows a previous local + dispatch.c:1643:9: warning: shadowed declaration is here + events.c: In function 'GetClientsForDelivery': + events.c:2030:68: warning: declaration of 'clients' shadows a global declaration + ../include/dix.h:124:28: warning: shadowed declaration is here + events.c: In function 'DeliverEventToWindowMask': + events.c:2113:19: warning: declaration of 'clients' shadows a global declaration + ../include/dix.h:124:28: warning: shadowed declaration is here + events.c: In function 'EventSuppressForWindow': + events.c:4420:12: warning: declaration of 'free' shadows a global declaration + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Peter Hutterer + +commit 1aa783754e21a263b0973516850656b13fd18f0d +Author: Yaakov Selkowitz +Date: Tue Oct 16 14:06:30 2012 -0500 + + dix: fix redundant redeclaration warnings in dixfont + + These functions are already declared in . + Redeclaring them just for _X_EXPORT causes tons of warnings throughout + xserver, but they need to be declared somewhere to be picked up by + sdksyms.sh. Doing so in a private header limits the warnings to + sdksyms.c; fixing those as well would require changes to fontsproto. + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Peter Hutterer + +commit 27c5966de35d4726dd9795b4828d4236851f6a88 +Author: Yaakov Selkowitz +Date: Mon Oct 15 01:25:17 2012 -0500 + + xfree86: os-support: fix old-style function definition warnings + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Alan Coopersmith + Reviewed-by: Peter Hutterer + +commit 64b961bb21369aaea694d883f361a36bc23b19b9 +Author: Yaakov Selkowitz +Date: Wed Oct 24 23:57:11 2012 -0500 + + macros: clarify documentation + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Peter Hutterer + +commit 04f980ead5e9af066143a921e0a0e98f26f28ee5 +Merge: a194630 a4941ce +Author: Keith Packard +Date: Mon Nov 5 08:45:21 2012 -0800 + + Merge remote-tracking branch 'jturney/mingw-w64-w32api' + +commit a4941ce4961f254ac31e2cef6dd0863866246bab +Author: Jon TURNEY +Date: Tue Aug 21 15:31:16 2012 +0100 + + hw/xwin: Wrap 'Status' when including ddraw.h + + Status is #defined as an alias for a type in xkbsrv.h, which conflicts with it's + use as a parameter name in rpcdce.h + + This fixes compilation with MinGW-w64 w32api headers + + (The MinGW-w64 w32api headers actually provide a ddraw.h, so this fix tries to + do things in a way which will still work if our private copy of ddraw.h is + eventually removed) + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 57bbf6e2aead6cce76a9f5d43829b58868a26059 +Author: Jon TURNEY +Date: Mon Oct 29 14:35:45 2012 +0000 + + hw/xwin: Remove pointless winFinishCreateWindowsWindowDDNL() + + Remove pointless winFinishCreateWindowsWindowDDNL() and the useless DirectDraw + surface pointers in the window privates + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 5bc4c53d23d02d3d7297a8f00a92b6e4d5e0d6fe +Author: Jon TURNEY +Date: Tue Sep 4 17:28:16 2012 +0100 + + hw/xwin: Link with libdxguid rather than defining the DirectX GUIDs ourselves + + Decruftify by linking with libdxguid rather than defining the DirectX GUIDs + ourselves. This fixes compilation with MinGW-w64 w32api headers, which do not + provide GUID_SECT (which only ever did anything for gcc prior to 2.95, anyhow) + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit a194630f7f7b287cb4ea4a459df0745f4c0d4c1a +Merge: 74a3130 d511a30 +Author: Keith Packard +Date: Thu Nov 1 13:38:54 2012 -0700 + + Merge remote-tracking branch 'whot/for-keith' + +commit d511a3016a79c50cb38e7504d4831a9ae128e422 +Author: Benjamin Tissoires +Date: Fri Oct 26 16:27:34 2012 +0200 + + Add missing labels for multitouch valuators + + ABS_MT_DISTANCE exists since kernel v2.6.38, + ABS_MT_TOOL_X|Y appeared in v3.6. + + Signed-off-by: Benjamin Tissoires + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit ced56f322ead10d1bc93fcd1f8e0ec3ae51292a3 +Author: Carlos Garnacho +Date: Thu Oct 25 15:03:50 2012 +0200 + + Sync TouchListener memory allocation with population in TouchSetupListeners() + + The allocated TouchListener array may fall short by 1 if hitting the worst case + situation where there's an active grab, passive grabs on each window in the + sprite trace and event selection for touch in one of the windows. This may lead + to memory corruptions as the array is overflown. + + Signed-off-by: Carlos Garnacho + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 74a3130426d7e1b456e45daa517769cd3e4b58c0 +Merge: 1ca096d f32ad6d +Author: Keith Packard +Date: Mon Oct 29 09:09:16 2012 -0700 + + Merge remote-tracking branch 'jturney/master' + +commit 1ca096d5e07221025c4c4110528772b7d94f15ee +Author: Michel Dänzer +Date: Mon Oct 29 12:57:54 2012 +0100 + + EXA: Track source/mask pixmaps more explicitly for Composite fallback regions. + + In particular, make sure pExaScr->src/maskPix are cleared when the + corresponding pictures aren't associated with drawables, i.e. solid or gradient + pictures. Without this, we would in some cases associate the source/mask region + with unrelated pixmaps from previous Composite fallbacks, resulting in random + corruption. + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47266 + + Signed-off-by: Michel Dänzer + Reviewed-by: Alex Deucher + Signed-off-by: Keith Packard + +commit f32ad6dd314a587c301b7f1a6e4ee74e5d8cc06c +Author: Ryan Pavlik +Date: Fri Oct 21 12:32:49 2011 -0500 + + os/utils.c: Provide only stubs for Lock/UnlockServer on WIN32 + + MinGW and MSVC lack the POSIX functions to compile the lock file code. + + Signed-off-by: Ryan Pavlik + Reviewed-by: Jon TURNEY + Reviewed-by: Yaakov Selkowitz + +commit 74735c5ebff15db8891808068fe8569d8ccde9e7 +Author: Colin Harrison +Date: Sat Feb 18 20:37:19 2012 +0000 + + hw/xwin: fmemopen is available on cygwin but not MinGW + + This is a follow-up to commit 0659437f5ec0e3f646373394f5f9c5461e2170f3. + + Signed-off-by: Colin Harrison + Reviewed-by: Jon TURNEY + Reviewed-by: Yaakov Selkowitz + +commit 748be9da20a8bf3dd99701a95eac7ee3895a28de +Author: Jon TURNEY +Date: Tue May 1 20:08:41 2012 +0100 + + doc: Update documentation about Windows platforms support a bit + + Update what c-extensions says about Windows platforms support a bit: + - Document that MinGW Win32 gets let off being POSIX-compilant + - Document the minimum Windows version supported + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 760be785eb49fed4652950fb55dc07b0a41d87de +Author: Peter Hutterer +Date: Wed Oct 24 11:20:54 2012 +1000 + + xfree86: remove unused variable sigstate + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit e7cd5cce740e653000fb1192b600268dcf77dde2 +Author: Peter Hutterer +Date: Thu Oct 18 15:11:31 2012 +1000 + + dix: fix zaphod screen scrossing (#54654) + + POINTER_SCREEN coordinates are screen-relative. For a Zaphod setup, the + coordinates after a screen crossing are already relative to the new screen's + origin. Add that offset to the coordinates before re-setting. + + regression introduced by + commit bafbd99080be49a17be97d2cc758fbe623369945 + Author: Peter Hutterer + Date: Wed Aug 8 11:34:32 2012 +1000 + + dix: work around scaling issues during WarpPointer (#53037) + + X.Org Bug 54654 + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit 676447190190d8546165e21be242cf16dd69f5ae +Author: Peter Hutterer +Date: Wed Oct 17 14:13:29 2012 +1000 + + Xi: don't deliver TouchEnd to a client waiting for TouchBegin (#55738) + + If a client is still waiting for the TouchBegin, don't deliver a TouchEnd + event. + + X.Org Bug 55738 + + Signed-off-by: Peter Hutterer + Tested-by: Thomas Jaeger + Reviewed-by: Keith Packard + +commit 3018f9c1e5109680dcf69b8f2d7807696a473bde +Author: Peter Hutterer +Date: Fri Oct 12 13:48:27 2012 +1000 + + Xi: set xChangeDeviceControlReply.status to Success by default + + If the status is other than Success, the code will set it to the required + value. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit 2decff6393a44b56d80d53570718f95354fde454 +Author: Peter Hutterer +Date: Thu Oct 11 16:03:33 2012 +1000 + + xkb: ProcesssPointerEvent must work on the VCP if it gets the VCP + + For button release events, the current code picks the VCK. Because that has + a XKB struct, it thinks this is a PointerKeys event and proceeds to send the + release event through the XTest pointer. That has no effect in normal + operation as the button is never down and an attempt is silently discarded + (normal event processing continues with the VCP). + + On server shutdown, the XTest device is already removed, leading to a + null-pointer derefernce when the device is checked for whether buttons are + down (XkbFakeDeviceButton → button_is_down(xtest pointer)). + + The current state has only worked by accident, the right approach here is to + handle the VCP's event as such and not switch to the keyboard. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit cc1d8fa8a4ef2e34e9837a44945094fd77e40a0b +Author: Yaakov Selkowitz +Date: Sun Oct 14 23:38:20 2012 -0500 + + Configure fixes for MinGW + + As for Cygwin, define FD_SETSIZE for uses of select() to be correct. + Link with libpthread. + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Jon TURNEY + +commit 53830281b4da096f9c13107d73ec9c76ff1d14cc +Merge: abc2ef5 9cbcb5b +Author: Keith Packard +Date: Fri Oct 26 18:04:34 2012 -0700 + + Merge remote-tracking branch 'sandmann/for-keithp' + +commit abc2ef590c7cb33ebe21726f83b7347406975f95 +Merge: 0e85e5e c5396ec +Author: Keith Packard +Date: Fri Oct 26 17:11:58 2012 -0700 + + Merge remote-tracking branch 'whot/for-keith' + +commit 9cbcb5bd6a5360a128d15b77a02d8d3351f74366 +Author: Søren Sandmann Pedersen +Date: Wed May 30 05:19:08 2012 -0400 + + Use new pixman_glyph_cache_t API that will be in pixman 0.28.0 + + This new API allows glyphs to be cached in a data structure in pixman, + and entire glyph strings to be composited in one go. + + Also bump pixman dependency to 0.27.2. + + Results from the cairo peformance test suite running against Xvfb with + a screen size of 1680x1050@32bpp: + + Speedups + ======== + xlib firefox-talos-gfx 12416.63 -> 3603.93 3.45x speedup + ██▌ + xlib xfce4-terminal-a1 1727.57 -> 1048.85: 1.65x speedup + ▋ + xlib evolution 1370.49 -> 869.34: 1.58x speedup + ▋ + xlib gnome-terminal-vim 1832.83 -> 1251.94: 1.46x speedup + ▌ + xlib poppler 1519.70 -> 1204.05: 1.26x speedup + ▎ + xlib firefox-planet-gnome 6982.55 -> 5598.16: 1.25x speedup + ▎ + xlib ocitysmap 1142.77 -> 1071.53: 1.07x speedup + ▏ + + No slowdowns were reported. + + Results of x11perf -aa10text: + + Before: + + 8000000 reps @ 0.0007 msec (1450000.0/sec) + 8000000 reps @ 0.0007 msec (1460000.0/sec) + 8000000 reps @ 0.0007 msec (1460000.0/sec) + 8000000 reps @ 0.0007 msec (1470000.0/sec) + 8000000 reps @ 0.0007 msec (1480000.0/sec) + 40000000 trep @ 0.0007 msec (1460000.0/sec) + + After: + + 32000000 reps @ 0.0002 msec (4910000.0/sec) + 32000000 reps @ 0.0002 msec (4830000.0/sec) + 32000000 reps @ 0.0002 msec (4890000.0/sec) + 32000000 reps @ 0.0002 msec (4830000.0/sec) + 32000000 reps @ 0.0002 msec (4900000.0/sec) + 160000000 trep @ 0.0002 msec (4870000.0/sec) + + Version 2: Destroy the glyph cache at server regen time + + Acked-by: Aaron Plattner + Reviewed-by: Keith Packard + Signed-off-by: Soren Sandmann + +commit c5396ec05a5c6cab6608ba677f703c5227b1de13 +Author: Thierry Reding +Date: Wed Oct 17 12:11:49 2012 +0200 + + xf86: Fix build against recent Linux kernel + + Recent Linux kernels reworked the linux/input.h header file, which is + now part of the "user-space API". The include guard therefore has an + additional additional _UAPI prefix. + + Instead of adding another case to the #ifdef, drop any include guard + checks and instead always undefine the BUS_* definitions on Linux. + + Signed-off-by: Thierry Reding + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 7d89eb4978a6649be22747c3de2886781e311647 +Author: Colin Walters +Date: Wed Jan 4 17:37:06 2012 -0500 + + autogen.sh: Honor NOCONFIGURE=1 + + (Also while we have the patient open, use exec instead of hanging + around uselessly in waitpid) + + http://people.gnome.org/~walters/docs/build-api.txt + + Reviewed-by: Adam Jackson + Signed-off-by: Colin Walters + Signed-off-by: Peter Hutterer + +commit c0a752d2864872023216005375a6a1973fadeffe +Author: Lionel Elie Mamane +Date: Tue Oct 9 03:17:49 2012 +0200 + + dix: fix Ungrab action #55785 + + UngrabAllDevices(Bool kill_client): + If we are not going to kill the client (kill_clients false), + we need to deactivate grabs of active clients, too. + (If we are going to kill the client, + no need to deactivate the grab, + as this will be done as part of the client kill.) + + Fixes: X.Org Bug 55785 + + Signed-off-by: Lionel Elie Mamane + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 3b67cd26149eb991b5f015061a818af65369e668 +Author: Chase Douglas +Date: Thu Jun 7 14:12:06 2012 -0700 + + End physically active touches when device is disabled + + Otherwise: + + * We can't end the touches while device is disabled + * New touches after enabling the device may erroneously be mapped to old + logical touches + + Signed-off-by: Chase Douglas + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 0e85e5e62819c9e516d6e19836f9f5d7a5d53e87 +Author: Colin Harrison +Date: Thu Oct 11 18:05:47 2012 +0100 + + hw/xwin: Fix no return value warning in winClipboardProc() + + winclipboardthread.c: In function ‘winClipboardProc’: + winclipboardthread.c:415:9: warning: ‘return’ with no value, in function returning non-void + winclipboardthread.c:424:13: warning: ‘return’ with no value, in function returning non-void + + Signed-off-by: Colin Harrison + Reviewed-by: Jon TURNEY + +commit 51ed6a7d46c6cc19eb9aaf838be41eb57fd8230a +Author: Colin Harrison +Date: Thu Oct 11 17:57:37 2012 +0100 + + hw/xwin: Remove unused variable in winmultiwindowwm.c + + winmultiwindowwm.c: In function ‘UpdateName’: + winmultiwindowwm.c:522:14: warning: unused variable ‘pszName’ [-Wunused-variable] + + Signed-off-by: Colin Harrison + Reviewed-by: Jon TURNEY + +commit 5886b1dc4d2ce12a238a2e3600fdb576abc6e419 +Author: Colin Harrison +Date: Thu Oct 11 17:56:11 2012 +0100 + + hw/xwin: Remove unused variables in winwindow.c + + winwindow.c: In function ‘winCreateWindowNativeGDI’: + winwindow.c:62:19: warning: unused variable ‘pWinPriv’ [-Wunused-variable] + winwindow.c: In function ‘winDestroyWindowNativeGDI’: + winwindow.c:85:19: warning: unused variable ‘pWinPriv’ [-Wunused-variable] + winwindow.c: In function ‘winPositionWindowNativeGDI’: + winwindow.c:108:19: warning: unused variable ‘pWinPriv’ [-Wunused-variable] + winwindow.c: In function ‘winChangeWindowAttributesNativeGDI’: + winwindow.c:213:19: warning: unused variable ‘pWinPriv’ [-Wunused-variable] + winwindow.c: In function ‘winUnmapWindowNativeGDI’: + winwindow.c:241:19: warning: unused variable ‘pWinPriv’ [-Wunused-variable] + winwindow.c: In function ‘winMapWindowNativeGDI’: + winwindow.c:265:19: warning: unused variable ‘pWinPriv’ [-Wunused-variable] + + Signed-off-by: Colin Harrison + Reviewed-by: Jon TURNEY + +commit 08b33882f34fed0c23d54ff7361efc5833868a4b +Author: Colin Harrison +Date: Thu Oct 11 17:52:11 2012 +0100 + + hw/xwin: Remove unused variables in winvalargs.c + + winvalargs.c: In function ‘winValidateArgs’: + winvalargs.c:62:10: warning: unused variable ‘fImplicitScreenFound’ [-Wunused-variable] + winvalargs.c:60:9: warning: unused variable ‘iMaxConsecutiveScreen’ [-Wunused-variable] + + Signed-off-by: Colin Harrison + Reviewed-by: Jon TURNEY + +commit 7e665f1a21468118dababdbf6d8573f1ce1ebd47 +Author: Colin Harrison +Date: Thu Oct 11 17:50:42 2012 +0100 + + hw/xwin: Remove unused variables in winwindowswm.c + + winwindowswm.c: In function ‘ProcWindowsWMQueryVersion’: + winwindowswm.c:85:9: warning: unused variable ‘n’ [-Wunused-variable] + winwindowswm.c: In function ‘SProcWindowsWMQueryVersion’: + winwindowswm.c:565:9: warning: unused variable ‘n’ [-Wunused-variable] + + Signed-off-by: Colin Harrison + Reviewed-by: Jon TURNEY + +commit e893d570aa3e9ae8df6a30ac4adaf0949a2fc733 +Author: Jon TURNEY +Date: Thu Oct 11 19:36:13 2012 +0100 + + Use X_ATTRIBUTE_PRINTF where suggested for os.h + + InitOutput.c: In function ‘OsVendorInit’: + InitOutput.c:630:29: warning: assignment left-hand side might be a candidate for a format attribute [-Wmissing-format-attribute] + winprocarg.c: In function ‘ddxProcessArgument’: + winprocarg.c:231:29: warning: assignment left-hand side might be a candidate for a format attribute [-Wmissing-format-attribute] + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit e59cc83bcdca6b64c1bfb2de395d741757f615f6 +Author: Jon TURNEY +Date: Thu Oct 11 19:35:19 2012 +0100 + + hw/xwin: Use X_ATTRIBUTE_PRINTF where suggested for winmsg.c + + winmsg.c: In function ‘winVMsg’: + winmsg.c:47:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute] + winmsg.c: In function ‘winDrvMsg’: + winmsg.c:56:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute] + winmsg.c: In function ‘winMsg’: + winmsg.c:66:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute] + winmsg.c: In function ‘winDrvMsgVerb’: + winmsg.c:77:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute] + winmsg.c: In function ‘winMsgVerb’: + winmsg.c:87:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute] + winmsg.c: In function ‘winErrorFVerb’: + winmsg.c:97:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute] + winmsg.c: In function ‘winDebug’: + winmsg.c:107:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute] + winmsg.c: In function ‘winTrace’: + winmsg.c:117:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute] + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 3d6e6a394ea2d5dcb77aa706f751423315d8a7ed +Author: Jon TURNEY +Date: Thu Oct 11 19:32:24 2012 +0100 + + hw/xwin: Use X_ATTRIBUTE_PRINTF where suggested for winerror.c + + Also, fix the typoed name OsVenderVErrorF (sic), so it actually gets prototyped + and remove redundant declarations of it's prototype. + + winerror.c: In function ‘OsVendorVErrorF’: + winerror.c:56:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute] + winerror.c: In function ‘winMessageBoxF’: + winerror.c:104:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute] + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 13fb6b36b8742a79b9768944eee6d1ad66d7e4d9 +Author: Jon TURNEY +Date: Thu Oct 11 16:20:35 2012 +0100 + + hw/xwin: Use char strings in winClipboardUNIXtoDOS for consistency with the rest of the clipboard code + + winclipboardxevents.c: In function ‘winClipboardFlushXEvents’: + winclipboardxevents.c:575:13: warning: passing argument 1 of ‘winClipboardUNIXtoDOS’ from incompatible pointer type + winclipboard.h:102:2: note: expected ‘unsigned char **’ but argument is of type ‘char **’ + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit fa36a7cd488e4f7fb91beed8a87764b8e0c1a72f +Author: Jon TURNEY +Date: Thu Oct 11 15:51:39 2012 +0100 + + hw/xwin: Fix warning about discarding const in initializing winKBLayouts + + winlayouts.h:46:5: warning: initialization discards qualifiers from pointer target type + winlayouts.h:46:5: warning: initialization discards qualifiers from pointer target type + winlayouts.h:46:5: warning: initialization discards qualifiers from pointer target type + [repeated for each layout] + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 0ea65df8a5f97a6fe5225226493aa01380080d2f +Author: Jon TURNEY +Date: Thu Sep 27 17:23:43 2012 +0100 + + hw/xwin: Fix some of the warnings in generated gl wrapper code + + Fix some of the warnings in generated gl wrapper code: + - glWinResolveHelper takes a const char * argument + - ensure formal parameter names don't collide with reserved names or shadow + global declarations (e.g. near, far, index (from string.h), remainder (from + math.h), pointer (from Xdefs.h) by postpending a '_'. + + generated_gl_wrappers.c:13:3: warning: passing argument 2 of 'glWinResolveHelper' discards qualifiers from pointer target type + glwrap.c:70:1: note: expected 'char *' but argument is of type 'const char *' + [repeated many times] + generated_gl_wrappers.c: In function 'glVertexAttrib1dARBWrapper': generated_gl_wrappers.c:6884:47: warning: declaration of 'index' shadows a global declaration [-Wshadow] + generated_gl_wrappers.c:6886:3: warning: passing argument 2 of 'glWinResolveHelper' discards qualifiers from pointer target type + [repeated many times] + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit f7f0739311927ad177dece7119272481b75b73b4 +Author: Colin Harrison +Date: Tue Oct 19 23:42:53 2010 +0100 + + hw/xwin: Warning fix in ProcWindowsWMFrameSetTitle() + + winwindowswm.c: In function ‘ProcWindowsWMFrameSetTitle’: + winwindowswm.c:514: error: pointer targets in passing argument 2 of ‘strncpy’ differ in signedness + + If you're going to stick random casts into your code, at least use the goddammed + right ones. :-) + + Signed-off-by: Colin Harrison + Reviewed-by: Jon TURNEY + +commit 97c9ed026a7f7efe5fca02c188bcbdbcd7c594e9 +Author: Jon TURNEY +Date: Wed Jan 25 19:01:55 2012 +0000 + + hw/xwin: Fix shadowed local variable i in HandleCustomWM_COMMAND() + + Fix shadowed local variable i in HandleCustomWM_COMMAND() + + Also, fds are meant to be representable as an int + + winprefs.c: In function ‘HandleCustomWM_COMMAND’: + winprefs.c:346:23: error: declaration of ‘i’ shadows a previous local + winprefs.c:322:7: error: shadowed declaration is here + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit b55d0b92fc536793a877f6073754801a7c3c2dd5 +Author: Jon TURNEY +Date: Wed Jan 25 18:56:22 2012 +0000 + + hw/xwin: Fix shadowed local variables in winLoadCursor() + + Move shadowed local variables x and y to the places they are used + + wincursor.c: In function ‘winLoadCursor’: + wincursor.c:212:11: error: declaration of ‘x’ shadows a previous local + wincursor.c:166:7: error: shadowed declaration is here + wincursor.c:212:14: error: declaration of ‘y’ shadows a previous local + wincursor.c:166:10: error: shadowed declaration is here + wincursor.c:228:11: error: declaration of ‘x’ shadows a previous local + wincursor.c:166:7: error: shadowed declaration is here + wincursor.c:228:14: error: declaration of ‘y’ shadows a previous local + wincursor.c:166:10: error: shadowed declaration is here + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit a8c9c3699e6dfde29eeec058d903740a499dcf3b +Author: Jon TURNEY +Date: Thu Oct 11 19:11:36 2012 +0100 + + hw/xwin/glx: Fix using Mask as a formal parameter shadows a global typedef of the same name + + Fix using Mask as a formal parameter shadows the typedef of the same name from X.h + + indirect.c: In function 'GetShift': + indirect.c:1629:14: warning: declaration of 'Mask' shadows a global declaration [-Wshadow] + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 47df98c7851fd9e97a54f0b4950340506d4a9244 +Author: Jon TURNEY +Date: Wed Jan 25 19:17:16 2012 +0000 + + hw/xwin: Fix using screenInfo as a formal parameter to InitOutput() shadows a global declaration + + Using screenInfo as a formal parameter to InitOutput() shadows a global declaration of screenInfo. + Change the formal parameter name from screenInfo to pScreenInfo, as everywhere else uses. + + InitOutput.c: In function ‘InitOutput’: + InitOutput.c:891:25: error: declaration of ‘screenInfo’ shadows a global declaration + ../../include/scrnintstr.h:570:19: error: shadowed declaration is here + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 97e9c34687f7dc05ee0bdef097a19e7623fb59a3 +Author: Jon TURNEY +Date: Wed Jan 25 19:07:49 2012 +0000 + + hw/xwin: Fix using menu as a formal parameter shadows a global variable of the same name + + Using menu as a formal parameter shadows a global variable of the same name + + winprefsyacc.y: In function ‘SetRootMenu’: + winprefsyacc.y:286:20: error: declaration of ‘menu’ shadows a global declaration + winprefsyacc.y:55:19: error: shadowed declaration is here + winprefsyacc.y: In function ‘SetDefaultSysMenu’: + winprefsyacc.y:293:26: error: declaration of ‘menu’ shadows a global declaration + winprefsyacc.y:55:19: error: shadowed declaration is here + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit efe96a17bd741f222ccb226d306b5c1dc1f25ade +Author: Jon TURNEY +Date: Wed Jan 25 18:54:57 2012 +0000 + + hw/xwin: Fix using index as a formal parameter shadows index() + + Using index as a formal parameter shadows index() from strings.h + + winallpriv.c: In function ‘winInitCmapPrivates’: + winallpriv.c:119:45: error: declaration of ‘index’ shadows a global declaration + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 451c5d9175cdeb36fd614502ff0317f968490dfc +Author: Jon TURNEY +Date: Wed Jan 25 19:09:12 2012 +0000 + + hw/xwin: Fix using index as a formal parameter in winscrinit.c shadows index() + + Using index as a local variable shadows index() from strings.h + + winscrinit.c: In function ‘winFinishScreenInitFB’: + winscrinit.c:274:28: error: declaration of ‘index’ shadows a global declaration + winscrinit.c: In function ‘winFinishScreenInitNativeGDI’: + winscrinit.c:623:35: error: declaration of ‘index’ shadows a global declaration + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 21faee4b383a12bef58f300b4ad1a3bd34d6de2d +Author: Jon TURNEY +Date: Wed Jan 25 19:05:42 2012 +0000 + + hw/xwin: Fix using index as a local variable shadows index() + + Using index as a local variable shadows index() from strings.h + + winprefs.c: In function ‘LoadImageComma’: + winprefs.c:574:7: error: declaration of ‘index’ shadows a global declaration + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 2d9123fd0c89c1a72e7281e56985196bc53507bf +Author: Jon TURNEY +Date: Wed Jan 25 18:59:21 2012 +0000 + + hw/xwin: Fix using index as a formal parameter in winmonitors.c shadows index() + + Fix using index as a local variable shadows global declaration of index() from strings.h + + winmonitors.c: In function ‘QueryMonitor’: + winmonitors.c:59:23: error: declaration of ‘index’ shadows a global declaration + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 5b0435dbdaa47404629800e4e9c5a6952a7bb260 +Author: Jon TURNEY +Date: Wed Jan 25 18:53:02 2012 +0000 + + hw/xwin: Fix using system as a local variable in winCheckMount() shadows system() + + Using system as local variable in winCheckMount() shadows the global declaration of system() from stdlib.h + + InitOutput.c: In function ‘winCheckMount’: + InitOutput.c:296:10: error: declaration of ‘system’ shadows a global declaration + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 17d84c743d6b52f32c4ca0341aebaff972522945 +Author: Jon TURNEY +Date: Wed Jan 25 17:18:12 2012 +0000 + + hw/xwin: Remove obsolete redundant declarations of winPushPixels() + + winPushPixels() and winpushpxl.c was removed in it's entirety in commit + f31bd087e8a7f65cd588bd1d022bb18e72b2a60c "Death to mfb" + + wingc.c:37:1: error: redundant redeclaration of ‘winPushPixels’ + win.h:1104:1: note: previous declaration of ‘winPushPixels’ was here + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit f06b468d96afd323e28645dde44170ab367da4f1 +Author: Jon TURNEY +Date: Wed Jan 25 17:09:18 2012 +0000 + + hw/xwin: Fix redundant declarations in winmultiwindowwm.c + + winmultiwindowwm.c:139:14: error: redundant redeclaration of ‘display’ + ../../include/opaque.h:52:14: note: previous declaration of ‘display’ was here + winmultiwindowwm.c:140:13: error: redundant redeclaration of ‘ErrorF’ + ../../include/os.h:558:13: note: previous declaration of ‘ErrorF’ was here + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 3e8269177ee01fe107830032b60a8d311d4b4b0e +Author: Jon TURNEY +Date: Wed Jan 25 17:08:17 2012 +0000 + + hw/xwin: Fix redundant declarations in winclipboardwrappers.c + + Fix redundant declarations in winclipboardwrappers.c. + Also remove obsolete winProcQueryTree() prototype. + + winclipboardwrappers.c:64:12: error: redundant redeclaration of ‘g_iNumScreens’ + winglobals.h:33:12: note: previous declaration of ‘g_iNumScreens’ was here + winclipboardwrappers.c:67:13: error: redundant redeclaration of ‘g_fXdmcpEnabled’ + winglobals.h:45:13: note: previous declaration of ‘g_fXdmcpEnabled’ was here + winclipboardwrappers.c:75:27: error: redundant redeclaration of ‘winProcEstablishConnectionOrig’ + winglobals.h:66:27: note: previous declaration of ‘winProcEstablishConnectionOrig’ was here + winclipboardwrappers.c:76:27: error: redundant redeclaration of ‘winProcQueryTreeOrig’ + winglobals.h:67:27: note: previous declaration of ‘winProcQueryTreeOrig’ was here + winclipboardwrappers.c:77:27: error: redundant redeclaration of ‘winProcSetSelectionOwnerOrig’ + winglobals.h:68:27: note: previous declaration of ‘winProcSetSelectionOwnerOrig’ was here + + winclipboardwrappers.c:56:5: warning: redundant redeclaration of ‘winProcEstablishConnection’ [-Wredundant-decls] + winclipboardwrappers.c:52:5: note: previous declaration of ‘winProcEstablishConnection’ was here + winclipboardwrappers.c:57:5: warning: redundant redeclaration of ‘winProcSetSelectionOwner’ [-Wredundant-decls] + winclipboardwrappers.c:54:5: note: previous declaration of ‘winProcSetSelectionOwner’ was here + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 0975fa0b391d7b8d7e8a127ebf7a863e53fcab7d +Author: Jon TURNEY +Date: Wed Jan 25 17:06:27 2012 +0000 + + hw/xwin: Fix redundant declaration in winclipboardthread.c + + winclipboardthread.c:51:22: error: redundant redeclaration of ‘serverGeneration’ + ../../include/misc.h:362:22: note: previous declaration of ‘serverGeneration’ was here + winclipboardthread.c: In function ‘winClipboardProc’: + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 4a1da00c495706e0fbcec2b30aef3ad7acf5b703 +Author: Jon TURNEY +Date: Wed Jan 25 17:05:25 2012 +0000 + + hw/xwin: Fix redundant declaration in winclipboardinit.c + + In file included from winclipboardinit.c:35:0: + winclipboard.h:81:13: error: redundant redeclaration of ‘ErrorF’ + ../../include/os.h:558:13: note: previous declaration of ‘ErrorF’ was here + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 30f31b80f0105676359105c895bc195b9f3e704c +Author: Jon TURNEY +Date: Wed Jan 25 16:48:45 2012 +0000 + + hw/xwin: Fix various warnings in code generated by lex/yacc + + Remove various redundant declarations. + + Instruct lex not to generate code which isn't going to be used, thus avoiding + some unused function warnings. + + Note that bison <2.5 expects stdlib.h to define _STDLIB_H if it's been included, + and avoids prototyping free/malloc in that case. Some stdlib.h (e.g. newlib) may + not match precisely (e.g. defining _STDLIB_H_), so we define it after including + stdlib.h to be sure, and avoid a redudant declaration warning for those symbols. + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 4231b9541c6fd26f43b605ecc9dd76622dd786f7 +Author: Jon TURNEY +Date: Wed Jan 25 16:38:49 2012 +0000 + + hw/xwin: Fix redundant declaration in winprefs.c + + winprefs.c:63:14: error: redundant redeclaration of ‘display’ + ../../include/opaque.h:52:14: note: previous declaration of ‘display’ was here + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 70087c55fffc3cbc52f550418e6b1230bbb1b3b3 +Author: Jon TURNEY +Date: Wed Jan 25 16:36:40 2012 +0000 + + hw/xwin: Fix redundant declaration warnings in winmonitors.c + + Include xwin-config.h so HAVE_STRLCPY and HAVE_STRNDUP are defined, so + duplicate declarations of strlcpy(), strlcat() and strndup() aren't made + by os.h + + In file included from ../../include/misc.h:111:0, + from ../../include/screenint.h:51, + from ../../include/scrnintstr.h:51, + from win.h:157, + from winmonitors.c:31: + ../../include/os.h:491:15: error: redundant redeclaration of ‘strlcpy’ + /usr/include/string.h:86:35: note: previous declaration of ‘strlcpy’ was here + ../../include/os.h:492:15: error: redundant redeclaration of ‘strlcat’ + /usr/include/string.h:85:35: note: previous declaration of ‘strlcat’ was here + ../../include/os.h:496:15: error: redundant redeclaration of ‘strndup’ + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 9904c8fe75c96cf84d8885aa95f2743c1b25ea37 +Author: Jon TURNEY +Date: Wed Jan 25 16:09:59 2012 +0000 + + hw/xwin: Remove completely unused winregistry.c + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit a69429a17bf4630f6e26f61630a1c2b287202627 +Author: Jon TURNEY +Date: Fri Sep 7 14:58:06 2012 +0100 + + Fix 'make distcheck' for hw/xwin + + Add some missing header files to _SOURCES so they get distributed properly + + Signed-off-by: Jon TURNEY + Reviewed-by: Yaakov Selkowitz + +commit 1d9fd7ffb03ff6e44f3a8736a94e4558203ce607 +Author: Jon TURNEY +Date: Thu Sep 6 13:51:38 2012 +0100 + + Fix compilation of Xorg DDX without XF86VIDMODE + + Fix compilation of Xorg DDX without XF86VIDMODE since 6e74fdda, by putting + xf86vmode.c back under the XF86VIDMODE automake conditional it was accidentally + taken out of. + + Signed-off-by: Jon TURNEY + Tested-by: Yaakov Selkowitz + Reviewed-by: Daniel Stone + +commit 25741b1aa3a0fb39cb842a43ab52935673cfdefa +Author: Jon TURNEY +Date: Sun Sep 2 15:17:05 2012 +0100 + + hw/xwin: Only add GLX extension once. + + Using of LoadExtension() to add GLX onto to the end of the list of extensions on + every server regeneration leads to hilarious consequences (i.e. crashing) after + the first regeneration :-) + + Possibly xf86ExtensionInit() and QuartzExtensionInit() need a similar fix. + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + Tested-by: Colin Harrison + +commit 7ceb85481280fecbf033f147f0f7834cad3890c6 +Author: Jon TURNEY +Date: Sun Sep 2 14:55:25 2012 +0100 + + Correct description of -displayfd option in man page. + + A display number, not a port number, is written to the specified fd. + + Signed-off-by: Jon TURNEY + Reviewed-by: Alan Coopersmith + +commit 4b7f00346daed20c96f3e8ea13ae411858a5424b +Author: Peter Hutterer +Date: Wed Oct 10 13:33:48 2012 +1000 + + dix: fix crash on shutdown if a disabled device is still grabbed (XI1 grab) + + A disabled device doesn't have a sprite (less so a sprite->win) and triggers + a NULL-pointer dereference on shutdown when all active grabs are released as + part of the cleanup. + + Fix this by checking for sprite being non-null and setting the focus window + to the NullWindow if it is. The rest of the patch just attempts to make + things more readable. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit 0c7109f3215378bb3ed6c00c71129a63ffb4e787 +Author: Denys Vlasenko +Date: Mon Oct 8 14:18:02 2012 +1000 + + os: fix typo in OsSigHandler() error message + + Recieved → Received + + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 0a75bd640b3dc26b89d9e342999a7f4b7e98edbf +Author: Peter Hutterer +Date: Wed Oct 3 13:12:27 2012 +1000 + + xfree86: add xf86UpdateDesktopDimensions() + + This call is required for external drivers (specifically NVIDIA) that do + not share the xfree86 infrastructure to update the desktop dimensions. + Without it, the driver would update the ScreenRecs but not update the total + dimensions the input code relies on for transformation. + + This call is a thin wrapper around the already-existing internal call and + should be backported to all stable series servers, with the minor ABI bump. + + Signed-off-by: Peter Hutterer + CC: Andy Ritger + Reviewed-by: Aaron Plattner + +commit 09f1e5b15b769e1122f0a8d7cae0820038992312 +Author: Julien Cristau +Date: Sun Oct 7 18:40:35 2012 +0200 + + Revert "kinput: allocate enough space for null character." + + This reverts commit 531785dd746d64ef7f473a83ca73bb20e74b6fca. + + The above commit breaks Xephyr option parsing. Andrzej writes: + + Xephyr -retro -keybd evdev,,device=/dev/input/event2,xkbrules=evdev,xkbmodel=evdev,xkblayout=pl -mouse evdev,,device=/dev/input/event1 :3 + + results in: + + + Pointer option key (device=) of value (/dev/input/event1) not assigned! + Kbd option key (device=) of value (/dev/input/event2) not assigned! + Kbd option key (xkbrules=) of value (evdev) not assigned! + Kbd option key (xkbmodel=) of value (evdev) not assigned! + Kbd option key (xkblayout=) of value (pl) not assigned! + + + The effect of the patch is that the "key=value" pairs are parsed in such + a way that the key is added an "equals" sign to it and we end up with + keys like "device=" instead of "device". This in turn has effect on + KdParsePointerOptions and KdParseKbdOptions: the key does not match + any choice presented in the "switch" statement, and so "Pointer/Kbd + option key (...) of value (...) not assigned!" happens, making all + "key=value" options inaccessible to the user. Reverting the patch makes + them available again. + + Reference: http://bugs.debian.org/689246 + Reported-by: Andrzej Pietrasiewicz + Signed-off-by: Julien Cristau + Cc: Dave Airlie + Reviewed-by: Søren Sandmann + Signed-off-by: Keith Packard + +commit 7f9d78d8ffb1a312f9b3d69c05323f601571e162 +Author: Keith Packard +Date: Thu Oct 4 22:51:06 2012 -0700 + + os: Don't re-declare ConnectionInputPtr and ConnectionOutputPtr + + They're declared in osdep.h, so don't redeclare them in io.c as + well. Keeps the compiler happier. + + Signed-off-by: Keith Packard + Reviewed-by: Dave Airlie + +commit d5bf6f95f31037bd49b11348b500c3c13b7e0c99 +Author: Keith Packard +Date: Thu Oct 4 14:42:37 2012 -0700 + + Fix FlushClient to write extraBuf when provided (regression fix) + + In commit: + + commit 092c57ab173c8b71056f6feb3b9d04d063a46579 + Author: Adam Jackson + Date: Fri Jun 17 14:03:01 2011 -0400 + + os: Hide the Connection{In,Out}put implementation details + + Reviewed-by: Daniel Stone + Signed-off-by: Adam Jackson + + the check for an empty output buffer was moved from one calling + location into the FlushClient implementation itself. However, this + neglected the possibility that additional data, in the form of + 'extraBuf' would be passed to FlushClient from other code paths. If the + output buffer happened to be empty at that time, the extra data would + never be written to the client. + + This is fixed by checking the total data to be written, which includes + both pending and extra data, instead of just the pending data. + + Signed-off-by: Keith Packard + Reviewed-by: Julien Cristau + +commit 8367dd9736d74eca971da345c2bf559ce5bbf649 +Merge: 36c18bb 7998e26 +Author: Keith Packard +Date: Thu Oct 4 13:08:35 2012 -0700 + + Merge remote-tracking branch 'whot/for-keith' + +commit 36c18bb81be619df712778bcb99dd6f1fa38701a +Author: Stephan Schreiber +Date: Wed Aug 29 20:03:58 2012 +0200 + + int10: fix pci_device_read_rom usage + + I noticed that the build-in int10 driver always reports + "Unable to retrieve all of segment 0x0C0000." + even though the entire BIOS data is retrieved with success. + + The associated code is in hw/xfree86/int10/generic.c, in the function + xf86ExtendedInitInt10(): + + if (pci_device_read_rom(pInt->dev, vbiosMem) < V_BIOS_SIZE) { + xf86DrvMsg(screen, X_WARNING, + "Unable to retrieve all of segment 0x0C0000.\n"); + } + + The function pci_device_read_rom() is from libpciaccess; its return + value is not a size but an error status code: 0 means success. + If pci_device_read_rom() returns 0 for success, the warning is generated. + + The proposed patch corrects the evaluation of the return value of + pci_device_read_rom() and of the supplied BIOS size. + + Debian bug#686153 + + Signed-off-by: Julien Cristau + Reviewed-by: Dave Airlie + Signed-off-by: Keith Packard + +commit 4bf3eac5fe20fb203b917a486f69514c55be595a +Author: Adam Jackson +Date: Thu Sep 27 17:12:19 2012 -0400 + + configure: Stop using AM_MAINTAINER_MODE + + All this does is make it so editing configure.ac or Makefile.am doesn't + rebuild the makefiles. Which is just stupid. + + v2: Remove --enable-maintainer-mode from autogen.sh + + Signed-off-by: Adam Jackson + Reviewed-by: Eric Anholt + Reviewed-by: Dan Nicholson + Reviewed-by: Peter Hutterer + Reviewed-by: Alex Deucher + Signed-off-by: Keith Packard + +commit 262679d436941580485a10e30938974958f7d588 +Author: Keith Packard +Date: Thu Oct 4 11:42:22 2012 -0700 + + Set version to 1.14 development branch (1.13.99.0) + + Signed-off-by: Keith Packard + +commit f179b13b91c8891254d31345ee04e773839e6b87 +Merge: 4dd5989 3d2b768 +Author: Keith Packard +Date: Thu Oct 4 11:39:46 2012 -0700 + + Merge remote-tracking branch 'daniels/master' + +commit 7998e26159893674be69183a73a89a53f5608d58 +Author: Jason Gerecke +Date: Fri Sep 28 15:03:42 2012 -0700 + + Fix additional gcc -Wwrite-strings warning in xf86 ddx + + Commit 09e4b78f missed a case. + + Signed-off-by: Jason Gerecke + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit f64254d85e731d0b4369d871a9a735b03f283ba6 +Author: Peter Hutterer +Date: Thu Aug 23 15:00:24 2012 +1000 + + mi: drop two useless conditions in miPointerSetPosition + + pDev cannot be NULL here since fill_pointer_events is the only caller. + And if the screen is NULL, then the device tries to send events before it is + fully initialised. That certainly shouldn't happen and would be a bug + elsewhere. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit 314776eb369ca2e438907795ae030dd743c281fc +Author: Daniel Stone +Date: Fri Sep 7 18:30:23 2012 +0100 + + Touch: Fix duplicate TouchBegin selection with virtual devices + + Given the following scenario: + 1) client A selects for TouchBegin on window W for device D + 2) client B selects for TouchBegin on window W for XIAllDevices + 3) client C selects for TouchBegin on window W with device E + + Step 3 will fail with BadImplementation, because attempting to look up + XIAllDevices or XIAllMasterDevices with dixLookupDevices doesn't work. + This should succeed (or, if it was selecting for device D, fail with + BadAccess as it would be a duplicate selection). + + Fix this by performing the appropriate lookup for virtual devices. + + Signed-off-by: Daniel Stone + Cc: Peter Hutterer + Cc: Chase Douglas + Signed-off-by: Peter Hutterer + +commit 3e6358ee6c33979329b78fe2097a1fdf76fb69cd +Author: Daniel Drake +Date: Fri Sep 7 21:48:35 2012 -0400 + + Xi: Don't check for TOUCH_END, it's never set + + This flag is never set, so checking for it here means that we'll + never release the simulated mouse button press after the user touches + (and releases) the touchscreen for the first time. + + Fixes a problem where the XO laptop touchpad became totally + unusable after touching the screen for the first time (since X then + behaved as if the mouse button was held down all the time). + + Signed-off-by: Daniel Drake + Reviewed-by: Chase Douglas + Signed-off-by: Peter Hutterer + +commit 9d6b8365702e4648e793fea21ad22f7174558680 +Author: Peter Hutterer +Date: Fri Sep 28 11:49:29 2012 +1000 + + dix: fix crash on XI 1.x grabs on disabled devices. (#54934) + + If the device is disabled, the sprite window is NULL and dereferencing + crashes the server. + + This is only triggered for XI 1.x grabs (ProcXGrabDevice) as XI2 grabs would + trigger another code path, creating a sprite for the disabled device as if + detaching it (which is wrong and fixed with this patch too). + + Grabbing a disabled device doesn't make sense as it won't send events + anyway. However, the protocol specs do not prohibit it, so we need to keep + it working. + Luckily, oldWin is only used for focus out events, which aren't necessary + given that the device is disabled. + + X.Org Bug 54934 + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + +commit 3d2b768efae9936c6929c2bc13c7a1acc074ecd3 +Author: Daniel Stone +Date: Fri Sep 7 18:17:46 2012 +0100 + + Touch: Fix duplicate TouchBegin selection with virtual devices + + Given the following scenario: + 1) client A selects for TouchBegin on window W for device D + 2) client B selects for TouchBegin on window W for XIAllDevices + 3) client C selects for TouchBegin on window W with device E + + Step 3 will fail with BadImplementation, because attempting to look up + XIAllDevices or XIAllMasterDevices with dixLookupDevices doesn't work. + This should succeed (or, if it was selecting for device D, fail with + BadAccess as it would be a duplicate selection). + + Fix this by performing the appropriate lookup for virtual devices. + + Signed-off-by: Daniel Stone + Reviewed-by: Chase Douglas + +commit e3903a9383351b061b1a99dfc653ca50de764ec4 +Author: Frederic Plourde +Date: Wed Sep 12 10:48:32 2012 -0400 + + Add glXCreateNewContext support in Xephyr #54798 + + Similar to how we intercept and pass through CreateContext, also pass + through newer CreateNewContext requests. + + Fixes Clutter → Xephyr → VirtualBox. + + Signed-off-by: Frederic Plourde + Reviewed-by: Daniel Stone + +commit 11afebc92ce1a7462ff2886286504425b1c8f0ba +Author: Daniel Stone +Date: Fri Sep 7 18:10:35 2012 +0100 + + Xephyr: GLX: Support MakeContextCurrent and MakeCurrentReadSGI + + We need to pass these requests through to the host server in the same + way we do glXMakeCurrent. Generalise the existing MakeCurrent + submission into once that will send MakeCurrent, MakeContextCurrent or + MakeCurrentReadSGI, depending on the request and the host server's + capabilities, and add decoding/hijack support for incoming + MakeContextCurrent and MakeCurrentReadSGI requests. + + Fixes Clutter → Xephyr → VirtualBox. + + Signed-off-by: Daniel Stone + Reviewed-by: Adam Jackson + Reviewed-by: Ian Romanick + +commit 4dd5989d15465f3f3480b521d4e36673972fa24a +Merge: 0b02150 506e343 +Author: Keith Packard +Date: Mon Sep 24 11:43:01 2012 -0700 + + Merge remote-tracking branch 'ajax/server-1.14-abi-churn' + +commit 0b02150c27e98f996e10d7489f9f67a30e4e3497 +Author: Yufeng Shen +Date: Mon Sep 24 14:03:31 2012 -0400 + + dix: fix scale_to_desktop for edge ABS events + + Scale_to_desktop() converts ABS events from device coordinates + to screen coordinates: + [dev_X_min, dev_X_max] -> [screen_X_min, screen_X_max] + [dev_Y_min, dev_Y_max] -> [screen_Y_min, screen_Y_max] + + An edge ABS event with X = dev_X_max (e.g., generated from the + edge of a touchscreen) will be converted to have screen X value + = screen_X_max, which, however, will be filterd out when xserver + tries to find proper Window to receive the event, because the + range check for a Window to receive events is + window_X_min <= event_screen_X < window_X_max + Events with event_screen_X = screen_X_max will fail the test get + and rejected by the Window. + + To fix this, we change the device to screen coordinates mapping to + [dev_X_min, dev_X_max] -> [screen_X_min, screen_X_max-1] + [dev_Y_min, dev_Y_max] -> [screen_Y_min, screen_Y_max-1] + + Reviewed-by: Chase Douglas + Reviewed-by: Jeremy Huddleston Sequoia + Signed-off-by: Yufeng Shen + Signed-off-by: Keith Packard + +commit 7722bcbab2507d263c7685b15cccbfdd52fc3a24 +Merge: 4dc2a76 f54987d +Author: Keith Packard +Date: Sun Sep 23 16:04:13 2012 -0700 + + Merge remote-tracking branch 'jeremyhu/master' + +commit 4dc2a76740d921c824a4d8193f39dd373475f02a +Author: Adam Jackson +Date: Thu Sep 20 17:57:00 2012 -0400 + + miext/damage: Only wrap into the GC ops chain if there's a listener (v3) + + before after Operation + -------- ----------------- ----------------- + 1148346.9 1191807.5 ( 1.04) PutImage 10x10 square + 2091666.1 2180983.0 ( 1.04) ShmPutImage 10x10 square + + v3: In miDamage{R,Unr}egister, bump the serial number of the affected + drawable (and all children if it's a window) so subsequent drawing + against the damage will trigger another ValidateGC pass and we wrap + in/out correctly. Spotted by Aaron Plattner. + + Signed-off-by: Adam Jackson + Reviewed-by: Aaron Plattner + Signed-off-by: Keith Packard + +commit ad0156c369a40762df6b70780358ce14e5f2c9b1 +Author: Adam Jackson +Date: Thu Sep 20 11:16:26 2012 -0400 + + dix: Remove MapUnmapEventsEnabled and friends + + This hack was added to suppress events generated by Composite's internal + unmap/map cycle on redirection state change. Since that cycle was + removed in 193ecc8b4, these can go. + + Signed-off-by: Adam Jackson + Reviewed-by: Ville Syrjälä + Signed-off-by: Keith Packard + +commit 387b1ac33ca63d27e42d4f61cf248bafb7c43c17 +Author: Adam Jackson +Date: Thu Sep 20 11:16:25 2012 -0400 + + dix: Factor out DeliverUnmapNotify + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit d20cc0fca4e36ad9bdbda8950c4466b1976e70a1 +Author: Adam Jackson +Date: Thu Sep 20 11:16:24 2012 -0400 + + dix: Factor out DeliverMapNotify + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit 63843cb70030812bb3a311b2e8dfb0d1b0a75176 +Author: Adam Jackson +Date: Thu Sep 20 11:16:23 2012 -0400 + + dix: Factor out MaybeDeliverMapRequest + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit dab7a1ec7fd97e07405e0b01dc1f1ec6e5fc2e7c +Author: Adam Jackson +Date: Thu Sep 20 11:16:22 2012 -0400 + + dix: Fix some indentation + + Signed-off-by: Adam Jackson + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit 3d1051aecbb1955084804133cacd12c7f696833a +Author: Peter Hutterer +Date: Thu Sep 20 05:56:39 2012 +1000 + + dix: set the device transformation matrix + + The property handler is registered after setting the property, so + dev->transform remains as all-zeros. That causes pixman_f_transform_invert() + to fail (in transformAbsolute()) and invert remains as garbage. This + may then cause a cursor jump to 0,0. + + Since the axes are not yet initialized here and we need to allow for drivers + changing the matrix, we cannot use the property handler for matrix + initialization, essentially duplicating the code. + + Triggered by the fix to (#49347) in 749a593e49adccdf1225be28a521412ec85333f4 + + https://bugzilla.redhat.com/show_bug.cgi?id=852841 + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + Signed-off-by: Keith Packard + +commit 1cb0261ef54b7dd6a7ef84e1c3959e424706228b +Author: Daniel Martin +Date: Thu Sep 6 00:38:26 2012 +0200 + + dix: Delete mibstore.h + + Since Nov 2010 (commit c4c4676) the only purpose of mibstore.h was to + define an empty function (miInitializeBackingStore()) for backward + compatibility. Time to say goodbye. + + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 08a9ed2524679ed939fa0ad466ee3faf905b8ac4 +Author: Daniel Martin +Date: Thu Sep 6 00:38:25 2012 +0200 + + dix: Remove refs to mi backing store from docs + + Remove any reference to mibstore.h and miInitializeBackingStore() from + the documentation. + + Reviewed-by: Aaron Plattner + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 76d8739b1f4ed07b874ae56a492d1e0aa0fd9b04 +Author: Daniel Martin +Date: Thu Sep 6 00:38:24 2012 +0200 + + dix: Remove #includes of mibstore.h + + Remove more backing store leftovers. + + Reviewed-by: Aaron Plattner + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 056fd15deaa85d3ed936df9a3b2e0cdcfa599da8 +Author: Daniel Martin +Date: Thu Sep 6 00:38:23 2012 +0200 + + dix: Delete mibstore.c + + The only reference to mibstore.c was removed with commit c4c4676. Remove the + file itself too. + + Reviewed-by: Aaron Plattner + Reviewed-by: Adam Jackson + Signed-off-by: Keith Packard + +commit f54987de97720200ee94eba1c7a737d4ad8c55c8 +Author: Jeremy Huddleston Sequoia +Date: Thu Sep 20 21:11:21 2012 -0700 + + XQuartz: Add some verbose logging to debug xp_lock_window being unbalanced + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 25d26875bc9bd6fd23ae1b5280f015abf1b033b7 +Author: Jeremy Huddleston Sequoia +Date: Thu Sep 20 21:49:40 2012 -0700 + + XQuartz: Avoid a possible deadlock with DRI on OS X 10.7.5 and OS X 10.8.2 + + + http://bugs.winehq.org/show_bug.cgi?id=31751 + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 506e3437c73e5ae935ff7c056d7808fbb0c7e614 +Author: Adam Jackson +Date: Thu Sep 20 14:22:48 2012 -0400 + + dix: Fix types in WindowOptRec + + No reason for these to be 64 bits on LP64. + + Reviewed-by: Daniel Stone + Signed-off-by: Adam Jackson + +commit 092c57ab173c8b71056f6feb3b9d04d063a46579 +Author: Adam Jackson +Date: Fri Jun 17 14:03:01 2011 -0400 + + os: Hide the Connection{In,Out}put implementation details + + Reviewed-by: Daniel Stone + Signed-off-by: Adam Jackson + +commit e2c7d70e5ddb8b17676a13ceebfbb87d14d63243 +Author: Adam Jackson +Date: Fri Jun 17 13:43:38 2011 -0400 + + dix: Extend initial connection handshake for forwarding proxies + + Forwarding proxies like sshd will appear to be local, even though they + aren't really. This leads to weird behaviour for extensions that truly + require running under the same OS services as the client, like MIT-SHM + and DRI2. + + Add two new legal values for the initial connection's byteOrder field, + 'r' and 'R'. These act like 'l' and 'B' respectively, but have the side + effect of forcing the client to be treated as non-local. Forwarding + proxies should attempt to munge the first packet of the connection + accordingly; older servers will reject connections thusly munged, so the + proxy should fall back to passthrough if the munged connection attempt + fails. + + Reviewed-by: Daniel Stone + Signed-off-by: Adam Jackson + +commit 31bf81772e146af79b0c456aae2159eba8b0280f +Author: Adam Jackson +Date: Thu Sep 20 14:00:09 2012 -0400 + + dix: Repack ClientRec + + Pick smaller types where possible, including bitfielding some Bools and + small enums, then shuffle the result to be hole-free. 192 -> 128 bytes + on LP64, 144 -> 96 bytes on ILP32. + + Signed-off-by: Adam Jackson + +commit ff8e3ad8074cd2c8bed49b39c40c2b4892118270 +Author: Adam Jackson +Date: Thu Sep 20 13:16:59 2012 -0400 + + dix: Pull client-is-local flag up to the ClientRec + + Reviewed-by: Daniel Stone + Signed-off-by: Adam Jackson + +commit 3f7bc222638d5d38324ecbc8c2c4e39af17d110e +Author: Adam Jackson +Date: Thu Jun 16 17:40:24 2011 -0400 + + os: Repack ConnectionOutput for LP64 + + Reviewed-by: Daniel Stone + Signed-off-by: Adam Jackson + +commit d01921ec18c21f21d377b60626cc2d3418b84a7c +Merge: 70e5766 245e7e0 +Author: Keith Packard +Date: Thu Sep 20 17:26:48 2012 +0200 + + Merge remote-tracking branch 'ajax/ioperm' + +commit 5109c7f6581b3e4e23700bfd03b4daf0ba97630e +Author: Adam Jackson +Date: Thu Sep 20 11:19:39 2012 -0400 + + xfree86: Bump video ABI to 14 + + Signed-off-by: Adam Jackson + +commit 245e7e0361b18766583ae391a2ac1231bb1a1f84 +Author: Adam Jackson +Date: Tue Jun 26 14:32:31 2012 -0400 + + xfree86: Change the semantics of driverFunc(GET_REQUIRED_HW_INTERFACES) + + This is a really awkward interface, since we're calling it well before + the driver knows what device it's going to drive. Drivers with both KMS + and UMS support therefore don't know whether to say they need I/O port + access or not, and have to assume they do. + + With this change we now call it only to query whether port access might + be needed; we don't use that to determine whether to call a driver's + probe function or not, instead we call them unconditionally. If the + driver doesn't check whether port access was enabled, they might crash + ungracefully. To accomodate this, we move xorgHWAccess to be explicitly + intentionally exported (sigh xf86Priv.h) so that drivers can check that + before they attempt port access. + + v2: Move initial xf86EnableIO() nearer the logic that determines whether + to call it, suggested by Simon Farnsworth. + + Reviewed-by: Alex Deucher + Reviewed-by: Simon Farnsworth + Signed-off-by: Adam Jackson + +commit d88fb00d791c2b19cf9dd244276838aba3a6b442 +Author: Adam Jackson +Date: Tue Jun 26 13:15:45 2012 -0400 + + linux: Make failure to iopl non-fatal + + We load the driver list, then enable I/O, then call driver probe based + on whether I/O enable succeeded. That's bad, because the loaded + security policy might forbid port access. We happen to treat that as + fatal for some reason, which means even drivers that don't need I/O + access (like kms and fbdev) don't get the chance to run. Facepalm. + + How about we just make that non-fatal instead, that sounds like a much + better plan. + + Reviewed-by: Alex Deucher + Reviewed-by: Simon Farnsworth + Signed-off-by: Adam Jackson + +commit 048674a6aeb61149a1b5f6b0bc3762ddf57f38ee +Author: Adam Jackson +Date: Tue Jun 26 13:12:45 2012 -0400 + + linux: Refactor xf86{En,Dis}ableIO + + Pull platform methods into their own sections for legibility, and + rewrite the ifdefs to be more concise. + + Reviewed-by: Alex Deucher + Reviewed-by: Simon Farnsworth + Signed-off-by: Adam Jackson + +commit 70e5766874a919039678bb2ed75f2ccea0cb4345 +Author: Dave Airlie +Date: Mon Aug 27 15:22:44 2012 +1000 + + xf86: fix multi-seat video device support. (v2) + + If we are not seat 0 the following apply: + + don't probe any bus other than platform + don't probe any drivers other than platform + assume the first platform device we match on the bus is the primary GPU. + + This just adds checks in the correct places to ensure this, and + with this X can now start on a secondary seat for an output device. + + v2: fix Seat0 macros + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit 37d956e3ac9513b74078882dff489f9b0a7a5a28 +Author: Keith Packard +Date: Mon Sep 10 11:14:20 2012 +1000 + + xf86: fix compat output selection for no output GPUs + + This should work properly with dynamic outputs. + + Reviewed-by: Dave Airlie + Signed-off-by: Dave Airlie + +commit e0b92f5f86f8ce71ab4c80e9902e51e2525f9705 +Author: Dave Airlie +Date: Thu Sep 13 18:44:06 2012 +1000 + + config/udev: ignore change on drm devices + + for input devices we handle change like remove/add, but for + drm devices we get change events when we hotplug outputs, + so lets just ignore change at this level, and let the drivers + handle it. We may in the future want to route driver udev + from here instead. + + Reported-by: Timo Aaltonen + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit 10672a5abe7d4e924844d7e41c86c24d6367a52b +Author: Dave Airlie +Date: Mon Sep 10 14:48:37 2012 +1000 + + xf86/platform: scan pci after probing devices + + This solves a race if we are trying to dynamically power off + secondary GPUs. Its not the greatest fix ever but it probably + as good as we can do for now. + + The GPU probing causes the devices to be powered up, then when + we scan the PCI bus we get the correct information from the kernel, + rather than a bunch of 0xff due to the device being powered off. + + drop gratuitous '&'. + + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit 22746df15b5f75dc85f5cf5b73932eb8a44cb89b +Author: Dave Airlie +Date: Thu Sep 6 16:33:54 2012 +1000 + + dri2: invalidate drawable after sharing pixmap + + After we share the pixmap, the backing storage may have changed, + and we need to invalidate and buffers pointing at it. + + This fixes GL compositors and prime windows lacking contents initially. + + Reviewed-by: Chris Wilson + Signed-off-by: Dave Airlie + +commit f0bad69edd57facd6cffde8cb0863d1a735e2492 +Author: Keith Packard +Date: Wed Sep 5 14:45:08 2012 -0700 + + Version bumped to 1.13 + + Signed-off-by: Keith Packard + +commit 856f80c8d7f22b979c72d9c70b70187df6004a03 +Merge: 0db936a b8ab93d +Author: Keith Packard +Date: Wed Sep 5 11:02:58 2012 -0700 + + Merge remote-tracking branch 'jeremyhu/master' + +commit 0db936a5b7125d9b73633733cb34e5e4b72f01e8 +Author: Dave Airlie +Date: Mon Sep 3 15:09:36 2012 +1000 + + xf86: call enter/leave VT for gpu screens as well + + Otherwise we can't do fast user switch properly for multiple GPUs. + + Reviewed-by: Alex Deucher + Signed-off-by: Dave Airlie + +commit 18deac48db0d2387242461025904eb28a0f71fac +Author: Dave Airlie +Date: Mon Aug 27 15:17:21 2012 +1000 + + config/udev: respect seat for hotplugged video devices. + + This respects the seat tag for hotplugged video devices at X start. + + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit ec740cffeba59216f4293fba829097654cde3b11 +Author: Dave Airlie +Date: Mon Aug 27 15:15:19 2012 +1000 + + config/udev: add wrapper around check if server is not seat 0 + + this is a simple clean-up that is useful to stop further propogation + of this construct. + + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit 49ec57d5094be0dd2b67435ac7bb04ead780f36d +Author: Dave Airlie +Date: Fri Aug 24 13:23:01 2012 +1000 + + dix: free default colormap before screen deletion + + If we don't free this here, it gets freed later in the resource + cleanups, however it then looks up up pmap->pScreen, which we + freed already in this function. So free the default colormap + when we should. + + This fixes a bug after a couple of hotplug cycles when you try + to exit the X server and it crashes. + + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit 20f601a0fbc01a4f8ab85e54ee45f78f7817cdb5 +Author: Dave Airlie +Date: Fri Aug 24 12:56:18 2012 +1000 + + xf86/crtc: don't free config->name + + This is set by pre_init not screen init, so if we free it here + and then recycle the server, we lose all the providers. + + I think we need to wrap FreeScreen here to do this properly, + will investigate for 1.14 most likely, safer to just leak this + on server exit for now. + + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit b8ab93dfbc7f292b5bfe7e9113e1af824ccbd1a8 +Author: Jeremy Huddleston Sequoia +Date: Tue Aug 28 10:06:51 2012 -0700 + + list: Use offsetof() and typeof() to determine member offsets within a structure + + Some compilers have difficulty with the previous implementation which + relies on undefined behavior according to the C standard. Using + offsetof() from (which most likely just uses + __builtin_offsetof on modern compilers) allows us to accomplish this + without ambiguity. + + This fix also requires support for typeof(). If your compiler does not + support typeof(), then the old implementation will be used. If you see + failures in test/list, please try a more modern compiler. + + v2: Added fallback if typeof() is not present. + + Signed-off-by: Jeremy Huddleston Sequoia + Reviewed-by: Peter Hutterer + +commit 148583d62b84832369e9df39b3e527b99ca96761 +Author: Peter Hutterer +Date: Wed Aug 29 09:11:35 2012 +1000 + + tests: move GCC diagnostics pragma outside of function + + This is a a gcc 4.6+ feature. + + signal-logging.c:210: error: #pragma GCC diagnostic not allowed inside + functions + + Signed-off-by: Peter Hutterer + Reviewed-by: Dave Airlie + Signed-off-by: Keith Packard + +commit c75c947b6e9bc725821b28835f3667c4aabef9ee +Author: Jeremy Huddleston Sequoia +Date: Tue Aug 28 12:43:55 2012 -0700 + + test/list: Fix test_xorg_list_del test + + We never use child[2], so it's state is undefined. + + This issue seems to have existed since the test was first + written: 92788e677be79bd04e5ef140f4ced50ad8b1bf8e + + Signed-off-by: Jeremy Huddleston Sequoia + Reviewed-by: Peter Hutterer + +commit 486038fe16957b39d39842365c5409c494c9a8df +Author: Jeremy Huddleston Sequoia +Date: Mon Aug 27 22:35:51 2012 -0700 + + XQuartz: Bump Info.plist version to 2.7.4 + + Signed-off-by: Jeremy Huddleston Sequoia + +commit b90b3f6eac34616c46ab693fafbf6b73a04f407b +Author: Jeremy Huddleston Sequoia +Date: Mon Aug 27 17:15:19 2012 -0700 + + test: Make os test more compliant + + sighandler_t is not UNIX. + + Regression from: 7f09126e068015db54c56bb982b8f91065375700 + + Signed-off-by: Jeremy Huddleston Sequoia + Reviewed-by: Peter Hutterer + +commit a557edca6152ad09c685a00e01534c35a1f00f2e +Merge: 6619f5c 24ffcfc +Author: Keith Packard +Date: Mon Aug 27 08:06:09 2012 -0700 + + Merge remote-tracking branch 'whot/for-keith' + +commit 24ffcfcded6b4b024958801e8a6cecad36d9a3e3 +Author: Peter Hutterer +Date: Mon Aug 20 10:28:26 2012 +1000 + + os: fix typo, fsync when WIN32 is _not_ defined + + Introduced in 164b38c72fe9c69d13ea4f9c46d4ccc46566d826 + + Reported-by: Jon TURNEY + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit d53e6e02a2595ced1882f5fcd34d08ea039b3b85 +Author: Peter Hutterer +Date: Thu Aug 16 13:54:42 2012 +1000 + + mi: don't check for core events in miPointerSetPosition (#53568) + + As of 81cfe44b1ed0de84ad1941fe2ca74bebef3fc58d, miPointerSetPosition now + returns the screen pointer of the device. This broke floating slave devices, + as soon as a motion event was submitted, miPointerSetPosition returned NULL, + crashing the server. + + dev->coreEvents is only false if the device is a floating slave, in which + case it has a sprite. + + X.Org Bug 53568 + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit 6619f5c0e1086b57888ff7146e8ed5897b50d440 +Author: Keith Packard +Date: Tue Aug 21 13:46:34 2012 -0700 + + Relase 1.12.99.905 + + RC with updated ABI version numbers. + + Signed-off-by: Keith Packard + +commit bafbd99080be49a17be97d2cc758fbe623369945 +Author: Peter Hutterer +Date: Wed Aug 8 11:34:32 2012 +1000 + + dix: work around scaling issues during WarpPointer (#53037) + + In WarpPointer calls, we get input in screen coordinates. They must be + scaled to device coordinates, and then back to screen coordinates for screen + crossing and root coordinates in events. + + The rounding errors introduced (and clipping in core/XI 1.x events) can lead + to the actual position being different to the requested input coordinates. + e.g. 200 scales to 199.9999, truncated to 199 in the event. + + Avoid this by simply overwriting the scaled screen coordinates with the + input coordinates for the POINTER_SCREEN case. + + X.Org Bug 53037 + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit 1ebba43052d68d874148e63c9ae38489ddfc5ec1 +Author: Peter Hutterer +Date: Wed Aug 15 14:49:04 2012 +1000 + + os: don't block signal-unsafe logging, merely warn about it. + + Throw an error into the log file, but continue anyway. And after three + warnings, stop complaining. Not all input drivers will be fixed in time (or + ever) and our printf implementation is vastly inferior, so there is still a + use-case for non-sigsafe logging. + + This also adds more linebreaks to the message. + + CC: Chase Douglas + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + +commit 4912b4adb666dad96b832ab2d7caaae49808723e +Author: Peter Hutterer +Date: Mon Aug 13 14:44:44 2012 +1000 + + os: add support for %d and %i to pnprintf + + The mouse driver uses %i in some debug messages + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + +commit 7f8c39c8b5ef89153ecd84d16331e96d8feb18ef +Author: Peter Hutterer +Date: Mon Aug 13 14:24:36 2012 +1000 + + Add FormatInt64 to convert signed integers in signal-safe manner + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + +commit 36c1d92ec0ef0f3927034a12d4cb79dcc22bd185 +Author: Peter Hutterer +Date: Mon Aug 13 12:24:39 2012 +1000 + + test: add a few tests for signal-safe logging + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + +commit b69536b475118a8787c1726355b504207bf83f8f +Author: Peter Hutterer +Date: Mon Aug 13 11:15:54 2012 +1000 + + test: assert from signal-safe number conversion + + Throw an assert when the conversion fails instead of just returning. Asserts + are more informative. + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + +commit 3e091e1075dc29120e54ab2ef110b04ce7383ffd +Author: Aaron Plattner +Date: Fri Aug 17 11:26:05 2012 -0700 + + xfree86: Bump extension ABI to 7.0 + + Commit 9d457f9c55f12106ba44c1c9db59d14f978f0ae8 added an array of + DevPrivateSetRec structures in the middle of the ScreenRec, which throws off + extension modules trying to call things like pScreen->DestroyPixmap. + + Signed-off-by: Aaron Plattner + Signed-off-by: Keith Packard + +commit ac616d8ed5a634c6b32775eb7b071a13c575fd97 +Author: Jeremy Huddleston Sequoia +Date: Thu Aug 16 19:09:42 2012 -0700 + + XQuartz: Use asl_log_descriptor for children as well + + This change is #if'd out due to a bug in asl_log_descriptor, but + it is left here as reference to be enabled in the future. + + Signed-off-by: Jeremy Huddleston Sequoia + +commit ad123071e54d890d36d1373f59b8a6eb4937e936 +Author: Jeremy Huddleston Sequoia +Date: Thu Aug 16 13:02:28 2012 -0700 + + XQuartz: Use asl_log_descriptor on Mountain Lion + + Signed-off-by: Jeremy Huddleston Sequoia + +commit 7c3d2e4828deb4e8ec38e8ef88d6f92b2d931033 +Author: Jeremy Huddleston Sequoia +Date: Thu Aug 16 19:42:54 2012 -0700 + + XQuartz: console_redirect: Properly zero-out the tail of the array on realloc() + + We forgot to multiply by sizeof(), so it wasn't fully zeroed out. + + Signed-off-by: Jeremy Huddleston Sequoia + +commit a32e01802ff1c938c0afe0cc007a273b9ada8610 +Author: Jeremy Huddleston Sequoia +Date: Thu Aug 16 15:43:34 2012 -0700 + + XQuartz: console_redirect: Set the correct location for reading into the buffer + + Prior to this change, it was possible that a large message would have some + of its data prepended to subsequent messages due to our not incorrectly + setting the location to write into the buffer. + + Signed-off-by: Jeremy Huddleston Sequoia + +commit ad5fe2d9614959b68bf71e23abf7e5abac9c2734 +Merge: 16d8da5 99b94af +Author: Keith Packard +Date: Wed Aug 15 13:29:17 2012 -0700 + + Merge remote-tracking branch 'jeremyhu/master' + +commit 16d8da5ca99211bd180f532d78d7c5943d38c8ad +Author: Paul Berry +Date: Tue Jul 31 15:15:56 2012 -0700 + + glx: Skip multisampled configs when matching pre-existing X visuals. + + In __glXScreenInit() we generate the set of GLX visuals in two steps: + first we match each pre-existing X visual with a corresponding + FBConfig, then we generate a new X visual to correspond to all the + remaining FBConfigs. + + The first step is used for the two default 24-bit visuals (true color + and direct color) and for the 32-bit visual. If windowsystem + multisampling is enabled in Mesa, we need to ensure that none of these + three visuals gets matched to a multisampled config. + + Fixes a bug with windowsystem multisampling in gnome-shell. If the X + server happens to match up a multisampled FBConfig to the 32-bit + visual, gnome-shell will try to use it to read pixels from + alpha-blended windows (such as gnome-terminal), resulting in no window + appearing on screen. + + Reviewed-by: Ian Romanick + Reviewed-by: Chad Versace + Signed-off-by: Keith Packard + +commit 99b94af1ffbef7047f88e7d6c594242d172bec02 +Author: Jeremy Huddleston +Date: Wed Aug 15 10:28:16 2012 -0700 + + XQuartz: Fix build regression for GlxExtensionInit + + quartz.c:153:6: error: use of undeclared identifier 'GlxExtensionInit'; did you mean 'GEExtensionInit'? [Semantic Issue] + {GlxExtensionInit, "GLX", &noGlxExtension}, + + Regression-from: aad428b8e21c77397c623b78706eb64b1fea77c9 + Signed-off-by: Jeremy Huddleston + +commit c0540b4c8db676d18a9a09828f1590b0b16f9ebc +Author: Keith Packard +Date: Tue Aug 7 17:49:48 2012 -0700 + + Kludge -- Call RandR screen before cleaning up xf86 crtcs + + The core RandR screen cleanup now involves cleaning up any GPU screen + associations, and those call down into DDX to clean up the driver. If + the pointers from the xf86 structures back to the core randr + structures are set to NULL at that point, bad things happen. + + This patch "knows" that the core RandR close screen is underneath the + xf86 randr close screen function, and so makes sure it gets called + first. + + Signed-off-by: Keith Packard + Reviewed-by: Dave Airlie + +commit 288b87e42cbb5db34cda848143655e84af8455da +Author: Keith Packard +Date: Tue Aug 7 17:49:47 2012 -0700 + + Close GPU screens before core screens + + This should make cleaning up the GPU screens easier as the core + screens they are associated with will still be around. + + Signed-off-by: Keith Packard + Reviewed-by: Dave Airlie + +commit 19772670e3041fe1c7f5bbf32fa039a6d8245ccb +Author: Keith Packard +Date: Tue Aug 7 17:49:46 2012 -0700 + + Only free Render filter names on last screen close + + Hotplugging screens causes the render filter names to get freed while + still in use; wait for the last core screen to be closed before + freeing them. That only happens at server reset, when we want them to + be freed. + + Signed-off-by: Keith Packard + Reviewed-by: Dave Airlie + +commit 863d528a9f76d0e8f122aebf19f8564a4c67a938 +Author: Simon Schubert <2@0x2c.org> +Date: Sun Aug 12 09:40:16 2012 -0700 + + fb: reorder Bresenham error correction to avoid overshoot. + + When fbBresSolid draws a line, it can happen that after the last + pixel, the Bresenham error term overflows, and fbBresSolid paints + another pixel before adjusting the error term. + + However, if this happens on the last pixel (len=0), this extra pixel + might overshoot the boundary, and, in rare cases, lead to a segfault. + + Fix this issue by adjusting for the Bresenham error term before + drawing the main pixel, not after. + + Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=24274 + Signed-off-by: Simon Schubert <2@0x2c.or> + Tested-by: Mitch Davis + Signed-off-by: Matt Turner + Signed-off-by: Keith Packard + +commit c22c936b35cee60609041ccb7ee52c00b0634d7b +Author: Keith Packard +Date: Tue Aug 7 16:04:25 2012 -0700 + + Release 1.12.99.904 + + Closing the non-critical bug window for 1.13 + + Signed-off-by: Keith Packard + +commit f94ec283efc922106e7ea1d85771950c66ee8f3b +Author: Keith Packard +Date: Tue Aug 7 16:18:21 2012 -0700 + + Distribute include/glx_extinit.h + + This changed should have been in aad428b8e21c77397c623b78706eb64b1fea77c9 + + Signed-off-by: Keith Packard + +commit 9ca67de8feab59fcf7d6e3fdec8d8a7cfbb21651 +Author: Julien Cristau +Date: Sat Jul 14 16:07:51 2012 +0200 + + Bump glproto requirement to 1.4.16 + + Signed-off-by: Julien Cristau + Reviewed-by: Dave Airlie + Signed-off-by: Keith Packard + +commit 02f94b2d446f6700f791f318c551ac835af8445a +Merge: 360fa77 7f09126 +Author: Keith Packard +Date: Mon Aug 6 16:52:12 2012 -0700 + + Merge remote-tracking branch 'whot/for-keith' + +commit 360fa7736b214cae3ccd39feb4dc87b9e7e9734c +Merge: 2100e72 ac09a4a +Author: Keith Packard +Date: Mon Aug 6 16:42:34 2012 -0700 + + Merge remote-tracking branch 'airlied/for-keithp' + +commit 2100e72388a3dc174093d80c9723f021b4614d17 +Merge: 4a6f42d c37c650 +Author: Keith Packard +Date: Mon Aug 6 16:40:54 2012 -0700 + + Merge remote-tracking branch 'alanc/master' + +commit 7f09126e068015db54c56bb982b8f91065375700 +Author: Peter Hutterer +Date: Fri Aug 3 15:36:34 2012 +1000 + + os: don't unconditionally unblock SIGIO in OsReleaseSignals() + + Calling OsReleaseSignal() inside the signal handler releases SIGIO, causing + the signal handler to be called again from within the handler. + + Practical use-case: when synaptics calls TimerSet in the signal handler, + this causes the signals to be released, eventually hanging the server. + + Regression introduced in 08962951de. + + Signed-off-by: Peter Hutterer + Reviewed-by: Jeremy Huddleston + +commit cb306a8f174bec9ded95191b91797f59250e6808 +Author: Peter Hutterer +Date: Tue Jul 31 16:09:38 2012 +1000 + + dix: make sure the mask is set for emulated scroll events (#52508) + + If a device has smooth scrolling axes, but submits scroll button events, we + convert those to motion events and update the valuators. For legacy button + events, the valuator mask is likely unset though, causing + add_to_scroll_valuator() to return early, leaving us with an empty mask. + That again skipped the rest of the code and no events were generated. + + Fix it by making sure that the scroll valuator in the mask is at least + initialized to 0. + + Broke evdev wheel emulation, introduced by + 54476b5e4461ff523e935961affabcf0de12c556. + + X.Org Bug 52508 + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + +commit 4a6f42dda00ba3b5616f8a86f0d4c9a652c7d9d4 +Author: Adam Jackson +Date: Mon Jul 23 16:34:28 2012 -0400 + + sync: Fix logic error from b55bf248581dc66321b24b29f199f6dc8d02db1b + + That commit adds two hunks, and I _think_ they're backwards. It adds + code to modify bracket_greater on NegativeTransition triggers, and + bracket_less on PositiveTransition triggers. That breaks symmetry with + the surrounding code; the code as of this commit could probably be + simplified further. + + I can't keep the sync trigger rules in my head for more than about five + minutes at a time, so I'm sending this on for more eyes. RHEL 6.3's + xserver is shipping with b55bf248 reverted: + + https://bugzilla.redhat.com/show_bug.cgi?id=748704#c33 + + And there appear to be some upstream reports of the same issue: + + https://bugzilla.gnome.org/show_bug.cgi?id=658955 + + So I'd like to get this sorted out. + + Signed-off-by: Adam Jackson + Reviewed-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 454d0e3a1bb14d7f2579ccb5e513cec5686160e7 +Author: Dave Airlie +Date: Thu Jul 26 12:56:51 2012 +1000 + + randr: fix xinerama output for output slaves + + This fixes the xinerama geometry when output slaves are enabled. + + Tested with xdpyinfo -ext XINERAMA before after slave added. + + Signed-off-by: Dave Airlie + Signed-off-by: Keith Packard + +commit ac09a4a091a43188241365152e1244fd8fd93ee7 +Author: Dave Airlie +Date: Fri Aug 3 16:43:22 2012 +1000 + + dri2: fix master pixmap free and reset pointer + + These are two minor changes, one to reset the pointer to NULL, + after freeing the pixmaps, one to make sure we use the right API for + the master pixmap, though I doubt it'll ever really matter. + + Signed-off-by: Dave Airlie + Reviewed-by: Alex Deucher + +commit 64623ef90db649e89345f71871affe7a9606f6ea +Author: Dave Airlie +Date: Fri Aug 3 16:42:44 2012 +1000 + + dri2: free slave pixmap on app exit + + When the drawable disappears we need to free the prime master/slave combos. + + This fixes a leak after a prime app is run. + + Signed-off-by: Dave Airlie + Reviewed-by: Alex Deucher + +commit 1a465fef9bc21142eecca3999f0761a3c0501a09 +Author: Dave Airlie +Date: Fri Aug 3 16:41:45 2012 +1000 + + pixmap: have slave pixmap take a reference on master pixmap + + Since the free routines free the master pixmap then the slave, we should + be taking a reference when we bind them together. + + Fixes a use-after-free when resizing a primed gears. + + Signed-off-by: Dave Airlie + Reviewed-by: Alex Deucher + +commit c37c65052f674cd58894ad0b9ec22928a62c624e +Author: Alan Coopersmith +Date: Mon Jul 16 21:12:06 2012 -0700 + + Make indentation of dix/tables.c much more consistent and readable + + Signed-off-by: Alan Coopersmith + Acked-by: Daniel Stone + +commit 9f7ef7f7f0566f6319d8328ce0a1e6d0fa866720 +Author: Alan Coopersmith +Date: Mon Jul 16 20:53:00 2012 -0700 + + Fix up formatting of initializers for arrays of structs + + The indenter seems to have gotten confused by initializing arrays of + structs with the struct defined inline - for predefined structs it did + a better job, so match that. + + Signed-off-by: Alan Coopersmith + +commit c7b7abfaa068042e396d19538215402cfbb4f1e4 +Author: Alan Coopersmith +Date: Sat Jul 14 11:21:15 2012 -0700 + + RRModeCreate: plug memory leak of newModes if AddResource fails + + Reported by parfait 1.0: + + Error: Memory leak (CWE 401) + Memory leak of pointer 'newModes' allocated with realloc(((char*)modes), ((num_modes + 1) * 8)) + at line 93 of randr/rrmode.c in function 'RRModeCreate'. + pointer allocated at line 82 with realloc(((char*)modes), ((num_modes + 1) * 8)). + Error: Memory leak (CWE 401) + Memory leak of pointer 'newModes' allocated with malloc(8) + at line 93 of randr/rrmode.c in function 'RRModeCreate'. + pointer allocated at line 84 with malloc(8). + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + +commit 1eb7be863353be2cf3e83738253eb60c5fe49d19 +Author: Alan Coopersmith +Date: Sat Jul 14 09:29:52 2012 -0700 + + rrproperty.c: free newly allocated prop in more error paths + + Reported by parfait 1.0: + + Error: Memory leak (CWE 401) + Memory leak of pointer 'prop' allocated with RRCreateOutputProperty(property) + at line 220 of randr/rrproperty.c in function 'RRChangeOutputProperty'. + 'prop' allocated at line 154 with RRCreateOutputProperty(property). + prop leaks when pending != 0 at line 160. + Error: Memory leak (CWE 401) + Memory leak of pointer 'prop' allocated with RRCreateOutputProperty(property) + at line 346 of randr/rrproperty.c in function 'RRConfigureOutputProperty'. + 'prop' allocated at line 334 with RRCreateOutputProperty(property). + at line 350 of randr/rrproperty.c in function 'RRConfigureOutputProperty'. + 'prop' allocated at line 334 with RRCreateOutputProperty(property). + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + +commit 42e655de4d95cb108aec50efec6bbdb709bb13d7 +Author: Alan Coopersmith +Date: Tue Jul 10 23:29:53 2012 -0700 + + rrproviderproperty.c: free newly allocated prop in more error paths + + Reported by parfait 1.0: + + Error: Memory leak (CWE 401) + Memory leak of pointer 'prop' allocated with RRCreateProviderProperty(property) + at line 221 of randr/rrproviderproperty.c in function 'RRChangeProviderProperty'. + 'prop' allocated at line 155 with RRCreateProviderProperty(property). + prop leaks when pending != 0 at line 161. + + Error: Memory leak (CWE 401) + Memory leak of pointer 'prop' allocated with RRCreateProviderProperty(property) + at line 345 of randr/rrproviderproperty.c in function 'RRConfigureProviderProperty'. + 'prop' allocated at line 333 with RRCreateProviderProperty(property). + at line 349 of randr/rrproviderproperty.c in function 'RRConfigureProviderProperty'. + 'prop' allocated at line 333 with RRCreateProviderProperty(property). + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + +commit 94b514d5e4b376d05e106eb3853da511256e8545 +Merge: 7d87545 7328900 +Author: Keith Packard +Date: Mon Aug 6 15:13:17 2012 -0700 + + Merge remote-tracking branch 'whot/for-keith' + +commit 7d87545ba7395ade507cca7bdca7052b26ed18d8 +Merge: ad707a7 988d7ac +Author: Keith Packard +Date: Mon Aug 6 15:11:13 2012 -0700 + + Merge remote-tracking branch 'jturney/master' + +commit ad707a7dcc65c30e030c7600b54f734090e56a91 +Merge: 5a51cb8 884f51e +Author: Keith Packard +Date: Mon Aug 6 15:08:01 2012 -0700 + + Merge remote-tracking branch 'jeremyhu/master' + +commit 5a51cb86f39a6809305c403beea54c3625e36259 +Author: Keith Packard +Date: Tue Jul 10 23:09:47 2012 -0700 + + xfree86: When xf86CrtcCloseScreen is called, the randr CRTCs are gone + + The RandR CRTC structures are freed when their resource IDs are + destroyed during server shut down, which is before the screen is + closed. Calling back into RandR with stale pointers just segfaults the + server. + + Signed-off-by: Keith Packard + Reviewed-by: Dave Airlie + Tested-by: Knut Petersen + +commit 1bf81af4a6be1113bcc3b940ab264d5c9e0f0c5d +Author: Rui Matos +Date: Mon Jul 30 14:32:12 2012 -0400 + + xf86RandR12: Don't call ConstrainCursorHarder() if panning is enabled + + Panning is at odds with CRTC cursor confinement. This disables CRTC cursor + confinement as long as panning is enabled. + + Fixes regression introduced in 56c90e29f04727c903bd0f084d23bf44eb1a0a11. + + Reviewed-by: Adam Jackson + Signed-off-by: Rui Matos + Signed-off-by: Keith Packard + +commit ff56f88616aa63797384c2c484b2bd0f194df96a +Author: Adam Jackson +Date: Mon Jul 30 14:32:11 2012 -0400 + + randr: Fix up yet another corner case in preferred mode selection + + Let's say - purely for the sake of argument, mind you - that you had a + server GPU with anemic memory bandwidth, and you walked up to it and + plugged in a monitor that was 1920x1080 because that's what happened to + be on the crash cart. Say the memory bandwidth is such that anything + larger than 1280x1024 gets filtered away. Now you're in trouble, + because the established timings section includes a 720x400 mode because + that's what DOS 80x25 is, and that happens to just about match the + physical aspect ratio. + + Instead let's reuse the logic from the existing aspect-match path: pick + the larger mode of either the physical aspect ratio or 4:3. + + Reviewed-by: Julien Cristau + Signed-off-by: Adam Jackson + Reviewed-by: Alex Deucher + Signed-off-by: Keith Packard + +commit 531785dd746d64ef7f473a83ca73bb20e74b6fca +Author: Dave Airlie +Date: Mon Jul 30 14:32:10 2012 -0400 + + kinput: allocate enough space for null character. + + This code wasn't allocating enough space and was assigning the NULL + one past the end. + + Pointed out by coverity. + + Reviewed-by: Jeremy Huddleston + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + Signed-off-by: Keith Packard + +commit 8843aed82e7d69422e7763a35832a2be8f26723f +Author: Vic Lee +Date: Mon Jul 30 14:32:09 2012 -0400 + + ephyr: Resize screen automatically when parent window is resized + + Bugzilla: https://bugs.freedesktop.org/25804 + Reviewed-by: Adam Jackson + Signed-off-by: Vic Lee + Signed-off-by: Keith Packard + +commit b46bbafae6d0a8b3f2f7853d5c1475fc223b1ed6 +Author: Adam Jackson +Date: Mon Jul 30 14:32:08 2012 -0400 + + ephyr: Fix up some bizarre formatting + + Signed-off-by: Adam Jackson + Signed-off-by: Keith Packard + +commit 7328900042b9c1312aed48753fd6054e64613e4c +Author: Alan Coopersmith +Date: Mon Jul 30 23:37:06 2012 -0700 + + XIChangeDeviceProperty: free newly allocated prop when SetProperty fails + + Reported by parfait 1.0: + + Error: Memory leak (CWE 401) + Memory leak of pointer 'prop' allocated with XICreateDeviceProperty(property) + at line 774 of Xi/xiproperty.c in function 'XIChangeDeviceProperty'. + 'prop' allocated at line 700 with XICreateDeviceProperty(property). + prop leaks when handler != NULL at line 768 + and handler->SetProperty != NULL at line 769 + and checkonly != 0 at line 772 + and rc != 0 at line 772. + + Signed-off-by: Alan Coopersmith + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 4dbbcdf64563cb95f83c04b2442cb7e868384264 +Author: Daniel d'Andrada +Date: Thu Jul 26 17:31:57 2012 -0300 + + Do sent TouchEnd to listeners that don't own an accepted touch + + When the owner of a touch accepts it, the other listeners must + receive a TouchEnd. + + Even though there's code implementing the logic above in + ProcessTouchOwnershipEvent(), DeliverTouchEndEvent() was refusing to send + those TouchEnd events in this situatuation. + + Signed-off-by: Daniel d'Andrada + Reviewed-by: Chase Douglas + Signed-off-by: Peter Hutterer + +commit 02d91ccb0955252153206061a44340f051077624 +Author: Peter Hutterer +Date: Thu Jun 21 15:42:17 2012 +1000 + + test: always add DIX_LIB and OS_LIB on XORG builds + + With --disable-xorg, We also disabled a bunch of tests because of their + perceived reliance on a DDX. The cause was libtool missing some object files + that never ended up in libxservertest.la. Only the xfree86 test has a true + dependency on XORG. + + DIX_LIB was pointing to dix.O (instead of libdix.la) when + DTRACE_SPECIAL_OBJECTS was defined. libdix.la should be part of XSERVER_LIBS + but dix.O is not a recognised libtool object, so it got skipped for + libxservertest.a. Only in the XORG case would we add DIX_LIB and OS_LIB + manually, thus forcing linkage with the dtrace-generated objects. + + Fixing this by packaging up the dtrace-generated files as part of + libdix.la/libos.la doesn't work for Solaris (and possible others), so simply + always force linkage against the DIX_LIB/OS_LIB in the case of dtrace objects. + + Signed-off-by: Peter Hutterer + Reviewed-by: Alan Coopersmith + Tested-by: Alan Coopersmith + +commit 988d7ace19a009991a4528e783d1a94c2444c66a +Author: Jon TURNEY +Date: Thu Jul 5 09:38:44 2012 +0100 + + glx: Do not report the GLX_INTEL_swap_event extension for indirect swrast + + Commit 84956ca4 bogusly adds GLX_INTEL_swap_event to the extensions reported + by swrast. + + "DRI2 supports this now - and already enables it explicitly - but drisw does + not and should not. Otherwise toolkits like clutter will only ever SwapBuffers + once and wait forever for an event that's not coming." + + (A similar bug for direct swrast is already fixed in mesa commit 25620eb1) + + (Note that this may be papering over the cracks somewhat, as if we do report + GLX_INTEL_swap_event, some clutter apps fail with GLXBadDrawable calling + GLXChangeDrawableAttributes to change the setting of GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK + in the GLX_EVENT_MASK, apparently after the drawable is destroyed, which suggests + a bug with GLXDrawable lifetimes) + + Signed-off-by: Jon TURNEY + Reviewed-by: Jeremy Huddleston Sequoia + +commit fd3d45c137bb849aa9030d732ea9277292e01d3d +Author: Jon TURNEY +Date: Thu Jul 5 09:34:24 2012 +0100 + + glx: Don't note GLX_INTEL_swap_event as being required by GLX 1.4, it isn't. + + Don't note GLX_INTEL_swap_event as being required by GLX 1.4, it isn't. + (This data is not currently used in the server) + + (A similar change is made in mesa commit d3f7597bc9f6d5) + + Signed-off-by: Jon TURNEY + Reviewed-by: Jeremy Huddleston Sequoia + +commit a8464dfa28dea78201e3e4398eb3bcb745e10087 +Author: Colin Harrison +Date: Sun Jul 22 13:15:02 2012 +0100 + + os: Fix TMP fall-back in Win32TempDir() + + Fix Win32TempDir() in the case where we fell back to checking the TMP + environment variable. It looks like this has been wrong since forever. + + Signed-off-by: Colin Harrison + Reviewed-by: Jon TURNEY + +commit f6e7b82acadfca8239edc0f7e72cd0f3f9cfc2c4 +Author: Marc Haesen +Date: Sat Jul 21 21:18:44 2012 +0100 + + hw/xwin: Fixes to pixelFormat <-> fbConfig conversion in WGL mode + + Fix FIXME in fbConfigToPixelFormat() to correctly populate RGBA-mask shift + parameters. Also request colourindex pixelFormats correctly. + + Now that they are requested correctly, don't skip colorindex visuals when + converting pixelFormats to fbConfigs. + + Populate transparent colour information when converting pixelFormat from + DescribePixelFormats() to a fbConfig. + + Signed-off-by: Marc Haesen + Reviewed-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 45c432871d6a244e9e558a6a4e7c36e90764135e +Author: Jon TURNEY +Date: Sat Jul 21 14:13:37 2012 +0100 + + hw/xwin: Introduce winProcessXEventsTimeout() to the concept of fractions of a second + + Oh this is terrible. + + Currently we only compute the select timeout in whole seconds. This means if we + have less than 1 second remaining, we select with a timeout of 0 (i.e. poll) + which causes the task to spin, burning 100% CPU for the remaining timeout (and + possibly preventing the process we are waiting for from running :S) + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 23cd4d0174194e10721d2e465fd1a1c52f001520 +Author: Jon TURNEY +Date: Sat Jul 21 12:33:05 2012 +0100 + + hw/xwin: Fix winUpdateWindowPosition() not to assume WS_EX_APPWINDOW style + + Also improve it's debug output a bit + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 527cf13135cfd279733060e0028bbfbe02be5167 +Author: Jon TURNEY +Date: Sat Jul 21 14:09:16 2012 +0100 + + hw/xwin: Make winOverrideIcon() thread-safe for icon data access + + winOverrideIcon() is called from the internal WM client thread. + + Accessing server-internal data structures to get icon data or window hints is + not safe, as there is no lock to ensure we do not collide with these data + structures being updated in the server thread. + + Rewrite so the internal client thread uses X client calls to obtain this data + safely + + We used to also set the icon inside the server when the window was initially + created. For simplicity, we simply send a message to the internal WM to update + the icon when the window is created (rather than writing different icon update + code which can work in the server thread for that one case...) + + extwm mode used to do the icon update in the server. I'm not sure that actually + made much sense. Let's assume the external WM client can do it instead... + + v2 + Make sure that WM_WM_ICON_EVENT does nothing for override-redirect windows + + v3 + Reinstate check that native window actually has expected properties for an X + window before trying to update it's icon; some auxiliary windows owned by the + XWin process don't, which would cause a crash + + v4 + Various fixes to pixmap icon conversion: + - remove left-over malloc in winScaleXimageToWindowsIcon causing a memory leak + - don't recalculate DDBitmap stride in winScaleXimageToWindowsIcon, when we already have worked it out + - properly check that XGetWindowProperty(NET_WM_ICON) returned some data + - don't try to retrieve WM_HINTS icon_mask if it isn't set + - restore accidentally dropped calculation of effBpp, stride, maskStride of output DDBitmap + - make sure imageMask is zero-initalized before we use it to mask the DDBitmap + + v5 + Remove a left-over unused variable + + v6 + Avoid XDestroyImage(NULL) crash if XGetImage failed for icon_pixmap + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 2677d89823b851fea31036f51589985bb86864b7 +Author: Jon TURNEY +Date: Sun Jul 22 17:38:55 2012 +0100 + + hw/xwin: Also update icon when _NET_WM_ICON property changes + + _NET_WM_ICON property is also considered to decide on the window icon, so also + send a WM_WM_ICON_EVENT message to the WM if the PropertyNotify event is for + _NET_WM_ICON property + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit a07541f1ffc28c57a762beefb96c7bf0ac40b0a4 +Author: Jon TURNEY +Date: Sun Jul 22 16:15:12 2012 +0100 + + hw/xwin: Rename WM_WM_HINTS_EVENT to WM_WM_ICON_EVENT + + WM_WM_HINTS_EVENT only updates the icon, so rename it to WM_WM_ICON_EVENT + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 2a47c91eb382d1ff0fb009a39efa7dc9c6fd5112 +Author: Jon TURNEY +Date: Fri Jul 20 13:51:35 2012 +0100 + + hw/xwin: Refactor Xutf8TextPropertyToString() from GetWindowName() as a separate utility function + + Simplify GetWindowName() by moving UTF-8 to wchar conversion out to it's call + site. This allows us to do extra processing on the window name in future. + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 884f51e9770c9ccd3b38a14ea393ea2c7a5ef235 +Author: Jeremy Huddleston Sequoia +Date: Wed Aug 1 18:46:08 2012 -0700 + + XQuartz: Fix xp_window_bring_all_to_front linking on OS versions with older libXplugin + + Found-by: Tinderbox + Signed-off-by: Jeremy Huddleston Sequoia + +commit b4c2358e0a388730f1beda5d3a12e79755208ce6 +Author: Jeremy Huddleston Sequoia +Date: Wed Aug 1 18:45:43 2012 -0700 + + pbproxy: Fix a warning about a bad method prototype + + x-selection.m:1502:1: warning: method has no return type specified; defaults to 'id' + [-Wmissing-method-return-type,Semantic Issue] + - init + ^ + (id) + 1 warning generated. + + Signed-off-by: Jeremy Huddleston Sequoia + +commit f193907f1b2f8d17dac9b59b7e93ddbb0f4e31ca +Author: Jon TURNEY +Date: Fri Jun 22 14:56:22 2012 +0100 + + Fix pseudoramiX.c compilation without darwin.h + + Signed-off-by: Jon TURNEY + Reviewed-by: Jeremy Huddleston Sequoia + +commit 067931ccce592e319baffa26d4f7380d8d924537 +Author: Jon TURNEY +Date: Mon Jul 23 12:16:36 2012 +0100 + + hw/xquartz: Various fixes for pseudoramiX.c + + Various fixes, applied to panoramiX.c in commit 2b266eda, also need applying to pseudoramiX.c: + Fix panoramiX request and reply swapping + Set window and screen values in panoramix replies + Prevent buffer overrun in ProcPanoramiXGetScreenSize + + These fixes seem to be necessary in order to compile pseudoramiX.c with gcc + + pseudoramiX.c: In function 'ProcPseudoramiXGetState': + pseudoramiX.c:221:56: error: call to 'wrong_size' declared with attribute error: wrong sized variable passed to swap + pseudoramiX.c: In function 'ProcPseudoramiXGetScreenCount': + pseudoramiX.c:250:62: error: call to 'wrong_size' declared with attribute error: wrong sized variable passed to swap + pseudoramiX.c: In function 'ProcPseudoramiXGetScreenSize': + pseudoramiX.c:283:56: error: call to 'wrong_size' declared with attribute error: wrong sized variable passed to swap + pseudoramiX.c:284:57: error: call to 'wrong_size' declared with attribute error: wrong sized variable passed to swap + + Signed-off-by: Jon TURNEY + Reviewed-by: Jeremy Huddleston Sequoia + +commit aad428b8e21c77397c623b78706eb64b1fea77c9 +Author: Dave Airlie +Date: Thu Jul 26 09:54:08 2012 +1000 + + glx: drop GLX_LIBS from X server and workaround sdksyms. + + We've had reports of two copies of the GLX bits, one in the server + and one in libglx.so causing problems, I didn't understand why the + X server needed a copy so drop it, however then we have to fix a missing + GlxExtensionInit that comes from sdksyms, so work around it by moving + that one declaration into a header that sdksyms doesn't scan. + + Thanks to Jon Turney for debugging the actual problem. + (copyright header from extinit.h that seems most appropriate put on top). + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52402 + Tested-by: Peter Hutterer + Reviewed-by: Daniel Stone + Tested-by: Jon TURNEY + Signed-off-by: Dave Airlie + Signed-off-by: Keith Packard + +commit afa53fe7cffd430cf11f25ca818cb955a78c0c1c +Author: Keith Packard +Date: Wed Jul 25 14:29:48 2012 -0700 + + Version 1.12.99.903 (1.13 RC3) + + Signed-off-by: Keith Packard + +commit 98e3f3fde35ca805d44ee38394bfd86058f9f4b8 +Author: Adam Jackson +Date: Thu Jul 19 15:00:05 2012 -0400 + + doc: Drop XAA references from xorg.conf man page + + Signed-off-by: Adam Jackson + Reviewed-by: Dave Airlie + Reviewed-by: Alan Coopersmith + Reviewed-by: Alex Deucher + Reviewed-by: Daniel Stone + Acked-by: Aaron Plattner + Signed-off-by: Keith Packard + +commit dea928477bf835a13b2bd2b16c0dbaaf5468130c +Author: Adam Jackson +Date: Thu Jul 19 15:00:04 2012 -0400 + + xfree86: Drop some dead XAA decls from SDK headers + + Signed-off-by: Adam Jackson + Reviewed-by: Dave Airlie + Reviewed-by: Alan Coopersmith + Reviewed-by: Alex Deucher + Reviewed-by: Daniel Stone + Acked-by: Aaron Plattner + Signed-off-by: Keith Packard + +commit a44a379a2a4c198dbd6ffd6cc0db376f8fb64327 +Author: Adam Jackson +Date: Thu Jul 19 15:00:03 2012 -0400 + + cw: Remove + + XAA was the only consumer. + + Signed-off-by: Adam Jackson + Reviewed-by: Dave Airlie + Reviewed-by: Alan Coopersmith + Reviewed-by: Alex Deucher + Reviewed-by: Daniel Stone + Acked-by: Aaron Plattner + Signed-off-by: Keith Packard + +commit 20b4d90f32b3ca5def5be2fdf04a91ae6c47f125 +Merge: 83df169 fd228d3 +Author: Keith Packard +Date: Wed Jul 25 13:52:35 2012 -0700 + + Merge remote-tracking branch 'jeremyhu/master' + +commit fd228d318428d0d9dea52ca560a9b66660dd2d02 +Author: Jeremy Huddleston +Date: Wed Jul 25 11:40:33 2012 -0700 + + XQuartz: Call xp_window_bring_all_to_front if available in libXplugin + + Signed-off-by: Jeremy Huddleston + +commit 83df169538bddcf3a61e2c5e02a4f3e10af93b60 +Author: Aaron Plattner +Date: Fri Jul 20 00:59:20 2012 -0700 + + dix: don't use "new" as a parameter name + + "new" is a reserved word in C++. + + Signed-off-by: Aaron Plattner + Reviewed-by: Alan Coopersmith + Signed-off-by: Keith Packard + +commit 3b7f313b3d74f9df876152c55d55cbb339bf2d02 +Author: Jeremy Huddleston +Date: Tue Jul 24 00:32:30 2012 -0700 + + XQuartz: Fix runtime regressions introduced by extension loading changes + + * GLX is now loaded + * PseudoramiX loading is back in miinitext. It needs to be loaded + before RandR. + + Regression-from: 27a624bee66d2797eacf90317054207dcf248028 + Regression-from: 5f5bbbe543f65c48ecbb5cce80116a86ca3fbe86 + + Signed-off-by: Jeremy Huddleston + +commit 0d64e881a31d89d28f2ded9b8e83e93632870a16 +Author: Jeremy Huddleston +Date: Mon Jul 23 23:16:29 2012 -0700 + + XQuartz: Build fix for __GLXscreen::createContext changes + + Regression-from: 96d74138b1c0273e88933220d99a893858b649cd + + Signed-off-by: Jeremy Huddleston + +commit 77de2994774e7be24a0bad521180628feb1027c6 +Author: Keith Packard +Date: Tue Jul 17 15:47:39 2012 -0700 + + Bump to version 1.12.99.902 + + Signed-off-by: Keith Packard + +commit beeea70495a8d5c4afc1b1eb2cc06a24ab1a986d +Merge: 6e438a0 6910280 +Author: Keith Packard +Date: Tue Jul 17 12:17:39 2012 -0700 + + Merge remote-tracking branch 'alanc/master' + +commit 6e438a0e183f5a6c22070746c038af53d5b935ca +Merge: 5884e7d 75966a4 +Author: Keith Packard +Date: Tue Jul 17 12:12:53 2012 -0700 + + Merge remote-tracking branch 'jturney/master' + +commit 75966a4186955f3a4625e93796145036c5986d2e +Author: Keith Packard +Date: Fri Jul 13 14:36:25 2012 -0700 + + xwin: Clean up os wrappers for System, Popen and Pclose on Windows + + Popen and Pclose are never used on Windows, so don't bother to even + try to define them. + + System(s) was defined as system(s), but the two users of that + function are in xkb, which carefully redefines that as + Win32System. Move Win32System and Win32TempDir to os/utils.c, renaming + Win32System to be just System, which simplifies the xkb code + + Signed-off-by: Keith Packard + Reviewed-by: Jon TURNEY + +commit 6910280297ab610100dd8e7fbe5bb5cc08968f2f +Author: Alan Coopersmith +Date: Sat Jul 14 10:54:36 2012 -0700 + + Use C99 designated initializers in DRI2GetParam replies + + DRI2GetParam was going through review in parallel with main batch of + C99 initialization changes - sync up now that both have landed. + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + +commit a6c5b8d3ee053cadf685b0e4de96407ad6df4dd4 +Author: Alan Coopersmith +Date: Sat Jul 14 10:50:41 2012 -0700 + + Use C99 designated initializers in RandR 1.4 extension Events + + RandR 1.4 was going through review in parallel with main batch of + C99 initialization changes - sync up now that both have landed. + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + +commit ada04ef0ca8a1213e865ba2c000ccd6ed6d0e371 +Author: Alan Coopersmith +Date: Sat Jul 14 10:45:29 2012 -0700 + + Use C99 designated initializers in RandR 1.4 extension Replies + + RandR 1.4 was going through review in parallel with main batch of + C99 initialization changes - sync up now that both have landed. + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + +commit fb73f7f40fa46458990038332017d4496caa0691 +Author: Alan Coopersmith +Date: Sat Jul 14 10:02:52 2012 -0700 + + Fix two more C99 initialization mistakes using members of same struct + + Similar to 34cf559bcf99dad, use temporary variables instead of + referencing members of the struct being initialized in the middle + of the initialization. + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + +commit 5884e7dedecdd82ddbb037360cf9c85143e094b5 +Author: Aaron Plattner +Date: Mon Jul 16 17:40:31 2012 -0700 + + xf86: Re-export extension disable flags + + These flags were unexported by commit a1d41e311c21eb6627caa0d168e070ceaf90806f, + which moved the declarations around and lost the _X_EXPORT attributes in the + process. Since drivers need these and it's late in the release cycle, just + re-export them for now. + + Signed-off-by: Aaron Plattner + Reviewed-by: Andy Ritger + Signed-off-by: Keith Packard + +commit 357ec54f46d31ff77c441c15c322152e04f89a11 +Author: Jon TURNEY +Date: Wed Mar 14 13:58:32 2012 +0000 + + hw/xwin: Refer to xkeyboard-config man page for XKB configuration option values + + Also polish the keyboard configuration text a bit + Include man section number in references to setxkbmap + Consistently refer to 'manual page' rather using both that and 'man page' + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 5940580f8c12145c1ef4c3eee898676b48d95879 +Author: Jörg Mensmann +Date: Tue Apr 17 10:48:19 2012 +0100 + + hw/xwin: Fix command line arguments for multiple monitors. + + Moving Xwin to a certain monitor using "-screen 0 @2" would fail, + printing "ddxProcessArgument - screen - Querying monitors failed". + + This happened since commit 3ead1d810b0e157078db39712e02ea6dc85216d8, + because EnumDisplayMonitor() returns FALSE if its callback function + returns FALSE (which is not clearly documented), and QueryMonitor() + would then also return FALSE. + + Moving back to the old behaviour, where the return value of + EnumDisplayMonitors() is ignored. + + Reviewed-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 18801f5e5a98d80f4811ade8c98df65175b1935a +Author: Jon TURNEY +Date: Fri Feb 10 09:27:16 2012 +0000 + + hw/xwin: Remove unused WindowExposuresProcPtr storage in screen private + + We don't wrap the WindowExposures screen function + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 8fd30859c293035fe505da76d8d7e64131bd5bc0 +Author: Jon TURNEY +Date: Fri Feb 10 13:25:32 2012 +0000 + + hw/xwin: Remove long obsolete README for hw/xwin + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 3568d4af4ff2490e79286d242916e81afed57b58 +Author: Jon TURNEY +Date: Thu Feb 23 22:32:09 2012 +0000 + + hw/xwin: Remove a pointless OS version check in winInstallKeyboardHookLL() + + Checking for OS later than NT4 SP3 (which we didn't do correctly anyhow, + just checking for NT) is pointless when other code in hw/xwin assumes at + least NT 5.0 + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 0ed0d3979050c4ee7bef64441d50c494d58d93b0 +Author: Jon TURNEY +Date: Thu Jul 5 22:08:38 2012 +0100 + + hw/xwin: Remove winClipboardDetectUnicodeSupport() + + This code for detecting if the Windows clipboard can support unicode + is long obsolete. + + All NT versions of Windows support unicode clipboard, so any version + of Windows we can run on must support unicode clipboard. + + The -nounicodeclipboard flag to disable use of unicode on the clipboard + is retained. + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit c98471fad7d85fc9d9959b1c48edd90415f7bf15 +Author: Jon TURNEY +Date: Thu Jul 5 18:00:06 2012 +0100 + + hw/xwin: Consolidate duplicated code as getHwnd() function + + Consolidate code to find the native HWND of an X window, stored in the _WINDOWSWM_NATIVE_HWND + property, duplicated in UpdateName() and PreserveWin32Stack() as getHwnd() + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit df7636dddb4981e14ee7d128c43bb08bdf6a8727 +Author: Jon TURNEY +Date: Thu Jul 5 14:20:52 2012 +0100 + + hw/xwin: Correct function name in log message + + Correct function name in log message winInitializeDefaultScreens -> winInitializeScreenDefaults + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 9cdd3ed07425b222e8197b9a2f57ec1525c6fd54 +Author: Jon TURNEY +Date: Fri Mar 16 12:56:45 2012 +0000 + + hw/xwin: Tidy up some more pointless output which is always emitted + + It's not very useful to log lines like the below when the About.. dialog is used + + winAboutDlgProc - WM_COMMAND - IDOK or IDCANCEL + winAboutDlgProc - WM_CLOSE + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit eb5b4d8d809712053701f057a35bbf5348ac9059 +Author: Colin Harrison +Date: Thu Jul 5 14:03:44 2012 +0100 + + hw/xwin: RANDR resize didn't occur when screen window was maximized or restored + + In windowed mode, with option -resize, RANDR resize was missing when the screen + window was maximized or restored. + + Signed-off-by: Colin Harrison + Reviewed-by: Jon TURNEY + +commit 7e07d61857c5d2ee6e3c36c81b51bb4fe378b5a0 +Author: Jon TURNEY +Date: Thu Jul 5 14:01:03 2012 +0100 + + hw/xwin: Bug fixes for screen sizing when the screen window is on a non-primary monitor + + There is a bug that when the -screen option is used to specify a monitor for + the screen window to be located on, but no explicit size is specified + (and the -multiplemonitors option isn't specified), the screen + window size is always constrained to fit the work area of the primary + monitor (rather than the work area of the specified monitor) + + This gives incorrect results if you want a screen the same size as your + non-primary monitor (e.g. by using -screen 0 @2) and your non-primary + monitor is larger than your primary monitor. + + (This can be worked around by specifying -multiplemonitors and an explicit + screen size the same size as the monitor (e.g. -multiplemonitors -screen 0 + 1600x1200@2)) + + Fix to use work area for the monitor specified for the screen, rather than the + primary monitor work area (unless -multiplemonitors is used, in which case we + continue to use the virtual desktop work area instead) + + Also fix the adjustment for an autohide taskbar, so that it is only done if the + taskbar is on the same monitor as the screen (or -multiplemonitors is used) + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 090856b55b5895ce07f36ddebe6d8f7cb86c1826 +Author: Jon TURNEY +Date: Thu Jul 5 13:19:02 2012 +0100 + + hw/xwin: Tidy up some pointless output which is always emitted + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 9fe9c5f868886abf671b3be3964af1965dd92472 +Author: Jon TURNEY +Date: Sun Feb 13 18:52:52 2011 +0000 + + hw/xwin: Don't bother reporting XORG_VERSION_CURRENT + + Don't bother reporting XORG_VERSION_CURRENT, when we also + report the version number broken down into it's components + XORG_VERSION_MAJOR, XORG_VERSION_MINOR, etc. as well. + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit d5977e5bd2c8ee77db08d5f948f266c9661b9fb5 +Author: Dave Airlie +Date: Fri Jul 13 00:28:19 2012 +1000 + + xf86: include xf86platformBus.h in xf86AutoConfig.c + + This fixes an implicit declaration, + xf86AutoConfig.c:202:5: error: implicit declaration of function 'xf86PlatformMatchDriver' [-Werror=implicit-function-declaration] + xf86AutoConfig.c:202:5: warning: nested extern declaration of 'xf86PlatformMatchDriver' [-Wnested-externs] + + Signed-off-by: Dave Airlie + Reviewed-by: Keith Packard + +commit afa3b9ccd27ff9c58f536cb3b727e85feb6a6f6a +Author: Bartosz Brachaczek +Date: Fri Jul 6 02:52:40 2012 +0200 + + glx: Fix checking GL version + + Signed-off-by: Bartosz Brachaczek + Reviewed-by: Ian Romanick + Signed-off-by: Dave Airlie + +commit 743ccf6fa0a9a4579d6de6d10e2e6040640772d9 +Author: Dave Airlie +Date: Thu Jul 12 19:09:15 2012 +1000 + + glx/dri2: don't return NULL in a function with no return. + + Reported by gcc. + + Reviewed-by: Ian Romanick + Reviewed-by: Matt Turner + Signed-off-by: Dave Airlie + +commit d1a00c26becdc2490ab4660abf108eca09c30d23 +Author: Dave Airlie +Date: Thu Jul 12 19:05:41 2012 +1000 + + glx/dri2: use correct define from dri attribs. + + Looks like idr renamed this and pushed the wrong one. + + Reviewed-by: Ian Romanick + Reviewed-by: Matt Turner + Signed-off-by: Dave Airlie + +commit c62205adcd48d497450655d0136f8ca5bd5cbae7 +Author: Dave Airlie +Date: Thu Jul 12 19:04:13 2012 +1000 + + glx/dri2: fix incorrect == vs = + + glxdri2.c:486: warning: statement with no effect + + Reviewed-by: Ian Romanick + Reviewed-by: Matt Turner + Signed-off-by: Dave Airlie + +commit defca4c192bd7f4af2b273c7cb1fe8665888772a +Author: Dave Airlie +Date: Thu Jul 12 18:52:34 2012 +1000 + + glx/dri2: fix typo in the notification reset for robustness. + + Reviewed-by: Ian Romanick + Reviewed-by: Matt Turner + Signed-off-by: Dave Airlie + +commit d1cae6bb804f7dfc889fd3c5d5eb116f4baf5149 +Author: Dave Airlie +Date: Thu Jul 12 18:51:52 2012 +1000 + + glx: pass screen into the convert function + + when robustness is enabled, this is required. + + Reviewed-by: Ian Romanick + Signed-off-by: Dave Airlie + +commit ea74e381ae91f45ec195a5505262e2e5a3c0e1c9 +Author: Dave Airlie +Date: Fri Jul 13 00:47:24 2012 +1000 + + xtest: add extinit.h for SyncExtensionInit + + This adds the decl for SyncExtenionInit. + + Signed-off-by: Dave Airlie + Tested-by: Keith Packard + Signed-off-by: Keith Packard + +commit 746193a7f10f11cccae05c98b933aadf58fc7375 +Merge: a2d0829 2b74949 +Author: Keith Packard +Date: Thu Jul 12 15:10:51 2012 -0700 + + Merge remote-tracking branch 'jturney/xwin-extmod-removal-fixes' + +commit a2d0829531249e24dbca25fc20ed30a2bb2d8ed8 +Author: Michel Dänzer +Date: Thu Jul 12 13:16:37 2012 +0200 + + glx: Free DRI2 drawable reference to destroyed GLX drawable. + + Otherwise the reference can lead to use after free in + __glXDRIinvalidateBuffers(). + + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50019 + + Signed-off-by: Michel Dänzer + Reviewed-by: Kristian Høgsberg + Signed-off-by: Keith Packard + +commit 8a87acc9e57be740e3bd252567622246051a0723 +Author: Michel Dänzer +Date: Thu Jul 12 13:16:36 2012 +0200 + + dri2: Add DRI2CreateDrawable2. + + Same as DRI2CreateDrawable, except it can return the DRI2 specific XID of the + DRI2 drawable reference to the base drawable. + + Signed-off-by: Michel Dänzer + Reviewed-by: Kristian Høgsberg + Signed-off-by: Keith Packard + +commit 2b74949ad02bd916c3ac502db3f28057f12a8117 +Author: Jon TURNEY +Date: Thu Jul 12 00:36:43 2012 +0100 + + Restore GLX extension to XWin + + - Add an XwinExtensionInit(), similar in spirit to QuartzExtensionInit() + and xf86ExtensionInit() + - Load the GLX extension (I'm guessing XQuartz needs this adding somewhere + as well) + - Also, since we now have a proper place to install the native GL provider + where it will take priority over the the swrast provider, do so + + Signed-off-by: Jon TURNEY + Reviewed-by: Daniel Stone + Reviewed-by: Colin Harrison + +commit 656e5fea6c9ca15f932889edcc590dd01c881945 +Merge: 8b820f2 1720cd9 +Author: Keith Packard +Date: Thu Jul 12 08:26:35 2012 -0700 + + Merge remote-tracking branch 'jeremyhu/master' + +commit 8b820f221ad54eb96a16c7060048abc8824371b6 +Author: Daniel Stone +Date: Wed Jul 11 17:31:53 2012 +0100 + + sdksyms: Fix build with --disable-xv + + I hate this [redacted] script. + + Signed-off-by: Daniel Stone + Tested-by: Keith Packard + Signed-off-by: Keith Packard + +commit 06ac7937fc37cdf073b77386bed47e14cff23628 +Author: Jon TURNEY +Date: Thu Jul 12 12:37:05 2012 +0100 + + Restore extern to the declaration of __glXDRISWRastProvider + + b86aa74 dropped the 'extern' from the declaration of __glXDRISWRastProvider + + This turns out to be important to me, as without it, the final link only gets + the tentative definition of __glXDRISWRastProvider implied by the declaration, + and not the proper one from glxdriswrast.c, presumably because nothing else + references anything in the object that file generates. + + Signed-off-by: Jon TURNEY + Reviewed-by: Daniel Stone + Reviewed-by: Colin Harrison + +commit bcbf95b1bafa6ffe724768b9309295e2fdb4b860 +Author: Jon TURNEY +Date: Thu Jul 12 00:36:10 2012 +0100 + + Revert bogus GlxPushProvider() in commit a1d41e3 + + a1d41e3 "Move extension initialisation prototypes into extinit.h" + also includes a change to GlxExtensionInit to install the swrast GLX + provider. + + Since b86aa74 "GLX: Insert swrast provider from GlxExtensionInit" + already does this (correctly, by installing the swrast provider + at the end of the chain, rather than at the beginning), and since this + would seem to have the effect of making the swrast provider the most + preferred provider, I'm guessing this wasn't intended. + + Signed-off-by: Jon TURNEY + Reviewed-by: Daniel Stone + Reviewed-by: Colin Harrison + +commit 1720cd9badf21e5d6b2c6c929e609ab3b0b92fd2 +Author: Jeremy Huddleston +Date: Wed Jul 11 23:54:27 2012 -0700 + + XQuartz: Re-add prototype for DRIExtensionInit + + Regression from: a1d41e311c21eb6627caa0d168e070ceaf90806f + + Signed-off-by: Jeremy Huddleston + CC: Daniel Stone + +commit 1a64d3cc9c319d5e9ab2365b60469fb5b83407fc +Author: Jeremy Huddleston +Date: Wed Jul 11 23:49:59 2012 -0700 + + XQuartz: Fix build failure due to incorrect PseudoramiXExtensionInit prototype + + pseudoramiX.c:129:1: error: conflicting types for 'PseudoramiXExtensionInit' [Semantic Issue] + PseudoramiXExtensionInit(int argc, char *argv[]) + ^ + ../../include/extinit.h:175:13: note: previous declaration is here + extern void PseudoramiXExtensionInit(void); + ^ + + Signed-off-by: Jeremy Huddleston + +commit 228f8bfe81890770f1ba109a0acca1c81a2ffee9 +Author: Jeremy Huddleston +Date: Wed Jul 11 23:49:33 2012 -0700 + + XQuartz: Silence an unused-variable warning + + Signed-off-by: Jeremy Huddleston + +commit deb08658e2a6b1647a7213a316c6f3019bcdce48 +Author: Maarten Lankhorst +Date: Wed Jul 11 16:27:46 2012 +0200 + + xfree86: Strip dangling pointers from desiredMode + + Based on the original patch by Chris Wilson, which was a better fix than mine. + + We stash a copy of the desiredMode on the crtc so that we can restore it + after a vt switch. This copy is a simple memcpy and so also stashes a + references to the pointers contained within the desiredMode. Those + pointers are freed the next time the outputs are probed and mode list + rebuilt, resulting in us chasing those dangling pointers on the next + mode switch. + + ==22787== Invalid read of size 1 + ==22787== at 0x40293C2: __GI_strlen (in + /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) + ==22787== by 0x668F875: strdup (strdup.c:42) + ==22787== by 0x5DBA00: XNFstrdup (utils.c:1124) + ==22787== by 0x4D72ED: xf86DuplicateMode (xf86Modes.c:209) + ==22787== by 0x4CA848: xf86CrtcSetModeTransform (xf86Crtc.c:276) + ==22787== by 0x4D05B4: xf86SetDesiredModes (xf86Crtc.c:2677) + ==22787== by 0xA7479D0: sna_create_screen_resources + (sna_driver.c:220) + ==22787== by 0x4CB914: xf86CrtcCreateScreenResources (xf86Crtc.c:725) + ==22787== by 0x425498: main (main.c:216) + ==22787== Address 0x72c60e0 is 0 bytes inside a block of size 9 free'd + ==22787== at 0x4027AAE: free (in + /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) + ==22787== by 0x4A547E: xf86DeleteMode (xf86Mode.c:1984) + ==22787== by 0x4CD84F: xf86ProbeOutputModes (xf86Crtc.c:1578) + ==22787== by 0x4DC405: xf86RandR12GetInfo12 (xf86RandR12.c:1537) + ==22787== by 0x518119: RRGetInfo (rrinfo.c:202) + ==22787== by 0x51D997: rrGetScreenResources (rrscreen.c:335) + ==22787== by 0x51E0D0: ProcRRGetScreenResources (rrscreen.c:475) + ==22787== by 0x513852: ProcRRDispatch (randr.c:493) + ==22787== by 0x4346DB: Dispatch (dispatch.c:439) + ==22787== by 0x4256E4: main (main.c:287) + + Signed-off-by: Maarten Lankhorst + Reported-by: Zdenek Kabelac + Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=36108 + Reviewed-by: Chris Wilson + Signed-off-by: Keith Packard + +commit 59c2c4f645b4d782599c274f4bc752de9623d308 +Author: Daniel Stone +Date: Tue Jul 10 09:10:22 2012 +0100 + + AllocDevicePair: Ensure XKB privates are initialised + + Since we call directly into XKB and may be doing so before the extension + has been initialised, make sure its privates are set up first. XTest + had a hack to do this itself, but seems cleaner to just make sure we do + it in AllocDevicePair. + + Signed-off-by: Daniel Stone + Reviewed-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit f937c3d50157a9a42d2f2f10590b6b139ce18a29 +Author: Daniel Stone +Date: Tue Jul 10 09:10:21 2012 +0100 + + Sync: Always initialise system counter list + + Sync is designed to let you add system counters before the extension has + been initialised, which means the system counter list may well be full + of bees. Make sure it's initialised before we add to it, to avoid the + risk of fatal injury. + + Signed-off-by: Daniel Stone + Reviewed-by: Alan Coopersmith + Signed-off-by: Keith Packard + +commit 34cf559bcf99dad550527b5ff53f247f0e8e73ee +Author: Keith Packard +Date: Tue Jul 10 15:58:48 2012 -0700 + + ProcGetPointerMapping uses rep.nElts before it is initialized + + In: + + commit d792ac125a0462a04a930af543cbc732f8cdab7d + Author: Alan Coopersmith + Date: Mon Jul 9 19:12:43 2012 -0700 + + Use C99 designated initializers in dix Replies + + the initializer for the .length element of the xGetPointerMappingReply + structure uses the value of rep.nElts, but that won't be set until + after this initializer runs, so we get garbage in the length element + and clients using it will generally wedge. + + Easy to verify: + + $ xmodmap -pp + + Fixed by creating a local nElts variable and using that. + + Signed-off-by: Keith Packard + Reviewed-by: Alan Coopersmith + +commit 44bd27cdd13b6e6c4e6fd3873361e3308ef25ffe +Author: Keith Packard +Date: Tue Jul 10 01:14:13 2012 -0700 + + Version 1.12.99.901 (1.13 RC1) + + Signed-off-by: Keith Packard + +commit 6e12cb147da58bd12a158807b2cd5afac32ae70f +Merge: 532fbc2 0231279 +Author: Keith Packard +Date: Tue Jul 10 00:52:11 2012 -0700 + + Merge branch 'local-fixes' + +commit 532fbc29c900469ef4867ccb7eabb953019dcab5 +Author: Daniel Stone +Date: Tue Jul 10 02:03:38 2012 +0100 + + GE: Remove unused RT_GECLIENT + + Remove remnants of an earlier experiment which had the GE extension + handling event delivery directly. Nothing's used the resource since, so + purge it. + + Signed-off-by: Daniel Stone + Reviewed-by: Adam Jackson + Reviewed-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 0e70b333d4846b166bf4a0a0c5d1a80623ba08dc +Author: Daniel Stone +Date: Tue Jul 10 02:03:37 2012 +0100 + + XFree86: os-support: Remove unused xf86MakeNewMapping + + No drivers used this, so it got unexported, and now it's so unused it + got culled during the link. Take the poor function out behind the shed + and put it out of its misery. + + Signed-off-by: Daniel Stone + Reviewed-by: Adam Jackson + Acked-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 43f2393746c44e9d35be6a2a3555205f8e1b4ddf +Author: Daniel Stone +Date: Tue Jul 10 02:03:36 2012 +0100 + + Xinerama: Reset Composite request vector on close + + Similar (identical) to how it interacts with Render and XFixes, also + call PanoramiXCompositeReset() to restore the Composite dispatch table + to how it was when it started, on reset. + + Signed-off-by: Daniel Stone + Reviewed-by: Adam Jackson + Acked-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 766a403bc7ff249fdc6b9049329b633e73738329 +Author: Daniel Stone +Date: Tue Jul 10 02:03:35 2012 +0100 + + XvMC: Remove unused XvMCGeneration + + I wonder if this even works across multiple generations. + + Signed-off-by: Daniel Stone + Reviewed-by: Adam Jackson + Acked-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 7cef23a6dd7a5d76983cf20979e845ea6ae63a10 +Author: Daniel Stone +Date: Tue Jul 10 02:03:34 2012 +0100 + + Render: Remove unused glyphDepths + + No-one has used this since 0a71e154. + + Signed-off-by: Daniel Stone + Reviewed-by: Adam Jackson + Acked-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 65011064d7e70aed59fb716f9ed3d76d196244ce +Author: Daniel Stone +Date: Tue Jul 10 02:03:33 2012 +0100 + + Xi: Remove dead Device{Enter,Leave}WindowMask + + These were an unused remnant of earlier MPX work; their only users got + cleared out in dc153271, but the mask declarations remained. Remove + them, and move DevicePropertyNotify's mask up to be contiguous with the + rest of the range. + + Signed-off-by: Daniel Stone + Reviewed-by: Adam Jackson + Reviewed-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit fadfc2947075c832cd1107d2c0866ad13fa756c4 +Author: Daniel Stone +Date: Tue Jul 10 02:03:32 2012 +0100 + + GLX: Remove unused noGlxVisualInit + + No-one ever did anything with this variable except assign its default + value to it. + + Signed-off-by: Daniel Stone + Reviewed-by: Adam Jackson + Acked-by: Peter Hutterer + Reviewed-by: Ian Romanick + Signed-off-by: Keith Packard + +commit 06e4ba8b26fb974bdd84144b3e002f0f7589e7f7 +Author: Daniel Stone +Date: Tue Jul 10 02:03:31 2012 +0100 + + XKB: Geom: Remove unused code + + These codepaths were never called by anyone. Shame there weren't more + of them. + + Signed-off-by: Daniel Stone + Reviewed-by: Adam Jackson + Reviewed-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit e191e296e6e7861978ea4a0ae9aa7b780e52732b +Author: Daniel Stone +Date: Mon Jul 9 20:04:15 2012 +0100 + + Remove XAA + + Commit 0c6987df in June 2008 disabled XAA offscreen pixmaps per default, + as they were broken, leaving XAA only able to accelerate operations + directly on the screen pixmap and nowhere else, eliminating acceleration + for basically every modern toolkit, and any composited environment. + + So, it hasn't worked for over four years. No-one's even come close to + fixing it. + + RIP. + + Signed-off-by: Daniel Stone + Reviewed-by: Dave Airlie + Reviewed-by: Alex Deucher + +commit 66362441867f68dac97de33744bd0ca478fb65d3 +Author: Daniel Stone +Date: Tue Jul 10 02:03:29 2012 +0100 + + Remove last renmants of XFree86LOADER define + + Not to be confused with XFree86Loader or XorgLoader. Which are both now + dead too. + + Signed-off-by: Daniel Stone + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit a15dac550918c55b08bbe0007f068cc5096ebaa1 +Author: Daniel Stone +Date: Tue Jul 10 02:03:28 2012 +0100 + + Remove unused setupFunc from extensions + + setupFunc was used as an early callback for half-modular extensions such + as Xv, XvMC and DGA to set up hooks between the core server and the + modular component. Now we've rid ourselves of that, we can also bin + setupFunc. + + Signed-off-by: Daniel Stone + Reviewed-by: Jamey Sharp + Signed-off-by: Keith Packard + +commit 710318e803c6d5c6b8ae170d38c8253f5d780472 +Author: Daniel Stone +Date: Tue Jul 10 02:03:27 2012 +0100 + + Replace NO_HW_ONLY_EXTS with Xorg DDX test + + Turns out the only thing we use NO_HW_ONLY_EXTS for is to check whether + or not we're building inside the Xorg DDX. Replace it with an + XorgLoader test instead, and remove all its users. + + Signed-off-by: Daniel Stone + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit 5f5bbbe543f65c48ecbb5cce80116a86ca3fbe86 +Author: Daniel Stone +Date: Tue Jul 10 02:03:26 2012 +0100 + + Unify miinitext.c + + Rather than having a non-Xorg and an Xorg-specific path which basically + just duplicated each other for no reason, we could ... just have one. + + Signed-off-by: Daniel Stone + Reviewed-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 147967f67d4976a87ed07fe11b59b174907f5d43 +Author: Daniel Stone +Date: Tue Jul 10 02:03:25 2012 +0100 + + Remove Xorg-specific extensions from non-Xorg miinitext + + miinitext.c had a completely separate codepath for non-Xorg servers, + which included tests for Xorg-specific extensions such as + XFree86-VidMode, which were external even to the Xorg DDX. So we can + just remove them, and the associated #undefs. + + Signed-off-by: Daniel Stone + Reviewed-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 27a624bee66d2797eacf90317054207dcf248028 +Author: Daniel Stone +Date: Tue Jul 10 02:03:24 2012 +0100 + + Quartz: Move PseudoramiX initialisation to DDX + + As PseudoramiX is a DDX-specific extension, move its loading and + initialisation to hw/xquartz. This creates a QuartzExtensionInit() + similar in spirit to xf86ExtensionInit. + + Signed-off-by: Daniel Stone + Acked-by: Peter Hutterer + Reviewed-by: Jeremy Huddleston + Signed-off-by: Keith Packard + +commit 79d14d9fc3d92ba866864d3a5910a8c6c8e9b64f +Author: Daniel Stone +Date: Tue Jul 10 02:03:23 2012 +0100 + + Move the remnants of loadext.c to miinitext.c + + There was nothing XFree86-specific or loader-specific about this, aside + from using xf86MsgVerb instead of ErrorF. + + Signed-off-by: Daniel Stone + Reviewed-by: Jamey Sharp + Signed-off-by: Keith Packard + +commit a089af3477dd01a831b89c06f982679c60e42975 +Author: Daniel Stone +Date: Tue Jul 10 02:03:22 2012 +0100 + + Loader: Move ExtensionModule types to DIX + + In preparation for gutting loadext.c, move the ExtensionModule struct to + the DIX, and unexport ExtensionModuleList (why, why, why, why was this + ever exported in the first place, tbqh). + + Signed-off-by: Daniel Stone + Reviewed-by: Jamey Sharp + Signed-off-by: Keith Packard + +commit 8171108602556446f12c1cfbc37c6abf3b0195eb +Author: Daniel Stone +Date: Tue Jul 10 02:03:21 2012 +0100 + + Loader: Remove extension initialisation sorting + + Extensions could previously declare initialisation dependencies on other + extensions, which would then get nicely sorted by the loader. We only + had one user for this, GLX, which had one pointless (Composite) and one + possibly useful dependency (DBE). As DBE is now a built-in, it will + always be sorted by GLX, so we no longer have any users for it. + + Signed-off-by: Daniel Stone + Reviewed-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit d52ab85c7ef5058dcbd8a75eb84058908dc22906 +Author: Daniel Stone +Date: Tue Jul 10 02:03:20 2012 +0100 + + GLX: Remove extension init dependencies + + GLX was the only user of extension init order dependencies, using them + to depend on Composite, which has always been built-in anyway, and DBE, + which is now built-in. + + Signed-off-by: Daniel Stone + Reviewed-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 2fba9445a0357f67641e41ac334b5529c37774a2 +Author: Daniel Stone +Date: Tue Jul 10 02:03:19 2012 +0100 + + Add static extensions before those in modules + + Make sure we add static extensions before anything in a module. This is + more or less a no-op at the moment, but will come in handy later when + extension dependency sorting is removed. + + Signed-off-by: Daniel Stone + Reviewed-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 9a953e0e9dcb8a8e43cc27ffaef460268fbe1916 +Author: Daniel Stone +Date: Tue Jul 10 02:03:18 2012 +0100 + + Move DRI2 from external module to built-in + + Instead of keeping a tiny amount of code in an external module, just man + up and build it into the core server. + + v2: Fix test/Makefile.am to only link libdri2.la if DRI2 is set + + Signed-off-by: Daniel Stone + Reviewed-by: Jamey Sharp + Signed-off-by: Keith Packard + +commit b8a3267c36e2e335b888bd4f2ef2f2c477cdfdce +Author: Daniel Stone +Date: Tue Jul 10 02:03:17 2012 +0100 + + DRI2: Remove prototype for DRI2DestroyDrawable + + DRI2DestroyDrawable() was still being _X_EXPORTed, but hasn't existed + since 1da1f33f last year. + + Signed-off-by: Daniel Stone + Reviewed-by: Cyril Brulebois + Reviewed-by: Jamey Sharp + Reviewed-by: Ian Romanick + Signed-off-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 7025a909bfe4d1f5518ec6fc5f89e2c3fb6501fd +Author: Daniel Stone +Date: Tue Jul 10 02:03:16 2012 +0100 + + XFree86: DRI: Don't use per-target CFLAGS + + AM_CFLAGS will suffice, given we only have one target in this directory. + + Signed-off-by: Daniel Stone + Reviewed-by: Cyril Brulebois + Signed-off-by: Keith Packard + +commit 459c6da0f907ba33d733c7e62a116184ba2f14e5 +Author: Daniel Stone +Date: Tue Jul 10 02:03:15 2012 +0100 + + Move DRI1 from external module to built-in + + Rather than building the tiny amount of code required for XFree86-DRI as + an external module, build it in if it's enabled at configure time. + + v2: Fix test/Makefile.am to only link libdri.la if DRI is set + + Signed-off-by: Daniel Stone + Reviewed-by: Peter Hutterer + Signed-off-by: Keith Packard + + fixup for DRI1 move + + Signed-off-by: Keith Packard + +commit b905d87ba0a9b045ea41bb1ad36a4f9f1170a1b8 +Author: Daniel Stone +Date: Tue Jul 10 02:03:14 2012 +0100 + + Xext: Only build one library + + Now that libXextmodule.la is both empty and unused, we can just build + the one libXext.la for everyone, rather than having Xorg be special and + unique. + + Signed-off-by: Daniel Stone + Reviewed-by: Jamey Sharp + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit a7a2f9f66ddc27df96557093f3dd266e24eb653b +Author: Daniel Stone +Date: Tue Jul 10 02:03:13 2012 +0100 + + Remove the last remnants of extmod + + extmod was originally a big pointless module. Now it's an empty, + pointless module. This commit makes it unexist. + + Signed-off-by: Daniel Stone + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 6e74fdda42fb4bd80fd48e1ae6471bffbb837804 +Author: Daniel Stone +Date: Wed Jun 22 00:28:18 2011 +0100 + + Move XFree86-VidMode from extmod to built-in + + As with DGA, move VidMode from being part of extmod to a built-in part + of the server, if compiled as such. This is initialised from + xf86ExtensionInit rather than miinitext because it's wholly dependent on + the Xorg DDX. + + Signed-off-by: Daniel Stone + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 60f53e3012be795eee741ecd4be858552c5e86c8 +Author: Tomas Carnecky +Date: Tue Jul 10 02:03:11 2012 +0100 + + DGA: Remove excessive module-induced indirection + + The DGA event base used to have to be passed through a function pointer, + as the code was cleaved in two with half in a module, and half in the + core server. Now that's not the case, just access DGAEventBase + directly. + + v2: Deal with Alan's event initialization cleanups + + Signed-off-by: Tomas Carnecky + Reviewed-by: Daniel Stone + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 7a5880bc3b47e1f90a638f056ad4d40be6931977 +Author: Daniel Stone +Date: Tue Jul 10 02:03:10 2012 +0100 + + Move DGA from extmod to built-in + + Rather than leave DGA languishing in extmod, move it to be a built-in + extension. As it's quite specific to the Xorg DDX, just move it + sideways to the rest of the DGA code in hw/xfree86/common, and + initialise it from xf86ExtensionInit, rather than miinitext. + + Signed-off-by: Daniel Stone + Acked-by: Keith Packard + Signed-off-by: Keith Packard + +commit 6fb481d1251626456914d0012d6ca5a342bfdf71 +Author: Daniel Stone +Date: Tue Jul 10 02:03:09 2012 +0100 + + Move SELinux from extmod to built-in + + Instead of letting it languish in extmod just because we want to + configure bits of it from xf86, move XSELinux to the builtin part of + Xext, and do its configuration from xf86ExtensionInit. + + Signed-off-by: Daniel Stone + Reviewed-by: Jamey Sharp + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 5d92ee4081a23a6b4d1f9ba2a98985f539f99312 +Author: Tomas Carnecky +Date: Tue Jul 10 02:03:08 2012 +0100 + + Xv: Remove excessive module-induced indirection + + Xv used to call XvScreenInit and co. through function pointers, as + XvScreenInit may have been sitting on the other side of a module + boundary from xf86XvScreenInit. Why this was so is a mystery, but make + it not so any more. + + Signed-off-by: Tomas Carnecky + Reviewed-by: Daniel Stone + Acked-by: Peter Hutterer + Signed-off-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 2e6c5f959153cdcea4bcf719621ebec408250f54 +Author: Daniel Stone +Date: Tue Jul 10 02:03:07 2012 +0100 + + XFree86: sdksyms: Remove unused -DXorgLoader + + We no longer have anything in the tree that checks for XorgLoader. This + was a fairly monumental hack: xvdi.h used to hide all its functions + behind #ifndef XorgLoader, solely to avoid sdksyms.sh picking up its + symbols, as it was previously a module rather than built-in. + + This is no longer the case, so we can remove the define. + + Signed-off-by: Daniel Stone + Reviewed-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 7a11b817e770cd2196814f1ac6264c6d87b76c6a +Author: Tomas Carnecky +Date: Tue Jul 10 02:03:06 2012 +0100 + + Move Xv and XvMC from extmod to built-in + + Always build these extensions into the core server, rather than letting + them languish in extmod. + + Signed-off-by: Tomas Carnecky + Reviewed-by: Daniel Stone + Reviewed-by: Jamey Sharp + Signed-off-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 7d859bd87834dd79c7fa3792075496ece698c082 +Author: Tomas Carnecky +Date: Tue Jul 10 02:03:05 2012 +0100 + + Move XRes from extmod to built-in + + Always build XRes support into the core server, rather than letting it + languish in extmod. + + Signed-off-by: Tomas Carnecky + Reviewed-by: Daniel Stone + Reviewed-by: Jamey Sharp + Signed-off-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit ba21fc29587e4f11320b88a70433beb1fe22cdf3 +Author: Tomas Carnecky +Date: Tue Jul 10 02:03:04 2012 +0100 + + Move DPMS from extmod to built-in + + Always build DPMS support into the core server, rather than letting it + languish in extmod. + + Signed-off-by: Tomas Carnecky + Reviewed-by: Daniel Stone + Reviewed-by: Jamey Sharp + Signed-off-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 3ed2c6e11298c4299042cfe4578f6cc02e441d58 +Author: Tomas Carnecky +Date: Tue Jul 10 02:03:03 2012 +0100 + + Move MIT-SCREEN-SAVER from extmod to built-in + + If we've built MIT-SCREEN-SAVER support, then just build it into the + main binary, rather than leaving it in extmod. + + Signed-off-by: Tomas Carnecky + Reviewed-by: Daniel Stone + Reviewed-by: Jamey Sharp + Signed-off-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit b8c9ab0fea0be299d9f48ac0c4ed0474104a7556 +Author: Tomas Carnecky +Date: Tue Jul 10 02:03:02 2012 +0100 + + Move RECORD from external module to built-in + + Rather than languishing in its own special module, move RECORD into the + core server. + + Signed-off-by: Tomas Carnecky + Reviewed-by: Daniel Stone + Reviewed-by: Jamey Sharp + Signed-off-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit bf61bf69b2b4f9e9993ca771de100079c7696bea +Author: Tomas Carnecky +Date: Tue Jul 10 02:03:01 2012 +0100 + + Move DBE from an external module to built-in + + If DBE support is compiled in the server, just man up and build it into + the server, rather than having it as an external module. + + Signed-off-by: Tomas Carnecky + Reviewed-by: Daniel Stone + Reviewed-by: Jamey Sharp + Signed-off-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit d785368e0e171080fea5447c87e81c93f515ff21 +Author: Daniel Stone +Date: Tue Jul 10 02:03:00 2012 +0100 + + miinitext: Use ARRAY_SIZE rather than sentinel + + NULL sentinels are totally lame. + + v2: numExtensionModules isn't public, so keep using the provided + sentinal - Keith Packard + + Signed-off-by: Daniel Stone + Reviewed-by: Stéphane Marchesin + Signed-off-by: Keith Packard + +commit f48d8f58b39af0036365368d6ac35319d6d856d5 +Author: Daniel Stone +Date: Tue Jul 10 02:02:59 2012 +0100 + + extmod: Use ARRAY_SIZE rather than sentinel + + When the array gets down to size zero (which it does in later patches), + gcc complains that the index is out of bounds. Avoid this by using + ARRAY_SIZE on extensionModules instead. + + Signed-off-by: Daniel Stone + Reviewed-by: Stéphane Marchesin + Signed-off-by: Keith Packard + +commit d35884da2f5a250ff6dd5131dc23ac629eccdd0c +Author: Daniel Stone +Date: Tue Jul 10 02:02:58 2012 +0100 + + Add xf86ExtensionInit for DDX extension configuration + + xf86ExtensionInit is called after configuration file parsing, so it can + perform the two parts of extension initialisation currently done by + extmod: enabling and disabling of extensions through an 'omit' option, + and SELinux configuration. + + Signed-off-by: Daniel Stone + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 4170e4e1f8e879394c896c490d9f08a38ecfdefd +Author: Daniel Stone +Date: Tue Jul 10 02:02:57 2012 +0100 + + Loader: Drop EXTERN_MODULE flag + + EXTERN_MODULE was used to specify that we shouldn't worry about modules + lacking a ModuleData object. It was also completely unused. *shrug* + + Signed-off-by: Daniel Stone + Signed-off-by: Peter Hutterer + Reviewed-by: Alan Coopersmith + Signed-off-by: Keith Packard + +commit a1d41e311c21eb6627caa0d168e070ceaf90806f +Author: Daniel Stone +Date: Tue Jul 10 02:02:56 2012 +0100 + + Move extension initialisation prototypes into extinit.h + + Create extinit.h (and xf86Extensions.h, for Xorg-specific extensions) to + hold all our extension initialisation prototypes, rather than + duplicating them everywhere. + + Signed-off-by: Daniel Stone + Reviewed-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit b86aa74cafddf9bca5addfeb458a23f46ddcf132 +Author: Daniel Stone +Date: Tue Jul 10 02:02:55 2012 +0100 + + GLX: Insert swrast provider from GlxExtensionInit + + Rather than making poor old miinitext.c do it, including making DMX + have fake symbols just to keep it happy. + + Signed-off-by: Daniel Stone + Reviewed-by: Stéphane Marchesin + Signed-off-by: Keith Packard + +commit 13552a5c4701097a1507a99ed8366ab1438844b6 +Author: Daniel Stone +Date: Tue Jul 10 02:02:54 2012 +0100 + + Reorder extension initialisation for non-Xorg + + Reorder static extension initialisation in miinitext for non-Xorg + servers to match Xorg's order. + + Tested with Xephyr; checked that the extension list was identical before + and after. + + Signed-off-by: Daniel Stone + Signed-off-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 5079db78aea8fa42e781dd876c1ee1c31571b3ae +Author: Tomas Carnecky +Date: Tue Jul 10 02:02:53 2012 +0100 + + Replace INITARGS with void + + INITARGS was a hardcoded define to void. Since knowing the function + signature for your extensions is kinda useful, just replace it with a + hardcoded void, but leave the define there for API compatibility. + + Signed-off-by: Tomas Carnecky + Reviewed-by: Daniel Stone + Reviewed-by: Cyril Brulebois + Reviewed-by: Jamey Sharp + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit bddb8c6cbe52ba9923b1d36d01f5ac9391b0ec0e +Author: Daniel Stone +Date: Tue Jul 10 02:02:52 2012 +0100 + + Xinerama: Fix ExtensionInit prototype + + Huh, so I guess INITARGS used to be int argc, char *argv then. Either + way, it's now void, so fix that ... + + Signed-off-by: Daniel Stone + Reviewed-by: Cyril Brulebois + Reviewed-by: Jamey Sharp + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit eb9661fef9f59587f898371f97a0952ac14d125f +Author: Daniel Stone +Date: Tue Jul 10 02:02:51 2012 +0100 + + Make extension.h self-contained, remove C++ externs + + externsion.h required bits from Xfuncproto.h and dixstruct.h, but + included neither; fix that. + + It also had _XFUNCPROTOBEGIN and _XFUNCPROTOEND wrappers, which is a bit + pointless for a server-only library, as it's only needed for C++. + + Signed-off-by: Daniel Stone + Reviewed-by: Cyril Brulebois + Reviewed-by: Jamey Sharp + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 854c1fa4a1e90288d1e2f3777fac3e1a9acb1235 +Author: Daniel Stone +Date: Tue Jul 10 02:02:50 2012 +0100 + + Add a common ARRAY_SIZE macro to dix.h + + Does what it says on the box, replacing those from Xi/ and glx/. + + Signed-off-by: Daniel Stone + Reviewed-by: Cyril Brulebois + Reviewed-by: Jamey Sharp + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 67953d6975ef2ee573b95e7641aaf3d72e9f8379 +Author: Daniel Stone +Date: Tue Jul 10 02:02:49 2012 +0100 + + Xorg: Link XKB DDX library after core server libs + + libxorgxkb.a contains a number of libraries which are used by XKB action + code to call back into the DDX, e.g. for VT switching, termination, grab + breaking, et al. Make sure libxkb.a comes first in the link order, so + it can mark XkbDDX* as used in order for the linker to not discard them. + + Signed-off-by: Daniel Stone + Reviewed-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 656af2c7e73d948338683675e14cd827b46a97c4 +Author: Daniel Stone +Date: Tue Jul 10 02:02:46 2012 +0100 + + Don't make failure to -nolisten fatal + + If failing to disable a protocol specified by -nolisten failed, we'd + throw a FatalError and bomb startup entirely. From poking at xtrans, it + looks like the only way we can get a failure here is because we've + specified a protocol name which doesn't exist, which probably doesn't + constitute a security risk. + + And it makes it possible to start gdm even though you've built with + --disable-tcp-transport. + + Signed-off-by: Daniel Stone + Reviewed-by: Alan Coopersmith + Signed-off-by: Keith Packard + +commit dc0c2dd92d5eb314582ea10830678753824375d9 +Author: Daniel Stone +Date: Tue Jul 10 02:02:45 2012 +0100 + + Xext: Add hashtable.h to sources to fix distcheck + + Signed-off-by: Daniel Stone + Reviewed-by: Alan Coopersmith + Signed-off-by: Keith Packard + +commit ad4092cf7d59a89b1b2922440eef65be5c0c5ebd +Author: Alan Coopersmith +Date: Mon Jul 9 19:12:44 2012 -0700 + + Replace padlength tables with inline functions from misc.h + + Adds new function padding_for_int32() and uses existing pad_to_int32() + depending on required results. + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Reviewed-by: Peter Hutterer + Tested-by: Daniel Stone + +commit 2b1c1300cc23912ee1c59f8dde938dd4d7287f4a +Author: Alan Coopersmith +Date: Mon Jul 9 19:12:44 2012 -0700 + + ephyrGLXQueryServerString: Stop making an unused copy of server_string + + ephyrGLXQueryServerString() carefully allocated a buffer padded to the + word-aligned string length for sending to the client, copied the string + to it, and then forgot to use it, potentially reading a few bytes of + garbage past the end of the server_string buffer. + + Since WriteToClient already handles the necessary padding, just send + it the actual length of the original server_string, and don't bother + making a padded copy. + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Tested-by: Daniel Stone + +commit 7a29f6878284e2d65e69fcd157aa9ec01d21b3c0 +Author: Alan Coopersmith +Date: Mon Jul 9 19:12:44 2012 -0700 + + Initialize padding bits to 0 in ErrorConnMax() + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Tested-by: Daniel Stone + +commit bed610fcae41ddfe21fa9acde599b17d1d15f5d1 +Author: Alan Coopersmith +Date: Mon Jul 9 19:12:44 2012 -0700 + + Set padding bytes to 0 in WriteToClient + + Clear them out when needed instead of leaving whatever values were + present in previously sent messages. + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Tested-by: Daniel Stone + +commit 1622dd8ab24d2fe7b9908110eb237774d4e03568 +Author: Alan Coopersmith +Date: Mon Jul 9 19:12:44 2012 -0700 + + Use C99 designated initializers in dix registry + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Tested-by: Daniel Stone + +commit 9805cedf7b0f76d3b75f94e956c4cc2dcf0d8b64 +Author: Alan Coopersmith +Date: Mon Jul 9 19:12:44 2012 -0700 + + Use C99 designated initializers in extension Events + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Tested-by: Daniel Stone + +commit 0af79b124e1317c36d1613d28755c5a8ce612e2a +Author: Alan Coopersmith +Date: Mon Jul 9 19:12:44 2012 -0700 + + Use C99 designated initializers in dix Events + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Tested-by: Daniel Stone + +commit 483266a583b0fd8a552303f318a71502ce3ff1d2 +Author: Alan Coopersmith +Date: Mon Jul 9 19:12:43 2012 -0700 + + Use C99 designated initializers in xf86 extension Replies + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Tested-by: Daniel Stone + +commit 14501fd33ee89acf9fc1d908003ed62f383d8bae +Author: Alan Coopersmith +Date: Mon Jul 9 19:12:43 2012 -0700 + + Use C99 designated initializers in Xephyr Replies + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Tested-by: Daniel Stone + +commit e4e827ec36fd20b7aea608db09790f76fb87e519 +Author: Alan Coopersmith +Date: Mon Jul 9 19:12:43 2012 -0700 + + Use C99 designated initializers in dmx Replies + + v2: fix in __glXGetVisualConfigs to not re-declare local 'reply' variable + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Tested-by: Daniel Stone + + Fixup for Use C99 designated initializeres in dmx Replies + + Signed-off-by: Keith Packard + +commit bd6f948c41865c2c9d3fba1000bf5f7458d3afc1 +Author: Alan Coopersmith +Date: Mon Jul 9 19:12:43 2012 -0700 + + Use C99 designated initializers in randr Replies + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Tested-by: Daniel Stone + +commit a406bd07593edb69285cf2fd91a6af4a5d956817 +Author: Alan Coopersmith +Date: Mon Jul 9 19:12:43 2012 -0700 + + Use C99 designated initializers in xkb Replies + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Tested-by: Daniel Stone + +commit 26efa09d0c7ee2f6a18547205c84be75376e688b +Author: Alan Coopersmith +Date: Mon Jul 9 19:12:43 2012 -0700 + + Use C99 designated initializers in glx Replies + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Tested-by: Daniel Stone + +commit cc5f09c86f7bea23b7546c3491b2c52ce8100a71 +Author: Alan Coopersmith +Date: Mon Jul 9 19:12:43 2012 -0700 + + Use C99 designated initializers in various extension Replies + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Tested-by: Daniel Stone + +commit 2f5caeaddb3616dc9ff57d784f7feba589c536e7 +Author: Alan Coopersmith +Date: Mon Jul 9 19:12:43 2012 -0700 + + Use C99 designated initializers in Xinput Replies + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Tested-by: Daniel Stone + +commit 6a721e3af5e11bae1d59ca551a02470f35d9e844 +Author: Alan Coopersmith +Date: Mon Jul 9 19:12:43 2012 -0700 + + Use C99 designated initializers in Xext Replies + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Tested-by: Daniel Stone + +commit d792ac125a0462a04a930af543cbc732f8cdab7d +Author: Alan Coopersmith +Date: Mon Jul 9 19:12:43 2012 -0700 + + Use C99 designated initializers in dix Replies + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Tested-by: Daniel Stone + +commit 69fa5630b5902aaad267fc67d0da4ca93625886a +Author: Alan Coopersmith +Date: Mon Jul 9 19:12:43 2012 -0700 + + Use C99 designated initializers in SendErrorToClient + + Let the compiler worry about 0-filling the rest of the fields, + instead of memsetting the whole struct and then going back to + overwrite some of the fields. + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Tested-by: Daniel Stone + +commit cdf5bcd420e5bcf4a4a24a275d3133a4e16ce41e +Author: Alan Coopersmith +Date: Mon Jul 9 19:12:42 2012 -0700 + + Use calloc to zero fill buffers being allocated for replies & events + + Ensures padding bytes are zero-filled + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Tested-by: Daniel Stone + +commit ef0f701c9245b0373eb0c7a84dd804af4738bb29 +Author: Alan Coopersmith +Date: Mon Jul 9 19:12:42 2012 -0700 + + xf86dga2.c & xf86vmode.c: Move REQUEST_SIZE_MATCH checks before using stuff + + Seems silly waiting to check if the client failed to send us enough bytes + until after we've already tried using them. + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Tested-by: Daniel Stone + +commit 2e739a8870d91fbac7f536ffa8f6d2cee0f66cec +Author: Alan Coopersmith +Date: Mon Jul 9 19:12:42 2012 -0700 + + ProcRRListOutputProperties: skip atom walk if the list is empty + + pAtoms is only allocated if numProps was non-zero, so move the walk + through the property list to copy atoms to it inside the if (numProps) + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Tested-by: Daniel Stone + +commit 15bc13c8d088e05f14c7262348e0066929c29251 +Author: Alan Coopersmith +Date: Mon Jul 9 19:12:42 2012 -0700 + + ProcRRGetScreenInfo: swap configTimestamp as well + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Tested-by: Daniel Stone + +commit 3a013b8816bc0bb765c99e8a2bf2ea536dc62c3b +Author: Jaroslav Šmíd +Date: Mon Jul 9 19:12:42 2012 -0700 + + Bug 51375: Xorg doesn't set status for RRGetOutputInfo + + https://bugs.freedesktop.org/show_bug.cgi?id=51375 + https://bugs.freedesktop.org/attachment.cgi?id=63397 + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Tested-by: Daniel Stone + +commit 5b86c072d1d586ce040d8831a05cf97ff8b17821 +Author: Alan Coopersmith +Date: Mon Jul 9 19:12:42 2012 -0700 + + Use temporary variables instead of parts of reply structures + + When passing variable pointers to functions or otherwise doing long + sequences to compute values for replies, create & use some new + temporary variables, to allow for simpler initialization of reply + structures in the following patches. + + Move memsets & other initializations to group with the rest of the + filling in of the reply structure, now that they're not needed so + early in the code path. + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Tested-by: Daniel Stone + +commit c2fb1a7b2ab58d70b38ee03ab2fdeb4e7183a356 +Author: Alan Coopersmith +Date: Mon Jul 9 19:12:42 2012 -0700 + + ProcQueryKeymap: rework logic around permission to copy key states + + Always initialize to zero, and then if permission is granted, copy + the current key state maps, instead of always copying and then + zeroing out if permission was denied. + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Tested-by: Daniel Stone + +commit dccb0858d71341e1258800b37d1bb78c0115838d +Author: Alan Coopersmith +Date: Mon Jul 9 19:12:42 2012 -0700 + + Core events: invert check for permission to copy key states + + Always initialize to zero, and then if permission is granted, copy + the current key state maps. Use memcpy instead of memmove for the + copy, since we're always copying to a newly allocated event on the + stack, so guaranteed not to overlap with the device map structure. + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Tested-by: Daniel Stone + +commit db69212df8a0bf09140368356d2d430c54afe346 +Author: Alan Coopersmith +Date: Mon Jul 9 19:12:42 2012 -0700 + + Rework reply initialization in ProcGetProperty & NullPropertyReply + + Don't need to pass an empty reply to NullPropertyReply, let it make + it's own. Move reply initialization code in remaining replies in + ProcGetProperty to group with the rest of the fields. (Prepares + for coming C99 designated initializer conversion.) + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Tested-by: Daniel Stone + +commit 6be74a9080e30fc502421cd438cd0c73fb8eb0b0 +Author: Alan Coopersmith +Date: Mon Jul 9 19:12:42 2012 -0700 + + Fix more poorly indented/wrapped comments & code + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Tested-by: Daniel Stone + +commit 789d64e19a3b3d98b88bc80f677e0c37bfb5c631 +Author: Alan Coopersmith +Date: Sun May 13 00:03:35 2012 -0700 + + Remove unneccesary casts from WriteToClient calls + + Casting return to (void) was used to tell lint that you intended + to ignore the return value, so it didn't warn you about it. + + Casting the third argument to (char *) was used as the most generic + pointer type in the days before compilers supported C89 (void *) + (except for a couple places it's used for byte-sized pointer math). + + Signed-off-by: Alan Coopersmith + Reviewed-by: Keith Packard + Tested-by: Daniel Stone + +commit 023127915e6922bc53e4c768de760d8a4f25c07c +Author: Keith Packard +Date: Mon Jul 9 16:34:39 2012 -0700 + + Reliably reset signals at server init time + + Each DDX currently calls OsReleaseSIGIO in case it was suspended when + the server regen started. This causes a BUG to occur if SIGIO was + *not* blocked at that time. Instead of relying on each DDX, make the + OS layer reliably reset all signal state at server init time, ensuring + that signals are suitably unblocked and that the various signal state + counting variables are set back to zero. + + Signed-off-by: Keith Packard + +commit d6756e0298e660a0aca58d75bcf79471ce07a634 +Author: Keith Packard +Date: Mon Jul 9 16:33:11 2012 -0700 + + xfree86: In InitOutput, only call OsReleaseSIGIO if OsBlockSIGIO was called + + Otherwise, OsReleaseSIGIO will complain, or perhaps something worse + will happen (if SIGIO actually needs to be blocked here). + + Signed-off-by: Keith Packard + +commit ea8b04507e5464e4817791db516a20cfed2a6724 +Author: Keith Packard +Date: Mon Jul 9 16:30:24 2012 -0700 + + privates: Resize GPU screen-specific privates too + + When allocating new global privates, make sure the gpu + screens get their private offsets updated. + + This only affects GPU screens that enumerate before the non-GPU + screens, which generally requires that the related device be present + when the system boots so that it can get an earlier DRM filename. + + Signed-off-by: Keith Packard + +commit d1c639c006526b8cab14dac582508f3f54848967 +Author: Keith Packard +Date: Mon Jul 9 16:29:04 2012 -0700 + + Add 'install-headers' target in the top-level Makefile + + This target recursively locates directories with sdk headers and + installs them all. Useful when you want to build a complete new X + server and drivers without having to install the X server before the + drivers are actually working. + + Signed-off-by: Keith Packard + +commit 329db3292223cccd4887062956622285c45a1523 +Author: Dave Airlie +Date: Sat Jul 7 10:10:08 2012 +0100 + + dri2/prime: allocate prime id at screen allocation time + + Add a static mask of prime id and allocate them at screen time, + if the driver supports the prime interfaces and is a gpu screen. + + This is instead of them changing due to user controlled randr commands, + as suggested by Keith. + + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit 30298012162de7f76e8a4c7b0362e98703f80011 +Author: Dave Airlie +Date: Tue Jun 26 10:20:52 2012 +0100 + + dri2: add initial prime support. (v1.2) + + This adds the initial prime support for dri2 offload. The main thing is + when we get a connection from a prime client, we stored the information + and mark all drawables from that client as prime. We then create all + buffers for that drawable on the prime device dri2screen. + + Then DRI2UpdatePrime is provided which drivers can call to get a shared + pixmap which they can use as the front buffer. The driver is then + responsible for doing the back->front copy to the shared buffer. + + prime requires a compositing manager be run, but it handles the case where + a window get un-redirected by allocating a new pixmap and pointing the crtc + at it while the client is in that state. + + Currently prime can't handle pageflipping, so always does straight copy swap, + + v1.1: renumber on top of master. + v1.2: fix auth on top of master. + + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit 234022cfb3ad2a1b16ab7981ce69f9cd5ba0fbeb +Author: Dave Airlie +Date: Sat Jul 7 10:20:58 2012 +0100 + + configure: bump dri2proto to 2.8 + + This is required for the prime macros. + + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit c41922940adbc8891575b3321fadf01ff4cb5854 +Author: Dave Airlie +Date: Tue Jun 26 10:00:21 2012 +0100 + + dix/randr: add a hook into screen to replace scanout pixmap + + For DRI2 in some offload cases we need to set a new pixmap on the crtc, + this hook allows dri2 to call into randr to do the necessary work to set + a pixmap as the scanout pixmap for the crtc the drawable is currently on. + + This is really only to be used for unredirected full screen apps in composited + environments. + + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit e2fd447e76c4a1233374c9d8fa9cae54a55dad50 +Author: Dave Airlie +Date: Thu Jul 5 15:50:56 2012 +0100 + + xf86: add callback for offloak sink setting support. + + This adds support for setting the offload sink to the xf86 ddx. + + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit 22f02120eb4092e1c283f81c8040f178693ff0a4 +Author: Dave Airlie +Date: Tue Jun 26 09:53:54 2012 +0100 + + xf86: store scanout pixmap in the xf86 struct as well. + + This is so we can tell the scanout pixmap has changed between calls + to the crtc set function. + + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit 426bc0a28edbe0e9153f692a02dd25f744ffa034 +Author: Dave Airlie +Date: Thu Jul 5 15:41:38 2012 +0100 + + randr: add hooks for offload sink provider protocol + + This adds the protocol handler and associated providers handling + for the offload slaves, it allows two providers to be connected as + offload sink/source. + + Reviewed-by: Keith Packard + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + +commit 12905dfaf01088a00f4a0a78cffba03329e7b724 +Author: Dave Airlie +Date: Sat May 26 13:11:01 2012 +0100 + + dix/xf86: initial offload slave tracking (v1.1) + + add the linked list and provider hooks. + + v1.1: add another assert in the add path. + + Reviewed-by: Keith Packard + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + +commit a7c01da54ab43f9d29333ccbd79dfc001f9dc5e3 +Author: Dave Airlie +Date: Thu Jul 5 20:34:54 2012 +0100 + + xf86: make sure rotate calcs are done on the right screen boundaries + + This fixes a segfault where this code believes we are outside the screen + boundaries on a slave device, but we aren't. + + Reviewed-by: Keith Packard + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + +commit cc02f4ef3e407be794132d004c947c9a4e14f4c2 +Author: Dave Airlie +Date: Tue Jun 19 16:01:16 2012 +0100 + + xf86/cursor: fallback to sw cursor if we have slaves present. + + Current USB devices have no hw rendered cursors, so we need the + master GPU to render the cursor, so whenever we plug in a + slave device, fallback to sw rendered cursors. + + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + +commit 98686512cbe1affb75222a63136854af79f1411b +Author: Dave Airlie +Date: Thu Jul 5 15:50:24 2012 +0100 + + xf86: add output source setting callback (v2) + + This adds support for the randr callback for setting the output source + for a device. + + v2: drop root clip change on detach + + Reviewed-by: Keith Packard + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + +commit 4c92eb00f97f7b8258de8e366226880382cc9ce9 +Author: Dave Airlie +Date: Thu Jul 5 15:41:22 2012 +0100 + + randr: add output source setup + + This adds the output sources to the associated list and adds the protocol + handler for the randr SetProviderOutputSource. + + Reviewed-by: Keith Packard + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + +commit bec4cb72c55bb6dee09c65c0844af201067a090f +Author: Dave Airlie +Date: Thu May 24 15:47:22 2012 +0100 + + randr: hook up output slave to screen resources return + + When the client asks for the screen resources list, it will now + get a list of crtc/outputs for the master + all attached slaves, + this will let randr configure all attached slave devices properly. + + Keith asked I merge the two functions, but not just yet, the current + multi screen code doesn't handle primary yet properly, will fix it up later. + + Reviewed-by: Keith Packard + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + +commit 88bc02bfaae2c15a30c606d34cf7940e6ad5ea14 +Author: Dave Airlie +Date: Mon Jun 18 14:11:24 2012 +0100 + + xf86/crtc: add new interface to detach slave crtcs + + This will detach any scanout pixmaps attached to slave crtcs. + + Reviewed-by: Keith Packard + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + +commit 9b8217f9ef6279fff6628631d18497bed0343ef9 +Author: Dave Airlie +Date: Thu Jun 14 15:24:46 2012 +0100 + + dix/pixmap: track dirty pixmaps in server. (v4) + + This adds two functions for drivers to use directly to keep a + linked list of slave pixmaps to do damage tracking on and keep + updated. It also adds a helper function that drivers may optionally + call to do a simple copy area damage update. + + v2: use damage.h not damagestr.h, fixes ephyr build. + + v3: address ajax review: use slave_dst, drop unused dst member. + + v4: check DamageCreate return, add SourceValidate comment, + add a comment addressing possible optimisation possibility + + Reviewed-by: Keith Packard + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + +commit c5cc2a8243c5e6bf454af989b7512ec7e20fc3f2 +Author: Dave Airlie +Date: Tue May 29 14:41:39 2012 +0100 + + randr: check the screen size bounds against the master + + The master contains the complete screen size bounds, so check + the width/height against it. + + Reviewed-by: Keith Packard + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + +commit 26d848cb916c8a85f2c69d2aeb004665ba07bf00 +Author: Dave Airlie +Date: Tue May 29 14:35:24 2012 +0100 + + randr: fix tellchanged to work with slave scanouts + + Tell changed need to tell only for the master pixmap, + however it gets called from various places for slave screens, + so convert to telling clients about changes on the master screen. + + Reviewed-by: Keith Packard + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + +commit 4bf0192d810e01c89a1903cc4bc5e639fc13a547 +Author: Dave Airlie +Date: Tue May 29 14:37:11 2012 +0100 + + randr: fixup constrain to work with slave screens. + + Current code constrains the cursor to the crtcs on the master + device, for slave outputs to work we have to include their crtcs + in the constrain calculations. + + Reviewed-by: Keith Packard + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + +commit 2ed3f64d9d453628ab5c03b8aee006093019c933 +Author: Dave Airlie +Date: Wed Jun 20 12:37:26 2012 +0100 + + xf86: add initial scanout pixmap support (v2) + + Add the simple passthrough interface for drivers to use, + so they can set scanout pixmaps. + + v2: detach scanout pixmap properly. + + Reviewed-by: Keith Packard + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + +commit f2da2c12042d3447b1c954e7301632d174a08b4f +Author: Dave Airlie +Date: Wed Jun 20 12:37:12 2012 +0100 + + randr: add initial scanout pixmap support (v3) + + When randr notices a crtc configuration request for a slave device, + it checks if the slave allocated pixmap exists and is suitable, + if not it allocates a new shared pixmap from the master, shares + it to the slave, and starts the master tracking damage to it, + to keep it updated from the current front pixmap. + + If the resize means the crtc is no longer used it will destroy + the slave pixmap. + + This adds the concept of a scanout_pixmap to the randr_crtc object, + and also adds a master pixmap pointer to the pixmap object, along + with defining some pixmap helper functions for getting pixmap box/regions. + + v2: split out pixmap sharing to a separate function. + + v3: update for void * + + Reviewed-by: Keith Packard + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + +commit 0b0e7148925e1f835d4f4f06e402a97023531828 +Author: Dave Airlie +Date: Thu May 24 16:03:31 2012 +0100 + + exa: pixmap sharing infrastructure (v3) + + This just adds exa interfaces for mixed exa so drivers can + share and set shared pixmaps up correctly. + + v2: update for passing slave screen. + v3: update for void * + + Reviewed-by: Keith Packard + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + +commit fd6c1bf0a3efced3ad4623dbd4716230a5f2419e +Author: Dave Airlie +Date: Thu May 24 16:03:19 2012 +0100 + + dix: pixmap sharing infrastructure (v3) + + This is a hooks for pixmap sharing and tracking. + + The pixmap sharing ones get an integer handle for the pixmap + and use a handle to be the backing for a pixmap. + + The tracker interface is to be used when a GPU needs to + track pixmaps to be updated for another GPU. + + v2: pass slave to sharing so it can use it to work out driver. + + v3: use void * as per keithp's suggestion. + + Reviewed-by: Keith Packard + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + +commit 382dd45bb88fa92764bf0ecd655cb9890eb84960 +Author: Dave Airlie +Date: Thu May 24 15:39:05 2012 +0100 + + dix: add ability to link output slave gpus to the current gpu (v1.1) + + Just add the interfaces to attach/detach output slaves, and + a linked list to keep track of them. Hook up the randr providers + list to include these slaves. + + v1.1: add another assert to the add path. + + Reviewed-by: Keith Packard + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + +commit 05d2472cd242293a5fa205efff5734a3380072b4 +Author: Dave Airlie +Date: Thu Jun 14 15:03:02 2012 +0100 + + xf86dga: handle DGAAvailable for gpu screens. (v2) + + v2: Split out DGAAvailable into two interfaces, one for calls from protocol + decoding and one for internal usage, after discussion with ajax and keithp. + + Reviewed-by: Keith Packard + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + +commit 3cbc4c10b52896324fe14d2ab56bd54577c9294c +Author: Dave Airlie +Date: Wed Jun 13 14:35:49 2012 +0100 + + randr: expose unattached providers to the clients. + + This provides the unattached provider list to the clients. + + Reviewed-by: Keith Packard + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + +commit d0e138c3f3e58ef127dad6c6aef48b1713b5ce58 +Author: Dave Airlie +Date: Wed Jun 13 14:32:05 2012 +0100 + + dix: attach unbound screens to protocol screen 0 (v2) + + This is the default attachment, unbound gpu screens get + attached to the 0 protocol screen. + + detach on hotunplug. + + v2: detach after tearing down crtc/outputs. + + Reviewed-by: Keith Packard + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + +commit 4caad34c932115dc0a9fd9c2995ebb2d38b9359c +Author: Dave Airlie +Date: Wed Jun 13 14:27:42 2012 +0100 + + dix: add unattached list for attaching screens to initially. (v1.1) + + This list is meant for attaching unbound gpu screens to initially, + before the client side rebinds them. + + v1.1: add another assert in the add path. + + Reviewed-by: Keith Packard + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + +commit 9b5cf2ed76b00937af12304e0e8dbd60df62067e +Author: Dave Airlie +Date: Wed Jun 13 14:17:06 2012 +0100 + + xfree86: add framework for provider support in ddx. (v4) + + This adds the framework for DDX provider support. + + v2: as per keithp's suggestion remove the xf86 provider object + and just store it in the toplevel object. + + v3: update for new protocol + + v4: drop devPrivate, free name + + Reviewed-by: Keith Packard + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + +commit 66d92afeaeed9f4a19267d95a1f81b9bf27162a5 +Author: Dave Airlie +Date: Wed Jun 13 14:03:04 2012 +0100 + + randr: add provider object and provider property support (v6) + + This adds the initial provider object and provider property + support to the randr dix code. + + v2: destroy provider in screen close + v2.1: fix whitespace + + v3: update for latest rev of protocol + renumber after 1.4 tearout. + + v4: fix logic issue, thanks Samsagax on irc + + v5: keithp's review: fix current_role, fix copyrights, fix master + reporting crtc/outputs. + + v6: port to new randr interface, drop all set role bits for now + + v7: drop devPrivate in provider, not needed, add BadMatch returns + for NULL SetProviderOffloadSink and SetProviderOutputSource, drop + the old typedef. + + Reviewed-by: Keith Packard + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + +commit 44eae69f1df2d00e0c9f1ea8d3c4fae06bcacfbc +Author: Dave Airlie +Date: Thu Jul 5 21:11:16 2012 +0100 + + configure: bump randrproto min requirements to 1.4.0 + + Needed to build latest randr stuff. + + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + +commit 4d24192bd24fb20d16d0054d77bffda883faeb79 +Merge: 7c9d8cb 74b786f +Author: Keith Packard +Date: Fri Jul 6 12:17:17 2012 -0700 + + Merge remote-tracking branch 'airlied/for-keithp-stage1' + +commit 7c9d8cbd368cac53e7aed9308292614337db3be2 Author: Torsten Kaiser Date: Fri Jul 6 12:10:25 2012 -0700 @@ -19,9 +8402,8 @@ Date: Fri Jul 6 12:10:25 2012 -0700 Signed-off-by: Torsten Kaiser Reviewed-by: Adam Jackson Signed-off-by: Keith Packard - (cherry picked from commit 7c9d8cbd368cac53e7aed9308292614337db3be2) -commit f27fcb81c4a30cec899628e4bb3e300edbcebe4b +commit 0b3abacb6430e6593c4358420ba457d8149bd32b Author: Torsten Kaiser Date: Fri Jul 6 12:06:13 2012 -0700 @@ -36,9 +8418,1001 @@ Date: Fri Jul 6 12:06:13 2012 -0700 Signed-off-by: Torsten Kaiser Reviewed-by: Adam Jackson Signed-off-by: Keith Packard - (cherry picked from commit 0b3abacb6430e6593c4358420ba457d8149bd32b) -commit e4497cd002ffb59cb7cf9df69d47ccb62ab55bf4 +commit 74b786f7cee5723468bba251a2155a65770b2ad4 +Author: Dave Airlie +Date: Tue Jun 5 17:45:03 2012 +0100 + + xfree86: add autoAddGPU option (v2) + + This option is to stop the X server adding non-primary devices as + gpu screens. + + v2: fix per Keith's suggestion. + + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit ef6686480ad1de6582b9ef5d13e5d4ffb3b3918c +Author: Dave Airlie +Date: Tue Jun 5 17:30:39 2012 +0100 + + xfree86: add platform bus hotplug support (v3) + + This provides add/remove support for platform devices at xfree86 ddx level. + + v2: cleanup properly if no driver found. + + v3: load the modesetting driver before checking driver list. + + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit b27cf30995e05da11e827ec41060051673336a7b +Author: Dave Airlie +Date: Tue Jun 5 17:29:56 2012 +0100 + + xserver/config: add udev/drm hotplug callbacks. (v2) + + This adds callbacks into the ddx for udev gpu hotplug. + + v2: fix some strncmp returns. + + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit 53b66c084fbf5bf47f8121632fabdc39b9fe8337 +Author: Dave Airlie +Date: Tue Jun 5 17:18:10 2012 +0100 + + xfree86: add DDX gpu screen support. (v3) + + This just adds the structures and interfaces required for adding/deleteing + gpu screens at the DDX level. The platform probe can pass a new flag + to the driver, so they can call xf86AllocateScreen and pass back the new + gpu screen flag. + + It also calls the gpu screens preinit and screeninit routines at + startup. + + v2: fix delete screen use after free. + + v3: split out pScrn into separate patch + + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit 726d467b534a30d8cbaafb858339c638c9f83195 +Author: Dave Airlie +Date: Mon Jun 25 11:51:26 2012 +0100 + + xf86: cleanup helper code to use a pointer. (v1.1) + + This is in preparation for gpu screens in here, just use + a pScrn pointer to point at the new screen. + + suggested by Keith. + v1.1: fix spacing as suggested by Aaron. + + Reviewed-by: Keith Packard + Reviewed-by: Aaron Plattner + Signed-off-by: Dave Airlie + +commit 9d179818293b466ec6f1777f0b792e1fbbeb318c +Author: Dave Airlie +Date: Tue Jun 5 17:09:38 2012 +0100 + + dix: introduce gpu screens. (v5) + + This patch introduces gpu screens into screenInfo. It adds interfaces + for adding and removing gpu screens, along with adding private fixup, + block handler support, and scratch pixmap init. + + GPU screens have a myNum that is offset by GPU_SCREEN_OFFSET (256), + this is used for logging etc. + + RemoveGPUScreen isn't used until "xfree86: add platform bus hotplug support". + + v2: no glyph pictures for GPU screens for now. + v3: introduce MAXGPUSCREENS, fix return value check + v4: fixup myNum when renumbering screens (ajax) + v5: drop cursor privates for now. + + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit 3478af3374abffa0c226ee077fda1fcfc0751e74 +Author: Dave Airlie +Date: Tue Jun 5 17:01:21 2012 +0100 + + screen: split out screen init code. (v2) + + This is a precursor for reusing this code to init gpu screens. + + v2: fixup int check as per Keith's review. + + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit cf66471353ac5899383b573a3cfca407e90d501e +Author: Dave Airlie +Date: Tue May 8 14:26:47 2012 +0100 + + xfree86: use udev to provide device enumeration for kms devices (v10) + + On Linux in order for future hotplug work, we are required to interface + to udev to detect device creation/removal. In order to try and get + some earlier testing on this, this patch adds the ability to use + udev for device enumeration on Linux. + + At startup the list of drm/kms devices is probed and this info is + used to load drivers. + + A new driver probing method is introduced that passes the udev + device info to the driver for probing. + + The probing integrates with the pci probing code and will fallback + to the pci probe and old school probe functions in turn. + + The flags parameter to the probe function will be used later + to provide hotplug and gpu screen flags for the driver to behave + in a different way. + + This patch changes the driver ABI, all drivers should at least + be set with a NULL udev probe function after this commit. + + v2: rename to platform bus, now with 100% less udev specific, + + this version passes config_odev_attribs around which are an array + of id/string pairs, then the udev code can attach the set of attribs + it understands, the OS specific code can attach its attrib, and then + the core/drivers can lookup the required attribs. + + also add MATCH_PCI_DEVICES macro. + + This version is mainly to address concerns raised by ajax. + + v3: Address comments from Peter. + fix whitespace that snuck in. + rework to use a linked list with some core functions that + xf86 wraps. + + v4: add free list, fix struct whitespace. + ajax this address most of your issues? + + v5: drop probe ifdef, fix logic issue + + v6: some overhaul after more testing. + + Implement primaryBus for platform devices. + document hotplug.h dev attribs - drop sysname attrib + fix build with udev kms disabled + make probing work like the PCI probe code, + match against bus id if one exists, or primary device. + + RFC: add new bus id support "PLAT:syspath". we probably + want to match on this a bit different, or use a different + property maybe. I was mainly wanting this for use with + specifying usb devices in xorg.conf directly, but PLAT:path + could also work I suppose. + + v6.1: add missing noop platform function + + v7: fix two interactions with pci probing and slot claiming, prevents + pci and platform trying to load two drivers for same slot. + + v8: test with zaphod mode on -ati driver, fixup resulting issue + clean up common probe code into another function, change busid + matching to allow dropping end of strings. + + v9: fix platform probing logic so it actually works. + v9.1: fix pdev init to NULL properly. + + v10: address most of Keith's concerns. + + v4 was thanks to Reviewed-by: Adam Jackson + v5 was Reviewed-by: Peter Hutterer + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit 2c52d776a42a28bb3e1463edf0cfe0672d0c08a9 +Author: Dave Airlie +Date: Tue Jun 19 16:01:08 2012 +0100 + + xf86: cursor code got mangled by indenting + + This fixes some really ugly code that got mangled by the indenting. + + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit 9e4b8b74b008dd72d1da7074bd7ecae677cefd20 +Author: Keith Packard +Date: Thu Jul 5 11:31:55 2012 -0700 + + privates: Allow device privates to be allocated after server start + + This will permit midispcur to allocate its privates for hotplug outputs + + Signed-off-by: Keith Packard + Reviewed-by: Dave Airlie + +commit 493ad833233707b0a42e5fbdd957a24fc6e52917 +Author: Keith Packard +Date: Thu Jul 5 11:31:29 2012 -0700 + + dix: Allocate device privates separate from devices + + This will allow device privates to be resized. + + Signed-off-by: Keith Packard + Reviewed-by: Dave Airlie + +commit f38b2b628322f4d763b0c7f8387d5ab0472a7d2b +Author: Keith Packard +Date: Thu Jul 5 11:15:18 2012 -0700 + + mi: Don't save midispcur rendering resources for each cursor + + Instead, only save them for the most recently drawn cursor. This saves + a bunch of storage for idle cursors. + + Signed-off-by: Keith Packard + Reviewed-by: Dave Airlie + +commit 7651176b0093cf3a4cff2277f6918a7d0451af41 +Author: Keith Packard +Date: Tue Jul 3 16:12:59 2012 -0700 + + Use screen-specific privates for exa pixmap and gc privates + + Signed-off-by: Keith Packard + Reviewed-by: Dave Airlie + +commit 7ca32f1c282cb6d4d7255f118a1e2e6f54e6b3fa +Author: Keith Packard +Date: Tue Jul 3 16:05:42 2012 -0700 + + Use new screen-specific privates for fb window and gc privates + + This ensures that only screens using fb will have this space allocated. + + Signed-off-by: Keith Packard + Reviewed-by: Dave Airlie + +commit 9d457f9c55f12106ba44c1c9db59d14f978f0ae8 +Author: Keith Packard +Date: Tue Jul 3 15:45:09 2012 -0700 + + Add screen-specific privates. + + Screen-specific privates areas are only allocated for objects related + to the target screen; objects allocated for other screens will not + have the private space reserved. This saves memory in these objects + while also allowing hot-plug screens to have additional private + allocation space beyond what the core screens are using. + + Drivers are encouraged to switch to this mechanism as it will reduce + memory usage in multi-GPU environments, but it is only required for + drivers which will be loaded after the server starts, like + modesetting. + + Objects providing screen-specific privates *must* be managed by the + screen-specific private API when allocating or initializing privates + so that the per-screen area can be initialized properly. + + The objects which support screen-specific privates are: + + Windows + Pixmaps + GCs + Pictures + + Extending this list to include Colormaps would be possible, but + require slightly more work as the default colormap is created before + all colormap privates are allocated during server startup, and hence + gets a bunch of special treatment. + + Of particular note, glyphs are *not* capable of supporting + screen-specific privates as they are global objects, not allocated on + a screen-specific basis, and so each driver must be able to see their + privates within the glyph. + + Signed-off-by: Keith Packard + Reviewed-by: Dave Airlie + +commit ed6daa15a7dcf8dba930f67401f4c1c8ca2e6fac +Author: Ian Romanick +Date: Wed Jul 4 15:21:09 2012 -0700 + + glx/dri2: Enable GLX_ARB_create_context_robustness + + If the driver supports __DRI2_ROBUSTNESS, then enable + GLX_ARB_create_cotnext_robustness as well. If robustness values are + passed to glXCreateContextAttribsARB and the driver doesn't support + __DRI2_ROBUSTNESS, existing drivers will already generate the correct + error values (so that the correct GLX errors are generated). + + Signed-off-by: Ian Romanick + Reviewed-by: Dave Airlie + Signed-off-by: Keith Packard + +commit 90aa2486e394c0344aceb2a70432761665a79333 +Author: Ian Romanick +Date: Wed Jul 4 15:21:08 2012 -0700 + + glx: Allow attributes and flags from GLX_ARB_create_context_robustness + + The assumtion is that if the underlying provider (e.g., glxdri2.c) doesn't + support this extension, it will generate BadMatch for these flags and + attributes. + + Signed-off-by: Ian Romanick + Reviewed-by: Dave Airlie + Signed-off-by: Keith Packard + +commit aef0b4593e165634ca7fa0745882dad12a54ebed +Author: Ian Romanick +Date: Wed Jul 4 15:21:07 2012 -0700 + + glx: Track the reset notification strategy for a context + + Also require that the reset notification for a new context and the other + context in the share group match. There isn't yet any way to specify a + non-default reset notification strategy, but that will come. + + Signed-off-by: Ian Romanick + Reviewed-by: Dave Airlie + Signed-off-by: Keith Packard + +commit f8198285cfc4704bc4d56922e5a2e99030a83778 +Author: Ian Romanick +Date: Wed Jul 4 15:21:06 2012 -0700 + + glx: Add extension string tracking for GLX_ARB_create_context_robustness + + Signed-off-by: Ian Romanick + Reviewed-by: Dave Airlie + Signed-off-by: Keith Packard + +commit 4ffbc984eac8a15925094614021de30dc8084e65 +Author: Ian Romanick +Date: Wed Jul 4 15:21:05 2012 -0700 + + glx: Reject creations of indirect contexts with unsupportable versions. + + Signed-off-by: Ian Romanick + Reviewed-by: Dave Airlie + Signed-off-by: Keith Packard + +commit 41d5120eaf2bdf308eb904cac9b5027b003fea8d +Author: Ian Romanick +Date: Wed Jul 4 15:21:04 2012 -0700 + + glx: Implement GLX_EXT_create_context_es2_profile + + This patch builds on the infrastucture put in place for + GLX_ARB_create_context_profile. If GLX_CONTEXT_ES2_PROFILE_BIT_EXT is + specified and the requested version is 2.0, create a context with the + __DRI_API_GLES2 API. + + This change assumes that any DRI2 driver can handle (possibly by saying "no + seeing an API setting other than __DRI_API_OPENGL or __DRI_API_OPENGL_CORE. + This allows enabling the extension any time GLX_ARB_create_context (and + GLX_ARB_create_context_profile) is enabled. + + v2: Clean up some comments. Note that our behavior for + GLX_CONTEXT_ES2_PROFILE_BIT_EXT w/version != 2.0 matches NVIDIA's. + + Signed-off-by: Ian Romanick + Reviewed-by: Dave Airlie + Signed-off-by: Keith Packard + +commit cef0b808d3152a20cd98d32457dde08bd5434e7c +Author: Ian Romanick +Date: Wed Jul 4 15:21:03 2012 -0700 + + glx: Implement GLX_ARB_create_context_profile + + Most of the infrastructure was already in place. This just adds: + + * Validate values specified with the GLX_CONTEXT_PROFILE_MASK_ARB + attribute. + + * Select a DRI2 "api" based on the setting of + GLX_CONTEXT_PROFILE_MASK_ARB. + + * Enable GLX_ARB_create_context_profile extension. + + This change assumes that any DRI2 driver can handle (possibly by saying "no") + seeing an API setting other than __DRI_API_OPENGL. This allows enabling this + extension any time GLX_ARB_create_context is enabled. + + Also, the validation code in __glXDisp_CreateContextAttribsARB is structured + in a very verbose manner (using a switch-statement) to ease the addition of + GLX_EXT_create_context_es2_profile. + + Signed-off-by: Ian Romanick + Reviewed-by: Dave Airlie + Signed-off-by: Keith Packard + +commit 09a8a169d5929665778ae33e58e345fe1192b64c +Author: Ian Romanick +Date: Wed Jul 4 15:21:02 2012 -0700 + + glx: Implement GLX SetClientInfo2ARB protocol + + The protocol is almost identical to SetClientInfoARB. The only + difference is the GL versions include an extra 4 bytes for the supported + profile. + + Signed-off-by: Ian Romanick + Reviewed-by: Dave Airlie + Signed-off-by: Keith Packard + +commit 167993254a5cbe11a1f44fad1e8ae042089c1619 +Author: Peter Hutterer +Date: Thu Jul 5 16:17:56 2012 +1000 + + list.h: don't crash when removing an element from a NULL list + + Signed-off-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit 8aa6d49d46dacc31a85023d0159c1fb67401df73 +Author: Ian Romanick +Date: Wed Jul 4 15:21:01 2012 -0700 + + glx: Don't request prototypes for GL extension functions + + The server does not want GL extension prototypes. It never links with + anything that could possibly provide implementations of these functions. It + *is* the provide, and it does not provde these symbols. All this does is + create hundreds of warnings like: + + incude/GL/glext.h:5570:45: warning: redundant redeclaration of 'glMultTransposeMatrixd' [-Wredundant-decls] + include/GL/gl.h:1940:45: note: previous declaration of 'glMultTransposeMatrixd' was here + + I believe this was necessary back before the AIGLX days, but that was a long, + long time ago. The warnings recently showed up with the addition of + -Wredundant-decls to the CWARNFLAGS. + + v2: Update the commit message, no code changes. + + Signed-off-by: Ian Romanick + Cc: Adam Jackson + Cc: Dave Airlie + Acked-by: Keith Packard + Signed-off-by: Keith Packard + +commit 258abbf823f753757e4dddc13ef495f4024680db +Author: Michal Srb +Date: Thu Jun 28 17:17:12 2012 +0200 + + Look for ModuleData only in appropriate library + + LoaderSymbol calls dlsym with RTLD_DEFAULT pseudo handle making it search in + every loaded library. In addition glibc adds NODELETE flag to the library + containing the symbol. + + It's used in doLoadModule to locate ModuleData symbol, the + module's library gets the flag and is kept in memory even after it is + unloaded. + + This patch adds LoaderSymbolFromModule function that looks for symbol only in + library specified by handle. That way the NODELETE flag isn't added. + + This glibc behavior doesn't seem to be documented, but even if other + implementations differ, there is no reason to search ModuleData symbol outside + the module's library. + + Signed-off-by: Michal Srb + Reviewed-by: Daniel Stone + + v2: Switch LoaderSymbolFromModule arguments order. + Correct description. + Reviewed-by: Adam Jackson + Signed-off-by: Peter Hutterer + +commit d84f0f823eeeecdf0498aadd3fbb1d11dabc0837 +Merge: 12bfb4c d04dfe3 +Author: Peter Hutterer +Date: Wed Jul 4 21:23:48 2012 +1000 + + Merge branch 'sigio-vt-switch-issues' into for-keith + + Conflicts: + test/Makefile.am + + Signed-off-by: Peter Hutterer + +commit 12bfb4cf1bebb66d2c2eb76b93c18a2915b865e5 +Author: Peter Hutterer +Date: Tue Jun 26 09:19:33 2012 +1000 + + Xi: extend PropagateMask to EMASKSIZE + + Number of devices is 2 + MAXDEVICES, with index 0 and 1 reserved for + XIAll{Master}Devices. At the current size, PropagateMask would be overrun in + RecalculateDeviceDeliverableEvents(). + + Found by Coverity. + + Signed-off-by: Peter Hutterer + Reviewed-by: Dave Airlie + +commit a9c09f8f8e2a97e4bfe927bc4c7f29b04ee3403a +Author: Peter Hutterer +Date: Mon Jun 25 14:24:11 2012 +1000 + + dix: fix memory leak in TouchEventHistoryReplay + + Don't leak if ti->history is NULL. + + Found by coverity. + + Signed-off-by: Peter Hutterer + Reviewed-by: Dave Airlie + +commit 55ff20eb37f00a3ad07b5acff19d4497ab513a97 +Author: Peter Hutterer +Date: Mon Jun 25 14:22:31 2012 +1000 + + dix: fix dereference before null check + + Found by Coverity. + + Signed-off-by: Peter Hutterer + Reviewed-by: Dave Airlie + +commit e3f47be9fbc489e3eb5832445924810b2ff300f7 +Author: Peter Hutterer +Date: Mon Oct 24 10:01:26 2011 +1000 + + xfree86: fix use-after-free issue in checkInput + + *dev is the condition of the while loop we're in, reset to NULL after + freeing + + Signed-off-by: Peter Hutterer + Reviewed-by: Dave Airlie + +commit 252a69b592001b34714d0fe7508e1898883f9d01 +Author: Peter Hutterer +Date: Wed Jun 20 14:25:54 2012 +1000 + + xkb: use local variable instead of casting arg + + No functional changes. + + Signed-off-by: Peter Hutterer + +commit d04dfe3f754ad3a5f158057175cbd44319c1ae51 +Author: Peter Hutterer +Date: Fri Jun 22 15:18:53 2012 +1000 + + Drop custom sigio block/unblock functions from kdrive, ephyr and dmx + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit 5d309af2ed93e91c7d72f548a11052051efbb40f +Author: Peter Hutterer +Date: Fri Jun 22 14:56:25 2012 +1000 + + xfree86: drop ddx-specific SIGIO blocking + + The hooks are left for this cycle, we can drop it next cycle once the + drivers that need it (e.g. wacom) have been updated. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit ff67135bec3ecea8cebeb46b42ece0a6671e231d +Author: Peter Hutterer +Date: Fri Jun 22 13:09:35 2012 +1000 + + xfree86: use OsBlockSIGIO from the ddx + + We can ignore the "wasset" argument now since the DIX will keep proper + refcounting. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit 6bf356ef2831baeccd7a650ed3fde0831e33c6c0 +Author: Peter Hutterer +Date: Fri Jun 22 13:02:40 2012 +1000 + + os: add OsBlockSIGIO and OsReleaseSIGIO + + Let the dix be in charge of changing the sigprocmask so we only have one + entity that changes it. + + Signed-off-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit 24525d96a3b9dba67eb75042500b2f208a2cc246 +Merge: 4cd91bd 35e3d22 +Author: Keith Packard +Date: Mon Jul 2 22:35:39 2012 -0700 + + Merge branch 'sigsafe-logging-varargs' + + This merge includes a minor fixup for '%p' arguments; must cast to + uintptr_t instead of uint64_t as we use -Werror=pointer-to-int-cast + which complains when doing a cast (even explicitly) from a pointer + to an integer of different size. + +commit 35e3d229150395a222a0f53318daf5dbeb8f6eb6 +Author: Peter Hutterer +Date: Thu May 24 14:04:42 2012 +1000 + + Bump to ABI_XINPUT_VERSION 18 + + The input ABI hasn't changed, but input drivers need something to hook on if + they want to log from within signal handlers and the input ABI is the + simplest way of doing so. + + Signed-off-by: Peter Hutterer + +commit 541934168dbeb17059542bb5a1da8eba7995fa05 +Author: Peter Hutterer +Date: Mon May 28 10:10:30 2012 +1000 + + xfree86: constify InputDriverPtr->driverName and default_options + + Already treated as const anyway by all drivers. + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + Signed-off-by: Peter Hutterer + +commit c66089d2206bafc01307a8327ff6089edcb4ed2d +Author: Peter Hutterer +Date: Mon May 28 09:57:33 2012 +1000 + + xfree86: constify InputInfoPtr->type_name + + This corresponds to XListInputDevice(3)'s "type" field (after being + converted to an Atom). Input drivers use the XI_KEYBOARD and similar + defines, even Wacom which falls out of the common defines uses constant + strings here. The use-case for having this non-const is small. + + Input ABI break technically, since we never freed this information anyway it + is not a noticable change. + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + Signed-off-by: Peter Hutterer + +commit 505c8a2b2cae0318db1148417ec850d54b38f7df +Author: Chase Douglas +Date: Mon Apr 9 09:41:38 2012 -0700 + + Log in OsVendorFatalError() in a signal safe manner + + The function can be called from a fatal signal handler. + + Signed-off-by: Chase Douglas + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit d51aebdbf99a9f240f7c318a70ba40e61cd43049 +Author: Chase Douglas +Date: Mon Apr 9 08:30:50 2012 -0700 + + Log in LoaderUnload() in a signal safe manner + + The function may be called from a fatal signal handler. + + Signed-off-by: Chase Douglas + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit c3e1168778ec20beeac9979dc57e36400c70dd63 +Author: Chase Douglas +Date: Mon Apr 9 08:28:17 2012 -0700 + + Log in UnloadModuleOrDriver() in a signal safe manner + + The function may be called from a fatal signal handler. + + Signed-off-by: Chase Douglas + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 89e3ac07aca1def155299aff6f7a57ccafb68fd7 +Author: Chase Douglas +Date: Mon Apr 9 08:23:32 2012 -0700 + + Log safely in fatal signal handler + + While we probably don't need to be signal safe here since we will never + return to the normal context, the logging signal context check will + cause unsafe logging to be unhandled. Using signal safe logging here + resolves the issue. + + Signed-off-by: Chase Douglas + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 6fd5add005d0660b591d808583d1a6c6a85f1277 +Author: Chase Douglas +Date: Fri Apr 6 16:17:41 2012 -0700 + + Log mieq enqueue overflow in a signal safe manner + + Signed-off-by: Chase Douglas + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 7f4a69b628a6246855054a0b94d6d6dd14e8842c +Author: Chase Douglas +Date: Fri Apr 13 16:01:38 2012 -0700 + + Log messages in TouchBeginDDXTouch() in a signal-safe manner + + Signed-off-by: Chase Douglas + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit f752226e40890643df213a62f0c96e6a0243e754 +Author: Chase Douglas +Date: Fri Apr 6 10:21:14 2012 -0700 + + Log messages in GetTouchEvents() in a signal safe manner + + Signed-off-by: Chase Douglas + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 82d1c6b310eaa5095eed9ee4ea958261a46a78e1 +Author: Chase Douglas +Date: Fri Apr 6 08:32:28 2012 -0700 + + Warn when attempting to log in a signal unsafe manner from signal context + + Also, print out the offending message format. This will hopefully help + developers track down unsafe logging. + + Signed-off-by: Chase Douglas + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 512bec06be6c79ca263da9de8f40430b8095b57b +Author: Chase Douglas +Date: Mon Apr 16 09:47:42 2012 -0700 + + Make BUG_WARN* signal safe + + Signed-off-by: Chase Douglas + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 0fa5217836cf7fd3872fccc9f3ff9ff32426c25b +Author: Chase Douglas +Date: Fri Apr 6 16:09:05 2012 -0700 + + Print backtrace in a signal-safe manner + + Backtraces are often printed in signal context, such as when a segfault + occurs. + + Signed-off-by: Chase Douglas + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + + os: print offset as unsigned int, not long unsigned int + + pnprintf() takes unsigned int for %u + + Signed-off-by: Peter Hutterer + +commit ac20815d5235e7a8e7b331365aabf5a489fc5e34 +Author: Chase Douglas +Date: Tue Jun 5 15:39:41 2012 +1000 + + Add ErrorFSigSafe() alternative to ErrorF() + + ErrorF() is not signal safe. Use ErrorSigSafe() whenever an error + message may be logged in signal context. + + [whot: edited to "ErrorFSigSafe"] + + Signed-off-by: Chase Douglas + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 164b38c72fe9c69d13ea4f9c46d4ccc46566d826 +Author: Chase Douglas +Date: Fri Apr 6 08:28:40 2012 -0700 + + Add LogMessageVerbSigSafe() for logging messages while in signal context + + [whot: edited to use varargs, squashed commit below] + + Signed-off-by: Chase Douglas + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + + os: fix vararg length calculation + + Make %u and %x sizeof(unsigned int), %p sizeof(void*). This is printf + behaviour and we can't guarantee that void* is uint64_t anyway. + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + +commit 4cd91bd4c6325b2e617ca90a725f02ac124c2372 +Author: Alan Coopersmith +Date: Sat May 12 10:11:33 2012 -0700 + + Enable no-undefined symbols mode in Solaris builds if -z parent is in ld + + The Solaris linker recently added a -z parent flag for easier checking + of symbol definitions in plugins against the program that loads them. + If that's present, this enables it, along with -z defs to error on + undefined symbols to alert us if any modules call symbols that won't + be found at runtime. + + This builds upon, and requires, the recent Cygwin work to build Xorg. + It moves a couple more modules to be after the Xorg binary in the build + order so that they can find the binary to check against, much as the + Cygwin changes did (these would be modules built on Solaris but not + Cygwin). + + v2: This version only sets the flags for the xorg-server build itself, + and does not yet export them in xorg-server.pc to the drivers, since + most of the drivers are not ready to build with -no-undefined yet. + + Signed-off-by: Alan Coopersmith + Reviewed-by: Yaakov Selkowitz + +commit d31942e15c619e9355ef8183223f9165902a9d56 +Author: Alan Coopersmith +Date: Sat May 12 10:10:49 2012 -0700 + + Add pixman to module dependencies for pixman_region_* functions + + Signed-off-by: Alan Coopersmith + Reviewed-by: Yaakov Selkowitz + +commit 339f38ef380d750c4c7afd60331a559845e4184e +Author: Alan Coopersmith +Date: Sat May 12 10:09:41 2012 -0700 + + Build tda9885.c functions into fi1236 to avoid libtool relinking problems + + Signed-off-by: Alan Coopersmith + Reviewed-by: Yaakov Selkowitz + +commit a00066d2916b6910429cc1c7feedafbaee0d4750 +Author: Alan Coopersmith +Date: Thu Jun 28 15:15:53 2012 -0700 + + Add dixGetGlyphs to replace GetGlyphs from libXfont to simplify linking + + No other Xfont consumer used it, and this saves us from having to link + callers against libXfont for one simple function when doing + -no-undefined symbols builds. + + The function is given a new name to avoid clashing with existing libXfont + binaries, but a #define is provided to preserve the API so we don't have + to fix all the callers at the same time. + + Signed-off-by: Alan Coopersmith + Reviewed-by: Yaakov Selkowitz + +commit 212b9803238d2de2e77cbe5de62d3f616ae50daf +Author: Aaron Plattner +Date: Fri Jun 29 13:33:58 2012 -0700 + + randr: Fix REQUEST vs. REQUEST_SIZE_MATCH mismatch + + ProcRRGetScreenSizeRange uses REQUEST(xRRGetScreenSizeRangeReq) followed by + REQUEST_SIZE_MATCH(xRRGetScreenInfoReq). This happens to work out because both + requests have the same size, so this is not a functional change, just a cosmetic + one. + + Signed-off-by: Aaron Plattner + Reviewed-by: Alan Coopersmith + Signed-off-by: Keith Packard + +commit 957bf959fb577b292a3e4f6bb67740ca09e7aeb9 +Author: Dave Airlie +Date: Wed Jun 27 14:36:04 2012 +0100 + + dix/render: consolidate window format matching code. + + This code existed in 3 different forms, perhaps it should be + consolidated. + + Reviewed-by: Keith Packard + Reviewed-by: Alex Deucher + Signed-off-by: Dave Airlie + Signed-off-by: Keith Packard + +commit a7b97b0fa85d695ae19d194cfa3267159d149e5d +Author: Christopher James Halse Rogers +Date: Thu Jun 28 12:07:11 2012 +1000 + + dri2: Fix authentication for < v8 clients (v2). + + The legacy logic was embarassingly wrong; AuthMagic should return errno, + so returning FALSE only when AuthMagic returns nonzero is exactly wrong. + + v2: Match drmAuthMagic by returning -EINVAL rather than EINVAL + Fix trailing whitespace + + https://bugs.freedesktop.org/show_bug.cgi?id=51400 + Signed-off-by: Christopher James Halse Rogers + Tested-by: Chris Wilson + Reviewed-by: Michel Dänzer + Tested-by: Knut Petersen + Signed-off-by: Keith Packard + +commit 8b4f0a4fdd6c15f49458bc3a8c3135b8c389240d +Merge: 59294a2 d642e71 +Author: Keith Packard +Date: Thu Jun 28 10:38:26 2012 -0700 + + Merge remote-tracking branch 'jturney/master' + +commit 59294a2179bd5bb996693af004b470932df00ac6 +Merge: 855003c 191b630 +Author: Keith Packard +Date: Thu Jun 28 10:11:44 2012 -0700 + + Merge remote-tracking branch 'whot/for-keith' + +commit 855003c333a0ead1db912695bc9705ef2b3144b4 +Author: Keith Packard +Date: Thu Jun 21 18:45:18 2012 -0700 + + randr: Catch two more potential unset rrScrPriv uses + + Ricardo Salveti found one place where the + randr code could use the randr screen private data without checking + for null first. This happens when the X server is running with + multiple screens, some of which are randr enabled and some of which + are not. Applications making protocol requests to the non-randr + screens can cause segfaults where the server touches the unset private + structure. + + I audited the code and found two more possible problem spots; the + trick to auditing for this issue was to look for functions not taking + a RandR data structure and where there was no null screen private + check above them in the call graph. + + Signed-off-by: Keith Packard + +commit 32603f57ca03b6390b109960f8bb5ea53ac95ecb +Author: Ricardo Salveti de Araujo +Date: Thu Jun 21 00:55:53 2012 -0300 + + randr: first check pScrPriv before using the pointer at RRFirstOutput + + Fix a seg fault in case pScrPriv is NULL at ProcRRGetScreenInfo, + which later calls RRFirstOutput. + + Signed-off-by: Ricardo Salveti de Araujo + Reviewed-by: Keith Packard + Signed-off-by: Keith Packard + +commit d642e7128790ec6b709df8d1a91333ab87598077 +Author: Yaakov Selkowitz +Date: Thu Jun 21 20:01:49 2012 +0100 + + configure.ac: link XWIN with GLX_SYS_LIBS + + Link XWIN with GLX_SYS_LIBS, just like all the other DDXs + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 9f1edced9abc066f0ba47672d006fe50fb206371 Author: Peter Hutterer Date: Fri Jun 15 10:00:51 2012 +1000 @@ -56,60 +9430,261 @@ Date: Fri Jun 15 10:00:51 2012 +1000 Signed-off-by: Peter Hutterer Reviewed-by: Keith Packard - (cherry picked from commit 9f1edced9abc066f0ba47672d006fe50fb206371) -commit ac85a6866fa63d1a1972dfa8fdcfe6ad76705648 +commit 4ba340cfaa8d430c808566495f8deda0ff1b4424 +Author: Keith Packard +Date: Thu Jun 21 18:42:46 2012 -0700 + + randr: Clean up compiler warnings about unused and shadowing variables + + set but not used variables + shadowing a previous local + + A hidden problem was that the VERIFY_RR_* macros define local 'rc' + variables, any other local definitions for those would be shadowed and + generate warnings from gcc. I've renamed the other locals 'ret' + instead of 'rc'. + + Signed-off-by: Keith Packard + +commit 191b630656ba206ad78b7803c3a76f7d9567d9d8 Author: Peter Hutterer -Date: Tue Jun 26 09:19:33 2012 +1000 +Date: Thu Jun 21 11:25:24 2012 +1000 - Xi: extend PropagateMask to EMASKSIZE + include: document _XkbErrCode2 macros - Number of devices is 2 + MAXDEVICES, with index 0 and 1 reserved for - XIAll{Master}Devices. At the current size, PropagateMask would be overrun in - RecalculateDeviceDeliverableEvents(). + Why sending the number of the (implementation-dependent) error statement to + the client is a good idea is a bit beyond me, but at least document it so we + can all share the despair. - Found by Coverity. + Signed-off-by: Peter Hutterer + Reviewed-by: Daniel Stone + +commit 7100118c8d3314d73bfef0a262af56686b227055 +Author: Peter Hutterer +Date: Mon Jun 18 11:28:52 2012 +1000 + + AC_SUBST the GLX_SYS_LIBS + + libxservertest needs -lpthread from glxapi.c's pthread_once() call. Usually + this would be pulled in by the XORG_LIBS but not when building without Xorg. + + This commit has no visible effect on the current tree, preparation for test + cleanups. + + Signed-off-by: Peter Hutterer + Reviewed-by: Alan Coopersmith + +commit 014ad46f1b353a95e2c4289443ee857cfbabb3ae +Author: Peter Hutterer +Date: Thu Jun 21 14:26:15 2012 +1000 + + os: print newline after printing display name + + Much easier for scripts that try to read the display value off the file + descriptor. Plus, this restores the behaviour we had for this patch in + Fedora since server 1.6 (April 2009). Signed-off-by: Peter Hutterer Reviewed-by: Dave Airlie - (cherry picked from commit 12bfb4cf1bebb66d2c2eb76b93c18a2915b865e5) + Reviewed-by: Chase Douglas -commit eca5de2f1a08b38cf17188c8b3d02bae7fc14cd5 -Author: Peter Hutterer -Date: Mon Jun 25 14:24:11 2012 +1000 +commit e1f86a7c77ed49e001ea42ef76ab83e87dbdf126 +Author: Sergei Trofimovich +Date: Mon Jun 18 01:13:21 2012 +0300 - dix: fix memory leak in TouchEventHistoryReplay - - Don't leak if ti->history is NULL. - - Found by coverity. - - Signed-off-by: Peter Hutterer - Reviewed-by: Dave Airlie - (cherry picked from commit a9c09f8f8e2a97e4bfe927bc4c7f29b04ee3403a) - -commit c4d28c40bfb7e6ccdb921b610f26a3881bc5974a -Author: Peter Hutterer -Date: Mon Oct 24 10:01:26 2011 +1000 - - xfree86: fix use-after-free issue in checkInput - - *dev is the condition of the while loop we're in, reset to NULL after - freeing - - Signed-off-by: Peter Hutterer - Reviewed-by: Dave Airlie - (cherry picked from commit e3f47be9fbc489e3eb5832445924810b2ff300f7) - -commit 487e8e829942fcafe2435576d1e4cf831002aed4 -Author: Peter Hutterer -Date: Mon Jul 2 10:15:14 2012 +1000 - - configure.ac: Version bump to 1.12.2.902 (1.12.3 RC2) + test/.gitignore: add hashtabletest + Signed-off-by: Sergei Trofimovich + Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer -commit d21b6f0a2d767ca6fbd8f0ec387f83a50a38b486 +commit c9bbf8fe574591c8e191eeef20f8994781718772 +Author: Jon TURNEY +Date: Thu Jun 21 19:38:55 2012 +0100 + + hw/xwin/glx: Fix glxWinCreateContext() function pointer mismatch + + Fix glxWinCreateContext() function signature to align with commit 96d74138 + "glx: Extend __GLXscreen::createContext to take attributes", which added more + parameters to the screen createContext function for implementing GLX_ARB_create_context + + indirect.c: In function 'glxWinScreenProbe': + indirect.c:683:36: warning: assignment from incompatible pointer type + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 6e85660c7503c7e88e24003562444dffde6c88ff +Author: Jon TURNEY +Date: Mon Mar 5 23:07:56 2012 +0000 + + hw/xwin/glx: Update gen_gl_wrappers.py for the current glx/dispatch.h + + Fix the code generator for the dispatch table initialization after + the whitespace/coding style changes to glx/dispatch.h + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit cb638ed9c81f07d8603b07db395e31a41fed8685 +Author: Jon TURNEY +Date: Thu Jun 21 18:55:57 2012 +0100 + + hw/xwin/glx: Blacklist 'GDI generic' GL renderer + + If the native GL renderer is the GDI generic renderer (as can happen + if we are in safe mode, or the video driver is VGA, or we have hybrid + graphics which hasn't noticed that xwin requires 3d acceleration), don't + use it. It's not accelerated and we will probably get better conformance + and perfomance from swrast. + + Fix so we don't install screen function wrappers in glxWinScreenProbe + unless we are succesful. + + Also, move fbConfig dumping to after GLX version has been determined + from extensions + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 8c24d20933ba9c2ef0e9a81815c3be23fa896aea +Author: Jon TURNEY +Date: Thu Jun 21 18:05:24 2012 +0100 + + hw/xwin/glx: Fix glxLogExtensions to handle a null string without crashing + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit c08c7c8f655d7721c1e02bfeeb965b6379f72553 +Author: Jon TURNEY +Date: Fri Jun 24 13:32:10 2011 +0100 + + hw/xwin/glx: Create a new dispatch table rather than modifying the existing one + + Create a new dispatch table rather than modifying the existing one + + struct _glapi_table is not a complete type after including glapi.h, so we use + glapi_get_dispatch_table_size() to determine it's size (alternatively, we could + include glapitable.h, to complete the type) + + This could possibly be written to use _glapi_create_table_from_handle() instead, but + that requires making all the wrapper functions exports + + Signed-off-by: Jon TURNEY + Reviewed-by: Colin Harrison + +commit 3ef3ce069d52dcfa932c90ccd30854a8d9daa15a +Merge: a0c8716 ff541e0 +Author: Keith Packard +Date: Thu Jun 21 08:52:34 2012 -0700 + + Merge remote-tracking branch 'alanc/master' + +commit 704b847abfd29e9adde27127a15a963414f8bcf4 +Author: Chase Douglas +Date: Fri Apr 6 10:13:45 2012 -0700 + + Add FormatUInt64{,Hex}() for formatting numbers in a signal safe manner + + Signed-off-by: Chase Douglas + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit bc85c81687a24aea738094ff11f4448fb3b3afbb +Author: Chase Douglas +Date: Fri Apr 6 08:03:09 2012 -0700 + + Save log file file descriptor for signal context logging + + None of the FILE based functions are signal safe, including fileno(), so + we need to save the file descriptor for when we are in signal context. + + Signed-off-by: Chase Douglas + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit d3725549f0276487fba1d419094209d18e86669f +Author: Chase Douglas +Date: Fri Apr 6 07:43:57 2012 -0700 + + Add global variable inSignalContext + + This will be used for checking for proper logging when in signal + context. + + Signed-off-by: Chase Douglas + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit a0c8716cdca139059e7aec8a3cb75726dd37a4a1 +Author: Peter Hutterer +Date: Thu Jun 21 13:45:06 2012 +1000 + + kdrive: adjust BlockHandler/WakeupHandler to new API + + Missing API update caused Xephyr to crash on startup, garbage memory + dereference when accessing timeout. + Introduced in 1f0e8bd5eb1a5539689cfc4f5a6b86b530907ec5 + + kdrive.c:868:27: warning: assignment from incompatible pointer type + kdrive.c:869:28: warning: assignment from incompatible pointer type + + Signed-off-by: Peter Hutterer + Signed-off-by: Keith Packard + +commit ff541e0a1f84bd98966148793f35afeaf71c271b +Author: Alan Coopersmith +Date: Wed Jun 13 21:20:51 2012 -0700 + + Remove obsolete tab stop comments from hw/xfree86/parser/*.c + + Signed-off-by: Alan Coopersmith + Reviewed-by: Peter Hutterer + +commit 687536b1044a3297f6b9a45f6a2d2987daa7be59 +Author: Alan Coopersmith +Date: Tue Jun 12 22:38:46 2012 -0700 + + Fix some overly indented/poorly line wrapped comments in dix/events.c + + Signed-off-by: Alan Coopersmith + Reviewed-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit 93a378aad4a4a03f37ddafccfedeb9d6e2be2a6a +Author: Alan Coopersmith +Date: Tue Jun 12 22:29:51 2012 -0700 + + OtherClientGone: Remove unreachable return statement + + Now that FatalError is marked as _X_NORETURN, the compilers know we + can't get here, and the return statement added to make them happy in + the past now makes them unhappy. + + Signed-off-by: Alan Coopersmith + Reviewed-by: Peter Hutterer + Reviewed-by: Keith Packard + +commit 3f97284b10c250457888902debd4d793cb4544d4 +Author: Christopher James Halse Rogers +Date: Wed Jun 20 13:53:53 2012 +1000 + + dri2: Pass a ScreenPtr through to the driver's AuthMagic function. (v3) + + xwayland drivers need access to their screen private data to authenticate. + Now that drivers no longer have direct access to the global screen arrays, + this needs to be passed in as function context. + + v2: Don't break ABI + v3: Paint the bikeshed blue; drop fd from AuthMagic2ProcPtr prototype + + Signed-off-by: Christopher James Halse Rogers + Reviewed-by: Kristian Høgsberg + Signed-off-by: Keith Packard + +commit dae317e7265007b38012244722e3b3a06e904ed5 Author: Andy Ritger Date: Thu Jun 14 09:15:37 2012 -0700 @@ -123,9 +9698,8 @@ Date: Thu Jun 14 09:15:37 2012 -0700 Signed-off-by: Andy Ritger Reviewed-by: Jeremy Huddleston Signed-off-by: Keith Packard - (cherry picked from commit dae317e7265007b38012244722e3b3a06e904ed5) -commit a6de3eac661ff6f23145cdaa49fc722381a1899e +commit 54476b5e4461ff523e935961affabcf0de12c556 Author: Peter Hutterer Date: Thu Jun 7 16:52:20 2012 +1000 @@ -139,19 +9713,198 @@ Date: Thu Jun 7 16:52:20 2012 +1000 Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas - (cherry picked from commit 54476b5e4461ff523e935961affabcf0de12c556) -commit b0be2d29b2c72c09de9845d2b1983e4c77c2ef17 +commit 8dc70acbf3d82611ac9ec1ec2a52edcc01934850 +Merge: ffb47a1 b59adc9 +Author: Keith Packard +Date: Thu Jun 14 13:04:29 2012 -0700 + + Merge remote-tracking branch 'alanc/master' + +commit ffb47a123ddd1233fb4229cf23483652065c5e82 +Merge: db9d2b8 b840ba5 +Author: Keith Packard +Date: Thu Jun 14 13:01:17 2012 -0700 + + Merge remote-tracking branch 'idr/GLX_ARB_create_context' + +commit db9d2b8a508ab812e5c717a41310faad81879b09 +Author: Dave Airlie +Date: Thu Jun 7 15:01:59 2012 +0100 + + xserver: fix build on arm tinderbox + + Rob Clark got an ARM tinderbox up and running, and this code is built there + but not here, this should fix it, though I hope that code never gets executed. + + Signed-off-by: Dave Airlie + Signed-off-by: Keith Packard + +commit 6d86b64dbaef5a16712fd1fdc3157f716d238877 +Merge: 812786f 4c68f5d +Author: Keith Packard +Date: Thu Jun 14 11:05:22 2012 -0700 + + Merge remote-tracking branch 'whot/for-keith' + +commit b59adc9c2427e5efac3513c20992723e23f92691 +Author: Alan Coopersmith +Date: Thu Jun 7 20:58:01 2012 -0700 + + Make stub version of fbdevHWAdjustFrame match new prototype in fbdevhw.h + + Removed flags argument to match api rework in commit 1f0e8bd5eb1a55 + + Signed-off-by: Alan Coopersmith + Reviewed-by: Dave Airlie + +commit 4c68f5d395c66f28b56e488cb3cd12f36820357b Author: Peter Hutterer -Date: Wed Apr 11 09:43:23 2012 +1000 +Date: Wed May 9 09:21:28 2012 +1000 - Xi: fix XITouchClass sourceid assignment + dix: disable all devices before shutdown + + f3410b97cf9b48a47bee3d15d232f8a88e75f4ef introduced a regression on server + shutdown. If any button or key was held on shutdown (ctrl, alt, backspace + are usually still down) sending a raw event will segfault the server. The + the root windows are set to NULL before calling CloseDownDevices(). + + Avoid this by disabling all devices first when shutting down. Disabled + devices won't send events anymore. + + Master keyboards must be disabled first, otherwise disabling the pointer + will trigger DisableDevice(keyboard) and the keyboard is removed from the + inputInfo.devices list and moved to inputInfo.off_devices. A regular loop + through inputInfo.devices would thus jump to off_devices and not recover. + + Signed-off-by: Peter Hutterer + Acked-by: Chase Douglas + Reviewed-by: Chase Douglas + +commit 9c0e820216cd1631f75b037b7908d55ac091692c +Author: Peter Hutterer +Date: Thu May 10 12:55:44 2012 +1000 + + Xi: drop forced unpairing when changing the hierarchy + + Devices are unpaired as needed on DisableDevice now. Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas - (cherry picked from commit 72cfc1a097dc1e09d2cd9415ef7855a2cef92351) -commit 4af8e22b1a539778388fe509a7f3a25860a7879c +commit e433d1046c222f9d969c2c28a4651ff9097614f4 +Author: Peter Hutterer +Date: Thu May 10 12:42:59 2012 +1000 + + dix: disable non-sprite-owners first when disabling paired devices + + If a sprite-owner is to be disabled but still paired, disable the paired + device first. i.e. disabling a master pointer will disable the master + keyboard first. + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + +commit df1704365e700d3cf1d36a241bdfc479159a8df7 +Author: Peter Hutterer +Date: Thu May 10 15:33:15 2012 +1000 + + dix: free the sprite when disabling the device + + Disabled devices don't need sprites (they can't send events anyway) and the + device init process is currently geared to check for whether sprite is + present to check if the device should be paired/attached. + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + +commit e57d6a89027c55fef987cdc259668c48a8b4ea1b +Author: Peter Hutterer +Date: Thu May 10 15:32:20 2012 +1000 + + dix: move freeing the sprite into a function + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + +commit 46adcefb0e08515195d8e49985a4e210395700b3 +Author: Peter Hutterer +Date: Thu May 10 12:10:12 2012 +1000 + + dix: return early from DisableDevice if the device is already disabled + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + +commit 076f9d3a6660fa7fef4ae9decaffd2feebdd32c4 +Author: Peter Hutterer +Date: Thu May 10 12:20:37 2012 +1000 + + dix: drop client argument from PairDevices - unused + + This is a leftover from early MPX days where any keyboard could be paired + with any pointer (before the device hierarchy). + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + +commit d034605f3914e41e0d636eafff9278be1c041b2c +Author: Peter Hutterer +Date: Thu May 10 14:13:20 2012 +1000 + + dix: rename shadowing loop variable in TouchResizeQueue + + second 'i' shadows the function-wide one, rename to 'j' + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + +commit a86f3ef511db16be5ddc723bf14e770dad23ee45 +Author: Peter Hutterer +Date: Thu May 10 11:55:21 2012 +1000 + + dix: change "still paired warning" to use BUG_RETURN_VAL + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + +commit 4bcf43919a14cd2cd20af4099cd213ce25792edb +Author: Peter Hutterer +Date: Thu May 10 15:32:47 2012 +1000 + + dix: use BUG_RETURN_VAL for pairing errors + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + Reviewed-by: Alan Coopersmith + +commit 642569fc79a1814acca1c8f529539b054bf36907 +Author: Peter Hutterer +Date: Thu May 10 12:11:57 2012 +1000 + + Replace a few BUG_WARN with BUG_RETURN_VAL + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + +commit 11ecfb8884b7c4def0863a57868a6b9fa1b63ae5 +Author: Peter Hutterer +Date: Thu May 10 11:48:05 2012 +1000 + + include: add BUG_RETURN_* macros + + Helper functions to avoid things like + + if (foo) { + BUG_WARN(foo); + return 1; + } + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + Reviewed-by: Alan Coopersmith + +commit ff41753b1bee414b16c0f1e8d183776e87c94065 Author: Peter Hutterer Date: Wed Jun 6 14:38:49 2012 +1000 @@ -166,63 +9919,462 @@ Date: Wed Jun 6 14:38:49 2012 +1000 Signed-off-by: Peter Hutterer Reviewed-by: Dan Nicholson - (cherry picked from commit ff41753b1bee414b16c0f1e8d183776e87c94065) -commit 0cecc4fc0f232bb64b8ef86d74164a676d92284f -Author: Peter Hutterer -Date: Tue May 29 10:17:50 2012 +0530 +commit f20a532ba3c7b7d74530f3906c7bacf016bb8faf +Author: Alan Coopersmith +Date: Sun May 20 00:00:59 2012 -0700 - configure.ac: Version bump to 1.12.2.901 (1.12.3 RC1) + Fix statement not reached warning in _DMXXineramaActive - Signed-off-by: Peter Hutterer + Signed-off-by: Alan Coopersmith + Reviewed-by: Mark Kettenis -commit aaf48906279bcf74bcfd0a1de24de099184be022 -Author: Julien Cristau -Date: Fri May 11 21:31:49 2012 +0200 +commit 1be317c4e5d99d11a124ad4e7a90a5dcae591e20 +Author: Alan Coopersmith +Date: Wed May 23 19:27:23 2012 -0700 - Xi: make stub DeleteInputDeviceRequest call RemoveDevice + Provide prototypes for Mmio functions for Solaris Studio on SPARC - DeleteInputDeviceRequest is called from CloseDownDevices on reset, so - call RemoveDevice to avoid leaking devices in Xvfb/Xnest/Xwin. + Actual inline implementations are provided via external *.il files + generated from *.S files in hw/xfree86/os-support/solaris - Signed-off-by: Julien Cristau - Signed-off-by: Peter Hutterer + Fixes missing prototype warnings that xorg-macros has recently elevated + to build-breaking errors. + + Signed-off-by: Alan Coopersmith + Signed-off-by: Henry Zhao + Reviewed-by: Dave Airlie + +commit 812786f4d4306cb16f8ed57fa4a1a32bb1d13fe3 +Author: Dave Airlie +Date: Tue Jun 5 19:55:52 2012 +0100 + + xwin: fixup block/wakeup handlers + + These got missed out in the api changeover. + + Reported-by: Colin Harrison + Signed-off-by: Dave Airlie + Signed-off-by: Keith Packard + +commit 3cbaf621782fb5f5679acf9104571d3ae2b48b72 +Author: Dave Airlie +Date: Tue Jun 5 17:54:02 2012 +0100 + + xfree86: fix new warnings introduced in rebase. + + Spotted these in tinderbox: + xf86xv.c: In function 'xf86XVScreenInit': + xf86xv.c:282: warning: assignment from incompatible pointer type + xf86xv.c: In function 'xf86XVCloseScreen': + xf86xv.c:1275: warning: assignment from incompatible pointer type + xf86xv.c: In function 'xf86XVAdjustFrame': + xf86xv.c:1366: warning: assignment from incompatible pointer type + + Missed removing one flags. + + Signed-off-by: Dave Airlie + Tested-by: Keith Packard + Signed-off-by: Keith Packard + +commit 1f0e8bd5eb1a5539689cfc4f5a6b86b530907ec5 +Author: Dave Airlie +Date: Tue Jun 5 13:22:18 2012 +0100 + + api: rework the X server driver API to avoid global arrays. + + This is a squash merge containing all the API changes, as + well as the video ABI bump. + + Its been squashed to make bisection easier. + + Full patch log below: + + commit b202738bbf0c5a1c1172767119c2c71f1e7f8070 + Author: Aaron Plattner + Date: Mon May 14 15:16:11 2012 -0700 + + xfree86: Bump video ABI to 13.0 + + The ABI was broken by changes to convert from screen index numbers to ScreenPtr + / ScrnInfoPtr in various structures and function signatures. + + Signed-off-by: Aaron Plattner + Reviewed-by: Dave Airlie + Signed-off-by: Dave Airlie + + commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3 + Author: Dave Airlie + Date: Thu May 24 10:56:57 2012 +0100 + + xf86: xf86ClearEntityListForScreen should take a pScrn + + When adding GPU screens this make life easier. + + (also fix comment, as pointed out by Alan) + + Reviewed-by: Alan Coopersmith + Reviewed-by: Peter Hutterer + Signed-off-by: Dave Airlie + + commit afee8b5ab4501597ecc1ade34124d7ca227ab055 + Author: Dave Airlie + Date: Thu May 24 07:07:32 2012 +0100 + + xf86i2c: add pscrn for drivers to use + + This just adds a pScrn pointer into the struct for the drivers to use + instead of scrnIndex. Mostly scrnIndex is used for logging, but some + drivers use it to lookup xf86Screens, so let them stash a pScrn instead. + + Removing the scrnIndex is a bit more involved and I'm not sure its worth + the effort. Doing i2c in the X server is legacy code as far as I'm concerned. + + Reviewed-by: Alex Deucher + Signed-off-by: Dave Airlie + + commit ea5092f1f679691d187f1eee9427e6057beec56e + Author: Dave Airlie + Date: Wed May 23 19:25:20 2012 +0100 + + dix/gc: consolidate GC object creation in one place + + The standard GC create and scratch GC create were 90% the same really, + and I have a need in the future for creating GC objects without the + other bits, so wanted to avoid a third copy. + + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + + commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1 + Author: Dave Airlie + Date: Wed May 23 10:24:06 2012 +0100 + + xf86: add a define to denote the new non-index interfaces are being used + + This can be used by drivers to provide compatible APIs. + + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + + commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3 + Author: Dave Airlie + Date: Wed May 23 15:09:12 2012 +0100 + + dix: make Create/Free scratch pixmaps take a ScreenPtr + + While technically an API/ABI change I doubt anyone uses it, + but it helps in splitting screens up. + + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + + commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60 + Author: Dave Airlie + Date: Wed May 23 14:57:55 2012 +0100 + + xf86/xv: remove scrnIndexfrom xf86FindXvOptions. + + Move this interface to taking an ScrnInfoPtr. + + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + + commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843 + Author: Dave Airlie + Date: Wed May 23 14:53:59 2012 +0100 + + xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2) + + stop passing indices into this function. + + v2: drop flags argument. + + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + + commit 58824e414f35682435f15bfe6c4b656bd90b9235 + Author: Dave Airlie + Date: Wed May 23 14:48:09 2012 +0100 + + xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI) + + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + + commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd + Author: Dave Airlie + Date: Tue Apr 10 14:18:59 2012 +0100 + + xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2) + + Instead of passing an index, pass the actual ScreenPtr. This allows + more moving towards not abusing xf86Screens + screenInfo. + + v2: drop the blockData/wakeupData args as per ajax's suggestion., + fix docs. + + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + + commit 790d003de20fb47674420a24dadd92412d78620d + Author: Dave Airlie + Date: Wed Apr 11 09:53:14 2012 +0100 + + xf86/common: remove some more pScrn->pScreen uses + + remove some more conversions that appeared after api cleanups. + + Reviewed-by: Alan Coopersmith + Acked-by: Aaron Plattner + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + + commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f + Author: Dave Airlie + Date: Tue Apr 10 16:34:53 2012 +0100 + + ddc: change API to take ScrnInfoPtr (v2) + + This removes all xf86Screens usage from ddc code, + it modifies the API for some functions to avoid taking indices. + + v2: address Alan's comments about dropping DDC2Init parameter. + + Reviewed-by: Alan Coopersmith + Acked-by: Aaron Plattner + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + + commit fe3f57b6eaf6860a33876a54f9439f69578f03a5 + Author: Dave Airlie + Date: Tue Apr 10 16:31:26 2012 +0100 + + vbe: don't use index for VBEInterpretPanelID (API) + + Remove use of xf86screens from vbe module. + + Reviewed-by: Alan Coopersmith + Acked-by: Aaron Plattner + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + + commit abf1965f4ed91529036d3fdb470d6a3ce6f29675 + Author: Dave Airlie + Date: Tue Apr 10 16:25:11 2012 +0100 + + int10/vbe: don't use xf86Screens. (ABI) (v3) + + Pass the ScrnInfoPtr instead of the index in the int10 struct. + + This saves us using it to dereference xf86Screens. + + v2: address Alan's comment to fix struct alignment. + + v3: squash in all the int10 fixes, test the vm86 code builds, + after comments by Keith. + + Reviewed-by: Alan Coopersmith + Acked-by: Aaron Plattner + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + + commit 23cca612b4fb5efc33683c7624b803b457387e3d + Author: Dave Airlie + Date: Tue Apr 10 15:30:18 2012 +0100 + + xserver: drop index argument to ScreenInit (ABI/API) (v2) + + This drops the index argument, its the same as pScreen->myNum, + and its the last major index abuse I can find. + + v2: address Alan's review - update docs, fix xwin/xnest/darwin + + Reviewed-by: Alan Coopersmith + Acked-by: Aaron Plattner + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + + commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960 + Author: Dave Airlie + Date: Tue Apr 10 15:23:01 2012 +0100 + + xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API) + + This migrates PointerMoved from an index to ScrnInfoPtr. + + Reviewed-by: Alan Coopersmith + Acked-by: Aaron Plattner + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + + commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9 + Author: Dave Airlie + Date: Tue Apr 10 15:20:46 2012 +0100 + + xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API) + + This migrates the PMEvent from index to ScrnInfoPtr. + + Reviewed-by: Alan Coopersmith + Acked-by: Aaron Plattner + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + + commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2 + Author: Dave Airlie + Date: Tue Apr 10 15:18:30 2012 +0100 + + xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API) + + This migrates the SetDGAMode callback from an index to ScrnInfoPtr. + + Reviewed-by: Alan Coopersmith + Acked-by: Aaron Plattner + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + + commit baf5e4818a74f2b68c3dfdcc56f54322351039a0 + Author: Dave Airlie + Date: Tue Apr 10 15:14:11 2012 +0100 + + xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2) + + This migrates the ChangeGamma interface to avoid passing a index. + + v2: fix xf86RandR12.c + xf86cmap.c call + + Reviewed-by: Alan Coopersmith + Acked-by: Aaron Plattner + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + + commit 51e5f90ada929d6b23176090badbb42fdb3fa550 + Author: Dave Airlie + Date: Tue Apr 10 15:11:09 2012 +0100 + + xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API) + + The EXA interface migrates to ScreenPtr, + and the xf86 interface migrated to ScrnInfoPtr. + + Reviewed-by: Alan Coopersmith + Acked-by: Aaron Plattner + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + + commit 94f1f21d17e86f96d4a54292a399160950087675 + Author: Dave Airlie + Date: Tue Apr 10 15:02:11 2012 +0100 + + xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API) + + This migrates the ValidMode to passing a ScrnInfoPtr instead + of an index. + + Reviewed-by: Alan Coopersmith + Acked-by: Aaron Plattner + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + + commit 3f8f18198fed4f39ec805b508a3482e91eea26b2 + Author: Dave Airlie + Date: Tue Apr 10 14:59:46 2012 +0100 + + xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2) + + This migrate the SwitchMode interface to take a ScrnInfoPtr + instead of an index. + + v2: drop flags. + + Reviewed-by: Alan Coopersmith + Acked-by: Aaron Plattner + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + + commit d06a038a5c49328ab3a8d969d24f9fcd22c63202 + Author: Dave Airlie + Date: Tue Apr 10 14:50:37 2012 +0100 + + xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2) + + This converts AdjustFrame code paths to passing a ScrnInfoPtr + instead of an integer index. + + v2: drop flags args. + + Reviewed-by: Alan Coopersmith + Acked-by: Aaron Plattner + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + + commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90 + Author: Dave Airlie + Date: Tue Apr 10 14:41:27 2012 +0100 + + xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2) + + Another index->pScrn conversion. + + v2: drop flags arg. + + Reviewed-by: Alan Coopersmith + Acked-by: Aaron Plattner + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + + commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3 + Author: Dave Airlie + Date: Tue Apr 10 14:35:41 2012 +0100 + + xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2) + + This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr + instead of an index into xf86Screens. This allows dropping more + public dereferences of the xf86Screens and screenInfo. + + v2: drop flags args as suggested by Keith, fix docs. + + Reviewed-by: Alan Coopersmith + Acked-by: Aaron Plattner + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + + commit 06729dbbc804a20242e6499f446acb5d94023c3c + Author: Dave Airlie + Date: Tue Apr 10 14:04:59 2012 +0100 + + xserver: remove index from CloseScreen (API/ABI breakage) + + This drops the index from the CloseScreen callback, + its always been useless really, since the pScreen contains it. + + Reviewed-by: Alan Coopersmith + Acked-by: Aaron Plattner + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + +commit 12f9aaff38ac2cf528387ce610e41fbd448698e2 +Author: Chase Douglas +Date: Fri Apr 6 12:44:07 2012 -0700 + + test/touch: Initialize device name + + Without this change, the test will segfault when we switch to signal- + safe logging. + + Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer - (cherry picked from commit e4153c1d9138ed40de1c615525066a0f5bb599dc) -commit f4a1ecb9280570c473631760885cc2afb5d174b9 -Author: Marcin Slusarz -Date: Mon May 21 21:39:43 2012 +0200 +commit 3476eb38063473a7a5fcd78e2095e284118de839 +Merge: 78f0d9c 42ae2e8 +Author: Keith Packard +Date: Sun Jun 3 20:24:24 2012 -0700 - xfree86: fix mouse wheel support for DGA clients - - xf86-input-evdev (since "smooth scrolling" support was added) can send mouse - motion and wheel events in one batch, so we need to handle it properly. - Otherwise mouse wheel events which come with motion events are lost - and separate mouse wheel events are handled through non-DGA path. - - Signed-off-by: Marcin Slusarz - Reviewed-by: Peter Hutterer - Signed-off-by: Peter Hutterer - (cherry picked from commit 2d4fda4b09e67e47d3e6fc4743fc6e81bfe40f28) + Merge remote-tracking branch 'whot/for-keith' -commit 889ce06946b8c1a246130a899e2702a3d7340fd2 -Author: Peter Hutterer -Date: Wed May 9 11:30:46 2012 +1000 - - dix: undo transformation for missing valuators (#49347) - - last.valuators contains the transformed valuators of the device. If the - device submits events with x/y missing, we need to get that from - last.valuators and undo the transformation to that axis. - - X.Org Bug 49347 - - Signed-off-by: Peter Hutterer - Reviewed-by: Chase Douglas - (cherry picked from commit 749a593e49adccdf1225be28a521412ec85333f4) - -commit 4c21adab7ce4290ea038e13dd20a850f50d95f23 +commit 42ae2e8199fe875319978249963de7499607988b Author: Siddhesh Poyarekar Date: Tue May 29 10:17:50 2012 +0530 @@ -236,9 +10388,8 @@ Date: Tue May 29 10:17:50 2012 +0530 Signed-off-by: Siddhesh Poyarekar Signed-off-by: Peter Hutterer - (cherry picked from commit 42ae2e8199fe875319978249963de7499607988b) -commit 472c2d1af75d8e321728589e377f73116adb29fa +commit 88c767edb01ed7efb19ffe3a453e16107b27130b Author: Michal Suchanek Date: Wed May 23 11:22:05 2012 +0200 @@ -253,32 +10404,418 @@ Date: Wed May 23 11:22:05 2012 +0200 Signed-off-by: Michal Suchanek Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit 88c767edb01ed7efb19ffe3a453e16107b27130b) -commit 97cae5e07a8e81c17cf18df7843db6ab1fc6a2a7 -Author: Alan Coopersmith -Date: Thu Jan 26 15:44:40 2012 -0800 +commit 78f0d9cdc441a575e15e5f7200ce74750d2f7ad2 +Author: Chad Versace +Date: Wed May 2 16:18:49 2012 -0700 - Convert sbusPaletteKey to latest DevPrivate API + dri2: Add DRI2GetParam request (v2) - Signed-off-by: Alan Coopersmith - Reviewed-by: Mark Kettenis + Bump dri2proto dependency to 2.7. + Bump DRI2INFOREC_VERSION to 7. + + This new protocol request effectively allows clients to perform feature + detection on the DDX. The request was added in DRI2 protocol 1.4. + + If I had DRI2GetParam in June 2011, when I was implementing support in the + Intel DDX and Mesa for new hardware that required a new DRI2 attachment + format, then I could have avoided a week of pain caused by the necessity + to write a horrid feature detection hack [1] in Mesa. In the future, when + the work begins to add MSAA support to the Intel DDX, having a clean way + to do feature detection will allow us to avoid revisiting and expanding + that hack. + + [1] mesa, commit aea2236a, function intel_verify_dri2_has_hiz + + v2: If driver doesn't define ds->GetParam, dont' crash. Fall back to + default behavior, per keithp. + + Reviewed-by: Keith Packard + Reviewed-by: Eric Anholt (v1) + Reviewed-by: Ian Romanick (v1) + Signed-off-by: Chad Versace + +commit 594b4a4f0601066d09e49a84c5af8c2eb6f07240 +Author: Peter Hutterer +Date: Thu May 24 13:34:11 2012 +1000 + + Xext: include dix-config.h + + silences + In file included from ../include/misc.h:111:0, from hashtable.c:2: + ./include/os.h:559:1: warning: redundant redeclaration of 'strndup' [-Wredundant-decls] + + Signed-off-by: Peter Hutterer + Reviewed-by: Alan Coopersmith + +commit d348ab06aae21c153ecbc3511aeafc8ab66d8303 +Author: Julien Cristau +Date: Fri May 11 21:31:50 2012 +0200 + + Xvfb: destroy the screen pixmap in CloseScreen + + Signed-off-by: Peter Hutterer + Reviewed-by: Peter Hutterer + +commit e4153c1d9138ed40de1c615525066a0f5bb599dc +Author: Julien Cristau +Date: Fri May 11 21:31:49 2012 +0200 + + Xi: make stub DeleteInputDeviceRequest call RemoveDevice + + DeleteInputDeviceRequest is called from CloseDownDevices on reset, so + call RemoveDevice to avoid leaking devices in Xvfb/Xnest/Xwin. + + Signed-off-by: Julien Cristau + Signed-off-by: Peter Hutterer + Reviewed-by: Peter Hutterer + +commit b840ba5f54de5b00a7700ca49e51308b8cc66f92 +Author: Ian Romanick +Date: Fri Dec 16 14:44:55 2011 -0800 + + glx: Implement protocol for glXCreateContextAttribsARB + + Signed-off-by: Ian Romanick Reviewed-by: Dave Airlie - (cherry picked from commit 96e0ab54962ab59f03275a098ee02c1f0f86b94e) + Reviewed-by: Christopher James Halse Rogers -commit 3484ef2de50970fefe0c2580f52357ee37d3e6f3 -Author: Alan Coopersmith -Date: Fri Apr 6 21:51:37 2012 -0700 +commit 23612a63fc12be13442a63193a19f883d7a87e5d +Author: Ian Romanick +Date: Fri Dec 16 14:42:51 2011 -0800 - cvt man page should use Hz, not kHz, for vertical refresh rate + glx: Make several functions available outside the glxcmds.c compilation unit - https://bugs.freedesktop.org/show_bug.cgi?id=48311 + validGlxScreen, validGlxFBConfig, validGlxContext, and + __glXdirectContextCreate will soon be used by createcontext.c. - Signed-off-by: Alan Coopersmith - Reviewed-by: Julien Cristau - (cherry picked from commit c3180a74a4fc6304bcfe676e3285d707874a9fea) + Signed-off-by: Ian Romanick + Reviewed-by: Dave Airlie + Reviewed-by: Christopher James Halse Rogers -commit a5808eae02749507c49978f71d5aba2f3193cb07 +commit cd5689cac5ed722e9dc1a3fab9a260b798062ee6 +Author: Ian Romanick +Date: Sat Dec 10 15:15:18 2011 -0800 + + glx: Use one function to add a context to all global tables + + Instead of having separate __glXAddContextToList and AddResource + functions, just have one function that does both steps. + + Signed-off-by: Ian Romanick + Reviewed-by: Jesse Barnes + Reviewed-by: Christopher James Halse Rogers + +commit c1d91ab37025d3e0df7e8f647fb21816fe0e8420 +Author: Ian Romanick +Date: Sat Dec 10 15:11:57 2011 -0800 + + glx: Initialize remaining context fields + + There is no reason to assume the screen's context allocated + initialized these fields, so don't. + + Signed-off-by: Ian Romanick + Reviewed-by: Jesse Barnes + Reviewed-by: Christopher James Halse Rogers + +commit 0db76e5f771fb964e67de716a254850a38e02f19 +Author: Ian Romanick +Date: Sat Dec 10 15:09:57 2011 -0800 + + glx: Initialize all context fields together + + v2: Fix whitespace error noticed by Christopher James Halse Rogers. + + Signed-off-by: Ian Romanick + Reviewed-by: Jesse Barnes + Reviewed-by: Christopher James Halse Rogers + +commit befa76d251eb5de85edb621056eed52784722bc7 +Author: Ian Romanick +Date: Fri Dec 9 17:28:21 2011 -0800 + + glx: Implement GLX SetClientInfoARB protocol + + v2: Bump glproto version to 1.4.15. This patch uses structure names + that only exist in that glproto version and later. Noticed by + Christopher James Halse Rogers. + + Signed-off-by: Ian Romanick + Reviewed-by: Dave Airlie + Reviewed-by: Christopher James Halse Rogers + +commit 8b8cd6f6f4dbf9d058ace638221f31801da7df9f +Author: Ian Romanick +Date: Mon Dec 5 13:52:01 2011 -0800 + + glx: Optionally call DRI2 createContextAttribs from __glXDRIscreenCreateContext + + Signed-off-by: Ian Romanick + Reviewed-by: Christopher James Halse Rogers + +commit 0a9226376c9a44c3b50baad25f2b7d2b9fecb708 +Author: Ian Romanick +Date: Mon Dec 5 13:48:19 2011 -0800 + + glx: Add tracking for GLX_ARB_create_context and GLX_ARB_create_context_profile + + The formatting of the extension data table was mangled by indent. + This patch also undoes that and adds approripate control comments so + that indent won't do it again. + + Signed-off-by: Ian Romanick + Reviewed-by: Dave Airlie + Reviewed-by: Christopher James Halse Rogers + +commit 96d74138b1c0273e88933220d99a893858b649cd +Author: Ian Romanick +Date: Mon Dec 5 10:56:07 2011 -0800 + + glx: Extend __GLXscreen::createContext to take attributes + + The attributes will be used for glXCreateContextAttribsARB additions + in follow-on patches. + + v2: Add missing 'int *error' parameters noticed by Christopher James + Halse Rogers. + + v3: Remove redundant 'int err;' declaration noticed by Christopher + James Halse Rogers. This was supposed to be in v2, but I missed it. + + v4: Add comma missing from additions in v2. Ugh. + + Signed-off-by: Ian Romanick + Reviewed-by: Jesse Barnes + Reviewed-by: Christopher James Halse Rogers + +commit 62f06b0dcde13cb87bc3d0c5ff86d8db7e3ff0ef +Author: Ian Romanick +Date: Fri Dec 2 21:14:46 2011 -0800 + + glx: Don't track GLClientmajorVersion or GLClientminorVersion + + Nothing uses these fields anywhere in the server. + + Signed-off-by: Ian Romanick + Reviewed-by: Jesse Barnes + Reviewed-by: Christopher James Halse Rogers + +commit 724176a87afdb9a79ce6307214bc2e869530aef3 +Author: Ian Romanick +Date: Mon Dec 5 10:55:20 2011 -0800 + + glx: Fix mishandling of shared contexts + + Signed-off-by: Ian Romanick + Reviewed-by: Eric Anholt + Reviewed-by: Christopher James Halse Rogers + +commit 2d4fda4b09e67e47d3e6fc4743fc6e81bfe40f28 +Author: Marcin Slusarz +Date: Mon May 21 21:39:43 2012 +0200 + + xfree86: fix mouse wheel support for DGA clients + + xf86-input-evdev (since "smooth scrolling" support was added) can send mouse + motion and wheel events in one batch, so we need to handle it properly. + Otherwise mouse wheel events which come with motion events are lost + and separate mouse wheel events are handled through non-DGA path. + + Signed-off-by: Marcin Slusarz + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 9bc53d8cb04af2be3feeebb1b10774c2d599a76b +Author: Michal Srb +Date: Tue May 22 21:19:40 2012 -0700 + + dri2: SProcDRI2Connect - send the response. + + The swapped implementation of DRI2Connect is always responding with empty + device and driver values. However the response was only prepared and never + sent (also had undefined .type member), causing e.g. glxinfo get stuck waiting + for response when started remotely from machine with different endianity. + + Signed-off-by: Michal Srb + Reviewed-by: Jeremy Huddleston + Tested-by: Michel Dänzer + Signed-off-by: Keith Packard + +commit 457fc77691b2df66f6dd3ba10ce7c1b61b9b42a3 +Merge: 2e237c8 5a3a98f +Author: Keith Packard +Date: Tue May 22 10:32:29 2012 -0700 + + Merge remote-tracking branch 'alanc/master' + +commit 2e237c838fe1780c2fcbd2306f35fd15b6747831 +Author: Dave Airlie +Date: Wed Apr 11 10:02:25 2012 +0100 + + xf86: reimplement XF86SCRNINFO macro using new functions. + + This macro did lookups via privates but we can just use the ScreenToScrn + conversion instead. + + This patch drops all in-server uses, we should drop the macro later, + once drivers have been converted to not use it. + + Reviewed-by: Adam Jackson + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit 8da35202f390cd8a0410814911017d99fa9dddcb +Author: Dave Airlie +Date: Wed Apr 11 09:53:35 2012 +0100 + + xf86/modes: drop more pScrn->pScreen usages + + Just simple conversion to use the lookup function. + + Reviewed-by: Adam Jackson + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit e7a9e30fd20a7c2a526783726d0a76b8a04b053a +Author: Dave Airlie +Date: Wed Apr 11 09:52:37 2012 +0100 + + xaa: convert pScrn->pScreen to use accessor. + + This uses a standard conversion function to do the conversion. + + Reviewed-by: Adam Jackson + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit 738367ac9b6179593a38074d0105de206cbed296 +Author: Dave Airlie +Date: Wed Apr 11 09:46:39 2012 +0100 + + xf86/modes: drop two uses of screenInfo + + Just use new macros to access scrn->screen. + + Reviewed-by: Adam Jackson + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit cc4fe613d0b0891ea9502340801b37e64301f573 +Author: Dave Airlie +Date: Sat May 5 09:47:24 2012 +0100 + + render/exa: use glyph picture accessors + + use the glyph picture accessors in the X server, render and EXA code. + + Reviewed-by: Aaron Plattner + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit a45e1d6cc6f2a5f31ed737294351cfa251caa030 +Author: Dave Airlie +Date: Sat May 5 09:38:28 2012 +0100 + + render: add GetGlyphPicture accessor. + + This is a new API to stop the drivers directly looking up the glyph pictures + in a global array. It provides a define GLYPH_HAS_GLYPH_PICTURE_ACCESSOR for + drivers to work in a compat way. + + Reviewed-by: Aaron Plattner + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit 41151f88a62f01b00c1912822b8b430df1eb307e +Author: Dave Airlie +Date: Tue Apr 10 15:47:33 2012 +0100 + + xf86: migrate to using xf86ScreenToScrn wrapper (v2) + + migrate to new helper API. + + This just wraps all the obvious uses of xf86Screens[pScreen->myNum], + and should be fairly simple to review. + + v2: remove commented out lines. + + Reviewed-by: Aaron Plattner + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit 53932b3803fa2c02949fd7d4d0e433ea58fa89f1 +Author: Dave Airlie +Date: Tue Apr 10 15:47:32 2012 +0100 + + xf86: add helper functions to convert to from ScrnInfoPtr/ScreenPtr (v2) + + These are just simple functions that we should start migrating drivers + to using. + + The end goal is to remove xf86Screens and screenInfo from the ABI. + + This includes a define XF86_HAS_SCRN_CONV that drivers can ifdef to provide + their own copies. I'll probably post a generic compat.h file for drivers later. + + v2: add asserts. + + Reviewed-by: Aaron Plattner + Reviewed-by: Keith Packard + Signed-off-by: Dave Airlie + +commit 39f73e813f7d404498629f6104a9003d092af28d +Author: Dave Airlie +Date: Tue May 8 13:01:12 2012 +0100 + + xf86/pci: fix slot claiming counting. + + Currently if we claim a slot for a PCI driver, we never let it go properly, + this prevents the fallback probe from reusing the slot, even though it + isn't claimed for that pci slot. + + So if you set the modesetting driver to point at a specific kms device, + that isn't a PCI device (i.e. USB dongle), then the modesetting driver + loads, the pci probe tries to bind the config slot to the primary PCI + device, however we then check the kms device bus id to discover it + isn't valid. However we don't remove the claim on the slot. Next the + old probe function is called and there is no slots to claim. + + This patch fixes that and converts the pciSlotClaimed boolean into + a counter, and changes the unclaim api to take a device pointer + to remove from the entity. + + Reviewed-by: Adam Jackson + Signed-off-by: Dave Airlie + +commit 07dcc3f1a98dff2ee374a15ac5beac778d2ccc97 +Author: Dave Airlie +Date: Sun May 6 17:13:02 2012 +0100 + + config/udev: add pre_init stage to config and udev. + + In order to use udev for gpu enumeration, we need to init udev earlier + than input initialisations. This splits the config init stuff so that udev + pre init sets up before output initialisation. + + this is just a prepatory patch, doesn't change anything major. + + Reviewed-by: Peter Hutterer + Signed-off-by: Dave Airlie + +commit a2a02882ab65133e6c0c69db1f38bc20b406236f +Author: Dave Airlie +Date: Sun May 6 17:35:34 2012 +0100 + + xfree86: add modesetting driver to fallback list on Linux + + Add the modesetting driver to the fallback list on Linux, after vesa + before fbdev. + + Acked-by: Peter Hutterer + Signed-off-by: Dave Airlie + +commit 5a3a98fcb799c2ac8fa7494645ad9030f1cac837 Author: Alan Coopersmith Date: Fri Apr 27 13:35:32 2012 -0700 @@ -289,9 +10826,8 @@ Date: Fri Apr 27 13:35:32 2012 -0700 Signed-off-by: Alan Coopersmith Reviewed-by: Dave Airlie Reviewed-by: Adam Jackson - (cherry picked from commit 5a3a98fcb799c2ac8fa7494645ad9030f1cac837) -commit 9a4e2d80a5e79f6818879d682bb21a47acefc550 +commit afcb7ba24ebd9968d48a192df438e7f1c0ecb770 Author: Alan Coopersmith Date: Fri Apr 27 13:31:56 2012 -0700 @@ -304,9 +10840,36 @@ Date: Fri Apr 27 13:31:56 2012 -0700 Signed-off-by: Alan Coopersmith Reviewed-by: Dave Airlie Reviewed-by: Adam Jackson - (cherry picked from commit afcb7ba24ebd9968d48a192df438e7f1c0ecb770) -commit 19126c0b36843f7c0e81631d1a1228d18e39eb62 +commit c3180a74a4fc6304bcfe676e3285d707874a9fea +Author: Alan Coopersmith +Date: Fri Apr 6 21:51:37 2012 -0700 + + cvt man page should use Hz, not kHz, for vertical refresh rate + + https://bugs.freedesktop.org/show_bug.cgi?id=48311 + + Signed-off-by: Alan Coopersmith + Reviewed-by: Julien Cristau + +commit 96e0ab54962ab59f03275a098ee02c1f0f86b94e +Author: Alan Coopersmith +Date: Thu Jan 26 15:44:40 2012 -0800 + + Convert sbusPaletteKey to latest DevPrivate API + + Signed-off-by: Alan Coopersmith + Reviewed-by: Mark Kettenis + Reviewed-by: Dave Airlie + +commit ba883a0f3435d5da82a8134e696c4905eea70f23 +Merge: ae1c48e acdc4f5 +Author: Keith Packard +Date: Thu May 17 16:49:19 2012 -0700 + + Merge remote-tracking branch 'jeremyhu/master' + +commit acdc4f54ee5784d26c251ff8c941b4360ae80e9b Author: Jeremy Huddleston Date: Thu May 17 10:08:02 2012 -0700 @@ -315,9 +10878,18 @@ Date: Thu May 17 10:08:02 2012 -0700 http://xquartz.macosforge.org/trac/ticket/579 Signed-off-by: Jeremy Huddleston - (cherry picked from commit acdc4f54ee5784d26c251ff8c941b4360ae80e9b) -commit 198a876e34b880be5f7da683ec3ff21a53edcec5 +commit c495211373a118acee02a29c6eb25a332abc856c +Author: Jeremy Huddleston +Date: Thu May 17 16:20:30 2012 -0700 + + XQuartz: Declare noPseudoramiXExtension for miinitext.c + + Regression-from: 6699f54fe0b3f4952a75e46fb6c3a643988e65dd + + Signed-off-by: Jeremy Huddleston + +commit f5fc5334116ad2b0c8930ac68c52bf0f7a2f1417 Author: Jeremy Huddleston Date: Mon May 7 17:07:27 2012 -0700 @@ -325,9 +10897,8 @@ Date: Mon May 7 17:07:27 2012 -0700 Regression-from: 30623d6ff7bca223f9e1a825e86bd317eef8bf16 Signed-off-by: Jeremy Huddleston - (cherry picked from commit f5fc5334116ad2b0c8930ac68c52bf0f7a2f1417) -commit 300970f8f80ef15614fef78215476a8011895000 +commit e0097ce9719f9b0aeccf7102630c0299f8acdf93 Author: Jeremy Huddleston Date: Mon May 7 16:31:38 2012 -0700 @@ -339,69 +10910,382 @@ Date: Mon May 7 16:31:38 2012 -0700 Reported-by: Peter Dyballa Signed-off-by: Jeremy Huddleston - (cherry picked from commit e0097ce9719f9b0aeccf7102630c0299f8acdf93) -commit 21956e2f8e506dd167f188be0d3b18e052c6913d +commit 4acbaa3027d89728ed932616f6ef66d93537b101 Author: Jeremy Huddleston Date: Mon May 7 16:16:20 2012 -0700 XQuartz: Workaround an SDK bug on Leopard/x86_64 Signed-off-by: Jeremy Huddleston - (cherry picked from commit 4acbaa3027d89728ed932616f6ef66d93537b101) -commit 131fe8fbd17edb05084cd7cddc3c4d3d3b393d73 -Author: Jeremy Huddleston -Date: Tue May 29 13:05:02 2012 -0700 +commit ae1c48ebc8a3c0b32b3d732e8a340bfe00bb9f79 +Author: Peter Hutterer +Date: Wed May 16 10:54:48 2012 +1000 - configure.ac: Version bump to 1.12.2 + Xi: fix "discards ''const' qualifier" warnings - Signed-off-by: Jeremy Huddleston - -commit 4a2b8eebd1e93a8a0d003e9f5a594430eff08dad -Author: Jeremy Huddleston -Date: Sat May 19 22:11:19 2012 -0700 - - configure.ac: Version bump to 1.12.1.902 (1.12.2 RC2) + extinit.c: In function 'XInputExtensionInit': + extinit.c:1301:29: warning: assignment discards 'const' qualifier from + pointer target type [enabled by default] + extinit.c:1303:36: warning: assignment discards 'const' qualifier from + pointer target type [enabled by default] - Signed-off-by: Jeremy Huddleston - -commit 32235e978685d3ebe9c418fecfe3ec584c402008 -Merge: 58dfb13 dab90b6 -Author: Jeremy Huddleston -Date: Thu May 17 09:56:29 2012 -0700 - - Merge remote-tracking branch 'whot/server-1.12-branch' into server-1.12-branch - -commit dab90b60f3b2ebfd8df4fa761f3f34859250f4db -Author: Chase Douglas -Date: Tue May 1 10:21:12 2012 -0700 - - Report touch emulated buttons in XIQueryPointer for XI 2.1 and earlier + property.c: In function 'XIChangeDeviceProperty': + xiproperty.c:757:39: warning: cast discards '__attribute__((const))' + qualifier from pointer target type [-Wcast-qual] - XInput 2.1 and earlier clients do not know about touches. We must report - touch emulated button presses for these clients. For later clients, we - only report true pointer button presses. + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + +commit e42bf98283ddc4eac2213c96e8ebcd711583e6b1 +Author: Peter Hutterer +Date: Wed May 16 10:47:45 2012 +1000 + + Xi: fix "shadows previous local" warnings - Signed-off-by: Chase Douglas + exevents.c: In function 'DeepCopyFeedbackClasses': + exevents.c:272:20: warning: declaration of 'classes' shadows a previous + local [-Wshadow] + exevents.c:245:16: warning: shadowed declaration is here [-Wshadow] + (and a few more like this) + + exevents.c: In function 'DeliverTouchEmulatedEvent': + exevents.c:1442:27: warning: declaration of 'win' shadows a parameter + [-Wshadow] + exevents.c:1404:55: warning: shadowed declaration is here [-Wshadow] + exevents.c:1475:28: warning: declaration of 'listener' shadows a parameter + [-Wshadow] + exevents.c:1403:62: warning: shadowed declaration is here [-Wshadow] + + xiselectev.c: In function 'ProcXISelectEvents': + xiselectev.c:178:34: warning: declaration of 'dummy' shadows a previous + local [-Wshadow] + xiselectev.c:91:18: warning: shadowed declaration is here [-Wshadow] + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + +commit ca6d25ad2d1fb4efae9d40c7e74c8494f9918625 +Author: Peter Hutterer +Date: Wed May 16 10:10:11 2012 +1000 + + dix: Move DeviceFocusEvent from Xi into enterleave.c + + This is only called from the enterleave implementation, so move it and its + helper functions to there. No functional changes. + + Fixes build error introduced in 31174565ec0090b4c03c9334c82878be2455f938 if + building with '-Werror=implicit-function-declaration' + + Signed-off-by: Peter Hutterer + Reviewed-by: Dave Airlie + Reviewed-by: Jeremy Huddleston + +commit 749a593e49adccdf1225be28a521412ec85333f4 +Author: Peter Hutterer +Date: Wed May 9 11:30:46 2012 +1000 + + dix: undo transformation for missing valuators (#49347) + + last.valuators contains the transformed valuators of the device. If the + device submits events with x/y missing, we need to get that from + last.valuators and undo the transformation to that axis. + + X.Org Bug 49347 + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + +commit 03318835a5a87a8a5cb3515130b5380d565c0d91 +Author: Peter Hutterer +Date: Mon May 14 15:06:56 2012 +1000 + + include: don't redeclare device events in xkbsrv.h + + ../../include/xkbsrv.h:308:51: warning: redundant redeclaration of + ‘DeviceKeyPress’ [-Wredundant-decls] + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + +commit 43754803c13c232fd5c37eb3d4b1ca2898d6a6cd +Author: Peter Hutterer +Date: Mon May 14 15:07:57 2012 +1000 + + test: don't shadow parameter 'len' + + protocol-xiquerydevice.c:226:25: warning: declaration of ‘len’ shadows a + parameter [-Wshadow] + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + +commit 1bafc9f26bef0997c98b97efa888ed5e2a54f6f0 +Author: Peter Hutterer +Date: Mon May 14 15:01:09 2012 +1000 + + test: fix redundant declaration of "BadDevice" + + In file included from protocol-common.c:36:0: + protocol-common.h:36:12: warning: redundant redeclaration of ‘BadDevice’ + [-Wredundant-decls] + In file included from protocol-common.c:30:0: + ../../Xi/exglobals.h:41:12: note: previous declaration of ‘BadDevice’ was + here + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + +commit 47e1d0ea43eb7a6caf774f375f11849d0d515e14 +Author: Peter Hutterer +Date: Mon May 14 14:56:02 2012 +1000 + + test: fix "userdata shadows global declaration" warnings + + protocol-xiquerypointer.c:124:72: warning: declaration of + ‘userdata’ shadows a global declaration [-Wshadow] + + and similar + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + +commit e6da635826bdda7f67bd492dda8dba8a97809213 +Author: Peter Hutterer +Date: Mon May 14 14:51:58 2012 +1000 + + test: fix "redundant declaration of devices" warning + + In file included from protocol-xiwarppointer.c:41:0: + protocol-common.h:91:23: warning: redundant redeclaration of ‘devices’ + [-Wredundant-decls] + protocol-common.h:86:3: note: previous declaration of ‘devices’ was here + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + +commit 693a31e704c0745b209e69711522417c4fa8541e +Author: Simon Thum +Date: Mon Apr 2 18:49:53 2012 +0200 + + dix: indentation fixes for pointer acceleration + + Signed-off-by: Simon Thum Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit ee542b85590814ee25369babce1ad14feeb137af) -commit 04474fc6a4c21a06c1a65c7afcbc4e0a27e3d0f7 -Author: Chase Douglas -Date: Tue May 1 10:21:11 2012 -0700 +commit 31174565ec0090b4c03c9334c82878be2455f938 +Author: Michal Suchanek +Date: Wed Apr 25 15:03:31 2012 +0200 - Report logical button state in ProcXIQueryPointer + dix: Remove redundant declarations. - Physical button state is usually meaningless to an X client. - - Signed-off-by: Chase Douglas - Signed-off-by: Peter Hutterer - Reviewed-by: Peter Hutterer - (cherry picked from commit 1e7b500a8e1d79b91a4e857a2da06194efe8cf69) + Signed-off-by: Michal Suchanek + Reviewed-by: Dave Airlie + Signed-off-by: Dave Airlie -commit 3b25ed442ca9152841fa821ac3b01c2c9cb4e0d1 +commit f1cec791d1def506b99b0e6c160e9e8be107bd13 +Author: Michal Suchanek +Date: Tue Apr 24 20:08:02 2012 +0200 + + xfree86: Add ifdef wrapper to xvmodproc.h + + Signed-off-by: Michal Suchanek + Reviewed-by: Dave Airlie + Signed-off-by: Dave Airlie + +commit d2f71b13946a14d9698d0355cc45b114b236e73b +Author: Michal Suchanek +Date: Tue Apr 24 18:44:48 2012 +0200 + + Xi: Remove redundant declaration. + + Signed-off-by: Michal Suchanek + Reviewed-by: Dave Airlie + Signed-off-by: Dave Airlie + +commit a4f87f885a55373a6daf56fd540e10c5f1db5a5c +Author: Michal Suchanek +Date: Tue Apr 24 18:43:31 2012 +0200 + + kdrive: Remove redundant declarations. + + Signed-off-by: Michal Suchanek + Reviewed-by: Dave Airlie + Signed-off-by: Dave Airlie + +commit 369edd78769fa1a174e4091d0fa0722350df5d68 +Author: Michal Suchanek +Date: Tue Apr 24 18:41:07 2012 +0200 + + dix: don't duplicate DoFocusEvents declaration. + + Signed-off-by: Michal Suchanek + Reviewed-by: Dave Airlie + Signed-off-by: Dave Airlie + +commit 36377fb0e88a6d237d98805e802ab3793582c976 +Author: Michal Suchanek +Date: Tue Apr 24 18:37:30 2012 +0200 + + dix: Remove redundant declarations. + + Signed-off-by: Michal Suchanek + Reviewed-by: Dave Airlie + Signed-off-by: Dave Airlie + +commit ea9ed83f8f0da241099d0a11c3460d46c5114dea +Author: Michal Suchanek +Date: Tue Apr 24 18:32:53 2012 +0200 + + xfree86: don't include xvmodproc.h when not needed + + The functions are already declared in xf86xv.h + + Signed-off-by: Michal Suchanek + Reviewed-by: Dave Airlie + Signed-off-by: Dave Airlie + +commit 1927e5ab25c9c9bf481e75ac50f4b140a96e634a +Author: Michal Suchanek +Date: Tue Apr 24 18:24:19 2012 +0200 + + xserver: Remove duplicate declaration in resource.h + + Signed-off-by: Michal Suchanek + Reviewed-by: Dave Airlie + Signed-off-by: Dave Airlie + +commit 1339681e4fbd4f5981e6246eedb23e8a9c5d10f4 +Author: Michal Suchanek +Date: Tue Apr 24 18:19:43 2012 +0200 + + miext: Remove redundant declaration. + + Signed-off-by: Michal Suchanek + Reviewed-by: Dave Airlie + Signed-off-by: Dave Airlie + +commit 6699f54fe0b3f4952a75e46fb6c3a643988e65dd +Author: Michal Suchanek +Date: Tue Apr 24 18:18:43 2012 +0200 + + mi: Remove redundant declarations. + + Signed-off-by: Michal Suchanek + Reviewed-by: Dave Airlie + Signed-off-by: Dave Airlie + +commit b4bf90f9fb20e0e56d2451096d4f62ecfc24a962 +Author: Michal Suchanek +Date: Tue Apr 24 18:16:30 2012 +0200 + + exa: Remove redundant declaration. + + Signed-off-by: Michal Suchanek + Reviewed-by: Dave Airlie + Signed-off-by: Dave Airlie + +commit 5595e7ce0735db6f82e1fe9df45434826019bf9e +Author: Michal Suchanek +Date: Tue Apr 24 18:15:17 2012 +0200 + + randr: Remove redundant declaration. + + Signed-off-by: Michal Suchanek + Reviewed-by: Dave Airlie + Signed-off-by: Dave Airlie + +commit c59c9dac84301f8eb2a0e4a09a8839146aa5a069 +Author: Michal Suchanek +Date: Tue Apr 24 18:13:22 2012 +0200 + + xkb: Remove redundant declarations. + + Signed-off-by: Michal Suchanek + Reviewed-by: Dave Airlie + Signed-off-by: Dave Airlie + +commit d0a83460451df1a4c5667b2f414c35ee81b4ffa4 +Author: Michal Suchanek +Date: Tue Apr 24 18:11:16 2012 +0200 + + xfixes: remove redundant declaration. + + Signed-off-by: Michal Suchanek + Reviewed-by: Dave Airlie + Signed-off-by: Dave Airlie + +commit 3a94b338aaa48b656aae1bb3a5a9d64300c0a093 +Merge: afc153a c91d00e +Author: Keith Packard +Date: Wed May 9 21:17:16 2012 -0700 + + Merge remote-tracking branch 'whot/for-keith' + +commit afc153a5b4fc58ae70dc214f61a71b1a8c855f06 +Author: James Cloos +Date: Tue May 8 17:55:10 2012 -0400 + + Fix RANDR’s gamma_to_ramp(). + + In order to generate a 256-entry ramp in [0,65535] which covers the full + range, one must mupliply eight-bit values not by 256 but rather by 257. + + Many years back – well before the RANDR extension was written, and + before xorg@fdo – a similar bug fix was made to the DIX for converting + client-supplied eight-bit color values into sixteen-bit values. + + Noticed by: Elle Stone and Graeme Gill. + + Signed-off-by: James Cloos + +commit e501c34d4937d5e6f19abd29f1ec7f95faa3bb55 +Author: Yaakov Selkowitz +Date: Tue May 1 22:03:24 2012 -0500 + + hw/xwin/glx: Use silent rules + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Jon TURNEY + +commit 026d402fef623a0bda0bedd9c0938ba787bf9829 +Author: Yaakov Selkowitz +Date: Fri Mar 30 14:33:18 2012 -0500 + + xfree86: use silent rules with sdksyms generation + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Jon TURNEY + +commit 3d98dac46c17bc6e03546b8a532bfb55f00e5084 +Author: Yaakov Selkowitz +Date: Sun Apr 29 20:45:17 2012 -0500 + + xfree86: respect EXEEXT in relink target + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Jon TURNEY + +commit e6461db6dcb437cfa7d4b23008c2c12f8169ff79 +Author: Yaakov Selkowitz +Date: Thu Apr 26 01:49:06 2012 -0500 + + os: Add CryptoAPI as a choice of SHA1 implementation + + Both Cygwin and MinGW can use Windows' native CryptoAPI for SHA1, + saving a dependency on libgcrypt or OpenSSL. The necessary functions + are in ADVAPI32.DLL, which is among the default lib flags and is + already used in hw/xwin for accessing the registry. + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Mikhail Gusarov + Reviewed-by: Jon TURNEY + Reviewed-by: Colin Harrison + Tested-by: Colin Harrison + +commit c91d00e0f330b9de604068e1bfcb0a307096434f Author: Daniel Kurtz Date: Wed Apr 18 17:51:53 2012 +0800 @@ -425,9 +11309,8 @@ Date: Wed Apr 18 17:51:53 2012 +0800 Signed-off-by: Daniel Kurtz Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit c91d00e0f330b9de604068e1bfcb0a307096434f) -commit 34a82b393a037788fbebbc423bfdcdd6f94f3577 +commit 6ce0eac4f8a05f6d7401445cab95027709d3a479 Author: Daniel Kurtz Date: Wed Apr 18 17:51:52 2012 +0800 @@ -456,9 +11339,8 @@ Date: Wed Apr 18 17:51:52 2012 +0800 Signed-off-by: Daniel Kurtz Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit 6ce0eac4f8a05f6d7401445cab95027709d3a479) -commit 8998037f183fd1f73fe0d272b4e072e53c7f3bcc +commit 5c2e2a164d615ab06be28a663734e782614b5cc7 Author: Daniel Kurtz Date: Wed Apr 18 09:51:51 2012 +0000 @@ -473,9 +11355,8 @@ Date: Wed Apr 18 09:51:51 2012 +0000 Signed-off-by: Daniel Kurtz Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit 5c2e2a164d615ab06be28a663734e782614b5cc7) -commit 9a2030ea26a2a0821d87afea502f5446ae002a6d +commit c30862879d2c766519780bb7f353f35edf0daa9b Author: Daniel Kurtz Date: Wed Apr 18 17:51:50 2012 +0800 @@ -487,113 +11368,105 @@ Date: Wed Apr 18 17:51:50 2012 +0800 Signed-off-by: Daniel Kurtz Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit c30862879d2c766519780bb7f353f35edf0daa9b) -commit 58dfb13953af71021317b9d85230b1163198f031 -Author: Jeremy Huddleston -Date: Thu May 10 00:53:20 2012 -0700 +commit 97041364a6acb2b66b5cfd06757c90a006ad50e9 +Merge: 1908272 ee542b8 +Author: Keith Packard +Date: Wed May 2 20:47:25 2012 -0700 - Revert "dix: when disabling a device, release all buttons and keys" + Merge remote-tracking branch 'whot/for-keith' - This reverts commit 90299556db24543bb7365e8c2897deca3aa219e7. - - The commit being reverted triggered a segfault on server shutdown when a - device posts raw events after the root windows are forced to NULL. - - https://lists.debian.org/debian-x/2012/05/msg00240.html - - Signed-off-by: Jeremy Huddleston + No conflicts here -commit f012f0c48dedba4df69cc1a1ecdf8ee5d37daca9 -Author: Michal Suchanek -Date: Thu Apr 26 15:11:20 2012 +0200 +commit ee542b85590814ee25369babce1ad14feeb137af +Author: Chase Douglas +Date: Tue May 1 10:21:12 2012 -0700 - dmx: Annotate dmxlog.c with _X_ATTRIBUTE_PRINTF and _X_NORETURN + Report touch emulated buttons in XIQueryPointer for XI 2.1 and earlier - and fix resulting printf warning in dmxLogVisual + XInput 2.1 and earlier clients do not know about touches. We must report + touch emulated button presses for these clients. For later clients, we + only report true pointer button presses. - Signed-off-by: Michal Suchanek + Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit d662fa2450856777b59c4b62b912395a8bfd52fd) -commit f8d2ca759ad37d5e99d462f21a2259ce17bb1a00 -Author: Peter Hutterer -Date: Wed Apr 18 15:56:37 2012 +1000 +commit 19082726cb2c69f53e9720904521e3c98f788bff +Author: Ryan Pavlik +Date: Fri Oct 21 12:47:38 2011 -0500 - dix: indentation fix + configure.ac: on MinGW, link with ws2_32 instead of winsock2 + ws2_32 is the correct name for the libary (even on 64 bit Windows :-)) + + Signed-off-by: Ryan Pavlik + Reviewed-by: Jon TURNEY + Reviewed-by: Yaakov Selkowitz + +commit ad9605a3e21b20fa8565dc6701610712ac6dd9e1 +Author: Ryan Pavlik +Date: Fri Nov 4 13:26:14 2011 -0500 + + configure.ac: MinGW doesn't have setuid binaries either. + + If the target platform isn't in a list of platforms we know don't use a + setuid binary, we try to test if we can chown something to root. + + This test possibly won't give the right answer if we are cross-compiling, + which is common for the MinGW target. This patch adds MinGW to the list + of platforms we know don't use a setuid binary. + + Signed-off-by: Ryan Pavlik + Reviewed-by: Jon TURNEY + Reviewed-by: Yaakov Selkowitz + +commit 2225208c2ef9857f14813376ce85d305f19263dd +Author: Ryan Pavlik +Date: Fri Nov 4 13:30:43 2011 -0500 + + configure.ac: auto-disable MITSHM if we lack IPC + + The MITSHM extension uses SYSV IPC, but even if configure's test + for IPC failed, MITSHM was still enabled by default, breaking + MinGW builds by default. + + Unfortunately, fixing this exposes the fact that the HAVE_SYSV_IPC + test wasn't being used for anything before and so we hadn't noticed it + was failing on Cygwin. + + Change from using SHM_W|SHM_R flags (which aren't required by POSIX) to + S_IRUSR|S_IWUSR flags (which are) + + Signed-off-by: Ryan Pavlik + Reviewed-by: Jon TURNEY + Reviewed-by: Yaakov Selkowitz + +commit 1e7b500a8e1d79b91a4e857a2da06194efe8cf69 +Author: Chase Douglas +Date: Tue May 1 10:21:11 2012 -0700 + + Report logical button state in ProcXIQueryPointer + + Physical button state is usually meaningless to an X client. + + Signed-off-by: Chase Douglas Signed-off-by: Peter Hutterer - (cherry picked from commit ebf214876a4885a98ded4f5525925b69005fae05) + Reviewed-by: Peter Hutterer -commit 15607cf2dc87405606b20113011f1ebd97637d32 -Author: Daniel Kurtz -Date: Thu Apr 12 10:11:10 2012 +1000 +commit 0426e6d65b6598edfbcb2fc66ee65fb08256469e +Author: Jon TURNEY +Date: Tue Jan 3 00:14:32 2012 +0000 - dix: don't BUG_WARN for button events from button-only device + configure.ac: Make default configuration for MinGW disable unsupported extensions and DDXs - Events from button-only devices still need coordinates, and they get them - from scale_to_desktop(). Therefore, a dev without valuators is not a bug. - However, a dev with valuators, but less than two of them still is a bug. + Same as the default configuration for Cygwin, --disable-xorg and --disable-dmx DDX by default, + and force --disable-xv and other unsupported extensions - This was noticed when unplugging a "Creative Technology SB Arena Headset", - which has some BTNs and some KEYs, but no REL or ABS valuators. - It emits [BTN_3] = 0 on unplug, which would trigger the BUG_WARN. - - Signed-off-by: Daniel Kurtz - Reviewed-by: Chase Douglas - Signed-off-by: Peter Hutterer - (cherry picked from commit c5a45b0f7658c77725adce2b64a0fbd62f208328) + Signed-off-by: Jon TURNEY + Reviewed-by: Yaakov Selkowitz -commit 3ad72a80088fe3236f38bd0696b04f399e24fe3d -Author: Keith Packard -Date: Wed Apr 11 09:33:54 2012 -0700 - - hw/xfree86: Re-indent xf86vmode.c - - This is the result of re-running the 'x-indent.sh' script over - xf86vmode.c to clean up the disaster caused by broken syntax in the - file. - - Signed-off-by: Keith Packard - (cherry picked from commit 9779b904c7c0b49c74054c22c420012c40595cdc) - -commit b5bf0ac5405eab77f26bb2f8726644232af17178 -Author: Keith Packard -Date: Wed Apr 11 09:28:21 2012 -0700 - - hw/xfree86: Spurious ');' in xf86vmode.c messed up indentation badly - - Inside the unfinished XF86VIDMODE_EVENTS #ifdef block the - function definition for xf86VidModeNotifyEvent had an extra ');' - before the prototype argument declarations. This was harmless for the - compiler as the code never gets used, but completely messed up the - file re-indentation. This patch removes the spurious characters in - preparation for re-indenting the file. - - Signed-off-by: Keith Packard - (cherry picked from commit 592bd0ae2b60cd6f6afd3efc40f5f659b12900b4) - -commit 943cac51e4cb79dcbd143d4bd6b22ca9327e7703 -Author: Jeremy Huddleston -Date: Mon May 7 00:03:01 2012 -0700 - - configure.ac: Bump to 1.12.1.901 (1.12.2 RC1) - - Signed-off-by: Jeremy Huddleston - -commit 22a1953c4a2747d637bb926034f11134809b8d06 -Author: Jeremy Huddleston -Date: Thu Apr 26 21:17:54 2012 -0700 - - XQuartz: Make sure we tell startx the correct server binary to use in our fallback path - - With multiple servers installed, we can't be certain if X is Xorg or Xquartz - - Signed-off-by: Jeremy Huddleston - (cherry picked from commit 93d6ba5b711cbd3f502d83e54c9739856d2e6f2a) - -commit 90299556db24543bb7365e8c2897deca3aa219e7 +commit f3410b97cf9b48a47bee3d15d232f8a88e75f4ef Author: Peter Hutterer Date: Mon Apr 30 10:01:48 2012 +1000 @@ -607,13 +11480,8 @@ Date: Mon Apr 30 10:01:48 2012 +1000 Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas - (cherry picked from commit f3410b97cf9b48a47bee3d15d232f8a88e75f4ef) - - Conflicts: - - dix/devices.c -commit b53cdf4c53f0787ed41281278877e0405fcb2674 +commit af88b43f9e604157b74270d609c08bdfa256a792 Author: Peter Hutterer Date: Fri Apr 27 16:31:17 2012 +1000 @@ -638,9 +11506,8 @@ Date: Fri Apr 27 16:31:17 2012 +1000 Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas - (cherry picked from commit af88b43f9e604157b74270d609c08bdfa256a792) -commit 9ddf9e2388f9ac5f4c325304ab0c59c1fd5e2024 +commit 08962951de969b9d8c870af8b6e47303dc0decfd Author: Peter Hutterer Date: Fri Apr 27 10:52:39 2012 +1000 @@ -656,9 +11523,20 @@ Date: Fri Apr 27 10:52:39 2012 +1000 Signed-off-by: Peter Hutterer Reviewed-by: Chase Douglas - (cherry picked from commit 08962951de969b9d8c870af8b6e47303dc0decfd) -commit 345761be71b86b687f407eb8de746a33bab7ad2e +commit d662fa2450856777b59c4b62b912395a8bfd52fd +Author: Michal Suchanek +Date: Thu Apr 26 15:11:20 2012 +0200 + + dmx: Annotate dmxlog.c with _X_ATTRIBUTE_PRINTF and _X_NORETURN + + and fix resulting printf warning in dmxLogVisual + + Signed-off-by: Michal Suchanek + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 5c361d59c5031d9b3f7f9093a52d2b1ff4d9ae5f Author: Chase Douglas Date: Fri Apr 20 11:08:15 2012 -0700 @@ -667,9 +11545,71 @@ Date: Fri Apr 20 11:08:15 2012 -0700 Signed-off-by: Chase Douglas Reviewed-by: Bryce Harrington Signed-off-by: Peter Hutterer - (cherry picked from commit 5c361d59c5031d9b3f7f9093a52d2b1ff4d9ae5f) -commit ed33772a0d3ace5844e157ae78885ded000819ea +commit 88bacc49f06da5927f716869f5a32672a8297ed0 +Author: Chase Douglas +Date: Wed Apr 4 15:29:42 2012 -0700 + + os: Add -displayfd option + + This option specifies a file descriptor in the launching process. X + will scan for an available display number and write that number back to + the launching process, at the same time as SIGUSR1 generation. This + means display managers don't need to guess at available display numbers. + As a consequence, if X fails to start when using -displayfd, it's not + because the display was in use, so there's no point in retrying the X + launch on a higher display number. + + Signed-off-by: Adam Jackson + Signed-off-by: Chase Douglas + Reviewed-by: Julien Cristau + Tested-by: Julien Cristau + Reviewed-by: Alan Coopersmith + Signed-off-by: Peter Hutterer + +commit 1d82ec95942b88dd01f0ac6b883368360a0b5fe6 +Author: Michal Suchanek +Date: Mon Apr 23 13:52:40 2012 +0200 + + xserver: Fix out-of-tree build + + Fixes regression caused by ccb3e78124fb05defd0c9b438746b79d84dfc3ae + + Signed-off-by: Michal Suchanek + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit ea51e9b2877df60135edaf2a8f88d0f2a2b41060 +Author: Peter Hutterer +Date: Mon Apr 23 10:35:53 2012 +1000 + + Xi: return BadValue on XIQueryVersion if the version is less than first call + + Clients that use plugin systems may require multiple calls to + XIQueryVersion from different plugins. The current error handling requires + client-side synchronisation of version numbers. + + The first call to XIQueryVersion defines the server behaviour. Once cached, + always return that version number to any clients. Unless a client requests a + version lower than the first defined one, then a BadValue must be returned + to be protocol-compatible. + + Introduced in 2c23ef83b0e03e163aeeb06133538606886f4e9c + + Signed-off-by: Peter Hutterer + Reviewed-by: Jeremy Huddleston + +commit 93d6ba5b711cbd3f502d83e54c9739856d2e6f2a +Author: Jeremy Huddleston +Date: Thu Apr 26 21:17:54 2012 -0700 + + XQuartz: Make sure we tell startx the correct server binary to use in our fallback path + + With multiple servers installed, we can't be certain if X is Xorg or Xquartz + + Signed-off-by: Jeremy Huddleston + +commit fa6dddc6ce51c1b7a43fb379fb2a19550f6c8683 Author: Michal Suchanek Date: Wed Mar 28 18:12:39 2012 -0700 @@ -680,9 +11620,8 @@ Date: Wed Mar 28 18:12:39 2012 -0700 Signed-off-by: Michal Suchanek Reviewed-by: Jeremy Huddleston Tested-by: Knut Petersen - (cherry picked from commit fa6dddc6ce51c1b7a43fb379fb2a19550f6c8683) -commit e4dbdee392c78de13fab03c3826f9453f42a8a46 +commit adcb48a29dcb3f32ff570551de4b014775c1e147 Author: Jonas Maebe Date: Sun Apr 22 20:52:47 2012 -0700 @@ -695,9 +11634,8 @@ Date: Sun Apr 22 20:52:47 2012 -0700 Signed-off-by: Jonas Maebe Reviewed-by: Jeremy Huddleston - (cherry picked from commit adcb48a29dcb3f32ff570551de4b014775c1e147) -commit 6b45dff0240729a78a43cc74f1631b2dd5a0d6b3 +commit e34519e525559b01a63d26639f13f0487468de28 Author: Jeremy Huddleston Date: Thu Apr 19 16:38:06 2012 -0700 @@ -709,9 +11647,8 @@ Date: Thu Apr 19 16:38:06 2012 -0700 http://xquartz.macosforge.org/trac/ticket/548 Signed-off-by: Jeremy Huddleston - (cherry picked from commit e34519e525559b01a63d26639f13f0487468de28) -commit 0d13e62da2b3527db7b3b6de91464015eb20a514 +commit 662d41acdde1dcb9774fbe4054e251c708acaffe Author: Jeremy Huddleston Date: Thu Apr 19 18:48:22 2012 -0700 @@ -729,18 +11666,16 @@ Date: Thu Apr 19 18:48:22 2012 -0700 http://xquartz.macosforge.org/trac/ticket/562 Signed-off-by: Jeremy Huddleston - (cherry picked from commit 662d41acdde1dcb9774fbe4054e251c708acaffe) -commit 287f8271a3af18fb1a56a761fa02ec76148d9e32 +commit eda85290ae47d8dd497ef9335d10268bbe3e02a0 Author: Jeremy Huddleston Date: Thu Apr 19 16:20:30 2012 -0700 XQuartz: Use screenInfo.{width,height} instead of grabbing it from the first screen Signed-off-by: Jeremy Huddleston - (cherry picked from commit eda85290ae47d8dd497ef9335d10268bbe3e02a0) -commit 67cc65ba3ca35b4eb9592e1e6f299938509cddec +commit b99586c9086ac29df144ef75df92f8c0c7554651 Author: Jeremy Huddleston Date: Wed Apr 18 17:50:55 2012 -0700 @@ -751,9 +11686,8 @@ Date: Wed Apr 18 17:50:55 2012 -0700 prepares us for future changes. Signed-off-by: Jeremy Huddleston - (cherry picked from commit b99586c9086ac29df144ef75df92f8c0c7554651) -commit 72226dc434a5d1c4ec391390fe5f2a2c34287fb3 +commit 30623d6ff7bca223f9e1a825e86bd317eef8bf16 Author: Jeremy Huddleston Date: Thu Apr 19 16:06:45 2012 -0700 @@ -761,9 +11695,8 @@ Date: Thu Apr 19 16:06:45 2012 -0700 Reported-by: Joe Rohde Signed-off-by: Jeremy Huddleston - (cherry picked from commit 30623d6ff7bca223f9e1a825e86bd317eef8bf16) -commit 8a48d44574375ba4fa85c5a59678998811ea4e80 +commit b4c4c65a35640e7274ccd4228f62110147878b72 Author: Jeremy Huddleston Date: Wed Apr 18 01:01:44 2012 -0700 @@ -773,9 +11706,74 @@ Date: Wed Apr 18 01:01:44 2012 -0700 anybody cares about this running in Tiger or Leopard. Signed-off-by: Jeremy Huddleston - (cherry picked from commit b4c4c65a35640e7274ccd4228f62110147878b72) -commit 9ef48c9ffff6704dbe7c976d86527f22b0e1d114 +commit d1ef0d4964e43a4ab777750ad214d1092fd1ffda +Author: Jeremy Huddleston +Date: Sat Apr 7 15:26:53 2012 -0700 + + test: Fix make dist + + It seems like make dist should be doing te right thing without this commit, + but it's not in some cases. Don't ask me to explain why. + + Signed-off-by: Jeremy Huddleston + +commit d97868d934fd1a00f9e9ef23a1154a70c7bc0464 +Author: Jeremy Huddleston +Date: Thu Apr 19 16:39:23 2012 -0700 + + os: Annotate OsVendorFatalError as _X_ATTRIBUTE_PRINTF + + Signed-off-by: Jeremy Huddleston + Tested-By: Michal Suchanek + +commit 0ba1794fe2896395875f62e911720c7585687444 +Author: Jeremy Huddleston +Date: Thu Apr 19 16:51:46 2012 -0700 + + xres: Fix build without composite + + Regression from: b8d0d19a6d410776b53a41e7cae90f68d4b22bb7 + Signed-off-by: Jeremy Huddleston + Reviewed-by: Rami Ylimäki + Tested-By: Michal Suchanek + +commit d77eb7ee49ef19c2c4c7381d56e9d0f9c3fbc890 +Merge: 31e3c0f c7b1625 +Author: Keith Packard +Date: Thu Apr 19 15:48:34 2012 -0500 + + Merge remote-tracking branch 'yselkowitz/master' + + Pull in Cygwin for XFree86 + +commit 31e3c0ff7f5fb36421be8de06e5f6e675ec26ddc +Author: Keith Packard +Date: Thu Apr 19 15:25:41 2012 -0500 + + Export CompositeClientWindowType + + Make sure CompositeClientWindowType is visible for XResource v1.2 + + Signed-off-by: Keith Packard + +commit e6308e32fe2b5f74133d4d238ffa512257f6327c +Merge: 3720aa3 51a8d8d +Author: Keith Packard +Date: Thu Apr 19 10:45:07 2012 -0500 + + Merge remote-tracking branch 'whot/for-keith' + + Touch input changes from Chase + +commit 51a8d8dd19d7496fe84b37a1f0a7a03658120539 +Merge: ebf2148 00cf1c4 +Author: Peter Hutterer +Date: Thu Apr 19 17:03:54 2012 +1000 + + Merge branch 'input-fixes' of git://people.freedesktop.org/~cndougla/xserver into for-keith + +commit 00cf1c40b28417d7035c2917d048553eb720023c Author: Chase Douglas Date: Wed Apr 18 18:21:54 2012 -0700 @@ -788,9 +11786,8 @@ Date: Wed Apr 18 18:21:54 2012 -0700 Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer - (cherry picked from commit 00cf1c40b28417d7035c2917d048553eb720023c) -commit 73cd880fe05c941391a8604406e9ecf657a77f02 +commit 312910b4e34215aaa50fc0c6092684d5878dc32f Author: Chase Douglas Date: Wed Apr 18 11:15:40 2012 -0700 @@ -805,9 +11802,8 @@ Date: Wed Apr 18 11:15:40 2012 -0700 Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer - (cherry picked from commit 312910b4e34215aaa50fc0c6092684d5878dc32f) -commit 96d8df5bc9d400d55830b23afe5525b222f8dfc7 +commit a986f2f30cbe2a00e72ded7315c4951d7703e549 Author: Chase Douglas Date: Tue Apr 17 11:40:15 2012 -0700 @@ -821,9 +11817,8 @@ Date: Tue Apr 17 11:40:15 2012 -0700 Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer - (cherry picked from commit a986f2f30cbe2a00e72ded7315c4951d7703e549) -commit a9dbdb49698a15ba9bdf4172a6e2fef6133244f3 +commit ec9c4295830c3de610e65aca17f4da4a7af3c4c5 Author: Chase Douglas Date: Wed Apr 18 12:04:58 2012 -0700 @@ -835,9 +11830,8 @@ Date: Wed Apr 18 12:04:58 2012 -0700 Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer - (cherry picked from commit ec9c4295830c3de610e65aca17f4da4a7af3c4c5) -commit 04431dd5e60dc91b61767157914b874515a18feb +commit e175971a6f44d94aa8306dc6b9228ccb2c8a0b4d Author: Chase Douglas Date: Tue Apr 17 11:39:10 2012 -0700 @@ -850,9 +11844,8 @@ Date: Tue Apr 17 11:39:10 2012 -0700 Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer - (cherry picked from commit e175971a6f44d94aa8306dc6b9228ccb2c8a0b4d) -commit 8ce9616a2ccd3f80bf56d69cb9e3fad89996fffb +commit d0449851d1233543c3133d77e0ab7233319cdf5f Author: Chase Douglas Date: Tue Apr 17 10:49:14 2012 -0700 @@ -871,9 +11864,8 @@ Date: Tue Apr 17 10:49:14 2012 -0700 Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer - (cherry picked from commit d0449851d1233543c3133d77e0ab7233319cdf5f) -commit da9cedb1e5e50acc7d3dc40398e1a460b7e3cfdc +commit 3d06bfe93d33cfe6150d8fb0058ee7bc8d80622b Author: Chase Douglas Date: Tue Apr 17 13:56:08 2012 -0700 @@ -886,9 +11878,8 @@ Date: Tue Apr 17 13:56:08 2012 -0700 Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer - (cherry picked from commit 3d06bfe93d33cfe6150d8fb0058ee7bc8d80622b) -commit 7be71cb0894052943f94638ffa405cf8dd61bc4a +commit 2efbed23c29020f9994ab7c3155ce7386950dc7a Author: Chase Douglas Date: Tue Apr 17 08:39:38 2012 -0700 @@ -905,9 +11896,8 @@ Date: Tue Apr 17 08:39:38 2012 -0700 Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer - (cherry picked from commit 2efbed23c29020f9994ab7c3155ce7386950dc7a) -commit 8ccc6ad63733c7de6bd64b1b11169836d941455b +commit ef64b5ee97099618cf2e2cbbd3e471095695ae24 Author: Chase Douglas Date: Mon Apr 16 15:53:51 2012 -0700 @@ -918,9 +11908,8 @@ Date: Mon Apr 16 15:53:51 2012 -0700 Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer - (cherry picked from commit ef64b5ee97099618cf2e2cbbd3e471095695ae24) -commit ea3afab228f44d9a41905daeda4c0f9236dbf8e6 +commit fc518cd9f59060cc19bb90361767c0f47f0e25eb Author: Chase Douglas Date: Mon Apr 16 15:31:47 2012 -0700 @@ -931,9 +11920,8 @@ Date: Mon Apr 16 15:31:47 2012 -0700 Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer - (cherry picked from commit fc518cd9f59060cc19bb90361767c0f47f0e25eb) -commit fac2c4a5dc1d19bb347729eee8b1bbfc981b853a +commit 80d7d1ec6a9d61aa96e7d019dc1bee29d90cea34 Author: Chase Douglas Date: Mon Apr 16 14:19:59 2012 -0700 @@ -945,9 +11933,8 @@ Date: Mon Apr 16 14:19:59 2012 -0700 Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer - (cherry picked from commit 80d7d1ec6a9d61aa96e7d019dc1bee29d90cea34) -commit aaf0063bde791659009eb9001485ac8c15745ae8 +commit 8dfd98245d2c44a1eb4c8b7c275e6cfc10fe40f1 Author: Chase Douglas Date: Wed Apr 11 11:14:51 2012 -0700 @@ -958,9 +11945,8 @@ Date: Wed Apr 11 11:14:51 2012 -0700 Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer - (cherry picked from commit 8dfd98245d2c44a1eb4c8b7c275e6cfc10fe40f1) -commit acb74b9b36b55d4f80d85fd6a2790b7c72e197a5 +commit 6ca30cb33e829b4edd01822367e44ffe6f0951b0 Author: Chase Douglas Date: Wed Apr 11 08:17:25 2012 -0700 @@ -972,9 +11958,8 @@ Date: Wed Apr 11 08:17:25 2012 -0700 Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer - (cherry picked from commit 6ca30cb33e829b4edd01822367e44ffe6f0951b0) -commit 0dea2b1c935ed4c80621e7f5d6fa5193ae09187a +commit cacdb9a74065ccba7d50a82e14abdf04b36c5309 Author: Chase Douglas Date: Wed Apr 11 08:13:17 2012 -0700 @@ -992,9 +11977,8 @@ Date: Wed Apr 11 08:13:17 2012 -0700 Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer - (cherry picked from commit cacdb9a74065ccba7d50a82e14abdf04b36c5309) -commit 2bb2eeb05c973ba410773e380e49c2503a2fe9e6 +commit 447fe7a1a72513aa68145962c47894242c589cc9 Author: Chase Douglas Date: Wed Apr 11 08:12:08 2012 -0700 @@ -1004,9 +11988,8 @@ Date: Wed Apr 11 08:12:08 2012 -0700 Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer - (cherry picked from commit 447fe7a1a72513aa68145962c47894242c589cc9) -commit a37539e794e2bff87ea68e0023cd0cce2bb8de60 +commit 93c33403642a3de3c9d141ad7940a7b880846aad Author: Chase Douglas Date: Wed Apr 4 12:59:55 2012 -0700 @@ -1019,9 +12002,8 @@ Date: Wed Apr 4 12:59:55 2012 -0700 Signed-off-by: Chase Douglas Reviewed-by: Jeremy Huddleston Acked-by: Peter Hutterer - (cherry picked from commit 93c33403642a3de3c9d141ad7940a7b880846aad) -commit d21d69c2d6b1eb292e9d3f6682339e93603913c9 +commit 4c1dfd21937efc6a85fb204a73dd7d7151d54daa Author: Chase Douglas Date: Wed Apr 4 12:57:40 2012 -0700 @@ -1034,9 +12016,160 @@ Date: Wed Apr 4 12:57:40 2012 -0700 Signed-off-by: Chase Douglas Reviewed-by: Jeremy Huddleston Acked-by: Peter Hutterer - (cherry picked from commit 4c1dfd21937efc6a85fb204a73dd7d7151d54daa) -commit 3d3ed6023077c0324fcbf446f387edb1db677b84 +commit 3720aa33ee50788dd3d4acc9bbf8dfcb72c8f5ce +Author: Erkki Seppälä +Date: Thu Apr 7 12:53:51 2011 +0300 + + Added resourceproto version dependency, >= 1.2.0 now required + + Signed-off-by: Erkki Seppälä + +commit 233eab4d05cae1fdb4129a2e9905961b78693f74 +Author: Erkki Seppälä +Date: Wed Dec 8 17:09:30 2010 +0200 + + dix: add reference count of the resource to ResourceSizeRec + + The ResourceSizeRec now contains the number of references to the + resource. For example a Pixmap knows this value and it can be useful + for determining the "weight" of the resource. Typically this value + is 1. + + Reviewed-by: Rami Ylimäki + Signed-off-by: Erkki Seppälä + +commit ccb3e78124fb05defd0c9b438746b79d84dfc3ae +Author: Erkki Seppälä +Date: Tue Dec 14 12:18:23 2010 +0200 + + Xext: add a generic hashtable implementation + + The generic hashtable implementation adds a key-value container, that + keeps the key and value inside the hashtable structure and manages + their memory by itself. This data structure is best suited for + fixed-length keys and values. + + One creates a new hash table with ht_create and disposes it with + ht_destroy. ht_create accepts the key and value sizes (in bytes) in + addition to the hashing and comparison functions to use. When adding + keys with ht_add, they will be copied into the hash and a pointer to + the value will be returned: data may be put into this structure (or if + the hash table is to be used as a set, one can just not put anything + in). + + The hash table comes also with one generic hashing function plus a + comparison function to facilitate ease of use. It also has a custom + hashing and comparison functions for hashing resource IDs with + HashXID. + + Reviewed-by: Rami Ylimäki + Signed-off-by: Erkki Seppälä + +commit a2ac01a8ea8508ed35aa844a589672c1165e05e4 +Author: Erkki Seppälä +Date: Wed Apr 6 10:16:53 2011 +0300 + + dix: don't use a local wrapper for calling HashResourceID + + Calls to Hash(client, id) were replaced with calls directly to + HashResourceID(id, clientTable[client].hashsize) and the Hash-function + was removed. + + Signed-off-by: Erkki Seppälä + +commit a0b0fb83f91bb82534a0d83fdd6c0222567b098d +Author: Erkki Seppälä +Date: Mon Dec 20 12:58:37 2010 +0200 + + dix: add hashing functions to resource.h for others to use. + + The public hashing function HashResourceID uses the same hashing + hashing algorithm as resource.c uses internally, but it provides an + interface that will is usable by external modules. It provides a + parameter for the number of bits for the hash, instead of finding the + size from its internal hash table. + + Signed-off-by: Erkki Seppälä + +commit 3ba0decb4b55a1fd122d269e15b2b2da8ced8624 +Author: Erkki Seppälä +Date: Wed Dec 8 15:30:57 2010 +0200 + + dix: add a mechanism for iterating through all subresources + + The mechanism allows iterating even through subresources that don't + have specific XID's. When such 'resources' are iterated, the XID for + them will be zero. A resource type can assign an iteration function + for its subresources with SetResourceTypeFindSubResFunc; by default + resources are assumed not to contain subresources. + + The purpose of this extension is to enable accurate accounting of + the resources a resource consumes or uses. + + This patch provides the subresource iteration functions for Windows + and GCs. + + Reviewed-by: Rami Ylimäki + Signed-off-by: Erkki Seppälä + +commit b8d0d19a6d410776b53a41e7cae90f68d4b22bb7 +Author: Rami Ylimäki +Date: Wed Oct 27 17:25:50 2010 +0300 + + composite: Report pixmap usage of client windows to resource extension. + + Signed-off-by: Erkki Seppälä + Signed-off-by: Rami Ylimäki + Reviewed-by: Mikhail Gusarov + Reviewed-by: Tiago Vignatti + +commit e83388cc70e21e7f377ed2e417d04469e23eb706 +Author: Rami Ylimäki +Date: Wed Oct 27 16:59:06 2010 +0300 + + render: Report pixmap usage of pictures to resource extension. + + Signed-off-by: Erkki Seppälä + Signed-off-by: Rami Ylimäki + Reviewed-by: Mikhail Gusarov + Reviewed-by: Tiago Vignatti + +commit 96864bfa951ea8bf4ab697753fc62c6a97598bc0 +Author: Erkki Seppälä +Date: Mon Nov 29 12:40:56 2010 +0200 + + Implemented first part of XResource extension v1.2: X_XResQueryClientIds + + This patch implements a part of the XResource extension v1.2 (as specified in + http://patchwork.freedesktop.org/patch/2720/ ). The request implemented is + X_XResQueryClientIds. + + This patch depends on the feature introduced by + 1e933665bef26c74196bb7c59910e6a78bcacf0e "dix: Add facilities for + client ID tracking." . + + This latest version also adds Doxygen-formatted comments and takes a better + notice of coding conventions (as in http://www.x.org/wiki/CodingStyle ). + + Signed-off-by: Erkki Seppälä + +commit ebf214876a4885a98ded4f5525925b69005fae05 +Author: Peter Hutterer +Date: Wed Apr 18 15:56:37 2012 +1000 + + dix: indentation fix + + Signed-off-by: Peter Hutterer + +commit 80fefc42f5e67e6b4a4b440d8991bee7e5f38359 +Merge: 9779b90 12188c8 +Author: Keith Packard +Date: Sun Apr 15 21:05:30 2012 -0700 + + Merge remote-tracking branch 'whot/for-keith' + +commit 12188c8a8a537b38b1ca4cf8c0de5447e19c886a Author: Chase Douglas Date: Tue Apr 3 17:31:01 2012 -0700 @@ -1049,9 +12182,8 @@ Date: Tue Apr 3 17:31:01 2012 -0700 Signed-off-by: Chase Douglas Signed-off-by: Peter Hutterer - (cherry picked from commit 12188c8a8a537b38b1ca4cf8c0de5447e19c886a) -commit 50b71dcfb8b2ec14a55a119f042509d69847d776 +commit 32ece7c09bf0ebc3d99b4078aacebbd44314776a Author: Chase Douglas Date: Tue Apr 10 17:12:42 2012 -0700 @@ -1075,9 +12207,8 @@ Date: Tue Apr 10 17:12:42 2012 -0700 Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit 32ece7c09bf0ebc3d99b4078aacebbd44314776a) -commit fb01dfb55a6a718affa9354c384823e462ee784a +commit 163b0f375d73c05873fb341652de3ed347337828 Author: Chase Douglas Date: Tue Apr 10 17:12:41 2012 -0700 @@ -1090,9 +12221,8 @@ Date: Tue Apr 10 17:12:41 2012 -0700 Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit 163b0f375d73c05873fb341652de3ed347337828) -commit b56c1f95bb2d22996651e0a5ca6b6b0e71710a7b +commit 210cd12c47d063f97915ff23292b61d09abfd73a Author: Chase Douglas Date: Tue Apr 10 17:12:40 2012 -0700 @@ -1106,84 +12236,191 @@ Date: Tue Apr 10 17:12:40 2012 -0700 Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer - (cherry picked from commit 210cd12c47d063f97915ff23292b61d09abfd73a) -commit 8ca5a94f454d04ed5f1d0b18272a838b8e7f1e7a -Author: Andreas Wettstein -Date: Sat Feb 25 20:48:17 2012 +0100 - - XKB: Redirect actions defunct with Gtk3 (XInput?) - - When redirect actions are used with Gtk3, Gtk3 complained about - events not holding a GdkDevice. This was caused by device IDs - not being set for redirect actions. - - More seriously, Gtk3 did not receive state changes redirect - actions might specify. This was because event_set_state in - dix/inpututils.c accesses the prev_state field, but the changes - for the redirect action were only put into the state field. - - Signed-off-by: Andreas Wettstein - Reviewed-by: Peter Hutterer - Signed-off-by: Peter Hutterer - (cherry picked from commit 9e017cf0cf1f0c9d0d9c2cfeb82ea5dc0eb5905e) - -commit d75da4eccbabc3f83937cbd4eb2d6be2fd27a4b9 +commit 82a1ae0af3b136371638659c3e909880a99f721c Author: Peter Hutterer -Date: Mon Feb 20 12:09:33 2012 +1000 +Date: Thu Apr 12 15:54:00 2012 +1000 - dix: IsFloating() on master devices is always false + xfree86: after VT switching back, only enable previously enabled devices - There are a few subtle bugs during startup where IsFloating() returns true - if the device is a master device that is not yet paired with its keyboard - device. - - Force IsFloating() to always return FALSE for master devices, that was the - intent after all and any code that relies on the other behaviour should be - fixed instead. + If a device was enabled before the VT switch, re-enabled it. Otherwise leave + it as is, there was probably a reason why it was disabled. Signed-off-by: Peter Hutterer - Reviewed-by: Jeremy Huddleston - Tested-by: Jon TURNEY - (cherry picked from commit 5497ce3da442d27c2dc7796bfef6ccd670bbadc4) + Reviewed-by: Chase Douglas + Reviewed-by: Daniel Stone -commit 38e73f7fc29fe8e9defa8a0516a50ac3a84e10c2 -Author: Jeremy Huddleston -Date: Fri Apr 13 15:44:08 2012 -0700 +commit c5a45b0f7658c77725adce2b64a0fbd62f208328 +Author: Daniel Kurtz +Date: Thu Apr 12 10:11:10 2012 +1000 - configure.ac: Bump to 1.12.1 + dix: don't BUG_WARN for button events from button-only device - Signed-off-by: Jeremy Huddleston - -commit d603515dbfef94ec9cf7f5538815a954511e9e70 -Author: Jeremy Huddleston -Date: Mon Apr 9 19:37:31 2012 -0700 - - configure.ac: Bump to 1.12.0.902 (1.12.1 RC2) + Events from button-only devices still need coordinates, and they get them + from scale_to_desktop(). Therefore, a dev without valuators is not a bug. + However, a dev with valuators, but less than two of them still is a bug. - Signed-off-by: Jeremy Huddleston - -commit 7e62bc31c65aedcdf55cd7dc02b349b6b5c0812c -Author: Jeremy Huddleston -Date: Sat Apr 7 15:26:53 2012 -0700 - - test: Fix make dist + This was noticed when unplugging a "Creative Technology SB Arena Headset", + which has some BTNs and some KEYs, but no REL or ABS valuators. + It emits [BTN_3] = 0 on unplug, which would trigger the BUG_WARN. - I don't know why this fixes the problem with make dist, but it does... - - Signed-off-by: Jeremy Huddleston + Signed-off-by: Daniel Kurtz + Reviewed-by: Chase Douglas + Signed-off-by: Peter Hutterer -commit ad89533327919223204021738dd108d7dd814e8c -Author: Jeremy Huddleston -Date: Mon Apr 9 19:36:04 2012 -0700 +commit 9779b904c7c0b49c74054c22c420012c40595cdc +Author: Keith Packard +Date: Wed Apr 11 09:33:54 2012 -0700 + + hw/xfree86: Re-indent xf86vmode.c + + This is the result of re-running the 'x-indent.sh' script over + xf86vmode.c to clean up the disaster caused by broken syntax in the + file. + + Signed-off-by: Keith Packard + +commit 592bd0ae2b60cd6f6afd3efc40f5f659b12900b4 +Author: Keith Packard +Date: Wed Apr 11 09:28:21 2012 -0700 + + hw/xfree86: Spurious ');' in xf86vmode.c messed up indentation badly + + Inside the unfinished XF86VIDMODE_EVENTS #ifdef block the + function definition for xf86VidModeNotifyEvent had an extra ');' + before the prototype argument declarations. This was harmless for the + compiler as the code never gets used, but completely messed up the + file re-indentation. This patch removes the spurious characters in + preparation for re-indenting the file. + + Signed-off-by: Keith Packard + +commit 72cfc1a097dc1e09d2cd9415ef7855a2cef92351 +Author: Peter Hutterer +Date: Wed Apr 11 09:43:23 2012 +1000 + + Xi: fix XITouchClass sourceid assignment + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + +commit 10cd6fdc431d2d0835c313b2f5bdda6dcea281fd +Author: Keith Packard +Date: Sun Apr 8 00:16:54 2012 -0700 Revert "xfree86: workaround crash on close" - This reverts commit b704d9146336c3044be2be7ae38ce2c5b5a47f86. + This reverts commit 55f552adb651715d2620db7248cd5b9b8187654a. - This was causing some regressions. Reverting as discussed on xorg-devel. + This appears to cause a crash at init time instead of close. + + Reported-by: Knut Petersen + Acked-by: Jeremy Huddleston + Signed-off-by: Keith Packard -commit 259aa5a69b69aa72be3fb7402b68560f9a6b05d6 +commit c7b162555849ab2d4cb195d02d98a40494c5ce55 +Author: Yaakov Selkowitz +Date: Thu Mar 29 02:26:41 2012 -0500 + + xfree86: link modules against Xorg symbols on Cygwin + + As a PE platform, all symbols in both EXEs and DLLs must be resolved + at link time. As Xorg modules depend on symbols in the Xorg + executable, we must build Xorg before its modules, creating an implib + from the former which is used to link the latter. This implib must + then be installed in order to build the drivers. + + Currently only two drivers are supported on Cygwin: xf86-video-dummy + (to replace Xvfb/Xfake) and xf86-video-nested (to replace Xnest/Xephyr). + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Jon TURNEY + Reviewed-by: Jeremy Huddleston + +commit 2dffdcd60f70f534ad730830fe97f0bb1a192e2a +Author: Yaakov Selkowitz +Date: Thu Mar 29 02:23:17 2012 -0500 + + xf86Config: load DIX libraries before drivers on Cygwin + + Cygwin doesn't have ELF rpath capabilities, so these libraries need + to be loaded before the drivers (namely dummy and nested) which + depend on their symbols. + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Jon TURNEY + Reviewed-by: Jeremy Huddleston + +commit 5dd3d2dbbafee28142552640ac6ef3eef2e6d9d3 +Author: Yaakov Selkowitz +Date: Thu Mar 29 02:21:01 2012 -0500 + + xf86Init: provide ddxBeforeReset ifdef DDXBEFORERESET + + This is necessary when building Xorg and XWin simultaneously, otherwise + undefined symbol errors result in sdksyms.c. + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Jon TURNEY + Reviewed-by: Jeremy Huddleston + +commit 96186bc7219a88e549928707b3da4b8bfc16c54d +Author: Yaakov Selkowitz +Date: Thu Mar 29 02:18:41 2012 -0500 + + loader: add Cygwin support + + Cygwin libraries use the .dll extension and "cyg" prefix in place of "lib". + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Jon TURNEY + Reviewed-by: Jeremy Huddleston + +commit 0ce48729d34ab610ff119303355883048b651500 +Author: Yaakov Selkowitz +Date: Thu Mar 29 02:17:22 2012 -0500 + + os-support: add Cygwin support + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Jon TURNEY + Reviewed-by: Jeremy Huddleston + +commit fd115ee114e95b4e7b96f789d3ad67e2e15555de +Author: Yaakov Selkowitz +Date: Thu Mar 29 02:13:27 2012 -0500 + + xfree86: allow modules to be built without undefined symbols + + This will be necessary to port Xorg to Cygwin, but other platforms may + find this useful as well. + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Jon TURNEY + Reviewed-by: Jeremy Huddleston + +commit 12cd7ca83c35bc61fbda7e61535692e3ec78194c +Author: Yaakov Selkowitz +Date: Thu Mar 29 02:06:36 2012 -0500 + + Cygwin/X: disable all unused or unapplicable extensions in configure + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Jon TURNEY + Reviewed-by: Jeremy Huddleston + +commit cb5661e86d4a428ec0ca4efc30a1a165d94d7215 +Author: Yaakov Selkowitz +Date: Tue Mar 27 22:16:08 2012 -0500 + + xf86Crtc: include "xf86xv.h" only if XV + + Signed-off-by: Yaakov Selkowitz + Reviewed-by: Alan Coopersmith + Reviewed-by: Jon TURNEY + Reviewed-by: Jeremy Huddleston + +commit 1110facdfeb95b1ad47d03c0ca3d73933b86dbd6 Author: Chase Douglas Date: Thu Mar 29 18:06:03 2012 -0700 @@ -1197,9 +12434,8 @@ Date: Thu Mar 29 18:06:03 2012 -0700 Signed-off-by: Chase Douglas Reviewed-by: Peter Hutterer Signed-off-by: Keith Packard - (cherry picked from commit 1110facdfeb95b1ad47d03c0ca3d73933b86dbd6) -commit 42474e98ec4245c9e80fc0e9a4b287f3999324f2 +commit e9d3848d7bda7f7de4c0f497aee4482d0b30ad49 Author: Jeremy Huddleston Date: Thu Apr 5 14:03:35 2012 -0700 @@ -1209,9 +12445,8 @@ Date: Thu Apr 5 14:03:35 2012 -0700 Regression introduced by: 7790dc86384cc451ac44663737fde84dd81ad4e1 Signed-off-by: Jeremy Huddleston - (cherry picked from commit e9d3848d7bda7f7de4c0f497aee4482d0b30ad49) -commit 4b3ac1b563c3de32ad13e794fefabd5124648393 +commit 6cb83b78c47b80556cb4d573524d60f0cd1a64ac Author: Jeremy Huddleston Date: Fri Mar 30 14:29:48 2012 -0700 @@ -1220,9 +12455,19 @@ Date: Fri Mar 30 14:29:48 2012 -0700 Fixes: https://trac.macports.org/ticket/33818 Signed-off-by: Jeremy Huddleston - (cherry picked from commit 6cb83b78c47b80556cb4d573524d60f0cd1a64ac) -commit b704d9146336c3044be2be7ae38ce2c5b5a47f86 +commit eca58ee4db43d85e5940919be094c38ad166d5d0 +Author: Jeremy Huddleston +Date: Wed Mar 28 15:07:51 2012 -0700 + + os: Fix regression with FatalError not calling va_start + + Regression From: a818b305989bbcde4e585112a7ee70cbc0b14a92 + + Found-by: Colin Harrison + Signed-off-by: Jeremy Huddleston + +commit 55f552adb651715d2620db7248cd5b9b8187654a Author: Michal Suchanek Date: Wed Mar 28 18:12:39 2012 -0700 @@ -1232,144 +12477,89 @@ Date: Wed Mar 28 18:12:39 2012 -0700 Signed-off-by: Michal Suchanek Reviewed-by: Jeremy Huddleston - (cherry picked from commit 55f552adb651715d2620db7248cd5b9b8187654a) -commit 391f75e87515fcc89b8e5cd058401c4a056d9139 -Author: Jeremy Huddleston -Date: Fri Mar 30 16:01:57 2012 -0700 - - configure.ac: Bump to 1.12.0.901 (1.12.1 RC1) - - Signed-off-by: Jeremy Huddleston - -commit 5eb20062208177172ff3443e522096a2e8f2f1e8 +commit 641a1b9363d59808d2586f9e84847ccc69701482 Author: Peter Hutterer -Date: Wed Mar 21 14:05:29 2012 +1000 +Date: Mon Mar 26 10:34:34 2012 +1000 - dix: set raw event values before adding up relative values (#46976) + test: reset the client before checking the swapped version - Regression introduced in 4e52cc0ef48145134cd58d357fb7289e6f8bb709 - - Raw event values are values as-is from the driver, modified only be - transformation or acceleration. 4e52cc caused the mask to be updated from - relative to absolute coordinates which then got written into the raw events. - - Move the raw event update into the respective branches for absolute/relative - events. - - X.Org Bug 46976 - - Signed-off-by: Peter Hutterer - Reviewed-by: Chase Douglas - Reviewed-by: Daniel Stone - Tested-by: Sven Arvidsson - Reviewed-by: Simon Thum - (cherry picked from commit 908ab3d580188533168c8cdfd2cab9dc689b4218) - -commit a095f7ae96a353073add83e78f88f29d854d289d -Author: Peter Hutterer -Date: Wed Mar 21 14:03:27 2012 +1000 - - dix: fix compiler warning "unused variable 'scr'" - - getevents.c: In function 'updateSlaveDeviceCoords': - getevents.c:326:15: warning: unused variable 'scr' [-Wunused-variable] - - Signed-off-by: Peter Hutterer - (cherry picked from commit 9c3bd3ae652af386b6821b197d24528f20ba867d) - -commit d0a6d9bcefaf56aa63708ea69e5c399dbf266d63 -Author: Peter Hutterer -Date: Mon Mar 12 16:26:29 2012 +1000 - - Xext: drop InitServertime() declaration. - - Not implemented anywhere. + As of 2c23ef83b0e03e163aeeb06133538606886f4e9c, the server returns BadValue + for the same client with multiple versions. Avoid this by resetting the + client before we issue the same request as a fake swap client. Signed-off-by: Peter Hutterer Reviewed-by: Jeremy Huddleston - Reviewed-by: Bryce Harrington - (cherry picked from commit 5910f2df58beaae2187438fef0b62c29a563e853) + Tested-by: Jeremy Huddleston -commit f8446ad3d71cdf9c2200f5584bd156c629fe3c90 -Author: Chase Douglas -Date: Wed Mar 7 16:06:27 2012 -0800 - - Use a new sprite trace for indirect touches when all touches have physically ended - - All touches of an indirect device, such as a trackpad, are sent to the - same window set. When there are no active touches, a new window set is - created; otherwise, the window set of an existing touch is copied. - - The current code checks for any logically active touches. This includes - touches that have physically ended but are still logically active due to - unhandled touch grabs. Instead, we want a new window set whenever there - are no physically active touches. - - This change skips over logically active but pending end touches, which - are touches that have physically ended. - - Signed-off-by: Chase Douglas - Reviewed-by: Peter Hutterer - Signed-off-by: Peter Hutterer - (cherry picked from commit 31df08a449cf9b6e1740e1c02257997490630d93) - -commit 5a3ec826e653377e8b70e7553d1f0ca72210447c -Author: Chase Douglas -Date: Wed Mar 7 16:06:26 2012 -0800 - - Xi: Fix TouchEnd to TouchUpdate change for one accepted grab - - If there is only one listener of a touch, the listener is a grab, and is - accepted before the touch has ended, the current code will not end the - touch record when the touch does end. - - This change adds a listener state for when a touch is accepted but has - not yet ended. We now keep the touch record alive in this state, but end - it when the touch ends. - - Signed-off-by: Chase Douglas - Reviewed-by: Peter Hutterer - Signed-off-by: Peter Hutterer - (cherry picked from commit 58427e08a4a36ce9e213e4b4fe5249d5db2c764d) - -commit a8c9a93c66edce893af3ba460d728fe2bc48c2af +commit 17f33ca0e5bff45a2d03e4d3b4753a714ce25baf Author: Peter Hutterer -Date: Mon Feb 27 10:09:44 2012 +1000 +Date: Mon Mar 26 10:28:32 2012 +1000 - dix: when rescaling from master, rescale from desktop dimensions (#46657) + test: init the sync extensions for tests to pass again - master->last.valuators[] is in desktop dimensions, so use those as - rescale axis ranges, not the screen. Otherwise, a rescale on any screen - not the top-left will cause out-of-bounds coordinates which will always - map to the bottom-right screen, causing the device to be stuck on that - screen. - - X.Org Bug 46657 + Introduced in d645edd11e7482f98c8b7e0d6c8693285c484907 Signed-off-by: Peter Hutterer - Reviewed-by: Chase Douglas - (cherry picked from commit eb84c154ed38194c32651727b6dfe2d1bde4c599) + Reviewed-by: Jeremy Huddleston + Tested-by: Jeremy Huddleston -commit bc8dc7183b50800470080eaa9c04cfd6ecc3591b +commit 8053faa7b81520b0a46459ba6e3b98f2599d5bbf Author: Peter Hutterer -Date: Thu Feb 16 15:11:40 2012 +1000 +Date: Fri Mar 23 08:20:22 2012 +1000 - Xext: return BadAccess if PickPointer fails (#45796) - - PickPointer or PickKeyboard return NULL, all MDs are currently disabled and - we cannot emulate a core event. This wasn't anticipated by the protocol, so - we don't really have an error code we may use here - BadAccess is simply the - least bad of the possible ones. - - And returning BadAccess beats crashing the server. - - X.Org Bug 45796 + Bump input ABI to 17 for per-device idlecounters Signed-off-by: Peter Hutterer - (cherry picked from commit 6b6afd3d013e3f4910fae3520d1d786df2b0e47a) -commit 1e2a7462bec388342424f22ebf77a6fd3f177d7d +commit 7f3997b01a8813c1d7055317eb06111aed8572c9 +Merge: 92d50c3 31646d8 +Author: Keith Packard +Date: Mon Mar 26 16:41:52 2012 -0700 + + Merge remote-tracking branch 'jeremyhu/master' + +commit 92d50c38b2bfeb82e7374a1966a53235e3f8275e +Author: Gaetan Nadon +Date: Sun Feb 26 12:15:31 2012 -0500 + + man: s/__xservername__/Xorg/g - no longer required + + Excerpt from http://lists.x.org/archives/xorg-devel/2011-March/020481.html: + + The Xorg & xorg.conf substitutions are leftover from the transitional + period where some distros were building our sources with the XFree86 + and XF86config names until they had time to adjust the rest of their + packages/installer/config code to the new names. + + This will fix inconsistencies and prevent the creation of new unneeded + sed patterns. + + Reviewed-by: Alan Coopersmith + Signed-off-by: Gaetan Nadon + Signed-off-by: Keith Packard + +commit 9e880cd2e36236e466fda0adadee34a407ae3341 +Author: Gaetan Nadon +Date: Sun Feb 26 12:15:30 2012 -0500 + + man: s/__xconfigfile__/xorg.conf/g - no longer required + + Excerpt from http://lists.x.org/archives/xorg-devel/2011-March/020481.html: + + The Xorg & xorg.conf substitutions are leftover from the transitional + period where some distros were building our sources with the XFree86 + and XF86config names until they had time to adjust the rest of their + packages/installer/config code to the new names. + + This will fix inconsistencies and prevent the creation of new unneeded + sed patterns. + + Reviewed-by: Alan Coopersmith + Signed-off-by: Gaetan Nadon + Signed-off-by: Keith Packard + +commit 31646d8fa9524adca1d7bc2cd2db90d47c2eb96e Author: Jeremy Huddleston Date: Sun Mar 25 23:33:54 2012 -0700 @@ -1380,9 +12570,8 @@ Date: Sun Mar 25 23:33:54 2012 -0700 Signed-off-by: Jeremy Huddleston Acked-by: Peter Hutterer - (cherry picked from commit 31646d8fa9524adca1d7bc2cd2db90d47c2eb96e) -commit 67d20e393fdbcc0702a9b3e9848faaa3571d8534 +commit 7790dc86384cc451ac44663737fde84dd81ad4e1 Author: Jeremy Huddleston Date: Sun Mar 25 22:30:55 2012 -0700 @@ -1392,9 +12581,8 @@ Date: Sun Mar 25 22:30:55 2012 -0700 Signed-off-by: Jeremy Huddleston Acked-by: Peter Hutterer - (cherry picked from commit 7790dc86384cc451ac44663737fde84dd81ad4e1) -commit 3ee84899b1a3ea5d12e384046c52c7262af78395 +commit 74fb534bf15687610367248071341fe4bfd1d8bf Author: Jeremy Huddleston Date: Sun Mar 25 22:16:22 2012 -0700 @@ -1405,18 +12593,16 @@ Date: Sun Mar 25 22:16:22 2012 -0700 Signed-off-by: Jeremy Huddleston Acked-by: Peter Hutterer - (cherry picked from commit 74fb534bf15687610367248071341fe4bfd1d8bf) -commit 815414858b918c39fdfb5f7500e2eec5d4946fba +commit 41a46546e92b66fed323b5845dd71a6385feb418 Author: Jeremy Huddleston Date: Sun Mar 25 23:05:43 2012 -0700 XQuartz: Formatting cleanup for sendX11NSEvent Signed-off-by: Jeremy Huddleston - (cherry picked from commit 41a46546e92b66fed323b5845dd71a6385feb418) -commit 3413570318ccb9fefb87169d6e7ea4b3391f4002 +commit 5324557c7b12dcacddac830bdb65769cb622c6cf Author: Jeremy Huddleston Date: Fri Mar 23 19:58:49 2012 -0700 @@ -1662,16 +12848,34 @@ Date: Fri Mar 23 19:58:49 2012 -0700 pp_space=remove Signed-off-by: Jeremy Huddleston - (cherry picked from commit 5324557c7b12dcacddac830bdb65769cb622c6cf) + +commit 3505e1faadddeeec85a0d3f823c877ea33f86e00 +Author: Jeremy Huddleston +Date: Fri Feb 17 13:15:12 2012 -0800 + + XQuartz: Detect FatalErrors on startup to prevent tight crash loops - Conflicts: + If a FatalError occurs before the server finishes launching, it will + not have drained the launchd-owned DISPLAY socket, so launchd will + just relaunch it. This can cause the server to crash in a tight loop + which will spam the user with CrashReporter windows that claim focus on + appearance. - hw/xquartz/X11Application.h - hw/xquartz/X11Application.m + This allows users stuck in this loop to "deal" with the problem without + popping up a crash report every 10 seconds. Signed-off-by: Jeremy Huddleston -commit c0b4dec9f248ee2c659c75f32d920ea3073d83e4 +commit a818b305989bbcde4e585112a7ee70cbc0b14a92 +Author: Jeremy Huddleston +Date: Fri Feb 17 12:35:02 2012 -0800 + + os: Pass the FatalError message to OsVendorFatalError + + Signed-off-by: Jeremy Huddleston + Reviewed-by: Jon TURNEY + +commit 0bb8a2566debd6cd11164df9ddca534150ec440a Author: Jeremy Huddleston Date: Tue Mar 13 00:15:55 2012 -0700 @@ -1682,18 +12886,16 @@ Date: Tue Mar 13 00:15:55 2012 -0700 Enables workaround for: https://bugs.freedesktop.org/show_bug.cgi?id=26124 Signed-off-by: Jeremy Huddleston - (cherry picked from commit 0bb8a2566debd6cd11164df9ddca534150ec440a) -commit a6f856a72f1a012c8bf3bce4f59be69679a6debf +commit 5ff46d651ac0cd396be2053b79675997ed7af765 Author: Jeremy Huddleston Date: Sat Mar 17 00:04:27 2012 -0700 XQuartz: Use doubles for input valuators Signed-off-by: Jeremy Huddleston - (cherry picked from commit 5ff46d651ac0cd396be2053b79675997ed7af765) -commit 3998ff2298424eef7952963b2e21862be4c10da0 +commit cd84c0949a9f397d8b803d3b87c9d02b260d4795 Author: Jeremy Huddleston Date: Sat Mar 17 00:08:19 2012 -0700 @@ -1706,18 +12908,446 @@ Date: Sat Mar 17 00:08:19 2012 -0700 http://bugs.winehq.org/show_bug.cgi?id=29732 Signed-off-by: Jeremy Huddleston - (cherry picked from commit cd84c0949a9f397d8b803d3b87c9d02b260d4795) -commit cdd704da190da8e6b15bb3dae81f84ce1535bff8 +commit 87939bf8311c0e7d168741fe57bc8fac414811d8 Author: Jeremy Huddleston Date: Tue Mar 13 00:25:53 2012 -0700 XQuartz: Move our logs into an X11 subdirectory Signed-off-by: Jeremy Huddleston - (cherry picked from commit 87939bf8311c0e7d168741fe57bc8fac414811d8) -commit 5926ed85a1e2cb873f9e0950cfe21510b6c94d6f +commit df327f98f6b8e02fadcfd313a85f906722acc572 +Author: Jeremy Huddleston +Date: Mon Mar 5 00:05:48 2012 -0800 + + test: Fix 'make dist' for configurations that build the Xorg DDX + + Signed-off-by: Jeremy Huddleston + +commit a7eac500e652f30deffd9dc5e623fab701077738 +Merge: bf876c8 d645edd +Author: Peter Hutterer +Date: Thu Mar 22 13:13:07 2012 +1000 + + Merge branch 'per-device-sync-counters' into for-keith + +commit d645edd11e7482f98c8b7e0d6c8693285c484907 +Author: Peter Hutterer +Date: Mon Mar 12 16:36:31 2012 +1000 + + Xext: Add per-device SyncCounters + + Previously, we only had one idle alarm that was triggered for all devices, + whenever the user used any device, came back from suspend, etc. + + Add system SyncCounters for each device (named "DEVICEIDLETIME x", with x + being the device id) that trigger on that device only. This allows for + enabling/disabling devices based on interaction with other devices. + + Popular use-case: disable the touchpad when the keyboard just above the + touchpad stops being idle. + + Signed-off-by: Peter Hutterer + Reviewed-by: Jeremy Huddleston + Reviewed-by: Jamey Sharp + Reviewed-by: James Jones + +commit 6aef209ebc2e54f5465da505a780f7b4cc273ee0 +Author: Peter Hutterer +Date: Mon Mar 12 13:51:02 2012 +1000 + + Change lastDeviceIdleTime to be per-device + + Preparation work for per-device idle counters. + + Signed-off-by: Peter Hutterer + Reviewed-by: Jeremy Huddleston + Reviewed-by: Jamey Sharp + Reviewed-by: James Jones + +commit 20cf0ef825e3f14b0688b691691e0aeba0a4860a +Author: Peter Hutterer +Date: Tue Mar 13 10:21:23 2012 +1000 + + Xext: strdup() the SystemSyncCounter name + + Required for future dynamic names. + + Signed-off-by: Peter Hutterer + Reviewed-by: Jeremy Huddleston + Reviewed-by: Jamey Sharp + Reviewed-by: James Jones + +commit f1b28aea4156f0381ea733ad2afbdd1f34f75599 +Author: Peter Hutterer +Date: Tue Mar 13 09:31:09 2012 +1000 + + Xext: store the bracket values for idle counters in the private + + And drop the three global variables, we have a reference to the counter + everywhere now. + + Signed-off-by: Peter Hutterer + Reviewed-by: Jeremy Huddleston + Reviewed-by: Jamey Sharp + Reviewed-by: James Jones + +commit d9553b2bbe06fba0b209218ffed9465edd79b4d2 +Author: Peter Hutterer +Date: Tue Mar 13 09:29:39 2012 +1000 + + Xext: pass the counter into block/wakeup handlers + + No functional changes, currently unused. Preparation work, we don't need a + global variable if we can pass the counters around anyway. + + Signed-off-by: Peter Hutterer + Reviewed-by: Jeremy Huddleston + Reviewed-by: Jamey Sharp + Reviewed-by: James Jones + +commit 90e6dc6de1ac339212989fd8e54131b196ebb369 +Author: Peter Hutterer +Date: Tue Mar 13 09:28:15 2012 +1000 + + Xext: add a private field to SyncSystemCounters + + Will be used to store counter-specific data. + + Signed-off-by: Peter Hutterer + Reviewed-by: Jeremy Huddleston + Reviewed-by: Jamey Sharp + Reviewed-by: James Jones + +commit 3ddae647c307005309daa2d5dfe4bc6acb8170ab +Author: Peter Hutterer +Date: Mon Mar 12 15:31:39 2012 +1000 + + Xext: localise pIdleTimeValueLess/Greater + + Cleanup for future features, no functional changes. + + Signed-off-by: Peter Hutterer + Reviewed-by: Jeremy Huddleston + Reviewed-by: Jamey Sharp + Reviewed-by: James Jones + +commit 43eb2f2758dfc6ca5a49afce97cc5baea8caf9f5 +Author: Peter Hutterer +Date: Mon Mar 12 15:27:56 2012 +1000 + + Xext: localise use of IdleTimeCounter + + Instead of referring to the global IdleTimeCounter everywhere, only do it + once and use a local variable for the rest. + + Cleanup for future features, no functional changes. + + Signed-off-by: Peter Hutterer + Reviewed-by: Jeremy Huddleston + Reviewed-by: Jamey Sharp + Reviewed-by: James Jones + +commit 1f12f059ef994e0b9b68fbd1f1556d0285c96b8b +Author: Jamey Sharp +Date: Wed Mar 14 17:22:18 2012 -0700 + + sync: Use a linked list instead of an array for SysCounterList. + + Signed-off-by: Jamey Sharp + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit bf876c87a9099fdfa63ed599f8ed9a954dd023d9 +Merge: 908ab3d c0b0a9b +Author: Peter Hutterer +Date: Thu Mar 22 11:34:43 2012 +1000 + + Merge branch 'dtrace-input-abi' into for-keith + +commit c0b0a9bce9237b0abe150c1a7b54939affecc751 +Author: Peter Hutterer +Date: Mon Mar 5 14:12:52 2012 +1000 + + dix: add dtrace probes to input API + + For driver debugging, it is helpful to know whether the driver has actually + submitted an event to the server. dtrace hooks can help here. + + Note that GetPointerEvents and friends may also be triggered by the server + for other emulated devices, some care must be taken when analysing the + results. + + Additional difficulty: proximity events have a run-time assigned type, so + this may make automatic detection a tad harder. If in doubt, go for any + event > 64 since the only two that can have that value are ProximityIn and + ProximityOut. + + An example systemtap script is below: + + # Compile+run with + # stap -g xorg.stp /usr/bin/Xorg + # + + function print_valuators:string(nvaluators:long, mask_in:long, valuators_in:long) %{ + int i; + unsigned char *mask = (unsigned char*)THIS->mask_in; + double *valuators = (double*)THIS->valuators_in; + char str[128] = {0}; + char *s = str; + + #define BitIsSet(ptr, bit) (((unsigned char*)(ptr))[(bit)>>3] & (1 << ((bit) & 7))) + + s += sprintf(s, "nval: %d ::", (int)THIS->nvaluators); + for (i = 0; i < THIS->nvaluators; i++) + { + s += sprintf(s, " %d: ", i); + if (BitIsSet(mask, i)) + s += sprintf(s, "%d", (int)valuators[i]); + } + + sprintf(THIS->__retvalue, "%s", str); + %} + + probe process(@1).mark("input__event") + { + deviceid = $arg1 + type = $arg2 + detail = $arg3 + flags = $arg4 + nvaluators = $arg5 + + str = print_valuators(nvaluators, $arg6, $arg7) + printf("Event: device %d type %d detail %d flags %#x %s\n", + deviceid, type, detail, flags, str); + } + + Signed-off-by: Peter Hutterer + Acked-by: Jeremy Huddleston + +commit 61cb98da1c6199964825de158d9eee7682d9c983 +Author: Peter Hutterer +Date: Mon Mar 12 16:03:50 2012 +1000 + + Xext: SyncCreateSystemCounter returns a SyncCounter* + + type safety++ + + Signed-off-by: Peter Hutterer + Reviewed-by: Jeremy Huddleston + Reviewed-by: Bryce Harrington + +commit 908ab3d580188533168c8cdfd2cab9dc689b4218 +Author: Peter Hutterer +Date: Wed Mar 21 14:05:29 2012 +1000 + + dix: set raw event values before adding up relative values (#46976) + + Regression introduced in 4e52cc0ef48145134cd58d357fb7289e6f8bb709 + + Raw event values are values as-is from the driver, modified only be + transformation or acceleration. 4e52cc caused the mask to be updated from + relative to absolute coordinates which then got written into the raw events. + + Move the raw event update into the respective branches for absolute/relative + events. + + X.Org Bug 46976 + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + Reviewed-by: Daniel Stone + Tested-by: Sven Arvidsson + Reviewed-by: Simon Thum + +commit 45fe3085f8f45e529383025414fdd263d86dfd2b +Author: Peter Hutterer +Date: Mon Mar 12 14:08:39 2012 +1000 + + Xext: remove needless /* parameter */ comments in declaration + + Signed-off-by: Peter Hutterer + Reviewed-by: Jeremy Huddleston + Reviewed-by: Bryce Harrington + +commit 9c3bd3ae652af386b6821b197d24528f20ba867d +Author: Peter Hutterer +Date: Wed Mar 21 14:03:27 2012 +1000 + + dix: fix compiler warning "unused variable 'scr'" + + getevents.c: In function 'updateSlaveDeviceCoords': + getevents.c:326:15: warning: unused variable 'scr' [-Wunused-variable] + + Signed-off-by: Peter Hutterer + +commit e21ffff4761d2b75815391c6947adcba425ab11e +Author: Peter Hutterer +Date: Mon Mar 12 14:07:44 2012 +1000 + + Xext: typedef QueryValue and BracketValue prototypes + + No functional changes, just for readability + + Signed-off-by: Peter Hutterer + Reviewed-by: Jeremy Huddleston + Reviewed-by: Bryce Harrington + +commit 14e3ea730eed344e6ed69c873f918d6f076d13dc +Author: Peter Hutterer +Date: Wed Mar 14 13:48:56 2012 +1000 + + include: add an X_DEBUG message type + + Signed-off-by: Peter Hutterer + Reviewed-by: Jamey Sharp + +commit 5910f2df58beaae2187438fef0b62c29a563e853 +Author: Peter Hutterer +Date: Mon Mar 12 16:26:29 2012 +1000 + + Xext: drop InitServertime() declaration. + + Not implemented anywhere. + + Signed-off-by: Peter Hutterer + Reviewed-by: Jeremy Huddleston + Reviewed-by: Bryce Harrington + +commit 31df08a449cf9b6e1740e1c02257997490630d93 +Author: Chase Douglas +Date: Wed Mar 7 16:06:27 2012 -0800 + + Use a new sprite trace for indirect touches when all touches have physically ended + + All touches of an indirect device, such as a trackpad, are sent to the + same window set. When there are no active touches, a new window set is + created; otherwise, the window set of an existing touch is copied. + + The current code checks for any logically active touches. This includes + touches that have physically ended but are still logically active due to + unhandled touch grabs. Instead, we want a new window set whenever there + are no physically active touches. + + This change skips over logically active but pending end touches, which + are touches that have physically ended. + + Signed-off-by: Chase Douglas + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit 58427e08a4a36ce9e213e4b4fe5249d5db2c764d +Author: Chase Douglas +Date: Wed Mar 7 16:06:26 2012 -0800 + + Xi: Fix TouchEnd to TouchUpdate change for one accepted grab + + If there is only one listener of a touch, the listener is a grab, and is + accepted before the touch has ended, the current code will not end the + touch record when the touch does end. + + This change adds a listener state for when a touch is accepted but has + not yet ended. We now keep the touch record alive in this state, but end + it when the touch ends. + + Signed-off-by: Chase Douglas + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit e884ff8ad4df2b3272a3d8ece772906207af5142 +Author: Peter Hutterer +Date: Wed Mar 7 19:08:33 2012 +1000 + + xfree86: remove out-of-date comment + + No idea what this was referring to but it goes past git history. + + Signed-off-by: Peter Hutterer + +commit 5497ce3da442d27c2dc7796bfef6ccd670bbadc4 +Author: Peter Hutterer +Date: Mon Feb 20 12:09:33 2012 +1000 + + dix: IsFloating() on master devices is always false + + There are a few subtle bugs during startup where IsFloating() returns true + if the device is a master device that is not yet paired with its keyboard + device. + + Force IsFloating() to always return FALSE for master devices, that was the + intent after all and any code that relies on the other behaviour should be + fixed instead. + + Signed-off-by: Peter Hutterer + Reviewed-by: Jeremy Huddleston + Tested-by: Jon TURNEY + +commit 2c23ef83b0e03e163aeeb06133538606886f4e9c +Author: Peter Hutterer +Date: Mon Feb 27 08:01:07 2012 +1000 + + Xi: prohibit multiple XIQueryVersion requests with different versions + + Return BadValue if major or minor differs on the second call. + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + +commit eb84c154ed38194c32651727b6dfe2d1bde4c599 +Author: Peter Hutterer +Date: Mon Feb 27 10:09:44 2012 +1000 + + dix: when rescaling from master, rescale from desktop dimensions (#46657) + + master->last.valuators[] is in desktop dimensions, so use those as + rescale axis ranges, not the screen. Otherwise, a rescale on any screen + not the top-left will cause out-of-bounds coordinates which will always + map to the bottom-right screen, causing the device to be stuck on that + screen. + + X.Org Bug 46657 + + Signed-off-by: Peter Hutterer + Reviewed-by: Chase Douglas + +commit 6b6afd3d013e3f4910fae3520d1d786df2b0e47a +Author: Peter Hutterer +Date: Thu Feb 16 15:11:40 2012 +1000 + + Xext: return BadAccess if PickPointer fails (#45796) + + PickPointer or PickKeyboard return NULL, all MDs are currently disabled and + we cannot emulate a core event. This wasn't anticipated by the protocol, so + we don't really have an error code we may use here - BadAccess is simply the + least bad of the possible ones. + + And returning BadAccess beats crashing the server. + + X.Org Bug 45796 + + Signed-off-by: Peter Hutterer + +commit 9e017cf0cf1f0c9d0d9c2cfeb82ea5dc0eb5905e +Author: Andreas Wettstein +Date: Sat Feb 25 20:48:17 2012 +0100 + + XKB: Redirect actions defunct with Gtk3 (XInput?) + + When redirect actions are used with Gtk3, Gtk3 complained about + events not holding a GdkDevice. This was caused by device IDs + not being set for redirect actions. + + More seriously, Gtk3 did not receive state changes redirect + actions might specify. This was because event_set_state in + dix/inpututils.c accesses the prev_state field, but the changes + for the redirect action were only put into the state field. + + Signed-off-by: Andreas Wettstein + Reviewed-by: Peter Hutterer + Signed-off-by: Peter Hutterer + +commit ab3a815a75ab5695753fa37a98b0ea5293d4cb91 Author: Daniel Stone Date: Thu Mar 15 15:18:29 2012 +0000 @@ -1732,9 +13362,8 @@ Date: Thu Mar 15 15:18:29 2012 +0000 change some false positives in XKB back. Signed-off-by: Daniel Stone - (cherry picked from commit ab3a815a75ab5695753fa37a98b0ea5293d4cb91) -commit dfecff4279b42a20ee1d186bfe49f5e2e3a53648 +commit 58b1f739d73b03ff7952ca986ed8746a7307fffe Author: Daniel Stone Date: Thu Mar 15 15:13:51 2012 +0000 @@ -1744,9 +13373,8 @@ Date: Thu Mar 15 15:13:51 2012 +0000 enough really. Signed-off-by: Daniel Stone - (cherry picked from commit 58b1f739d73b03ff7952ca986ed8746a7307fffe) -commit 8384075e1a0fb3189f9c37c17f9e12e1aae5102c +commit 9838b7032ea9792bec21af424c53c07078636d21 Author: Keith Packard Date: Wed Mar 21 12:55:09 2012 -0700 @@ -1794,9 +13422,8 @@ Date: Wed Mar 21 12:55:09 2012 -0700 Signed-off-by: Keith Packard Acked-by: Daniel Stone Acked-by: Alan Coopersmith - (cherry picked from commit 9838b7032ea9792bec21af424c53c07078636d21) -commit d9a9788bb163731f681951e9f0ac0e37fd095e6b +commit 75199129c603fc8567185ac31866c9518193cb78 Author: Keith Packard Date: Wed Mar 21 12:33:19 2012 -0700 @@ -1807,16 +13434,17 @@ Date: Wed Mar 21 12:33:19 2012 -0700 the files are re-indented. Signed-off-by: Keith Packard - (cherry picked from commit 75199129c603fc8567185ac31866c9518193cb78) -commit 3590d0bb77b787e07030e43f60fa2d0a4a020057 -Author: Jeremy Huddleston -Date: Mon Mar 5 00:05:48 2012 -0800 +commit a615b90cab7569fae9d123e4da1d3373c871d84b +Author: Keith Packard +Date: Wed Mar 14 11:32:36 2012 -0700 - test: Fix 'make dist' for configurations that build the Xorg DDX + Bump version number to 1.12.99.0 - Signed-off-by: Jeremy Huddleston - (cherry picked from commit df327f98f6b8e02fadcfd313a85f906722acc572) + Now that 1.12 has branched, reset the version on master to a + development number. + + Signed-off-by: Keith Packard commit b1be72c5ca6cb98ba64637990b142be0f1710a19 Author: Keith Packard diff --git a/xserver/Makefile.am b/xserver/Makefile.am index cea140bea..9a628537d 100644 --- a/xserver/Makefile.am +++ b/xserver/Makefile.am @@ -95,3 +95,10 @@ DIST_SUBDIRS = \ # gross hack relink: all $(AM_V_at)$(MAKE) -C hw relink + +install-headers: Makefile + +find . -name Makefile | while read m; do \ + if grep -q install-sdkHEADERS $$m; then \ + (cd `dirname "$$m"` && make install-sdkHEADERS) \ + fi \ + done diff --git a/xserver/Makefile.bsd-wrapper b/xserver/Makefile.bsd-wrapper index 92f65cf6a..3fdc52310 100644 --- a/xserver/Makefile.bsd-wrapper +++ b/xserver/Makefile.bsd-wrapper @@ -1,14 +1,14 @@ -# $OpenBSD: Makefile.bsd-wrapper,v 1.45 2013/03/16 01:24:43 aoyama Exp $ +# $OpenBSD: Makefile.bsd-wrapper,v 1.46 2013/06/07 17:28:45 matthieu Exp $ .include DIST= ${.CURDIR} # Machines for which we don't build the Xorg Xserver -NO_XORG_MACHINES= alpha aviion hppa64 landisk luna88k \ +NO_XORG_MACHINES= alpha aviion hp300 hppa64 landisk mac68k \ mvme68k mvme88k mvmeppc solbourne vax -NO_XF86UTIL_MACHINES= hp300 landisk sgi sparc vax +NO_XF86UTIL_MACHINES= hp300 landisk mac68k sgi sparc vax .for M in ${NO_XORG_MACHINES} NO_XORG_${M} = --disable-xorg @@ -45,4 +45,10 @@ CONFIGURE_ARGS= --localstatedir=/var --sysconfdir=/etc/X11 \ --disable-unit-tests \ ${DRI_OPTION} +includes: + @echo "Removing obsolete files" + -rm -f ${DESTDIR}${X11BASE}/include/xorg/xaa.h \ + ${DESTDIR}${X11BASE}/include/xorg/xaalocal.h \ + ${DESTDIR}${X11BASE}/include/xorg/mibstore.h + .include diff --git a/xserver/Makefile.in b/xserver/Makefile.in index 7a502d060..1800f5ed2 100644 --- a/xserver/Makefile.in +++ b/xserver/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -54,8 +54,8 @@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/xorg-server.pc.in \ $(srcdir)/xserver.ent.in $(top_srcdir)/configure COPYING \ - ChangeLog INSTALL compile config.guess config.sub depcomp \ - install-sh ltmain.sh missing ylwrap + ChangeLog INSTALL config.guess config.sub install-sh ltmain.sh \ + missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ @@ -240,13 +240,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -268,6 +264,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -292,6 +289,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -307,7 +305,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -406,6 +403,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -576,7 +574,7 @@ all: all-recursive .SUFFIXES: am--refresh: Makefile @: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -603,9 +601,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): xserver.ent: $(top_builddir)/config.status $(srcdir)/xserver.ent.in @@ -1129,6 +1127,13 @@ dist-hook: ChangeLog INSTALL relink: all $(AM_V_at)$(MAKE) -C hw relink +install-headers: Makefile + +find . -name Makefile | while read m; do \ + if grep -q install-sdkHEADERS $$m; then \ + (cd `dirname "$$m"` && make install-sdkHEADERS) \ + fi \ + done + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/xserver/Xext/Makefile.am b/xserver/Xext/Makefile.am index cb432e00e..8e31f1367 100644 --- a/xserver/Xext/Makefile.am +++ b/xserver/Xext/Makefile.am @@ -1,16 +1,4 @@ -# libXext.la: includes all extensions and should be linked into Xvfb, -# Xnest, Xdmx and Xprt -# libXextbuiltin.la: includes those extensions that are built directly into -# Xorg by default -# libXextmodule.la: includes those extensions that are built into a module -# that Xorg loads -if XORG -noinst_LTLIBRARIES = libXext.la libXextbuiltin.la libXextmodule.la -else noinst_LTLIBRARIES = libXext.la -endif - -INCLUDES = -I$(top_srcdir)/hw/xfree86/dixmods/extmod AM_CFLAGS = $(DIX_CFLAGS) @@ -30,10 +18,7 @@ BUILTIN_SRCS = \ syncsrv.h \ xcmisc.c \ xtest.c - -# Sources always included in libXextmodule.la & libXext.la. That's right, zero. -MODULE_SRCS = -MODULE_LIBS = +BUILTIN_LIBS = # Optional sources included if extension enabled by configure.ac rules @@ -46,19 +31,19 @@ endif # XVideo extension XV_SRCS = xvmain.c xvdisp.c xvmc.c xvdix.h xvmcext.h xvdisp.h if XV -MODULE_SRCS += $(XV_SRCS) +BUILTIN_SRCS += $(XV_SRCS) endif # XResource extension: lets clients get data about per-client resource usage -RES_SRCS = xres.c +RES_SRCS = hashtable.c hashtable.h xres.c if RES -MODULE_SRCS += $(RES_SRCS) +BUILTIN_SRCS += $(RES_SRCS) endif # MIT ScreenSaver extension SCREENSAVER_SRCS = saver.c if SCREENSAVER -MODULE_SRCS += $(SCREENSAVER_SRCS) +BUILTIN_SRCS += $(SCREENSAVER_SRCS) endif # Xinerama extension: making multiple video devices act as one virtual screen @@ -84,8 +69,8 @@ endif # requires X-ACE extension XSELINUX_SRCS = xselinux_ext.c xselinux_hooks.c xselinux_label.c xselinux.h xselinuxint.h if XSELINUX -MODULE_SRCS += $(XSELINUX_SRCS) -MODULE_LIBS += $(SELINUX_LIBS) +BUILTIN_SRCS += $(XSELINUX_SRCS) +BUILTIN_LIBS += $(SELINUX_LIBS) endif # Security extension: multi-level security to protect clients from each other @@ -103,20 +88,13 @@ endif # DPMS extension DPMS_SRCS = dpms.c dpmsproc.h if DPMSExtension -MODULE_SRCS += $(DPMS_SRCS) +BUILTIN_SRCS += $(DPMS_SRCS) endif # Now take all of the above, mix well, bake for 10 minutes and get libXext*.la -libXext_la_SOURCES = $(BUILTIN_SRCS) $(MODULE_SRCS) -libXext_la_LIBADD = $(MODULE_LIBS) - -if XORG -libXextbuiltin_la_SOURCES = $(BUILTIN_SRCS) - -libXextmodule_la_SOURCES = $(MODULE_SRCS) -libXextmodule_la_LIBADD = $(MODULE_LIBS) -endif +libXext_la_SOURCES = $(BUILTIN_SRCS) +libXext_la_LIBADD = $(BUILTIN_LIBS) EXTRA_DIST = \ $(MITSHM_SRCS) \ diff --git a/xserver/Xext/Makefile.in b/xserver/Xext/Makefile.in index 0a36da66a..d1d666af1 100644 --- a/xserver/Xext/Makefile.in +++ b/xserver/Xext/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -93,63 +93,43 @@ am__DEPENDENCIES_3 = $(am__DEPENDENCIES_2) libXext_la_DEPENDENCIES = $(am__DEPENDENCIES_3) am__libXext_la_SOURCES_DIST = bigreq.c geext.c shape.c sleepuntil.c \ sleepuntil.h sync.c syncsdk.h syncsrv.h xcmisc.c xtest.c shm.c \ - shmint.h panoramiX.c panoramiX.h panoramiXh.h panoramiXsrv.h \ - panoramiXprocs.c panoramiXSwap.c xace.c xace.h xacestr.h \ - security.c securitysrv.h xf86bigfont.c xf86bigfontsrv.h \ - xvmain.c xvdisp.c xvmc.c xvdix.h xvmcext.h xvdisp.h xres.c \ - saver.c xselinux_ext.c xselinux_hooks.c xselinux_label.c \ - xselinux.h xselinuxint.h dpms.c dpmsproc.h + shmint.h xvmain.c xvdisp.c xvmc.c xvdix.h xvmcext.h xvdisp.h \ + hashtable.c hashtable.h xres.c saver.c panoramiX.c panoramiX.h \ + panoramiXh.h panoramiXsrv.h panoramiXprocs.c panoramiXSwap.c \ + xace.c xace.h xacestr.h xselinux_ext.c xselinux_hooks.c \ + xselinux_label.c xselinux.h xselinuxint.h security.c \ + securitysrv.h xf86bigfont.c xf86bigfontsrv.h dpms.c dpmsproc.h am__objects_1 = shm.lo @MITSHM_TRUE@am__objects_2 = $(am__objects_1) -am__objects_3 = panoramiX.lo panoramiXprocs.lo panoramiXSwap.lo -@XINERAMA_TRUE@am__objects_4 = $(am__objects_3) -am__objects_5 = xace.lo -@XACE_TRUE@am__objects_6 = $(am__objects_5) -am__objects_7 = security.lo -@XCSECURITY_TRUE@am__objects_8 = $(am__objects_7) -am__objects_9 = xf86bigfont.lo -@XF86BIGFONT_TRUE@am__objects_10 = $(am__objects_9) -am__objects_11 = bigreq.lo geext.lo shape.lo sleepuntil.lo sync.lo \ +am__objects_3 = xvmain.lo xvdisp.lo xvmc.lo +@XV_TRUE@am__objects_4 = $(am__objects_3) +am__objects_5 = hashtable.lo xres.lo +@RES_TRUE@am__objects_6 = $(am__objects_5) +am__objects_7 = saver.lo +@SCREENSAVER_TRUE@am__objects_8 = $(am__objects_7) +am__objects_9 = panoramiX.lo panoramiXprocs.lo panoramiXSwap.lo +@XINERAMA_TRUE@am__objects_10 = $(am__objects_9) +am__objects_11 = xace.lo +@XACE_TRUE@am__objects_12 = $(am__objects_11) +am__objects_13 = xselinux_ext.lo xselinux_hooks.lo xselinux_label.lo +@XSELINUX_TRUE@am__objects_14 = $(am__objects_13) +am__objects_15 = security.lo +@XCSECURITY_TRUE@am__objects_16 = $(am__objects_15) +am__objects_17 = xf86bigfont.lo +@XF86BIGFONT_TRUE@am__objects_18 = $(am__objects_17) +am__objects_19 = dpms.lo +@DPMSExtension_TRUE@am__objects_20 = $(am__objects_19) +am__objects_21 = bigreq.lo geext.lo shape.lo sleepuntil.lo sync.lo \ xcmisc.lo xtest.lo $(am__objects_2) $(am__objects_4) \ - $(am__objects_6) $(am__objects_8) $(am__objects_10) -am__objects_12 = xvmain.lo xvdisp.lo xvmc.lo -@XV_TRUE@am__objects_13 = $(am__objects_12) -am__objects_14 = xres.lo -@RES_TRUE@am__objects_15 = $(am__objects_14) -am__objects_16 = saver.lo -@SCREENSAVER_TRUE@am__objects_17 = $(am__objects_16) -am__objects_18 = xselinux_ext.lo xselinux_hooks.lo xselinux_label.lo -@XSELINUX_TRUE@am__objects_19 = $(am__objects_18) -am__objects_20 = dpms.lo -@DPMSExtension_TRUE@am__objects_21 = $(am__objects_20) -am__objects_22 = $(am__objects_13) $(am__objects_15) $(am__objects_17) \ - $(am__objects_19) $(am__objects_21) -am_libXext_la_OBJECTS = $(am__objects_11) $(am__objects_22) + $(am__objects_6) $(am__objects_8) $(am__objects_10) \ + $(am__objects_12) $(am__objects_14) $(am__objects_16) \ + $(am__objects_18) $(am__objects_20) +am_libXext_la_OBJECTS = $(am__objects_21) libXext_la_OBJECTS = $(am_libXext_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = -@XORG_FALSE@am_libXext_la_rpath = -@XORG_TRUE@am_libXext_la_rpath = -libXextbuiltin_la_LIBADD = -am__libXextbuiltin_la_SOURCES_DIST = bigreq.c geext.c shape.c \ - sleepuntil.c sleepuntil.h sync.c syncsdk.h syncsrv.h xcmisc.c \ - xtest.c shm.c shmint.h panoramiX.c panoramiX.h panoramiXh.h \ - panoramiXsrv.h panoramiXprocs.c panoramiXSwap.c xace.c xace.h \ - xacestr.h security.c securitysrv.h xf86bigfont.c \ - xf86bigfontsrv.h -@XORG_TRUE@am_libXextbuiltin_la_OBJECTS = $(am__objects_11) -libXextbuiltin_la_OBJECTS = $(am_libXextbuiltin_la_OBJECTS) -@XORG_TRUE@am_libXextbuiltin_la_rpath = -@XORG_TRUE@libXextmodule_la_DEPENDENCIES = $(am__DEPENDENCIES_3) -am__libXextmodule_la_SOURCES_DIST = xvmain.c xvdisp.c xvmc.c xvdix.h \ - xvmcext.h xvdisp.h xres.c saver.c xselinux_ext.c \ - xselinux_hooks.c xselinux_label.c xselinux.h xselinuxint.h \ - dpms.c dpmsproc.h -@XORG_TRUE@am_libXextmodule_la_OBJECTS = $(am__objects_22) -libXextmodule_la_OBJECTS = $(am_libXextmodule_la_OBJECTS) -@XORG_TRUE@am_libXextmodule_la_rpath = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -184,11 +164,8 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(libXext_la_SOURCES) $(libXextbuiltin_la_SOURCES) \ - $(libXextmodule_la_SOURCES) -DIST_SOURCES = $(am__libXext_la_SOURCES_DIST) \ - $(am__libXextbuiltin_la_SOURCES_DIST) \ - $(am__libXextmodule_la_SOURCES_DIST) +SOURCES = $(libXext_la_SOURCES) +DIST_SOURCES = $(am__libXext_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -285,13 +262,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -313,6 +286,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -337,6 +311,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -352,7 +327,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -451,6 +425,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -550,16 +525,7 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -@XORG_FALSE@noinst_LTLIBRARIES = libXext.la - -# libXext.la: includes all extensions and should be linked into Xvfb, -# Xnest, Xdmx and Xprt -# libXextbuiltin.la: includes those extensions that are built directly into -# Xorg by default -# libXextmodule.la: includes those extensions that are built into a module -# that Xorg loads -@XORG_TRUE@noinst_LTLIBRARIES = libXext.la libXextbuiltin.la libXextmodule.la -INCLUDES = -I$(top_srcdir)/hw/xfree86/dixmods/extmod +noinst_LTLIBRARIES = libXext.la AM_CFLAGS = $(DIX_CFLAGS) @XORG_TRUE@sdk_HEADERS = xvdix.h xvmcext.h geext.h geint.h shmint.h \ @XORG_TRUE@ syncsdk.h $(am__append_6) $(am__append_8) @@ -567,13 +533,10 @@ AM_CFLAGS = $(DIX_CFLAGS) # Sources always included in libXextbuiltin.la & libXext.la BUILTIN_SRCS = bigreq.c geext.c shape.c sleepuntil.c sleepuntil.h \ sync.c syncsdk.h syncsrv.h xcmisc.c xtest.c $(am__append_1) \ - $(am__append_5) $(am__append_7) $(am__append_11) \ - $(am__append_12) - -# Sources always included in libXextmodule.la & libXext.la. That's right, zero. -MODULE_SRCS = $(am__append_2) $(am__append_3) $(am__append_4) \ - $(am__append_9) $(am__append_13) -MODULE_LIBS = $(am__append_10) + $(am__append_2) $(am__append_3) $(am__append_4) \ + $(am__append_5) $(am__append_7) $(am__append_9) \ + $(am__append_11) $(am__append_12) $(am__append_13) +BUILTIN_LIBS = $(am__append_10) # Optional sources included if extension enabled by configure.ac rules @@ -584,7 +547,7 @@ MITSHM_SRCS = shm.c shmint.h XV_SRCS = xvmain.c xvdisp.c xvmc.c xvdix.h xvmcext.h xvdisp.h # XResource extension: lets clients get data about per-client resource usage -RES_SRCS = xres.c +RES_SRCS = hashtable.c hashtable.h xres.c # MIT ScreenSaver extension SCREENSAVER_SRCS = saver.c @@ -610,11 +573,8 @@ BIGFONT_SRCS = xf86bigfont.c xf86bigfontsrv.h DPMS_SRCS = dpms.c dpmsproc.h # Now take all of the above, mix well, bake for 10 minutes and get libXext*.la -libXext_la_SOURCES = $(BUILTIN_SRCS) $(MODULE_SRCS) -libXext_la_LIBADD = $(MODULE_LIBS) -@XORG_TRUE@libXextbuiltin_la_SOURCES = $(BUILTIN_SRCS) -@XORG_TRUE@libXextmodule_la_SOURCES = $(MODULE_SRCS) -@XORG_TRUE@libXextmodule_la_LIBADD = $(MODULE_LIBS) +libXext_la_SOURCES = $(BUILTIN_SRCS) +libXext_la_LIBADD = $(BUILTIN_LIBS) EXTRA_DIST = \ $(MITSHM_SRCS) \ $(XV_SRCS) \ @@ -632,7 +592,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -657,9 +617,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): @@ -674,11 +634,7 @@ clean-noinstLTLIBRARIES: rm -f $${locs}; \ } libXext.la: $(libXext_la_OBJECTS) $(libXext_la_DEPENDENCIES) $(EXTRA_libXext_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(am_libXext_la_rpath) $(libXext_la_OBJECTS) $(libXext_la_LIBADD) $(LIBS) -libXextbuiltin.la: $(libXextbuiltin_la_OBJECTS) $(libXextbuiltin_la_DEPENDENCIES) $(EXTRA_libXextbuiltin_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(am_libXextbuiltin_la_rpath) $(libXextbuiltin_la_OBJECTS) $(libXextbuiltin_la_LIBADD) $(LIBS) -libXextmodule.la: $(libXextmodule_la_OBJECTS) $(libXextmodule_la_DEPENDENCIES) $(EXTRA_libXextmodule_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(am_libXextmodule_la_rpath) $(libXextmodule_la_OBJECTS) $(libXextmodule_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(libXext_la_OBJECTS) $(libXext_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -689,6 +645,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bigreq.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dpms.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geext.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hashtable.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/panoramiX.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/panoramiXSwap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/panoramiXprocs.Plo@am__quote@ diff --git a/xserver/Xext/bigreq.c b/xserver/Xext/bigreq.c index 49355c4a4..c78a1e4b4 100644 --- a/xserver/Xext/bigreq.c +++ b/xserver/Xext/bigreq.c @@ -38,9 +38,7 @@ from The Open Group. #include "extnsionst.h" #include #include "opaque.h" -#include "modinit.h" - -void BigReqExtensionInit(INITARGS); +#include "extinit.h" static int ProcBigReqDispatch(ClientPtr client) @@ -55,21 +53,22 @@ ProcBigReqDispatch(ClientPtr client) return BadRequest; REQUEST_SIZE_MATCH(xBigReqEnableReq); client->big_requests = TRUE; - memset(&rep, 0, sizeof(xBigReqEnableReply)); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.max_request_size = maxBigRequestSize; + rep = (xBigReqEnableReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .max_request_size = maxBigRequestSize + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.max_request_size); } - WriteToClient(client, sizeof(xBigReqEnableReply), (char *) &rep); + WriteToClient(client, sizeof(xBigReqEnableReply), &rep); return Success; } void -BigReqExtensionInit(INITARGS) +BigReqExtensionInit(void) { AddExtension(XBigReqExtensionName, 0, 0, ProcBigReqDispatch, ProcBigReqDispatch, diff --git a/xserver/Xext/dpms.c b/xserver/Xext/dpms.c index 348c87289..5f1a35d9c 100644 --- a/xserver/Xext/dpms.c +++ b/xserver/Xext/dpms.c @@ -39,27 +39,28 @@ Equipment Corporation. #include "opaque.h" #include #include "dpmsproc.h" -#include "modinit.h" +#include "extinit.h" static int ProcDPMSGetVersion(ClientPtr client) { /* REQUEST(xDPMSGetVersionReq); */ - xDPMSGetVersionReply rep; + xDPMSGetVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .majorVersion = DPMSMajorVersion, + .minorVersion = DPMSMinorVersion + }; REQUEST_SIZE_MATCH(xDPMSGetVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = DPMSMajorVersion; - rep.minorVersion = DPMSMinorVersion; if (client->swapped) { swaps(&rep.sequenceNumber); swaps(&rep.majorVersion); swaps(&rep.minorVersion); } - WriteToClient(client, sizeof(xDPMSGetVersionReply), (char *) &rep); + WriteToClient(client, sizeof(xDPMSGetVersionReply), &rep); return Success; } @@ -67,19 +68,19 @@ static int ProcDPMSCapable(ClientPtr client) { /* REQUEST(xDPMSCapableReq); */ - xDPMSCapableReply rep; + xDPMSCapableReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .capable = DPMSCapableFlag + }; REQUEST_SIZE_MATCH(xDPMSCapableReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.capable = DPMSCapableFlag; - if (client->swapped) { swaps(&rep.sequenceNumber); } - WriteToClient(client, sizeof(xDPMSCapableReply), (char *) &rep); + WriteToClient(client, sizeof(xDPMSCapableReply), &rep); return Success; } @@ -87,24 +88,24 @@ static int ProcDPMSGetTimeouts(ClientPtr client) { /* REQUEST(xDPMSGetTimeoutsReq); */ - xDPMSGetTimeoutsReply rep; + xDPMSGetTimeoutsReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .standby = DPMSStandbyTime / MILLI_PER_SECOND, + .suspend = DPMSSuspendTime / MILLI_PER_SECOND, + .off = DPMSOffTime / MILLI_PER_SECOND + }; REQUEST_SIZE_MATCH(xDPMSGetTimeoutsReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.standby = DPMSStandbyTime / MILLI_PER_SECOND; - rep.suspend = DPMSSuspendTime / MILLI_PER_SECOND; - rep.off = DPMSOffTime / MILLI_PER_SECOND; - if (client->swapped) { swaps(&rep.sequenceNumber); swaps(&rep.standby); swaps(&rep.suspend); swaps(&rep.off); } - WriteToClient(client, sizeof(xDPMSGetTimeoutsReply), (char *) &rep); + WriteToClient(client, sizeof(xDPMSGetTimeoutsReply), &rep); return Success; } @@ -188,21 +189,21 @@ static int ProcDPMSInfo(ClientPtr client) { /* REQUEST(xDPMSInfoReq); */ - xDPMSInfoReply rep; + xDPMSInfoReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .power_level = DPMSPowerLevel, + .state = DPMSEnabled + }; REQUEST_SIZE_MATCH(xDPMSInfoReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.power_level = DPMSPowerLevel; - rep.state = DPMSEnabled; - if (client->swapped) { swaps(&rep.sequenceNumber); swaps(&rep.power_level); } - WriteToClient(client, sizeof(xDPMSInfoReply), (char *) &rep); + WriteToClient(client, sizeof(xDPMSInfoReply), &rep); return Success; } @@ -354,7 +355,7 @@ SProcDPMSDispatch(ClientPtr client) } void -DPMSExtensionInit(INITARGS) +DPMSExtensionInit(void) { AddExtension(DPMSExtensionName, 0, 0, ProcDPMSDispatch, SProcDPMSDispatch, diff --git a/xserver/Xext/geext.c b/xserver/Xext/geext.c index 07028238e..1e5ae6f82 100644 --- a/xserver/Xext/geext.c +++ b/xserver/Xext/geext.c @@ -32,11 +32,10 @@ #include "geint.h" #include "geext.h" #include "protocol-versions.h" +#include "extinit.h" DevPrivateKeyRec GEClientPrivateKeyRec; -int RT_GECLIENT = 0; - GEExtension GEExtensions[MAXEXTENSIONS]; /* Major available requests */ @@ -65,14 +64,16 @@ ProcGEQueryVersion(ClientPtr client) REQUEST_SIZE_MATCH(xGEQueryVersionReq); - rep.repType = X_Reply; - rep.RepType = X_GEQueryVersion; - rep.length = 0; - rep.sequenceNumber = client->sequence; + rep = (xGEQueryVersionReply) { + .repType = X_Reply, + .RepType = X_GEQueryVersion, + .sequenceNumber = client->sequence, + .length = 0, - /* return the supported version by the server */ - rep.majorVersion = SERVER_GE_MAJOR_VERSION; - rep.minorVersion = SERVER_GE_MINOR_VERSION; + /* return the supported version by the server */ + .majorVersion = SERVER_GE_MAJOR_VERSION, + .minorVersion = SERVER_GE_MINOR_VERSION + }; /* Remember version the client requested */ pGEClient->major_version = stuff->majorVersion; @@ -85,7 +86,7 @@ ProcGEQueryVersion(ClientPtr client) swaps(&rep.minorVersion); } - WriteToClient(client, sizeof(xGEQueryVersionReply), (char *) &rep); + WriteToClient(client, sizeof(xGEQueryVersionReply), &rep); return Success; } diff --git a/xserver/Xext/geext.h b/xserver/Xext/geext.h index d2a15dcb9..f46897966 100644 --- a/xserver/Xext/geext.h +++ b/xserver/Xext/geext.h @@ -78,6 +78,4 @@ extern _X_EXPORT void GERegisterExtension(int extension, extern _X_EXPORT void GEInitEvent(xGenericEvent *ev, int extension); -extern _X_EXPORT void GEExtensionInit(void); - #endif /* _GEEXT_H_ */ diff --git a/xserver/Xext/hashtable.c b/xserver/Xext/hashtable.c new file mode 100644 index 000000000..9d9ef8949 --- /dev/null +++ b/xserver/Xext/hashtable.c @@ -0,0 +1,295 @@ +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#include +#include "misc.h" +#include "hashtable.h" + +/* HashResourceID */ +#include "resource.h" + +#define INITHASHSIZE 6 +#define MAXHASHSIZE 11 + +struct HashTableRec { + int keySize; + int dataSize; + + int elements; /* number of elements inserted */ + int bucketBits; /* number of buckets is 1 << bucketBits */ + struct xorg_list *buckets; /* array of bucket list heads */ + + HashFunc hash; + HashCompareFunc compare; + + pointer cdata; +}; + +typedef struct { + struct xorg_list l; + void *key; + void *data; +} BucketRec, *BucketPtr; + +HashTable +ht_create(int keySize, + int dataSize, + HashFunc hash, + HashCompareFunc compare, + pointer cdata) +{ + int c; + int numBuckets; + HashTable ht = malloc(sizeof(struct HashTableRec)); + + if (!ht) { + return NULL; + } + + ht->keySize = keySize; + ht->dataSize = dataSize; + ht->hash = hash; + ht->compare = compare; + ht->elements = 0; + ht->bucketBits = INITHASHSIZE; + numBuckets = 1 << ht->bucketBits; + ht->buckets = malloc(numBuckets * sizeof(*ht->buckets)); + ht->cdata = cdata; + + if (ht->buckets) { + for (c = 0; c < numBuckets; ++c) { + xorg_list_init(&ht->buckets[c]); + } + return ht; + } else { + free(ht); + return NULL; + } +} + +void +ht_destroy(HashTable ht) +{ + int c; + BucketPtr it, tmp; + int numBuckets = 1 << ht->bucketBits; + for (c = 0; c < numBuckets; ++c) { + xorg_list_for_each_entry_safe(it, tmp, &ht->buckets[c], l) { + xorg_list_del(&it->l); + free(it); + } + } + free(ht->buckets); +} + +static Bool +double_size(HashTable ht) +{ + struct xorg_list *newBuckets; + int numBuckets = 1 << ht->bucketBits; + int newBucketBits = ht->bucketBits + 1; + int newNumBuckets = 1 << newBucketBits; + int c; + + newBuckets = malloc(newNumBuckets * sizeof(*ht->buckets)); + if (newBuckets) { + for (c = 0; c < newNumBuckets; ++c) { + xorg_list_init(&newBuckets[c]); + } + + for (c = 0; c < numBuckets; ++c) { + BucketPtr it, tmp; + xorg_list_for_each_entry_safe(it, tmp, &ht->buckets[c], l) { + struct xorg_list *newBucket = + &newBuckets[ht->hash(ht->cdata, it->key, newBucketBits)]; + xorg_list_del(&it->l); + xorg_list_add(&it->l, newBucket); + } + } + free(ht->buckets); + + ht->buckets = newBuckets; + ht->bucketBits = newBucketBits; + return TRUE; + } else { + return FALSE; + } +} + +pointer +ht_add(HashTable ht, pointer key) +{ + unsigned index = ht->hash(ht->cdata, key, ht->bucketBits); + struct xorg_list *bucket = &ht->buckets[index]; + BucketRec *elem = calloc(1, sizeof(BucketRec)); + if (!elem) { + goto outOfMemory; + } + elem->key = malloc(ht->keySize); + if (!elem->key) { + goto outOfMemory; + } + /* we avoid signaling an out-of-memory error if dataSize is 0 */ + elem->data = calloc(1, ht->dataSize); + if (ht->dataSize && !elem->data) { + goto outOfMemory; + } + xorg_list_add(&elem->l, bucket); + ++ht->elements; + + memcpy(elem->key, key, ht->keySize); + + if (ht->elements > 4 * (1 << ht->bucketBits) && + ht->bucketBits < MAXHASHSIZE) { + if (!double_size(ht)) { + --ht->elements; + xorg_list_del(&elem->l); + goto outOfMemory; + } + } + + /* if memory allocation has failed due to dataSize being 0, return + a "dummy" pointer pointing at the of the key */ + return elem->data ? elem->data : ((char*) elem->key + ht->keySize); + + outOfMemory: + if (elem) { + free(elem->key); + free(elem->data); + free(elem); + } + + return NULL; +} + +void +ht_remove(HashTable ht, pointer key) +{ + unsigned index = ht->hash(ht->cdata, key, ht->bucketBits); + struct xorg_list *bucket = &ht->buckets[index]; + BucketPtr it; + + xorg_list_for_each_entry(it, bucket, l) { + if (ht->compare(ht->cdata, key, it->key) == 0) { + xorg_list_del(&it->l); + --ht->elements; + free(it->key); + free(it->data); + free(it); + return; + } + } +} + +pointer +ht_find(HashTable ht, pointer key) +{ + unsigned index = ht->hash(ht->cdata, key, ht->bucketBits); + struct xorg_list *bucket = &ht->buckets[index]; + BucketPtr it; + + xorg_list_for_each_entry(it, bucket, l) { + if (ht->compare(ht->cdata, key, it->key) == 0) { + return it->data ? it->data : ((char*) it->key + ht->keySize); + } + } + + return NULL; +} + +void +ht_dump_distribution(HashTable ht) +{ + int c; + int numBuckets = 1 << ht->bucketBits; + for (c = 0; c < numBuckets; ++c) { + BucketPtr it; + int n = 0; + + xorg_list_for_each_entry(it, &ht->buckets[c], l) { + ++n; + } + printf("%d: %d\n", c, n); + } +} + +/* Picked the function from http://burtleburtle.net/bob/hash/doobs.html by + Bob Jenkins, which is released in public domain */ +static CARD32 +one_at_a_time_hash(const void *data, int len) +{ + CARD32 hash; + int i; + const char *key = data; + for (hash=0, i=0; i> 6); + } + hash += (hash << 3); + hash ^= (hash >> 11); + hash += (hash << 15); + return hash; +} + +unsigned +ht_generic_hash(void *cdata, const void *ptr, int numBits) +{ + HtGenericHashSetupPtr setup = cdata; + return one_at_a_time_hash(ptr, setup->keySize) & ~((~0) << numBits); +} + +int +ht_generic_compare(void *cdata, const void *l, const void *r) +{ + HtGenericHashSetupPtr setup = cdata; + return memcmp(l, r, setup->keySize); +} + +unsigned +ht_resourceid_hash(void * cdata, const void * data, int numBits) +{ + const XID* idPtr = data; + XID id = *idPtr & RESOURCE_ID_MASK; + (void) cdata; + return HashResourceID(id, numBits); +} + +int +ht_resourceid_compare(void* cdata, const void* a, const void* b) +{ + const XID* xa = a; + const XID* xb = b; + (void) cdata; + return + *xa < *xb ? -1 : + *xa > *xb ? 1 : + 0; +} + +void +ht_dump_contents(HashTable ht, + void (*print_key)(void *opaque, void *key), + void (*print_value)(void *opaque, void *value), + void* opaque) +{ + int c; + int numBuckets = 1 << ht->bucketBits; + for (c = 0; c < numBuckets; ++c) { + BucketPtr it; + int n = 0; + + printf("%d: ", c); + xorg_list_for_each_entry(it, &ht->buckets[c], l) { + if (n > 0) { + printf(", "); + } + print_key(opaque, it->key); + printf("->"); + print_value(opaque, it->data); + ++n; + } + printf("\n"); + } +} diff --git a/xserver/Xext/hashtable.h b/xserver/Xext/hashtable.h new file mode 100644 index 000000000..5d1598425 --- /dev/null +++ b/xserver/Xext/hashtable.h @@ -0,0 +1,137 @@ +#ifndef HASHTABLE_H +#define HASHTABLE_H 1 + +#include +#include +#include +#include "list.h" + +/** @brief A hashing function. + + @param[in/out] cdata Opaque data that can be passed to HtInit that will + eventually end up here + @param[in] ptr The data to be hashed. The size of the data, if + needed, can be configured via a record that can be + passed via cdata. + @param[in] numBits The number of bits this hash needs to have in the + resulting hash + + @return A numBits-bit hash of the data +*/ +typedef unsigned (*HashFunc)(void * cdata, const void * ptr, int numBits); + +/** @brief A comparison function for hashed keys. + + @param[in/out] cdata Opaque data that ca be passed to Htinit that will + eventually end up here + @param[in] l The left side data to be compared + @param[in] r The right side data to be compared + + @return -1 if l < r, 0 if l == r, 1 if l > r +*/ +typedef int (*HashCompareFunc)(void * cdata, const void * l, const void * r); + +struct HashTableRec; + +typedef struct HashTableRec *HashTable; + +/** @brief A configuration for HtGenericHash */ +typedef struct { + int keySize; +} HtGenericHashSetupRec, *HtGenericHashSetupPtr; + +/** @brief ht_create initalizes a hash table for a certain hash table + configuration + + @param[out] ht The hash table structure to initialize + @param[in] keySize The key size in bytes + @param[in] dataSize The data size in bytes + @param[in] hash The hash function to use for hashing keys + @param[in] compare The comparison function for hashing keys + @param[in] cdata Opaque data that will be passed to hash and + comparison functions +*/ +extern _X_EXPORT HashTable ht_create(int keySize, + int dataSize, + HashFunc hash, + HashCompareFunc compare, + pointer cdata); +/** @brief HtDestruct deinitializes the structure. It does not free the + memory allocated to HashTableRec +*/ +extern _X_EXPORT void ht_destroy(HashTable ht); + +/** @brief Adds a new key to the hash table. The key will be copied + and a pointer to the value will be returned. The data will + be initialized with zeroes. + + @param[in/out] ht The hash table + @param[key] key The key. The contents of the key will be copied. + + @return On error NULL is returned, otherwise a pointer to the data + associated with the newly inserted key. + + @note If dataSize is 0, a pointer to the end of the key may be returned + to avoid returning NULL. Obviously the data pointed cannot be + modified, as implied by dataSize being 0. +*/ +extern _X_EXPORT pointer ht_add(HashTable ht, pointer key); + +/** @brief Removes a key from the hash table along with its + associated data, which will be free'd. +*/ +extern _X_EXPORT void ht_remove(HashTable ht, pointer key); + +/** @brief Finds the associated data of a key from the hash table. + + @return If the key cannot be found, the function returns NULL. + Otherwise it returns a pointer to the data associated + with the key. + + @note If dataSize == 0, this function may return NULL + even if the key has been inserted! If dataSize == NULL, + use HtMember instead to determine if a key has been + inserted. +*/ +extern _X_EXPORT pointer ht_find(HashTable ht, pointer key); + +/** @brief A generic hash function */ +extern _X_EXPORT unsigned ht_generic_hash(void *cdata, + const void *ptr, + int numBits); + +/** @brief A generic comparison function. It compares data byte-wise. */ +extern _X_EXPORT int ht_generic_compare(void *cdata, + const void *l, + const void *r); + +/** @brief A debugging function that dumps the distribution of the + hash table: for each bucket, list the number of elements + contained within. */ +extern _X_EXPORT void ht_dump_distribution(HashTable ht); + +/** @brief A debugging function that dumps the contents of the hash + table: for each bucket, list the elements contained + within. */ +extern _X_EXPORT void ht_dump_contents(HashTable ht, + void (*print_key)(void *opaque, void *key), + void (*print_value)(void *opaque, void *value), + void* opaque); + +/** @brief A hashing function to be used for hashing resource IDs when + used with HashTables. It makes no use of cdata, so that can + be NULL. It uses HashXID underneath, and should HashXID be + unable to hash the value, it switches into using the generic + hash function. */ +extern _X_EXPORT unsigned ht_resourceid_hash(void *cdata, + const void * data, + int numBits); + +/** @brief A comparison function to be used for comparing resource + IDs when used with HashTables. It makes no use of cdata, + so that can be NULL. */ +extern _X_EXPORT int ht_resourceid_compare(void *cdata, + const void *a, + const void *b); + +#endif // HASHTABLE_H diff --git a/xserver/Xext/panoramiX.c b/xserver/Xext/panoramiX.c index 98d327f26..be475f7f4 100644 --- a/xserver/Xext/panoramiX.c +++ b/xserver/Xext/panoramiX.c @@ -59,7 +59,7 @@ Equipment Corporation. #ifdef COMPOSITE #include "compint.h" #endif -#include "modinit.h" +#include "extinit.h" #include "protocol-versions.h" #ifdef GLXPROXY @@ -150,7 +150,7 @@ static GCFuncs XineramaGCFuncs = { (pGC)->funcs = &XineramaGCFuncs; static Bool -XineramaCloseScreen(int i, ScreenPtr pScreen) +XineramaCloseScreen(ScreenPtr pScreen) { PanoramiXScreenPtr pScreenPriv = (PanoramiXScreenPtr) dixLookupPrivate(&pScreen->devPrivates, PanoramiXScreenKey); @@ -163,7 +163,7 @@ XineramaCloseScreen(int i, ScreenPtr pScreen) free((pointer) pScreenPriv); - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } static Bool @@ -434,7 +434,7 @@ XineramaReinitData(void) */ void -PanoramiXExtensionInit(int argc, char *argv[]) +PanoramiXExtensionInit(void) { int i; Bool success = FALSE; @@ -592,8 +592,6 @@ PanoramiXExtensionInit(int argc, char *argv[]) } -extern Bool CreateConnectionBlock(void); - Bool PanoramiXCreateConnectionBlock(void) { @@ -894,6 +892,9 @@ PanoramiXResetProc(ExtensionEntry * extEntry) PanoramiXRenderReset(); #ifdef XFIXES PanoramiXFixesReset(); +#endif +#ifdef COMPOSITE + PanoramiXCompositeReset (); #endif screenInfo.numScreens = PanoramiXNumScreens; for (i = 256; i--;) @@ -904,21 +905,22 @@ int ProcPanoramiXQueryVersion(ClientPtr client) { /* REQUEST(xPanoramiXQueryVersionReq); */ - xPanoramiXQueryVersionReply rep; + xPanoramiXQueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .majorVersion = SERVER_PANORAMIX_MAJOR_VERSION, + .minorVersion = SERVER_PANORAMIX_MINOR_VERSION + }; REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = SERVER_PANORAMIX_MAJOR_VERSION; - rep.minorVersion = SERVER_PANORAMIX_MINOR_VERSION; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swaps(&rep.majorVersion); swaps(&rep.minorVersion); } - WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), (char *) &rep); + WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), &rep); return Success; } @@ -935,17 +937,19 @@ ProcPanoramiXGetState(ClientPtr client) if (rc != Success) return rc; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.state = !noPanoramiXExtension; - rep.window = stuff->window; + rep = (xPanoramiXGetStateReply) { + .type = X_Reply, + .state = !noPanoramiXExtension, + .sequenceNumber = client->sequence, + .length = 0, + .window = stuff->window + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.window); } - WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *) &rep); + WriteToClient(client, sizeof(xPanoramiXGetStateReply), &rep); return Success; } @@ -963,17 +967,19 @@ ProcPanoramiXGetScreenCount(ClientPtr client) if (rc != Success) return rc; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.ScreenCount = PanoramiXNumScreens; - rep.window = stuff->window; + rep = (xPanoramiXGetScreenCountReply) { + .type = X_Reply, + .ScreenCount = PanoramiXNumScreens, + .sequenceNumber = client->sequence, + .length = 0, + .window = stuff->window + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.window); } - WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *) &rep); + WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), &rep); return Success; } @@ -993,14 +999,16 @@ ProcPanoramiXGetScreenSize(ClientPtr client) if (rc != Success) return rc; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; + rep = (xPanoramiXGetScreenSizeReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, /* screen dimensions */ - rep.width = screenInfo.screens[stuff->screen]->width; - rep.height = screenInfo.screens[stuff->screen]->height; - rep.window = stuff->window; - rep.screen = stuff->screen; + .width = screenInfo.screens[stuff->screen]->width, + .height = screenInfo.screens[stuff->screen]->height, + .window = stuff->window, + .screen = stuff->screen + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); @@ -1009,7 +1017,7 @@ ProcPanoramiXGetScreenSize(ClientPtr client) swapl(&rep.window); swapl(&rep.screen); } - WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *) &rep); + WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), &rep); return Success; } @@ -1021,24 +1029,24 @@ ProcXineramaIsActive(ClientPtr client) REQUEST_SIZE_MATCH(xXineramaIsActiveReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; + rep = (xXineramaIsActiveReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, #if 1 - { /* The following hack fools clients into thinking that Xinerama * is disabled even though it is not. */ - rep.state = !noPanoramiXExtension && !PanoramiXExtensionDisabledHack; - } + .state = !noPanoramiXExtension && !PanoramiXExtensionDisabledHack #else - rep.state = !noPanoramiXExtension; + .state = !noPanoramiXExtension; #endif + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.state); } - WriteToClient(client, sizeof(xXineramaIsActiveReply), (char *) &rep); + WriteToClient(client, sizeof(xXineramaIsActiveReply), &rep); return Success; } @@ -1046,20 +1054,22 @@ int ProcXineramaQueryScreens(ClientPtr client) { /* REQUEST(xXineramaQueryScreensReq); */ - xXineramaQueryScreensReply rep; + CARD32 number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens; + xXineramaQueryScreensReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(number * sz_XineramaScreenInfo), + .number = number + }; REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.number = (noPanoramiXExtension) ? 0 : PanoramiXNumScreens; - rep.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo); if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.number); } - WriteToClient(client, sizeof(xXineramaQueryScreensReply), (char *) &rep); + WriteToClient(client, sizeof(xXineramaQueryScreensReply), &rep); if (!noPanoramiXExtension) { xXineramaScreenInfo scratch; @@ -1077,7 +1087,7 @@ ProcXineramaQueryScreens(ClientPtr client) swaps(&scratch.width); swaps(&scratch.height); } - WriteToClient(client, sz_XineramaScreenInfo, (char *) &scratch); + WriteToClient(client, sz_XineramaScreenInfo, &scratch); } } diff --git a/xserver/Xext/panoramiXprocs.c b/xserver/Xext/panoramiXprocs.c index 12d6163bb..576844cbf 100644 --- a/xserver/Xext/panoramiXprocs.c +++ b/xserver/Xext/panoramiXprocs.c @@ -566,14 +566,18 @@ PanoramiXGetGeometry(ClientPtr client) if (rc != Success) return rc; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.root = screenInfo.screens[0]->root->drawable.id; - rep.depth = pDraw->depth; - rep.width = pDraw->width; - rep.height = pDraw->height; - rep.x = rep.y = rep.borderWidth = 0; + rep = (xGetGeometryReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .root = screenInfo.screens[0]->root->drawable.id, + .depth = pDraw->depth, + .width = pDraw->width, + .height = pDraw->height, + .x = 0, + .y = 0, + .borderWidth = 0 + }; if (stuff->id == rep.root) { xWindowRoot *root = (xWindowRoot *) @@ -617,11 +621,13 @@ PanoramiXTranslateCoords(ClientPtr client) rc = dixLookupWindow(&pDst, stuff->dstWid, client, DixReadAccess); if (rc != Success) return rc; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.sameScreen = xTrue; - rep.child = None; + rep = (xTranslateCoordsReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .sameScreen = xTrue, + .child = None + }; if ((pWin == screenInfo.screens[0]->root) || (pWin->drawable.id == screenInfo.screens[0]->screensaver.wid)) { @@ -1954,10 +1960,12 @@ PanoramiXGetImage(ClientPtr client) return rc; } - xgi.visual = wVisual(((WindowPtr) pDraw)); - xgi.type = X_Reply; - xgi.sequenceNumber = client->sequence; - xgi.depth = pDraw->depth; + xgi = (xGetImageReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .visual = wVisual(((WindowPtr) pDraw)), + .depth = pDraw->depth + }; if (format == ZPixmap) { widthBytesLine = PixmapBytePad(w, pDraw->depth); length = widthBytesLine * h; @@ -2003,7 +2011,7 @@ PanoramiXGetImage(ClientPtr client) format, planemask, pBuf, widthBytesLine, isRoot); - (void) WriteToClient(client, (int) (nlines * widthBytesLine), pBuf); + WriteToClient(client, (int) (nlines * widthBytesLine), pBuf); linesDone += nlines; } } @@ -2020,8 +2028,7 @@ PanoramiXGetImage(ClientPtr client) nlines, format, plane, pBuf, widthBytesLine, isRoot); - (void) WriteToClient(client, - (int) (nlines * widthBytesLine), pBuf); + WriteToClient(client, (int)(nlines * widthBytesLine), pBuf); linesDone += nlines; } diff --git a/xserver/Xext/saver.c b/xserver/Xext/saver.c index 159153c23..8de043f8e 100644 --- a/xserver/Xext/saver.c +++ b/xserver/Xext/saver.c @@ -46,6 +46,7 @@ in this Software without prior written authorization from the X Consortium. #include "cursorstr.h" #include "colormapst.h" #include "xace.h" +#include "inputstr.h" #ifdef PANORAMIX #include "panoramiX.h" #include "panoramiXsrv.h" @@ -57,7 +58,7 @@ in this Software without prior written authorization from the X Consortium. #include -#include "modinit.h" +#include "extinit.h" static int ScreenSaverEventBase = 0; @@ -388,8 +389,12 @@ ScreenSaverFreeSuspend(pointer value, XID id) if (screenIsSaved != SCREEN_SAVER_ON) #endif { + DeviceIntPtr dev; UpdateCurrentTimeIf(); - lastDeviceEventTime = currentTime; + nt_list_for_each_entry(dev, inputInfo.devices, next) + lastDeviceEventTime[dev->id] = currentTime; + lastDeviceEventTime[XIAllDevices] = currentTime; + lastDeviceEventTime[XIAllMasterDevices] = currentTime; SetScreenSaverTimer(); } } @@ -403,7 +408,6 @@ SendScreenSaverNotify(ScreenPtr pScreen, int state, Bool forced) ScreenSaverScreenPrivatePtr pPriv; ScreenSaverEventPtr pEv; unsigned long mask; - xScreenSaverNotifyEvent ev; int kind; UpdateCurrentTimeIf(); @@ -421,16 +425,18 @@ SendScreenSaverNotify(ScreenPtr pScreen, int state, Bool forced) else kind = ScreenSaverInternal; for (pEv = pPriv->events; pEv; pEv = pEv->next) { - if (!(pEv->mask & mask)) - continue; - ev.type = ScreenSaverNotify + ScreenSaverEventBase; - ev.state = state; - ev.timestamp = currentTime.milliseconds; - ev.root = pScreen->root->drawable.id; - ev.window = pScreen->screensaver.wid; - ev.kind = kind; - ev.forced = forced; - WriteEventsToClient(pEv->client, 1, (xEvent *) &ev); + if (pEv->mask & mask) { + xScreenSaverNotifyEvent ev = { + .type = ScreenSaverNotify + ScreenSaverEventBase, + .state = state, + .timestamp = currentTime.milliseconds, + .root = pScreen->root->drawable.id, + .window = pScreen->screensaver.wid, + .kind = kind, + .forced = forced + }; + WriteEventsToClient(pEv->client, 1, (xEvent *) &ev); + } } } @@ -631,19 +637,21 @@ ScreenSaverHandle(ScreenPtr pScreen, int xstate, Bool force) static int ProcScreenSaverQueryVersion(ClientPtr client) { - xScreenSaverQueryVersionReply rep; + xScreenSaverQueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .majorVersion = SERVER_SAVER_MAJOR_VERSION, + .minorVersion = SERVER_SAVER_MINOR_VERSION + }; REQUEST_SIZE_MATCH(xScreenSaverQueryVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = SERVER_SAVER_MAJOR_VERSION; - rep.minorVersion = SERVER_SAVER_MINOR_VERSION; + if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); } - WriteToClient(client, sizeof(xScreenSaverQueryVersionReply), (char *) &rep); + WriteToClient(client, sizeof(xScreenSaverQueryVersionReply), &rep); return Success; } @@ -672,12 +680,14 @@ ProcScreenSaverQueryInfo(ClientPtr client) pPriv = GetScreenPrivate(pDraw->pScreen); UpdateCurrentTime(); - lastInput = GetTimeInMillis() - lastDeviceEventTime.milliseconds; + lastInput = GetTimeInMillis() - lastDeviceEventTime[XIAllDevices].milliseconds; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.window = pSaver->wid; + rep = (xScreenSaverQueryInfoReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .window = pSaver->wid + }; if (screenIsSaved != SCREEN_SAVER_OFF) { rep.state = ScreenSaverOn; if (ScreenSaverTime) @@ -714,7 +724,7 @@ ProcScreenSaverQueryInfo(ClientPtr client) swapl(&rep.idle); swapl(&rep.eventMask); } - WriteToClient(client, sizeof(xScreenSaverQueryInfoReply), (char *) &rep); + WriteToClient(client, sizeof(xScreenSaverQueryInfoReply), &rep); return Success; } @@ -827,7 +837,7 @@ ScreenSaverSetAttributes(ClientPtr client) if ((visual != ancwopt->visual) || (depth != pParent->drawable.depth)) { fOK = FALSE; for (idepth = 0; idepth < pScreen->numDepths; idepth++) { - pDepth = (DepthPtr) & pScreen->allowedDepths[idepth]; + pDepth = (DepthPtr) &pScreen->allowedDepths[idepth]; if ((depth == pDepth->depth) || (depth == 0)) { for (ivisual = 0; ivisual < pDepth->numVids; ivisual++) { if (visual == pDepth->vids[ivisual]) { @@ -1381,7 +1391,7 @@ SProcScreenSaverDispatch(ClientPtr client) } void -ScreenSaverExtensionInit(INITARGS) +ScreenSaverExtensionInit(void) { ExtensionEntry *extEntry; int i; diff --git a/xserver/Xext/security.c b/xserver/Xext/security.c index 3699510d3..6cc9aa044 100644 --- a/xserver/Xext/security.c +++ b/xserver/Xext/security.c @@ -38,7 +38,7 @@ in this Software without prior written authorization from The Open Group. #include "xacestr.h" #include "securitysrv.h" #include -#include "modinit.h" +#include "extinit.h" #include "protocol-versions.h" /* Extension stuff */ @@ -192,10 +192,10 @@ SecurityDeleteAuthorization(pointer value, XID id) while ((pEventClient = pAuth->eventClients)) { /* send revocation event event */ - xSecurityAuthorizationRevokedEvent are; - - are.type = SecurityEventBase + XSecurityAuthorizationRevoked; - are.authId = pAuth->id; + xSecurityAuthorizationRevokedEvent are = { + .type = SecurityEventBase + XSecurityAuthorizationRevoked, + .authId = pAuth->id + }; WriteEventsToClient(rClient(pEventClient), 1, (xEvent *) &are); FreeResource(pEventClient->resource, RT_NONE); } @@ -338,21 +338,22 @@ static int ProcSecurityQueryVersion(ClientPtr client) { /* REQUEST(xSecurityQueryVersionReq); */ - xSecurityQueryVersionReply rep; + xSecurityQueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .majorVersion = SERVER_SECURITY_MAJOR_VERSION, + .minorVersion = SERVER_SECURITY_MINOR_VERSION + }; REQUEST_SIZE_MATCH(xSecurityQueryVersionReq); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.majorVersion = SERVER_SECURITY_MAJOR_VERSION; - rep.minorVersion = SERVER_SECURITY_MINOR_VERSION; + if (client->swapped) { swaps(&rep.sequenceNumber); swaps(&rep.majorVersion); swaps(&rep.minorVersion); } - (void) WriteToClient(client, SIZEOF(xSecurityQueryVersionReply), - (char *) &rep); + WriteToClient(client, SIZEOF(xSecurityQueryVersionReply), &rep); return Success; } /* ProcSecurityQueryVersion */ @@ -528,11 +529,13 @@ ProcSecurityGenerateAuthorization(ClientPtr client) /* tell client the auth id and data */ - rep.type = X_Reply; - rep.length = bytes_to_int32(authdata_len); - rep.sequenceNumber = client->sequence; - rep.authId = authId; - rep.dataLength = authdata_len; + rep = (xSecurityGenerateAuthorizationReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(authdata_len), + .authId = authId, + .dataLength = authdata_len + }; if (client->swapped) { swapl(&rep.length); @@ -541,8 +544,7 @@ ProcSecurityGenerateAuthorization(ClientPtr client) swaps(&rep.dataLength); } - WriteToClient(client, SIZEOF(xSecurityGenerateAuthorizationReply), - (char *) &rep); + WriteToClient(client, SIZEOF(xSecurityGenerateAuthorizationReply), &rep); WriteToClient(client, authdata_len, pAuthdata); SecurityAudit @@ -1025,7 +1027,7 @@ SecurityResetProc(ExtensionEntry * extEntry) */ void -SecurityExtensionInit(INITARGS) +SecurityExtensionInit(void) { ExtensionEntry *extEntry; int ret = TRUE; diff --git a/xserver/Xext/shape.c b/xserver/Xext/shape.c index cc5214a1b..d36867cc8 100644 --- a/xserver/Xext/shape.c +++ b/xserver/Xext/shape.c @@ -44,7 +44,7 @@ in this Software without prior written authorization from The Open Group. #include #include "regionstr.h" #include "gcstruct.h" -#include "modinit.h" +#include "extinit.h" #include "protocol-versions.h" typedef RegionPtr (*CreateDftPtr) (WindowPtr /* pWin */ @@ -204,22 +204,23 @@ CreateClipShape(WindowPtr pWin) static int ProcShapeQueryVersion(ClientPtr client) { - xShapeQueryVersionReply rep; + xShapeQueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .majorVersion = SERVER_SHAPE_MAJOR_VERSION, + .minorVersion = SERVER_SHAPE_MINOR_VERSION + }; REQUEST_SIZE_MATCH(xShapeQueryVersionReq); - memset(&rep, 0, sizeof(xShapeQueryVersionReply)); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = SERVER_SHAPE_MAJOR_VERSION; - rep.minorVersion = SERVER_SHAPE_MINOR_VERSION; + if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swaps(&rep.majorVersion); swaps(&rep.minorVersion); } - WriteToClient(client, sizeof(xShapeQueryVersionReply), (char *) &rep); + WriteToClient(client, sizeof(xShapeQueryVersionReply), &rep); return Success; } @@ -631,12 +632,13 @@ ProcShapeQueryExtents(ClientPtr client) rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) return rc; - memset(&rep, 0, sizeof(xShapeQueryExtentsReply)); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.boundingShaped = (wBoundingShape(pWin) != 0); - rep.clipShaped = (wClipShape(pWin) != 0); + rep = (xShapeQueryExtentsReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .boundingShaped = (wBoundingShape(pWin) != 0), + .clipShaped = (wClipShape(pWin) != 0) + }; if ((region = wBoundingShape(pWin))) { /* this is done in two steps because of a compiler bug on SunOS 4.1.3 */ pExtents = RegionExtents(region); @@ -679,7 +681,7 @@ ProcShapeQueryExtents(ClientPtr client) swaps(&rep.widthClipShape); swaps(&rep.heightClipShape); } - WriteToClient(client, sizeof(xShapeQueryExtentsReply), (char *) &rep); + WriteToClient(client, sizeof(xShapeQueryExtentsReply), &rep); return Success; } @@ -824,7 +826,6 @@ void SendShapeNotify(WindowPtr pWin, int which) { ShapeEventPtr *pHead, pShapeEvent; - xShapeNotifyEvent se; BoxRec extents; RegionPtr region; BYTE shaped; @@ -881,15 +882,17 @@ SendShapeNotify(WindowPtr pWin, int which) return; } for (pShapeEvent = *pHead; pShapeEvent; pShapeEvent = pShapeEvent->next) { - se.type = ShapeNotify + ShapeEventBase; - se.kind = which; - se.window = pWin->drawable.id; - se.x = extents.x1; - se.y = extents.y1; - se.width = extents.x2 - extents.x1; - se.height = extents.y2 - extents.y1; - se.time = currentTime.milliseconds; - se.shaped = shaped; + xShapeNotifyEvent se = { + .type = ShapeNotify + ShapeEventBase, + .kind = which, + .window = pWin->drawable.id, + .x = extents.x1, + .y = extents.y1, + .width = extents.x2 - extents.x1, + .height = extents.y2 - extents.y1, + .time = currentTime.milliseconds, + .shaped = shaped + }; WriteEventsToClient(pShapeEvent->client, 1, (xEvent *) &se); } } @@ -920,15 +923,17 @@ ProcShapeInputSelected(ClientPtr client) } } } - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.enabled = enabled; + rep = (xShapeInputSelectedReply) { + .type = X_Reply, + .enabled = enabled, + .sequenceNumber = client->sequence, + .length = 0 + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); } - WriteToClient(client, sizeof(xShapeInputSelectedReply), (char *) &rep); + WriteToClient(client, sizeof(xShapeInputSelectedReply), &rep); return Success; } @@ -1001,19 +1006,21 @@ ProcShapeGetRectangles(ClientPtr client) rects[i].height = box->y2 - box->y1; } } - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = bytes_to_int32(nrects * sizeof(xRectangle)); - rep.ordering = YXBanded; - rep.nrects = nrects; + rep = (xShapeGetRectanglesReply) { + .type = X_Reply, + .ordering = YXBanded, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(nrects * sizeof(xRectangle)), + .nrects = nrects + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.nrects); SwapShorts((short *) rects, (unsigned long) nrects * 4); } - WriteToClient(client, sizeof(rep), (char *) &rep); - WriteToClient(client, nrects * sizeof(xRectangle), (char *) rects); + WriteToClient(client, sizeof(rep), &rep); + WriteToClient(client, nrects * sizeof(xRectangle), rects); free(rects); return Success; } diff --git a/xserver/Xext/shm.c b/xserver/Xext/shm.c index de480207d..55960907b 100644 --- a/xserver/Xext/shm.c +++ b/xserver/Xext/shm.c @@ -87,7 +87,7 @@ in this Software without prior written authorization from The Open Group. #include "panoramiXsrv.h" #endif -#include "modinit.h" +#include "extinit.h" typedef struct _ShmDesc { struct _ShmDesc *next; @@ -135,11 +135,11 @@ static ShmFuncs fbFuncs = { fbShmCreatePixmap, NULL }; #define VERIFY_SHMSEG(shmseg,shmdesc,client) \ { \ - int rc; \ - rc = dixLookupResourceByType((pointer *)&(shmdesc), shmseg, ShmSegType, \ - client, DixReadAccess); \ - if (rc != Success) \ - return rc; \ + int tmprc; \ + tmprc = dixLookupResourceByType((pointer *)&(shmdesc), shmseg, ShmSegType, \ + client, DixReadAccess); \ + if (tmprc != Success) \ + return tmprc; \ } #define VERIFY_SHMPTR(shmseg,offset,needwrite,shmdesc,client) \ @@ -202,14 +202,14 @@ CheckForShmSyscall(void) #endif static Bool -ShmCloseScreen(int i, ScreenPtr pScreen) +ShmCloseScreen(ScreenPtr pScreen) { ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen); pScreen->CloseScreen = screen_priv->CloseScreen; dixSetPrivate(&pScreen->devPrivates, shmScrPrivateKey, NULL); free(screen_priv); - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } static ShmScrPrivateRec * @@ -285,19 +285,20 @@ ShmRegisterFbFuncs(ScreenPtr pScreen) static int ProcShmQueryVersion(ClientPtr client) { - xShmQueryVersionReply rep; + xShmQueryVersionReply rep = { + .type = X_Reply, + .sharedPixmaps = sharedPixmaps, + .sequenceNumber = client->sequence, + .length = 0, + .majorVersion = SERVER_SHM_MAJOR_VERSION, + .minorVersion = SERVER_SHM_MINOR_VERSION, + .uid = geteuid(), + .gid = getegid(), + .pixmapFormat = sharedPixmaps ? ZPixmap : 0 + }; REQUEST_SIZE_MATCH(xShmQueryVersionReq); - memset(&rep, 0, sizeof(xShmQueryVersionReply)); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.sharedPixmaps = sharedPixmaps; - rep.pixmapFormat = sharedPixmaps ? ZPixmap : 0; - rep.majorVersion = SERVER_SHM_MAJOR_VERSION; - rep.minorVersion = SERVER_SHM_MINOR_VERSION; - rep.uid = geteuid(); - rep.gid = getegid(); + if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); @@ -306,7 +307,7 @@ ProcShmQueryVersion(ClientPtr client) swaps(&rep.uid); swaps(&rep.gid); } - WriteToClient(client, sizeof(xShmQueryVersionReply), (char *) &rep); + WriteToClient(client, sizeof(xShmQueryVersionReply), &rep); return Success; } @@ -594,14 +595,14 @@ ProcShmPutImage(ClientPtr client) stuff->dstX, stuff->dstY, shmdesc->addr + stuff->offset); if (stuff->sendEvent) { - xShmCompletionEvent ev; - - ev.type = ShmCompletionCode; - ev.drawable = stuff->drawable; - ev.minorEvent = X_ShmPutImage; - ev.majorEvent = ShmReqCode; - ev.shmseg = stuff->shmseg; - ev.offset = stuff->offset; + xShmCompletionEvent ev = { + .type = ShmCompletionCode, + .drawable = stuff->drawable, + .minorEvent = X_ShmPutImage, + .majorEvent = ShmReqCode, + .shmseg = stuff->shmseg, + .offset = stuff->offset + }; WriteEventsToClient(client, 1, (xEvent *) &ev); } @@ -616,6 +617,7 @@ ProcShmGetImage(ClientPtr client) Mask plane = 0; xShmGetImageReply xgi; ShmDescPtr shmdesc; + VisualID visual = None; int rc; REQUEST(xShmGetImageReq); @@ -630,7 +632,7 @@ ProcShmGetImage(ClientPtr client) return rc; VERIFY_SHMPTR(stuff->shmseg, stuff->offset, TRUE, shmdesc, client); if (pDraw->type == DRAWABLE_WINDOW) { - if ( /* check for being viewable */ + if ( /* check for being viewable */ !((WindowPtr) pDraw)->realized || /* check for being on screen */ pDraw->x + stuff->x < 0 || @@ -646,19 +648,22 @@ ProcShmGetImage(ClientPtr client) stuff->y + (int) stuff->height > wBorderWidth((WindowPtr) pDraw) + (int) pDraw->height) return BadMatch; - xgi.visual = wVisual(((WindowPtr) pDraw)); + visual = wVisual(((WindowPtr) pDraw)); } else { if (stuff->x < 0 || stuff->x + (int) stuff->width > pDraw->width || stuff->y < 0 || stuff->y + (int) stuff->height > pDraw->height) return BadMatch; - xgi.visual = None; + visual = None; } - xgi.type = X_Reply; - xgi.length = 0; - xgi.sequenceNumber = client->sequence; - xgi.depth = pDraw->depth; + xgi = (xShmGetImageReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .visual = visual, + .depth = pDraw->depth + }; if (stuff->format == ZPixmap) { length = PixmapBytePad(stuff->width, pDraw->depth) * stuff->height; } @@ -702,7 +707,7 @@ ProcShmGetImage(ClientPtr client) swapl(&xgi.visual); swapl(&xgi.size); } - WriteToClient(client, sizeof(xShmGetImageReply), (char *) &xgi); + WriteToClient(client, sizeof(xShmGetImageReply), &xgi); return Success; } @@ -830,11 +835,13 @@ ProcPanoramiXShmGetImage(ClientPtr client) } } - xgi.visual = wVisual(((WindowPtr) pDraw)); - xgi.type = X_Reply; - xgi.length = 0; - xgi.sequenceNumber = client->sequence; - xgi.depth = pDraw->depth; + xgi = (xShmGetImageReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .visual = wVisual(((WindowPtr) pDraw)), + .depth = pDraw->depth + }; if (format == ZPixmap) { widthBytesLine = PixmapBytePad(w, pDraw->depth); @@ -877,7 +884,7 @@ ProcPanoramiXShmGetImage(ClientPtr client) swapl(&xgi.visual); swapl(&xgi.size); } - WriteToClient(client, sizeof(xShmGetImageReply), (char *) &xgi); + WriteToClient(client, sizeof(xShmGetImageReply), &xgi); return Success; } @@ -1241,7 +1248,7 @@ SProcShmDispatch(ClientPtr client) } void -ShmExtensionInit(INITARGS) +ShmExtensionInit(void) { ExtensionEntry *extEntry; int i; diff --git a/xserver/Xext/sync.c b/xserver/Xext/sync.c index 37c59c2be..4d11992bb 100644 --- a/xserver/Xext/sync.c +++ b/xserver/Xext/sync.c @@ -69,13 +69,14 @@ PERFORMANCE OF THIS SOFTWARE. #include "syncsrv.h" #include "syncsdk.h" #include "protocol-versions.h" +#include "inputstr.h" #include #if !defined(WIN32) #include #endif -#include "modinit.h" +#include "extinit.h" /* * Local Global Variables @@ -87,8 +88,7 @@ static RESTYPE RTAwait; static RESTYPE RTAlarm; static RESTYPE RTAlarmClient; static RESTYPE RTFence; -static int SyncNumSystemCounters = 0; -static SyncCounter **SysCounterList = NULL; +static struct xorg_list SysCounterList; static int SyncNumInvalidCounterWarnings = 0; #define MAX_INVALID_COUNTER_WARNINGS 5 @@ -114,6 +114,14 @@ static void SyncInitServerTime(void); static void SyncInitIdleTime(void); +static inline void* +SysCounterGetPrivate(SyncCounter *counter) +{ + BUG_WARN(!IsSystemCounter(counter)); + + return counter->pSysCounterInfo ? counter->pSysCounterInfo->private : NULL; +} + static Bool SyncCheckWarnIsCounter(const SyncObject * pSync, const char *warning) { @@ -429,22 +437,25 @@ SyncSendAlarmNotifyEvents(SyncAlarm * pAlarm) UpdateCurrentTime(); - ane.type = SyncEventBase + XSyncAlarmNotify; - ane.kind = XSyncAlarmNotify; - ane.alarm = pAlarm->alarm_id; + ane = (xSyncAlarmNotifyEvent) { + .type = SyncEventBase + XSyncAlarmNotify, + .kind = XSyncAlarmNotify, + .alarm = pAlarm->alarm_id, + .alarm_value_hi = XSyncValueHigh32(pTrigger->test_value), + .alarm_value_lo = XSyncValueLow32(pTrigger->test_value), + .time = currentTime.milliseconds, + .state = pAlarm->state + }; + if (pTrigger->pSync && SYNC_COUNTER == pTrigger->pSync->type) { ane.counter_value_hi = XSyncValueHigh32(pCounter->value); ane.counter_value_lo = XSyncValueLow32(pCounter->value); } - else { /* XXX what else can we do if there's no counter? */ + else { + /* XXX what else can we do if there's no counter? */ ane.counter_value_hi = ane.counter_value_lo = 0; } - ane.alarm_value_hi = XSyncValueHigh32(pTrigger->test_value); - ane.alarm_value_lo = XSyncValueLow32(pTrigger->test_value); - ane.time = currentTime.milliseconds; - ane.state = pAlarm->state; - /* send to owner */ if (pAlarm->events) WriteEventsToClient(pAlarm->client, 1, (xEvent *) &ane); @@ -466,7 +477,7 @@ SyncSendCounterNotifyEvents(ClientPtr client, SyncAwait ** ppAwait, if (client->clientGone) return; - pev = pEvents = malloc(num_events * sizeof(xSyncCounterNotifyEvent)); + pev = pEvents = calloc(num_events, sizeof(xSyncCounterNotifyEvent)); if (!pEvents) return; UpdateCurrentTime(); @@ -921,26 +932,17 @@ static int FreeCounter(void *, XID); * ***** System Counter utilities */ -pointer +SyncCounter* SyncCreateSystemCounter(const char *name, CARD64 initial, CARD64 resolution, SyncCounterType counterType, - void (*QueryValue) (pointer /* pCounter */ , - CARD64 * /* pValue_return */ ), - void (*BracketValues) (pointer /* pCounter */ , - CARD64 * /* pbracket_less */ , - CARD64 * /* pbracket_greater */ ) + SyncSystemCounterQueryValue QueryValue, + SyncSystemCounterBracketValues BracketValues ) { SyncCounter *pCounter; - SysCounterList = realloc(SysCounterList, - (SyncNumSystemCounters + - 1) * sizeof(SyncCounter *)); - if (!SysCounterList) - return NULL; - /* this function may be called before SYNC has been initialized, so we * have to make sure RTCounter is created. */ @@ -949,6 +951,7 @@ SyncCreateSystemCounter(const char *name, if (RTCounter == 0) { return NULL; } + xorg_list_init(&SysCounterList); } pCounter = SyncCreateCounter(NULL, FakeClientID(0), initial); @@ -962,14 +965,16 @@ SyncCreateSystemCounter(const char *name, return pCounter; } pCounter->pSysCounterInfo = psci; - psci->name = name; + psci->pCounter = pCounter; + psci->name = strdup(name); psci->resolution = resolution; psci->counterType = counterType; psci->QueryValue = QueryValue; psci->BracketValues = BracketValues; + psci->private = NULL; XSyncMaxValue(&psci->bracket_greater); XSyncMinValue(&psci->bracket_less); - SysCounterList[SyncNumSystemCounters++] = pCounter; + xorg_list_add(&psci->entry, &SysCounterList); } return pCounter; } @@ -1033,15 +1038,15 @@ SyncComputeBracketValues(SyncCounter * pCounter) pnewltval = &psci->bracket_less; } else if (XSyncValueEqual(pCounter->value, pTrigger->test_value) && - XSyncValueLessThan(pTrigger->test_value, - psci->bracket_greater)) { + XSyncValueGreaterThan(pTrigger->test_value, + psci->bracket_less)) { /* * The value is exactly equal to our threshold. We want one - * more event in the positive direction to ensure we pick up - * when the value *exceeds* this threshold. + * more event in the negative direction to ensure we pick up + * when the value is less than this threshold. */ - psci->bracket_greater = pTrigger->test_value; - pnewgtval = &psci->bracket_greater; + psci->bracket_less = pTrigger->test_value; + pnewltval = &psci->bracket_less; } } else if (pTrigger->test_type == XSyncPositiveTransition && @@ -1053,15 +1058,15 @@ SyncComputeBracketValues(SyncCounter * pCounter) pnewgtval = &psci->bracket_greater; } else if (XSyncValueEqual(pCounter->value, pTrigger->test_value) && - XSyncValueGreaterThan(pTrigger->test_value, - psci->bracket_less)) { + XSyncValueLessThan(pTrigger->test_value, + psci->bracket_greater)) { /* * The value is exactly equal to our threshold. We want one - * more event in the negative direction to ensure we pick up - * when the value is less than this threshold. + * more event in the positive direction to ensure we pick up + * when the value *exceeds* this threshold. */ - psci->bracket_less = pTrigger->test_value; - pnewltval = &psci->bracket_less; + psci->bracket_greater = pTrigger->test_value; + pnewgtval = &psci->bracket_greater; } } } /* end for each trigger */ @@ -1114,26 +1119,10 @@ FreeCounter(void *env, XID id) free(ptl); /* destroy the trigger list as we go */ } if (IsSystemCounter(pCounter)) { - int i, found = 0; - + xorg_list_del(&pCounter->pSysCounterInfo->entry); + free(pCounter->pSysCounterInfo->name); + free(pCounter->pSysCounterInfo->private); free(pCounter->pSysCounterInfo); - - /* find the counter in the list of system counters and remove it */ - - if (SysCounterList) { - for (i = 0; i < SyncNumSystemCounters; i++) { - if (SysCounterList[i] == pCounter) { - found = i; - break; - } - } - if (found < (SyncNumSystemCounters - 1)) { - for (i = found; i < SyncNumSystemCounters - 1; i++) { - SysCounterList[i] = SysCounterList[i + 1]; - } - } - } - SyncNumSystemCounters--; } free(pCounter); return Success; @@ -1199,21 +1188,20 @@ FreeAlarmClient(void *value, XID id) static int ProcSyncInitialize(ClientPtr client) { - xSyncInitializeReply rep; + xSyncInitializeReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .majorVersion = SERVER_SYNC_MAJOR_VERSION, + .minorVersion = SERVER_SYNC_MINOR_VERSION, + }; REQUEST_SIZE_MATCH(xSyncInitializeReq); - memset(&rep, 0, sizeof(xSyncInitializeReply)); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.majorVersion = SERVER_SYNC_MAJOR_VERSION; - rep.minorVersion = SERVER_SYNC_MINOR_VERSION; - rep.length = 0; - if (client->swapped) { swaps(&rep.sequenceNumber); } - WriteToClient(client, sizeof(rep), (char *) &rep); + WriteToClient(client, sizeof(rep), &rep); return Success; } @@ -1223,21 +1211,21 @@ ProcSyncInitialize(ClientPtr client) static int ProcSyncListSystemCounters(ClientPtr client) { - xSyncListSystemCountersReply rep; - int i, len; + xSyncListSystemCountersReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .nCounters = 0, + }; + SysCounterInfo *psci; + int len = 0; xSyncSystemCounter *list = NULL, *walklist = NULL; REQUEST_SIZE_MATCH(xSyncListSystemCountersReq); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.nCounters = SyncNumSystemCounters; - - for (i = len = 0; i < SyncNumSystemCounters; i++) { - const char *name = SysCounterList[i]->pSysCounterInfo->name; - + xorg_list_for_each_entry(psci, &SysCounterList, entry) { /* pad to 4 byte boundary */ - len += pad_to_int32(sz_xSyncSystemCounter + strlen(name)); + len += pad_to_int32(sz_xSyncSystemCounter + strlen(psci->name)); + ++rep.nCounters; } if (len) { @@ -1254,12 +1242,11 @@ ProcSyncListSystemCounters(ClientPtr client) swapl(&rep.nCounters); } - for (i = 0; i < SyncNumSystemCounters; i++) { + xorg_list_for_each_entry(psci, &SysCounterList, entry) { int namelen; char *pname_in_reply; - SysCounterInfo *psci = SysCounterList[i]->pSysCounterInfo; - walklist->counter = SysCounterList[i]->sync.id; + walklist->counter = psci->pCounter->sync.id; walklist->resolution_hi = XSyncValueHigh32(psci->resolution); walklist->resolution_lo = XSyncValueLow32(psci->resolution); namelen = strlen(psci->name); @@ -1279,9 +1266,9 @@ ProcSyncListSystemCounters(ClientPtr client) namelen)); } - WriteToClient(client, sizeof(rep), (char *) &rep); + WriteToClient(client, sizeof(rep), &rep); if (len) { - WriteToClient(client, len, (char *) list); + WriteToClient(client, len, list); free(list); } @@ -1344,17 +1331,19 @@ ProcSyncGetPriority(ClientPtr client) return rc; } - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.priority = priorityclient->priority; + rep = (xSyncGetPriorityReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .priority = priorityclient->priority + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.priority); } - WriteToClient(client, sizeof(xSyncGetPriorityReply), (char *) &rep); + WriteToClient(client, sizeof(xSyncGetPriorityReply), &rep); return Success; } @@ -1621,26 +1610,27 @@ ProcSyncQueryCounter(ClientPtr client) if (rc != Success) return rc; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - /* if system counter, ask it what the current value is */ - if (IsSystemCounter(pCounter)) { (*pCounter->pSysCounterInfo->QueryValue) ((pointer) pCounter, &pCounter->value); } - rep.value_hi = XSyncValueHigh32(pCounter->value); - rep.value_lo = XSyncValueLow32(pCounter->value); + rep = (xSyncQueryCounterReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .value_hi = XSyncValueHigh32(pCounter->value), + .value_lo = XSyncValueLow32(pCounter->value) + }; + if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.value_hi); swapl(&rep.value_lo); } - WriteToClient(client, sizeof(xSyncQueryCounterReply), (char *) &rep); + WriteToClient(client, sizeof(xSyncQueryCounterReply), &rep); return Success; } @@ -1787,32 +1777,33 @@ ProcSyncQueryAlarm(ClientPtr client) if (rc != Success) return rc; - rep.type = X_Reply; - rep.length = - bytes_to_int32(sizeof(xSyncQueryAlarmReply) - sizeof(xGenericReply)); - rep.sequenceNumber = client->sequence; - pTrigger = &pAlarm->trigger; - rep.counter = (pTrigger->pSync) ? pTrigger->pSync->id : None; + rep = (xSyncQueryAlarmReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = + bytes_to_int32(sizeof(xSyncQueryAlarmReply) - sizeof(xGenericReply)), + .counter = (pTrigger->pSync) ? pTrigger->pSync->id : None, -#if 0 /* XXX unclear what to do, depends on whether relative value-types - * are "consumed" immediately and are considered absolute from then - * on. - */ - rep.value_type = pTrigger->value_type; - rep.wait_value_hi = XSyncValueHigh32(pTrigger->wait_value); - rep.wait_value_lo = XSyncValueLow32(pTrigger->wait_value); +#if 0 /* XXX unclear what to do, depends on whether relative value-types + * are "consumed" immediately and are considered absolute from then + * on. + */ + .value_type = pTrigger->value_type, + .wait_value_hi = XSyncValueHigh32(pTrigger->wait_value), + .wait_value_lo = XSyncValueLow32(pTrigger->wait_value), #else - rep.value_type = XSyncAbsolute; - rep.wait_value_hi = XSyncValueHigh32(pTrigger->test_value); - rep.wait_value_lo = XSyncValueLow32(pTrigger->test_value); + .value_type = XSyncAbsolute, + .wait_value_hi = XSyncValueHigh32(pTrigger->test_value), + .wait_value_lo = XSyncValueLow32(pTrigger->test_value), #endif - rep.test_type = pTrigger->test_type; - rep.delta_hi = XSyncValueHigh32(pAlarm->delta); - rep.delta_lo = XSyncValueLow32(pAlarm->delta); - rep.events = pAlarm->events; - rep.state = pAlarm->state; + .test_type = pTrigger->test_type, + .delta_hi = XSyncValueHigh32(pAlarm->delta), + .delta_lo = XSyncValueLow32(pAlarm->delta), + .events = pAlarm->events, + .state = pAlarm->state + }; if (client->swapped) { swaps(&rep.sequenceNumber); @@ -1825,7 +1816,7 @@ ProcSyncQueryAlarm(ClientPtr client) swapl(&rep.delta_lo); } - WriteToClient(client, sizeof(xSyncQueryAlarmReply), (char *) &rep); + WriteToClient(client, sizeof(xSyncQueryAlarmReply), &rep); return Success; } @@ -1971,18 +1962,20 @@ ProcSyncQueryFence(ClientPtr client) if (rc != Success) return rc; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; + rep = (xSyncQueryFenceReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, - rep.triggered = pFence->funcs.CheckTriggered(pFence); + .triggered = pFence->funcs.CheckTriggered(pFence) + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); } - WriteToClient(client, sizeof(xSyncQueryFenceReply), (char *) &rep); + WriteToClient(client, sizeof(xSyncQueryFenceReply), &rep); return client->noClientException; } @@ -2444,8 +2437,6 @@ SAlarmNotifyEvent(xSyncAlarmNotifyEvent * from, xSyncAlarmNotifyEvent * to) static void SyncResetProc(ExtensionEntry * extEntry) { - free(SysCounterList); - SysCounterList = NULL; RTCounter = 0; } @@ -2463,6 +2454,7 @@ SyncExtensionInit(void) if (RTCounter == 0) { RTCounter = CreateNewResourceType(FreeCounter, "SyncCounter"); + xorg_list_init(&SysCounterList); } RTAlarm = CreateNewResourceType(FreeAlarm, "SyncAlarm"); RTAwait = CreateNewResourceType(FreeAwait, "SyncAwait"); @@ -2608,33 +2600,48 @@ SyncInitServerTime(void) * IDLETIME implementation */ -static SyncCounter *IdleTimeCounter; -static XSyncValue *pIdleTimeValueLess; -static XSyncValue *pIdleTimeValueGreater; +typedef struct { + XSyncValue *value_less; + XSyncValue *value_greater; + int deviceid; +} IdleCounterPriv; static void IdleTimeQueryValue(pointer pCounter, CARD64 * pValue_return) { - CARD32 idle = GetTimeInMillis() - lastDeviceEventTime.milliseconds; + int deviceid; + CARD32 idle; + if (pCounter) { + SyncCounter *counter = pCounter; + IdleCounterPriv *priv = SysCounterGetPrivate(counter); + deviceid = priv->deviceid; + } + else + deviceid = XIAllDevices; + idle = GetTimeInMillis() - lastDeviceEventTime[deviceid].milliseconds; XSyncIntsToValue(pValue_return, idle, 0); } static void -IdleTimeBlockHandler(pointer env, struct timeval **wt, pointer LastSelectMask) +IdleTimeBlockHandler(pointer pCounter, struct timeval **wt, pointer LastSelectMask) { + SyncCounter *counter = pCounter; + IdleCounterPriv *priv = SysCounterGetPrivate(counter); + XSyncValue *less = priv->value_less, + *greater = priv->value_greater; XSyncValue idle, old_idle; - SyncTriggerList *list = IdleTimeCounter->sync.pTriglist; + SyncTriggerList *list = counter->sync.pTriglist; SyncTrigger *trig; - if (!pIdleTimeValueLess && !pIdleTimeValueGreater) + if (!less && !greater) return; - old_idle = IdleTimeCounter->value; + old_idle = counter->value; IdleTimeQueryValue(NULL, &idle); - IdleTimeCounter->value = idle; /* push, so CheckTrigger works */ + counter->value = idle; /* push, so CheckTrigger works */ - if (pIdleTimeValueLess && XSyncValueLessOrEqual(idle, *pIdleTimeValueLess)) { + if (less && XSyncValueLessOrEqual(idle, *less)) { /* * We've been idle for less than the threshold value, and someone * wants to know about that, but now we need to know whether they @@ -2643,7 +2650,7 @@ IdleTimeBlockHandler(pointer env, struct timeval **wt, pointer LastSelectMask) * immediately so we can reschedule. */ - for (list = IdleTimeCounter->sync.pTriglist; list; list = list->next) { + for (list = counter->sync.pTriglist; list; list = list->next) { trig = list->pTrigger; if (trig->CheckTrigger(trig, old_idle)) { AdjustWaitForDelay(wt, 0); @@ -2656,10 +2663,10 @@ IdleTimeBlockHandler(pointer env, struct timeval **wt, pointer LastSelectMask) * idle time greater than this. Schedule a wakeup for the next * millisecond so we won't miss a transition. */ - if (XSyncValueEqual(idle, *pIdleTimeValueLess)) + if (XSyncValueEqual(idle, *less)) AdjustWaitForDelay(wt, 1); } - else if (pIdleTimeValueGreater) { + else if (greater) { /* * There's a threshold in the positive direction. If we've been * idle less than it, schedule a wakeup for sometime in the future. @@ -2668,15 +2675,15 @@ IdleTimeBlockHandler(pointer env, struct timeval **wt, pointer LastSelectMask) */ unsigned long timeout = -1; - if (XSyncValueLessThan(idle, *pIdleTimeValueGreater)) { + if (XSyncValueLessThan(idle, *greater)) { XSyncValue value; Bool overflow; - XSyncValueSubtract(&value, *pIdleTimeValueGreater, idle, &overflow); + XSyncValueSubtract(&value, *greater, idle, &overflow); timeout = min(timeout, XSyncValueLow32(value)); } else { - for (list = IdleTimeCounter->sync.pTriglist; list; + for (list = counter->sync.pTriglist; list; list = list->next) { trig = list->pTrigger; if (trig->CheckTrigger(trig, old_idle)) { @@ -2689,24 +2696,26 @@ IdleTimeBlockHandler(pointer env, struct timeval **wt, pointer LastSelectMask) AdjustWaitForDelay(wt, timeout); } - IdleTimeCounter->value = old_idle; /* pop */ + counter->value = old_idle; /* pop */ } static void -IdleTimeWakeupHandler(pointer env, int rc, pointer LastSelectMask) +IdleTimeWakeupHandler(pointer pCounter, int rc, pointer LastSelectMask) { + SyncCounter *counter = pCounter; + IdleCounterPriv *priv = SysCounterGetPrivate(counter); + XSyncValue *less = priv->value_less, + *greater = priv->value_greater; XSyncValue idle; - if (!pIdleTimeValueLess && !pIdleTimeValueGreater) + if (!less && !greater) return; - IdleTimeQueryValue(NULL, &idle); + IdleTimeQueryValue(pCounter, &idle); - if ((pIdleTimeValueGreater && - XSyncValueGreaterOrEqual(idle, *pIdleTimeValueGreater)) || - (pIdleTimeValueLess && - XSyncValueLessOrEqual(idle, *pIdleTimeValueLess))) { - SyncChangeCounter(IdleTimeCounter, idle); + if ((greater && XSyncValueGreaterOrEqual(idle, *greater)) || + (less && XSyncValueLessOrEqual(idle, *less))) { + SyncChangeCounter(counter, idle); } } @@ -2714,34 +2723,69 @@ static void IdleTimeBracketValues(pointer pCounter, CARD64 * pbracket_less, CARD64 * pbracket_greater) { - Bool registered = (pIdleTimeValueLess || pIdleTimeValueGreater); + SyncCounter *counter = pCounter; + IdleCounterPriv *priv = SysCounterGetPrivate(counter); + XSyncValue *less = priv->value_less, + *greater = priv->value_greater; + Bool registered = (less || greater); if (registered && !pbracket_less && !pbracket_greater) { RemoveBlockAndWakeupHandlers(IdleTimeBlockHandler, - IdleTimeWakeupHandler, NULL); + IdleTimeWakeupHandler, pCounter); } else if (!registered && (pbracket_less || pbracket_greater)) { RegisterBlockAndWakeupHandlers(IdleTimeBlockHandler, - IdleTimeWakeupHandler, NULL); + IdleTimeWakeupHandler, pCounter); } - pIdleTimeValueGreater = pbracket_greater; - pIdleTimeValueLess = pbracket_less; + priv->value_greater = pbracket_greater; + priv->value_less = pbracket_less; +} + +static SyncCounter* +init_system_idle_counter(const char *name, int deviceid) +{ + CARD64 resolution; + XSyncValue idle; + IdleCounterPriv *priv = malloc(sizeof(IdleCounterPriv)); + SyncCounter *idle_time_counter; + + IdleTimeQueryValue(NULL, &idle); + XSyncIntToValue(&resolution, 4); + + idle_time_counter = SyncCreateSystemCounter(name, idle, resolution, + XSyncCounterUnrestricted, + IdleTimeQueryValue, + IdleTimeBracketValues); + + priv->deviceid = deviceid; + priv->value_less = priv->value_greater = NULL; + + idle_time_counter->pSysCounterInfo->private = priv; + + return idle_time_counter; } static void SyncInitIdleTime(void) { - CARD64 resolution; - XSyncValue idle; - - IdleTimeQueryValue(NULL, &idle); - XSyncIntToValue(&resolution, 4); - - IdleTimeCounter = SyncCreateSystemCounter("IDLETIME", idle, resolution, - XSyncCounterUnrestricted, - IdleTimeQueryValue, - IdleTimeBracketValues); - - pIdleTimeValueLess = pIdleTimeValueGreater = NULL; + init_system_idle_counter("IDLETIME", XIAllDevices); +} + +SyncCounter* +SyncInitDeviceIdleTime(DeviceIntPtr dev) +{ + char timer_name[64]; + sprintf(timer_name, "DEVICEIDLETIME %d", dev->id); + + return init_system_idle_counter(timer_name, dev->id); +} + +void SyncRemoveDeviceIdleTime(SyncCounter *counter) +{ + /* FreeAllResources() frees all system counters before the devices are + shut down, check if there are any left before freeing the device's + counter */ + if (!xorg_list_is_empty(&SysCounterList)) + xorg_list_del(&counter->pSysCounterInfo->entry); } diff --git a/xserver/Xext/syncsrv.h b/xserver/Xext/syncsrv.h index b0464b304..c68229f46 100644 --- a/xserver/Xext/syncsrv.h +++ b/xserver/Xext/syncsrv.h @@ -51,6 +51,7 @@ PERFORMANCE OF THIS SOFTWARE. #ifndef _SYNCSRV_H_ #define _SYNCSRV_H_ +#include "list.h" #include "misync.h" #include "misyncstr.h" @@ -65,19 +66,25 @@ typedef enum { XSyncCounterUnrestricted } SyncCounterType; +typedef void (*SyncSystemCounterQueryValue)(pointer counter, + CARD64 *value_return + ); +typedef void (*SyncSystemCounterBracketValues)(pointer counter, + CARD64 *pbracket_less, + CARD64 *pbracket_greater + ); + typedef struct _SysCounterInfo { - const char *name; + SyncCounter *pCounter; + char *name; CARD64 resolution; CARD64 bracket_greater; CARD64 bracket_less; SyncCounterType counterType; /* how can this counter change */ - void (*QueryValue) (pointer /*pCounter */ , - CARD64 * /*freshvalue */ - ); - void (*BracketValues) (pointer /*pCounter */ , - CARD64 * /*lessthan */ , - CARD64 * /*greaterthan */ - ); + SyncSystemCounterQueryValue QueryValue; + SyncSystemCounterBracketValues BracketValues; + void *private; + struct xorg_list entry; } SysCounterInfo; typedef struct _SyncAlarmClientList { @@ -113,33 +120,20 @@ typedef union { SyncAwait await; } SyncAwaitUnion; -extern pointer SyncCreateSystemCounter(const char * /* name */ , - CARD64 /* inital_value */ , - CARD64 /* resolution */ , - SyncCounterType - /* change characterization */ , - void (* /*QueryValue */ )( - pointer - /* pCounter */ - , - CARD64 * /* pValue_return */ ), /* XXX prototype */ - void (* /*BracketValues */ )( - pointer - /* pCounter */ - , - CARD64 * - /* pbracket_less */ - , - CARD64 * - /* pbracket_greater */ - ) +extern SyncCounter* SyncCreateSystemCounter(const char *name, + CARD64 initial_value, + CARD64 resolution, + SyncCounterType counterType, + SyncSystemCounterQueryValue QueryValue, + SyncSystemCounterBracketValues BracketValues ); -extern void SyncChangeCounter(SyncCounter * /* pCounter */ , - CARD64 /* new_value */ +extern void SyncChangeCounter(SyncCounter *pCounter, + CARD64 new_value ); extern void SyncDestroySystemCounter(pointer pCounter); -extern void SyncExtensionInit(void); +extern SyncCounter *SyncInitDeviceIdleTime(DeviceIntPtr dev); +extern void SyncRemoveDeviceIdleTime(SyncCounter *counter); #endif /* _SYNCSRV_H_ */ diff --git a/xserver/Xext/xace.c b/xserver/Xext/xace.c index b2e7ddaf0..026d3c5cf 100644 --- a/xserver/Xext/xace.c +++ b/xserver/Xext/xace.c @@ -47,18 +47,18 @@ XaceHookDispatch(ClientPtr client, int major) if (major < 128) { /* Call the core dispatch hook */ - XaceCoreDispatchRec rec = { client, Success /* default allow */ }; - CallCallbacks(&XaceHooks[XACE_CORE_DISPATCH], &rec); - return rec.status; + XaceCoreDispatchRec drec = { client, Success /* default allow */ }; + CallCallbacks(&XaceHooks[XACE_CORE_DISPATCH], &drec); + return drec.status; } else { /* Call the extension dispatch hook */ ExtensionEntry *ext = GetExtensionEntry(major); - XaceExtAccessRec rec = { client, ext, DixUseAccess, Success }; + XaceExtAccessRec erec = { client, ext, DixUseAccess, Success }; if (ext) - CallCallbacks(&XaceHooks[XACE_EXT_DISPATCH], &rec); + CallCallbacks(&XaceHooks[XACE_EXT_DISPATCH], &erec); /* On error, pretend extension doesn't exist */ - return (rec.status == Success) ? Success : BadRequest; + return (erec.status == Success) ? Success : BadRequest; } } diff --git a/xserver/Xext/xcmisc.c b/xserver/Xext/xcmisc.c index 99a6ece43..034bfb63b 100644 --- a/xserver/Xext/xcmisc.c +++ b/xserver/Xext/xcmisc.c @@ -38,27 +38,29 @@ from The Open Group. #include "extnsionst.h" #include "swaprep.h" #include -#include "modinit.h" +#include "extinit.h" #include static int ProcXCMiscGetVersion(ClientPtr client) { - xXCMiscGetVersionReply rep; + xXCMiscGetVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .majorVersion = XCMiscMajorVersion, + .minorVersion = XCMiscMinorVersion + }; REQUEST_SIZE_MATCH(xXCMiscGetVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = XCMiscMajorVersion; - rep.minorVersion = XCMiscMinorVersion; + if (client->swapped) { swaps(&rep.sequenceNumber); swaps(&rep.majorVersion); swaps(&rep.minorVersion); } - WriteToClient(client, sizeof(xXCMiscGetVersionReply), (char *) &rep); + WriteToClient(client, sizeof(xXCMiscGetVersionReply), &rep); return Success; } @@ -70,17 +72,19 @@ ProcXCMiscGetXIDRange(ClientPtr client) REQUEST_SIZE_MATCH(xXCMiscGetXIDRangeReq); GetXIDRange(client->index, FALSE, &min_id, &max_id); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.start_id = min_id; - rep.count = max_id - min_id + 1; + rep = (xXCMiscGetXIDRangeReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .start_id = min_id, + .count = max_id - min_id + 1 + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.start_id); swapl(&rep.count); } - WriteToClient(client, sizeof(xXCMiscGetXIDRangeReply), (char *) &rep); + WriteToClient(client, sizeof(xXCMiscGetXIDRangeReply), &rep); return Success; } @@ -102,16 +106,18 @@ ProcXCMiscGetXIDList(ClientPtr client) return BadAlloc; } count = GetXIDList(client, stuff->count, pids); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = count; - rep.count = count; + rep = (xXCMiscGetXIDListReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = count, + .count = count + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.count); } - WriteToClient(client, sizeof(xXCMiscGetXIDListReply), (char *) &rep); + WriteToClient(client, sizeof(xXCMiscGetXIDListReply), &rep); if (count) { client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, count * sizeof(XID), pids); @@ -184,7 +190,7 @@ SProcXCMiscDispatch(ClientPtr client) } void -XCMiscExtensionInit(INITARGS) +XCMiscExtensionInit(void) { AddExtension(XCMiscExtensionName, 0, 0, ProcXCMiscDispatch, SProcXCMiscDispatch, diff --git a/xserver/Xext/xf86bigfont.c b/xserver/Xext/xf86bigfont.c index 9de785678..46b3242d1 100644 --- a/xserver/Xext/xf86bigfont.c +++ b/xserver/Xext/xf86bigfont.c @@ -71,6 +71,7 @@ #include "gcstruct.h" #include "dixfontstr.h" #include "extnsionst.h" +#include "extinit.h" #include "protocol-versions.h" #include @@ -277,28 +278,24 @@ ProcXF86BigfontQueryVersion(ClientPtr client) xXF86BigfontQueryVersionReply reply; REQUEST_SIZE_MATCH(xXF86BigfontQueryVersionReq); - reply.type = X_Reply; - reply.length = 0; - reply.sequenceNumber = client->sequence; - reply.majorVersion = SERVER_XF86BIGFONT_MAJOR_VERSION; - reply.minorVersion = SERVER_XF86BIGFONT_MINOR_VERSION; - reply.uid = geteuid(); - reply.gid = getegid(); + reply = (xXF86BigfontQueryVersionReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .majorVersion = SERVER_XF86BIGFONT_MAJOR_VERSION, + .minorVersion = SERVER_XF86BIGFONT_MINOR_VERSION, + .uid = geteuid(), + .gid = getegid(), #ifdef HAS_SHM - reply.signature = signature; + .signature = signature, + .capabilities = (client->local && !client->swapped) + ? XF86Bigfont_CAP_LocalShm : 0 #else - reply.signature = 0; /* This is redundant. Avoids uninitialized memory. */ + .signature = 0, + .capabilities = 0 #endif - reply.capabilities = -#ifdef HAS_SHM - (LocalClient(client) && !client->swapped ? XF86Bigfont_CAP_LocalShm : 0) -#else - 0 -#endif - ; /* may add more bits here in future versions */ + }; if (client->swapped) { - char tmp; - swaps(&reply.sequenceNumber); swapl(&reply.length); swaps(&reply.majorVersion); @@ -307,16 +304,13 @@ ProcXF86BigfontQueryVersion(ClientPtr client) swapl(&reply.gid); swapl(&reply.signature); } - WriteToClient(client, - sizeof(xXF86BigfontQueryVersionReply), (char *) &reply); + WriteToClient(client, sizeof(xXF86BigfontQueryVersionReply), &reply); return Success; } static void swapCharInfo(xCharInfo * pCI) { - char tmp; - swaps(&pCI->leftSideBearing); swaps(&pCI->rightSideBearing); swaps(&pCI->characterWidth); @@ -359,7 +353,7 @@ ProcXF86BigfontQueryFont(ClientPtr client) #else switch (client->req_len) { case 2: /* client with version 1.0 libX11 */ - stuff_flags = (LocalClient(client) && + stuff_flags = (client->local && !client->swapped ? XF86Bigfont_FLAGS_Shm : 0); break; case 3: /* client with version 1.1 libX11 */ @@ -555,7 +549,7 @@ ProcXF86BigfontQueryFont(ClientPtr client) ? nUniqCharInfos * sizeof(xCharInfo) + (nCharInfos + 1) / 2 * 2 * sizeof(CARD16) : 0); - xXF86BigfontQueryFontReply *reply = malloc(rlength); + xXF86BigfontQueryFontReply *reply = calloc(1, rlength); char *p; if (!reply) { @@ -587,8 +581,6 @@ ProcXF86BigfontQueryFont(ClientPtr client) reply->shmid = shmid; reply->shmsegoffset = 0; if (client->swapped) { - char tmp; - swaps(&reply->sequenceNumber); swapl(&reply->length); swapCharInfo(&reply->minBounds); @@ -615,8 +607,6 @@ ProcXF86BigfontQueryFont(ClientPtr client) prFP->name = pFP->name; prFP->value = pFP->value; if (client->swapped) { - char tmp; - swapl(&prFP->name); swapl(&prFP->value); } @@ -638,13 +628,11 @@ ProcXF86BigfontQueryFont(ClientPtr client) for (j = 0; j < nCharInfos; j++, ps++) { *ps = pIndex2UniqIndex[j]; if (client->swapped) { - char tmp; - swaps(ps); } } } - WriteToClient(client, rlength, (char *) reply); + WriteToClient(client, rlength, reply); free(reply); if (nCharInfos > 0) { if (shmid == -1) @@ -675,7 +663,6 @@ static int SProcXF86BigfontQueryVersion(ClientPtr client) { REQUEST(xXF86BigfontQueryVersionReq); - char tmp; swaps(&stuff->length); return ProcXF86BigfontQueryVersion(client); @@ -685,7 +672,6 @@ static int SProcXF86BigfontQueryFont(ClientPtr client) { REQUEST(xXF86BigfontQueryFontReq); - char tmp; swaps(&stuff->length); REQUEST_SIZE_MATCH(xXF86BigfontQueryFontReq); diff --git a/xserver/Xext/xf86bigfontsrv.h b/xserver/Xext/xf86bigfontsrv.h index 2c78dc4c9..eab528775 100644 --- a/xserver/Xext/xf86bigfontsrv.h +++ b/xserver/Xext/xf86bigfontsrv.h @@ -27,7 +27,6 @@ #include -extern void XFree86BigfontExtensionInit(void); extern void XF86BigfontFreeFontShm(FontPtr); extern void XF86BigfontCleanup(void); diff --git a/xserver/Xext/xres.c b/xserver/Xext/xres.c index 9d89b6550..445abcab8 100644 --- a/xserver/Xext/xres.c +++ b/xserver/Xext/xres.c @@ -10,6 +10,7 @@ #include #include #include +#include #include "misc.h" #include "os.h" #include "dixstruct.h" @@ -20,29 +21,196 @@ #include "pixmapstr.h" #include "windowstr.h" #include "gcstruct.h" -#include "modinit.h" +#include "extinit.h" #include "protocol-versions.h" +#include "client.h" +#include "list.h" +#include "misc.h" +#include +#include "hashtable.h" +#include "picturestr.h" + +#ifdef COMPOSITE +#include "compint.h" +#endif + +/** @brief Holds fragments of responses for ConstructClientIds. + * + * note: there is no consideration for data alignment */ +typedef struct { + struct xorg_list l; + int bytes; + /* data follows */ +} FragmentList; + +#define FRAGMENT_DATA(ptr) ((void*) ((char*) (ptr) + sizeof(FragmentList))) + +/** @brief Holds structure for the generated response to + ProcXResQueryClientIds; used by ConstructClientId* -functions */ +typedef struct { + int numIds; + int resultBytes; + struct xorg_list response; + int sentClientMasks[MAXCLIENTS]; +} ConstructClientIdCtx; + +/** @brief Holds the structure for information required to + generate the response to XResQueryResourceBytes. In addition + to response it contains information on the query as well, + as well as some volatile information required by a few + functions that cannot take that information directly + via a parameter, as they are called via already-existing + higher order functions. */ +typedef struct { + ClientPtr sendClient; + int numSizes; + int resultBytes; + struct xorg_list response; + int status; + long numSpecs; + xXResResourceIdSpec *specs; + HashTable visitedResources; + + /* Used by AddSubResourceSizeSpec when AddResourceSizeValue is + handling crossreferences */ + HashTable visitedSubResources; + + /* used when ConstructResourceBytesCtx is passed to + AddResourceSizeValue2 via FindClientResourcesByType */ + RESTYPE resType; + + /* used when ConstructResourceBytesCtx is passed to + AddResourceSizeValueByResource from ConstructResourceBytesByResource */ + xXResResourceIdSpec *curSpec; + + /** Used when iterating through a single resource's subresources + + @see AddSubResourceSizeSpec */ + xXResResourceSizeValue *sizeValue; +} ConstructResourceBytesCtx; + +/** @brief Allocate and add a sequence of bytes at the end of a fragment list. + Call DestroyFragments to release the list. + + @param frags A pointer to head of an initialized linked list + @param bytes Number of bytes to allocate + @return Returns a pointer to the allocated non-zeroed region + that is to be filled by the caller. On error (out of memory) + returns NULL and makes no changes to the list. +*/ +static void * +AddFragment(struct xorg_list *frags, int bytes) +{ + FragmentList *f = malloc(sizeof(FragmentList) + bytes); + if (!f) { + return NULL; + } else { + f->bytes = bytes; + xorg_list_add(&f->l, frags->prev); + return (char*) f + sizeof(*f); + } +} + +/** @brief Sends all fragments in the list to the client. Does not + free anything. + + @param client The client to send the fragments to + @param frags The head of the list of fragments +*/ +static void +WriteFragmentsToClient(ClientPtr client, struct xorg_list *frags) +{ + FragmentList *it; + xorg_list_for_each_entry(it, frags, l) { + WriteToClient(client, it->bytes, (char*) it + sizeof(*it)); + } +} + +/** @brief Frees a list of fragments. Does not free() root node. + + @param frags The head of the list of fragments +*/ +static void +DestroyFragments(struct xorg_list *frags) +{ + FragmentList *it, *tmp; + xorg_list_for_each_entry_safe(it, tmp, frags, l) { + xorg_list_del(&it->l); + free(it); + } +} + +/** @brief Constructs a context record for ConstructClientId* functions + to use */ +static void +InitConstructClientIdCtx(ConstructClientIdCtx *ctx) +{ + ctx->numIds = 0; + ctx->resultBytes = 0; + xorg_list_init(&ctx->response); + memset(ctx->sentClientMasks, 0, sizeof(ctx->sentClientMasks)); +} + +/** @brief Destroys a context record, releases all memory (except the storage + for *ctx itself) */ +static void +DestroyConstructClientIdCtx(ConstructClientIdCtx *ctx) +{ + DestroyFragments(&ctx->response); +} + +static Bool +InitConstructResourceBytesCtx(ConstructResourceBytesCtx *ctx, + ClientPtr sendClient, + long numSpecs, + xXResResourceIdSpec *specs) +{ + ctx->sendClient = sendClient; + ctx->numSizes = 0; + ctx->resultBytes = 0; + xorg_list_init(&ctx->response); + ctx->status = Success; + ctx->numSpecs = numSpecs; + ctx->specs = specs; + ctx->visitedResources = ht_create(sizeof(XID), 0, + ht_resourceid_hash, ht_resourceid_compare, + NULL); + + if (!ctx->visitedResources) { + return FALSE; + } else { + return TRUE; + } +} + +static void +DestroyConstructResourceBytesCtx(ConstructResourceBytesCtx *ctx) +{ + DestroyFragments(&ctx->response); + ht_destroy(ctx->visitedResources); +} static int ProcXResQueryVersion(ClientPtr client) { REQUEST(xXResQueryVersionReq); - xXResQueryVersionReply rep; + xXResQueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .server_major = SERVER_XRES_MAJOR_VERSION, + .server_minor = SERVER_XRES_MINOR_VERSION + }; REQUEST_SIZE_MATCH(xXResQueryVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.server_major = SERVER_XRES_MAJOR_VERSION; - rep.server_minor = SERVER_XRES_MINOR_VERSION; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swaps(&rep.server_major); swaps(&rep.server_minor); } - WriteToClient(client, sizeof(xXResQueryVersionReply), (char *) &rep); + WriteToClient(client, sizeof(xXResQueryVersionReply), &rep); return Success; } @@ -66,16 +234,18 @@ ProcXResQueryClients(ClientPtr client) } } - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.num_clients = num_clients; - rep.length = bytes_to_int32(rep.num_clients * sz_xXResClient); + rep = (xXResQueryClientsReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(num_clients * sz_xXResClient), + .num_clients = num_clients + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.num_clients); } - WriteToClient(client, sizeof(xXResQueryClientsReply), (char *) &rep); + WriteToClient(client, sizeof(xXResQueryClientsReply), &rep); if (num_clients) { xXResClient scratch; @@ -88,7 +258,7 @@ ProcXResQueryClients(ClientPtr client) swapl(&scratch.resource_base); swapl(&scratch.resource_mask); } - WriteToClient(client, sz_xXResClient, (char *) &scratch); + WriteToClient(client, sz_xXResClient, &scratch); } } @@ -133,18 +303,19 @@ ProcXResQueryClientResources(ClientPtr client) num_types++; } - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.num_types = num_types; - rep.length = bytes_to_int32(rep.num_types * sz_xXResType); + rep = (xXResQueryClientResourcesReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(num_types * sz_xXResType), + .num_types = num_types + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.num_types); } - WriteToClient(client, sizeof(xXResQueryClientResourcesReply), - (char *) &rep); + WriteToClient(client, sizeof(xXResQueryClientResourcesReply), &rep); if (num_types) { xXResType scratch; @@ -170,7 +341,7 @@ ProcXResQueryClientResources(ClientPtr client) swapl(&scratch.resource_type); swapl(&scratch.count); } - WriteToClient(client, sz_xXResType, (char *) &scratch); + WriteToClient(client, sz_xXResType, &scratch); } } @@ -195,6 +366,17 @@ ResGetApproxPixmapBytes(PixmapPtr pix) } static void +ResFindResourcePixmaps(pointer value, XID id, RESTYPE type, pointer cdata) +{ + SizeType sizeFunc = GetResourceTypeSizeFunc(type); + ResourceSizeRec size = { 0, 0, 0 }; + unsigned long *bytes = cdata; + + sizeFunc(value, id, &size); + *bytes += size.pixmapRefSize; +} + +static void ResFindPixmaps(pointer value, XID id, pointer cdata) { unsigned long *bytes = (unsigned long *) cdata; @@ -229,6 +411,22 @@ ResFindGCPixmaps(pointer value, XID id, pointer cdata) *bytes += ResGetApproxPixmapBytes(pGC->tile.pixmap); } +static void +ResFindPicturePixmaps(pointer value, XID id, pointer cdata) +{ +#ifdef RENDER + ResFindResourcePixmaps(value, id, PictureType, cdata); +#endif +} + +static void +ResFindCompositeClientWindowPixmaps (pointer value, XID id, pointer cdata) +{ +#ifdef COMPOSITE + ResFindResourcePixmaps(value, id, CompositeClientWindowType, cdata); +#endif +} + static int ProcXResQueryClientPixmapBytes(ClientPtr client) { @@ -263,31 +461,622 @@ ProcXResQueryClientPixmapBytes(ClientPtr client) FindClientResourcesByType(clients[clientID], RT_GC, ResFindGCPixmaps, (pointer) (&bytes)); -#ifdef COMPOSITE - /* FIXME: include composite pixmaps too */ +#ifdef RENDER + /* Render extension picture pixmaps. */ + FindClientResourcesByType(clients[clientID], PictureType, + ResFindPicturePixmaps, + (pointer)(&bytes)); #endif - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.bytes = bytes; -#ifdef _XSERVER64 - rep.bytes_overflow = bytes >> 32; -#else - rep.bytes_overflow = 0; +#ifdef COMPOSITE + /* Composite extension client window pixmaps. */ + FindClientResourcesByType(clients[clientID], CompositeClientWindowType, + ResFindCompositeClientWindowPixmaps, + (pointer)(&bytes)); #endif + + rep = (xXResQueryClientPixmapBytesReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .bytes = bytes, +#ifdef _XSERVER64 + .bytes_overflow = bytes >> 32 +#else + .bytes_overflow = 0 +#endif + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.bytes); swapl(&rep.bytes_overflow); } - WriteToClient(client, sizeof(xXResQueryClientPixmapBytesReply), - (char *) &rep); + WriteToClient(client, sizeof(xXResQueryClientPixmapBytesReply), &rep); return Success; } +/** @brief Finds out if a client's information need to be put into the + response; marks client having been handled, if that is the case. + + @param client The client to send information about + @param mask The request mask (0 to send everything, otherwise a + bitmask of X_XRes*Mask) + @param ctx The context record that tells which clients and id types + have been already handled + @param sendMask Which id type are we now considering. One of X_XRes*Mask. + + @return Returns TRUE if the client information needs to be on the + response, otherwise FALSE. +*/ +static Bool +WillConstructMask(ClientPtr client, CARD32 mask, + ConstructClientIdCtx *ctx, int sendMask) +{ + if ((!mask || (mask & sendMask)) + && !(ctx->sentClientMasks[client->index] & sendMask)) { + ctx->sentClientMasks[client->index] |= sendMask; + return TRUE; + } else { + return FALSE; + } +} + +/** @brief Constructs a response about a single client, based on a certain + client id spec + + @param sendClient Which client wishes to receive this answer. Used for + byte endianess. + @param client Which client are we considering. + @param mask The client id spec mask indicating which information + we want about this client. + @param ctx The context record containing the constructed response + and information on which clients and masks have been + already handled. + + @return Return TRUE if everything went OK, otherwise FALSE which indicates + a memory allocation problem. +*/ +static Bool +ConstructClientIdValue(ClientPtr sendClient, ClientPtr client, CARD32 mask, + ConstructClientIdCtx *ctx) +{ + xXResClientIdValue rep; + + rep.spec.client = client->clientAsMask; + if (client->swapped) { + swapl (&rep.spec.client); + } + + if (WillConstructMask(client, mask, ctx, X_XResClientXIDMask)) { + void *ptr = AddFragment(&ctx->response, sizeof(rep)); + if (!ptr) { + return FALSE; + } + + rep.spec.mask = X_XResClientXIDMask; + rep.length = 0; + if (sendClient->swapped) { + swapl (&rep.spec.mask); + /* swapl (&rep.length, n); - not required for rep.length = 0 */ + } + + memcpy(ptr, &rep, sizeof(rep)); + + ctx->resultBytes += sizeof(rep); + ++ctx->numIds; + } + if (WillConstructMask(client, mask, ctx, X_XResLocalClientPIDMask)) { + pid_t pid = GetClientPid(client); + + if (pid != -1) { + void *ptr = AddFragment(&ctx->response, + sizeof(rep) + sizeof(CARD32)); + CARD32 *value = (void*) ((char*) ptr + sizeof(rep)); + + if (!ptr) { + return FALSE; + } + + rep.spec.mask = X_XResLocalClientPIDMask; + rep.length = 4; + + if (sendClient->swapped) { + swapl (&rep.spec.mask); + swapl (&rep.length); + } + + if (sendClient->swapped) { + swapl (value); + } + memcpy(ptr, &rep, sizeof(rep)); + *value = pid; + + ctx->resultBytes += sizeof(rep) + sizeof(CARD32); + ++ctx->numIds; + } + } + + /* memory allocation errors earlier may return with FALSE */ + return TRUE; +} + +/** @brief Constructs a response about all clients, based on a client id specs + + @param client Which client which we are constructing the response for. + @param numSpecs Number of client id specs in specs + @param specs Client id specs + + @return Return Success if everything went OK, otherwise a Bad* (currently + BadAlloc or BadValue) +*/ +static int +ConstructClientIds(ClientPtr client, + int numSpecs, xXResClientIdSpec* specs, + ConstructClientIdCtx *ctx) +{ + int specIdx; + + for (specIdx = 0; specIdx < numSpecs; ++specIdx) { + if (specs[specIdx].client == 0) { + int c; + for (c = 0; c < currentMaxClients; ++c) { + if (clients[c]) { + if (!ConstructClientIdValue(client, clients[c], + specs[specIdx].mask, ctx)) { + return BadAlloc; + } + } + } + } else { + int clientID = CLIENT_ID(specs[specIdx].client); + + if ((clientID < currentMaxClients) && clients[clientID]) { + if (!ConstructClientIdValue(client, clients[clientID], + specs[specIdx].mask, ctx)) { + return BadAlloc; + } + } + } + } + + /* memory allocation errors earlier may return with BadAlloc */ + return Success; +} + +/** @brief Response to XResQueryClientIds request introduced in XResProto v1.2 + + @param client Which client which we are constructing the response for. + + @return Returns the value returned from ConstructClientIds with the same + semantics +*/ +static int +ProcXResQueryClientIds (ClientPtr client) +{ + REQUEST(xXResQueryClientIdsReq); + + xXResClientIdSpec *specs = (void*) ((char*) stuff + sizeof(*stuff)); + int rc; + ConstructClientIdCtx ctx; + + InitConstructClientIdCtx(&ctx); + + REQUEST_AT_LEAST_SIZE(xXResQueryClientIdsReq); + REQUEST_FIXED_SIZE(xXResQueryClientIdsReq, + stuff->numSpecs * sizeof(specs[0])); + + rc = ConstructClientIds(client, stuff->numSpecs, specs, &ctx); + + if (rc == Success) { + xXResQueryClientIdsReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(ctx.resultBytes), + .numIds = ctx.numIds + }; + + assert((ctx.resultBytes & 3) == 0); + + if (client->swapped) { + swaps (&rep.sequenceNumber); + swapl (&rep.length); + swapl (&rep.numIds); + } + + WriteToClient(client, sizeof(rep), &rep); + WriteFragmentsToClient(client, &ctx.response); + } + + DestroyConstructClientIdCtx(&ctx); + + return rc; +} + +/** @brief Swaps xXResResourceIdSpec endianess */ +static void +SwapXResResourceIdSpec(xXResResourceIdSpec *spec) +{ + swapl(&spec->resource); + swapl(&spec->type); +} + +/** @brief Swaps xXResResourceSizeSpec endianess */ +static void +SwapXResResourceSizeSpec(xXResResourceSizeSpec *size) +{ + SwapXResResourceIdSpec(&size->spec); + swapl(&size->bytes); + swapl(&size->refCount); + swapl(&size->useCount); +} + +/** @brief Swaps xXResResourceSizeValue endianess */ +static void +SwapXResResourceSizeValue(xXResResourceSizeValue *rep) +{ + SwapXResResourceSizeSpec(&rep->size); + swapl(&rep->numCrossReferences); +} + +/** @brief Swaps the response bytes */ +static void +SwapXResQueryResourceBytes(struct xorg_list *response) +{ + struct xorg_list *it = response->next; + int c; + + while (it != response) { + xXResResourceSizeValue *value = FRAGMENT_DATA(it); + it = it->next; + for (c = 0; c < value->numCrossReferences; ++c) { + xXResResourceSizeSpec *spec = FRAGMENT_DATA(it); + SwapXResResourceSizeSpec(spec); + it = it->next; + } + SwapXResResourceSizeValue(value); + } +} + +/** @brief Adds xXResResourceSizeSpec describing a resource's size into + the buffer contained in the context. The resource is considered + to be a subresource. + + @see AddResourceSizeValue + + @param[in] value The X resource object on which to add information + about to the buffer + @param[in] id The ID of the X resource + @param[in] type The type of the X resource + @param[in/out] cdata The context object of type ConstructResourceBytesCtx. + Void pointer type is used here to satisfy the type + FindRes +*/ +static void +AddSubResourceSizeSpec(pointer value, + XID id, + RESTYPE type, + pointer cdata) +{ + ConstructResourceBytesCtx *ctx = cdata; + + if (ctx->status == Success) { + xXResResourceSizeSpec **prevCrossRef = + ht_find(ctx->visitedSubResources, &value); + if (!prevCrossRef) { + Bool ok = TRUE; + xXResResourceSizeSpec *crossRef = + AddFragment(&ctx->response, sizeof(xXResResourceSizeSpec)); + ok = ok && crossRef != NULL; + if (ok) { + xXResResourceSizeSpec **p; + p = ht_add(ctx->visitedSubResources, &value); + if (!p) { + ok = FALSE; + } else { + *p = crossRef; + } + } + if (!ok) { + ctx->status = BadAlloc; + } else { + SizeType sizeFunc = GetResourceTypeSizeFunc(type); + ResourceSizeRec size = { 0, 0, 0 }; + sizeFunc(value, id, &size); + + crossRef->spec.resource = id; + crossRef->spec.type = type; + crossRef->bytes = size.resourceSize; + crossRef->refCount = size.refCnt; + crossRef->useCount = 1; + + ++ctx->sizeValue->numCrossReferences; + + ctx->resultBytes += sizeof(*crossRef); + } + } else { + /* if we have visited the subresource earlier (from current parent + resource), just increase its use count by one */ + ++(*prevCrossRef)->useCount; + } + } +} + +/** @brief Adds xXResResourceSizeValue describing a resource's size into + the buffer contained in the context. In addition, the + subresources are iterated and added as xXResResourceSizeSpec's + by using AddSubResourceSizeSpec + + @see AddSubResourceSizeSpec + + @param[in] value The X resource object on which to add information + about to the buffer + @param[in] id The ID of the X resource + @param[in] type The type of the X resource + @param[in/out] cdata The context object of type ConstructResourceBytesCtx. + Void pointer type is used here to satisfy the type + FindRes +*/ +static void +AddResourceSizeValue(pointer ptr, XID id, RESTYPE type, pointer cdata) +{ + ConstructResourceBytesCtx *ctx = cdata; + if (ctx->status == Success && + !ht_find(ctx->visitedResources, &id)) { + Bool ok = TRUE; + HashTable ht; + HtGenericHashSetupRec htSetup = { + .keySize = sizeof(void*) + }; + + /* it doesn't matter that we don't undo the work done here + * immediately. All but ht_init will be undone at the end + * of the request and there can happen no failure after + * ht_init, so we don't need to clean it up here in any + * special way */ + + xXResResourceSizeValue *value = + AddFragment(&ctx->response, sizeof(xXResResourceSizeValue)); + if (!value) { + ok = FALSE; + } + ok = ok && ht_add(ctx->visitedResources, &id); + if (ok) { + ht = ht_create(htSetup.keySize, + sizeof(xXResResourceSizeSpec*), + ht_generic_hash, ht_generic_compare, + &htSetup); + ok = ok && ht; + } + + if (!ok) { + ctx->status = BadAlloc; + } else { + SizeType sizeFunc = GetResourceTypeSizeFunc(type); + ResourceSizeRec size = { 0, 0, 0 }; + + sizeFunc(ptr, id, &size); + + value->size.spec.resource = id; + value->size.spec.type = type; + value->size.bytes = size.resourceSize; + value->size.refCount = size.refCnt; + value->size.useCount = 1; + value->numCrossReferences = 0; + + ctx->sizeValue = value; + ctx->visitedSubResources = ht; + FindSubResources(ptr, type, AddSubResourceSizeSpec, ctx); + ctx->visitedSubResources = NULL; + ctx->sizeValue = NULL; + + ctx->resultBytes += sizeof(*value); + ++ctx->numSizes; + + ht_destroy(ht); + } + } +} + +/** @brief A variant of AddResourceSizeValue that passes the resource type + through the context object to satisfy the type FindResType + + @see AddResourceSizeValue + + @param[in] ptr The resource + @param[in] id The resource ID + @param[in/out] cdata The context object that contains the resource type +*/ +static void +AddResourceSizeValueWithResType(pointer ptr, XID id, pointer cdata) +{ + ConstructResourceBytesCtx *ctx = cdata; + AddResourceSizeValue(ptr, id, ctx->resType, cdata); +} + +/** @brief Adds the information of a resource into the buffer if it matches + the match condition. + + @see AddResourceSizeValue + + @param[in] ptr The resource + @param[in] id The resource ID + @param[in] type The resource type + @param[in/out] cdata The context object as a void pointer to satisfy the + type FindAllRes +*/ +static void +AddResourceSizeValueByResource(pointer ptr, XID id, RESTYPE type, pointer cdata) +{ + ConstructResourceBytesCtx *ctx = cdata; + xXResResourceIdSpec *spec = ctx->curSpec; + + if ((!spec->type || spec->type == type) && + (!spec->resource || spec->resource == id)) { + AddResourceSizeValue(ptr, id, type, ctx); + } +} + +/** @brief Add all resources of the client into the result buffer + disregarding all those specifications that specify the + resource by its ID. Those are handled by + ConstructResourceBytesByResource + + @see ConstructResourceBytesByResource + + @param[in] aboutClient Which client is being considered + @param[in/out] ctx The context that contains the resource id + specifications as well as the result buffer +*/ +static void +ConstructClientResourceBytes(ClientPtr aboutClient, + ConstructResourceBytesCtx *ctx) +{ + int specIdx; + for (specIdx = 0; specIdx < ctx->numSpecs; ++specIdx) { + xXResResourceIdSpec* spec = ctx->specs + specIdx; + if (spec->resource) { + /* these specs are handled elsewhere */ + } else if (spec->type) { + ctx->resType = spec->type; + FindClientResourcesByType(aboutClient, spec->type, + AddResourceSizeValueWithResType, ctx); + } else { + FindAllClientResources(aboutClient, AddResourceSizeValue, ctx); + } + } +} + +/** @brief Add the sizes of all such resources that can are specified by + their ID in the resource id specification. The scan can + by limited to a client with the aboutClient parameter + + @see ConstructResourceBytesByResource + + @param[in] aboutClient Which client is being considered. This may be None + to mean all clients. + @param[in/out] ctx The context that contains the resource id + specifications as well as the result buffer. In + addition this function uses the curSpec field to + keep a pointer to the current resource id + specification in it, which can be used by + AddResourceSizeValueByResource . +*/ +static void +ConstructResourceBytesByResource(XID aboutClient, ConstructResourceBytesCtx *ctx) +{ + int specIdx; + for (specIdx = 0; specIdx < ctx->numSpecs; ++specIdx) { + xXResResourceIdSpec *spec = ctx->specs + specIdx; + if (spec->resource) { + int cid = CLIENT_ID(spec->resource); + if (cid < currentMaxClients && + (aboutClient == None || cid == aboutClient)) { + ClientPtr client = clients[cid]; + if (client) { + ctx->curSpec = spec; + FindAllClientResources(client, + AddResourceSizeValueByResource, + ctx); + } + } + } + } +} + +/** @brief Build the resource size response for the given client + (or all if not specified) per the parameters set up + in the context object. + + @param[in] aboutClient Which client to consider or None for all clients + @param[in/out] ctx The context object that contains the request as well + as the response buffer. +*/ +static int +ConstructResourceBytes(XID aboutClient, + ConstructResourceBytesCtx *ctx) +{ + if (aboutClient) { + int clientIdx = CLIENT_ID(aboutClient); + ClientPtr client = NullClient; + + if ((clientIdx >= currentMaxClients) || !clients[clientIdx]) { + ctx->sendClient->errorValue = aboutClient; + return BadValue; + } + + client = clients[clientIdx]; + + ConstructClientResourceBytes(client, ctx); + ConstructResourceBytesByResource(aboutClient, ctx); + } else { + int clientIdx; + + ConstructClientResourceBytes(NULL, ctx); + + for (clientIdx = 0; clientIdx < currentMaxClients; ++clientIdx) { + ClientPtr client = clients[clientIdx]; + + if (client) { + ConstructClientResourceBytes(client, ctx); + } + } + + ConstructResourceBytesByResource(None, ctx); + } + + + return ctx->status; +} + +/** @brief Implements the XResQueryResourceBytes of XResProto v1.2 */ +static int +ProcXResQueryResourceBytes (ClientPtr client) +{ + REQUEST(xXResQueryResourceBytesReq); + + int rc; + ConstructResourceBytesCtx ctx; + + REQUEST_AT_LEAST_SIZE(xXResQueryResourceBytesReq); + REQUEST_FIXED_SIZE(xXResQueryResourceBytesReq, + stuff->numSpecs * sizeof(ctx.specs[0])); + + if (!InitConstructResourceBytesCtx(&ctx, client, + stuff->numSpecs, + (void*) ((char*) stuff + + sz_xXResQueryResourceBytesReq))) { + return BadAlloc; + } + + rc = ConstructResourceBytes(stuff->client, &ctx); + + if (rc == Success) { + xXResQueryResourceBytesReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(ctx.resultBytes), + .numSizes = ctx.numSizes + }; + + if (client->swapped) { + swaps (&rep.sequenceNumber); + swapl (&rep.length); + swapl (&rep.numSizes); + + SwapXResQueryResourceBytes(&ctx.response); + } + + WriteToClient(client, sizeof(rep), &rep); + WriteFragmentsToClient(client, &ctx.response); + } + + DestroyConstructResourceBytesCtx(&ctx); + + return rc; +} + static int ProcResDispatch(ClientPtr client) { @@ -301,8 +1090,11 @@ ProcResDispatch(ClientPtr client) return ProcXResQueryClientResources(client); case X_XResQueryClientPixmapBytes: return ProcXResQueryClientPixmapBytes(client); - default: - break; + case X_XResQueryClientIds: + return ProcXResQueryClientIds(client); + case X_XResQueryResourceBytes: + return ProcXResQueryResourceBytes(client); + default: break; } return BadRequest; @@ -335,7 +1127,39 @@ SProcXResQueryClientPixmapBytes(ClientPtr client) } static int -SProcResDispatch(ClientPtr client) +SProcXResQueryClientIds (ClientPtr client) +{ + REQUEST(xXResQueryClientIdsReq); + + REQUEST_AT_LEAST_SIZE (xXResQueryClientIdsReq); + swapl(&stuff->numSpecs); + return ProcXResQueryClientIds(client); +} + +/** @brief Implements the XResQueryResourceBytes of XResProto v1.2. + This variant byteswaps request contents before issuing the + rest of the work to ProcXResQueryResourceBytes */ +static int +SProcXResQueryResourceBytes (ClientPtr client) +{ + REQUEST(xXResQueryResourceBytesReq); + int c; + xXResResourceIdSpec *specs = (void*) ((char*) stuff + sizeof(*stuff)); + + swapl(&stuff->numSpecs); + REQUEST_AT_LEAST_SIZE(xXResQueryResourceBytesReq); + REQUEST_FIXED_SIZE(xXResQueryResourceBytesReq, + stuff->numSpecs * sizeof(specs[0])); + + for (c = 0; c < stuff->numSpecs; ++c) { + SwapXResResourceIdSpec(specs + c); + } + + return ProcXResQueryResourceBytes(client); +} + +static int +SProcResDispatch (ClientPtr client) { REQUEST(xReq); swaps(&stuff->length); @@ -349,15 +1173,18 @@ SProcResDispatch(ClientPtr client) return SProcXResQueryClientResources(client); case X_XResQueryClientPixmapBytes: return SProcXResQueryClientPixmapBytes(client); - default: - break; + case X_XResQueryClientIds: + return SProcXResQueryClientIds(client); + case X_XResQueryResourceBytes: + return SProcXResQueryResourceBytes(client); + default: break; } return BadRequest; } void -ResExtensionInit(INITARGS) +ResExtensionInit(void) { (void) AddExtension(XRES_NAME, 0, 0, ProcResDispatch, SProcResDispatch, diff --git a/xserver/Xext/xselinux_ext.c b/xserver/Xext/xselinux_ext.c index 342abb1a6..3115f03ea 100644 --- a/xserver/Xext/xselinux_ext.c +++ b/xserver/Xext/xselinux_ext.c @@ -26,7 +26,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "windowstr.h" #include "propertyst.h" #include "extnsionst.h" -#include "modinit.h" +#include "extinit.h" #include "xselinuxint.h" #define CTX_DEV offsetof(SELinuxSubjectRec, dev_create_sid) @@ -63,20 +63,20 @@ SELinuxCopyContext(char *ptr, unsigned len) static int ProcSELinuxQueryVersion(ClientPtr client) { - SELinuxQueryVersionReply rep; - - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.server_major = SELINUX_MAJOR_VERSION; - rep.server_minor = SELINUX_MINOR_VERSION; + SELinuxQueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .server_major = SELINUX_MAJOR_VERSION, + .server_minor = SELINUX_MINOR_VERSION + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swaps(&rep.server_major); swaps(&rep.server_minor); } - WriteToClient(client, sizeof(rep), (char *) &rep); + WriteToClient(client, sizeof(rep), &rep); return Success; } @@ -93,10 +93,12 @@ SELinuxSendContextReply(ClientPtr client, security_id_t sid) len = strlen(ctx) + 1; } - rep.type = X_Reply; - rep.length = bytes_to_int32(len); - rep.sequenceNumber = client->sequence; - rep.context_len = len; + rep = (SELinuxGetContextReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(len), + .context_len = len + }; if (client->swapped) { swapl(&rep.length); @@ -104,7 +106,7 @@ SELinuxSendContextReply(ClientPtr client, security_id_t sid) swapl(&rep.context_len); } - WriteToClient(client, sizeof(SELinuxGetContextReply), (char *) &rep); + WriteToClient(client, sizeof(SELinuxGetContextReply), &rep); WriteToClient(client, len, ctx); freecon(ctx); return Success; @@ -372,10 +374,12 @@ SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec * items, } /* Send reply to client */ - rep.type = X_Reply; - rep.length = size; - rep.sequenceNumber = client->sequence; - rep.count = count; + rep = (SELinuxListItemsReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = size, + .count = count + }; if (client->swapped) { swapl(&rep.length); @@ -383,8 +387,8 @@ SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec * items, swapl(&rep.count); } - WriteToClient(client, sizeof(SELinuxListItemsReply), (char *) &rep); - WriteToClient(client, size * 4, (char *) buf); + WriteToClient(client, sizeof(SELinuxListItemsReply), &rep); + WriteToClient(client, size * 4, buf); /* Free stuff and return */ rc = Success; @@ -683,7 +687,7 @@ SELinuxResetProc(ExtensionEntry * extEntry) } void -SELinuxExtensionInit(INITARGS) +SELinuxExtensionInit(void) { ExtensionEntry *extEntry; diff --git a/xserver/Xext/xtest.c b/xserver/Xext/xtest.c index e659b4154..0a854f39a 100644 --- a/xserver/Xext/xtest.c +++ b/xserver/Xext/xtest.c @@ -55,9 +55,7 @@ #include "eventstr.h" #include "inpututils.h" -#include "modinit.h" - -extern int DeviceValuator; +#include "extinit.h" /* XTest events are sent during request processing and may be interruped by * a SIGIO. We need a separate event list to avoid events overwriting each @@ -88,19 +86,21 @@ static int XTestSwapFakeInput(ClientPtr /* client */ , static int ProcXTestGetVersion(ClientPtr client) { - xXTestGetVersionReply rep; + xXTestGetVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .majorVersion = XTestMajorVersion, + .minorVersion = XTestMinorVersion + }; REQUEST_SIZE_MATCH(xXTestGetVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = XTestMajorVersion; - rep.minorVersion = XTestMinorVersion; + if (client->swapped) { swaps(&rep.sequenceNumber); swaps(&rep.minorVersion); } - WriteToClient(client, sizeof(xXTestGetVersionReply), (char *) &rep); + WriteToClient(client, sizeof(xXTestGetVersionReply), &rep); return Success; } @@ -134,14 +134,16 @@ ProcXTestCompareCursor(ClientPtr client) return rc; } } - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.same = (wCursor(pWin) == pCursor); + rep = (xXTestCompareCursorReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .same = (wCursor(pWin) == pCursor) + }; if (client->swapped) { swaps(&rep.sequenceNumber); } - WriteToClient(client, sizeof(xXTestCompareCursorReply), (char *) &rep); + WriteToClient(client, sizeof(xXTestCompareCursorReply), &rep); return Success; } @@ -154,7 +156,6 @@ ProcXTestFakeInput(ClientPtr client) DeviceIntPtr dev = NULL; WindowPtr root; Bool extension = FALSE; - deviceValuator *dv = NULL; ValuatorMask mask; int valuators[MAX_VALUATORS] = { 0 }; int numValuators = 0; @@ -239,14 +240,14 @@ ProcXTestFakeInput(ClientPtr client) } if (nev > 1 && !dev->valuator) { - client->errorValue = dv->first_valuator; + client->errorValue = firstValuator; return BadValue; } /* check validity of valuator events */ base = firstValuator; for (n = 1; n < nev; n++) { - dv = (deviceValuator *) (ev + n); + deviceValuator *dv = (deviceValuator *) (ev + n); if (dv->type != DeviceValuator) { client->errorValue = dv->type; return BadValue; @@ -304,7 +305,7 @@ ProcXTestFakeInput(ClientPtr client) numValuators = 2; firstValuator = 0; if (ev->u.u.detail == xFalse) - flags = POINTER_ABSOLUTE | POINTER_SCREEN; + flags = POINTER_ABSOLUTE | POINTER_DESKTOP; break; default: client->errorValue = ev->u.u.type; @@ -375,6 +376,14 @@ ProcXTestFakeInput(ClientPtr client) client->errorValue = ev->u.keyButtonPointer.root; return BadValue; } + + /* Add the root window's offset to the valuators */ + if ((flags & POINTER_ABSOLUTE) && firstValuator <= 1 && numValuators > 0) { + if (firstValuator == 0) + valuators[0] += root->drawable.pScreen->x; + if (firstValuator < 2 && firstValuator + numValuators > 1) + valuators[1 - firstValuator] += root->drawable.pScreen->y; + } } if (ev->u.u.detail != xTrue && ev->u.u.detail != xFalse) { client->errorValue = ev->u.u.detail; @@ -417,7 +426,7 @@ ProcXTestFakeInput(ClientPtr client) } for (i = 0; i < nevents; i++) - mieqProcessDeviceEvent(dev, &xtest_evlist[i], NULL); + mieqProcessDeviceEvent(dev, &xtest_evlist[i], miPointerGetScreen(inputInfo.pointer)); if (need_ptr_update) miPointerUpdateSprite(dev); @@ -675,7 +684,7 @@ XTestExtensionTearDown(ExtensionEntry * e) } void -XTestExtensionInit(INITARGS) +XTestExtensionInit(void) { AddExtension(XTestExtensionName, 0, 0, ProcXTestDispatch, SProcXTestDispatch, diff --git a/xserver/Xext/xvdisp.c b/xserver/Xext/xvdisp.c index 8abd51c11..31b77839f 100644 --- a/xserver/Xext/xvdisp.c +++ b/xserver/Xext/xvdisp.c @@ -62,7 +62,7 @@ SWriteQueryExtensionReply(ClientPtr client, xvQueryExtensionReply * rep) swaps(&rep->version); swaps(&rep->revision); - (void) WriteToClient(client, sz_xvQueryExtensionReply, (char *) rep); + WriteToClient(client, sz_xvQueryExtensionReply, rep); return Success; } @@ -74,7 +74,7 @@ SWriteQueryAdaptorsReply(ClientPtr client, xvQueryAdaptorsReply * rep) swapl(&rep->length); swaps(&rep->num_adaptors); - (void) WriteToClient(client, sz_xvQueryAdaptorsReply, (char *) rep); + WriteToClient(client, sz_xvQueryAdaptorsReply, rep); return Success; } @@ -86,7 +86,7 @@ SWriteQueryEncodingsReply(ClientPtr client, xvQueryEncodingsReply * rep) swapl(&rep->length); swaps(&rep->num_encodings); - (void) WriteToClient(client, sz_xvQueryEncodingsReply, (char *) rep); + WriteToClient(client, sz_xvQueryEncodingsReply, rep); return Success; } @@ -99,7 +99,7 @@ SWriteAdaptorInfo(ClientPtr client, xvAdaptorInfo * pAdaptor) swaps(&pAdaptor->num_ports); swaps(&pAdaptor->num_formats); - (void) WriteToClient(client, sz_xvAdaptorInfo, (char *) pAdaptor); + WriteToClient(client, sz_xvAdaptorInfo, pAdaptor); return Success; } @@ -114,7 +114,7 @@ SWriteEncodingInfo(ClientPtr client, xvEncodingInfo * pEncoding) swaps(&pEncoding->height); swapl(&pEncoding->rate.numerator); swapl(&pEncoding->rate.denominator); - (void) WriteToClient(client, sz_xvEncodingInfo, (char *) pEncoding); + WriteToClient(client, sz_xvEncodingInfo, pEncoding); return Success; } @@ -123,7 +123,7 @@ static int SWriteFormat(ClientPtr client, xvFormat * pFormat) { swapl(&pFormat->visual); - (void) WriteToClient(client, sz_xvFormat, (char *) pFormat); + WriteToClient(client, sz_xvFormat, pFormat); return Success; } @@ -135,7 +135,7 @@ SWriteAttributeInfo(ClientPtr client, xvAttributeInfo * pAtt) swapl(&pAtt->size); swapl(&pAtt->min); swapl(&pAtt->max); - (void) WriteToClient(client, sz_xvAttributeInfo, (char *) pAtt); + WriteToClient(client, sz_xvAttributeInfo, pAtt); return Success; } @@ -157,7 +157,7 @@ SWriteImageFormatInfo(ClientPtr client, xvImageFormatInfo * pImage) swapl(&pImage->vert_u_period); swapl(&pImage->vert_v_period); - (void) WriteToClient(client, sz_xvImageFormatInfo, (char *) pImage); + WriteToClient(client, sz_xvImageFormatInfo, pImage); return Success; } @@ -168,7 +168,7 @@ SWriteGrabPortReply(ClientPtr client, xvGrabPortReply * rep) swaps(&rep->sequenceNumber); swapl(&rep->length); - (void) WriteToClient(client, sz_xvGrabPortReply, (char *) rep); + WriteToClient(client, sz_xvGrabPortReply, rep); return Success; } @@ -180,7 +180,7 @@ SWriteGetPortAttributeReply(ClientPtr client, xvGetPortAttributeReply * rep) swapl(&rep->length); swapl(&rep->value); - (void) WriteToClient(client, sz_xvGetPortAttributeReply, (char *) rep); + WriteToClient(client, sz_xvGetPortAttributeReply, rep); return Success; } @@ -193,7 +193,7 @@ SWriteQueryBestSizeReply(ClientPtr client, xvQueryBestSizeReply * rep) swaps(&rep->actual_width); swaps(&rep->actual_height); - (void) WriteToClient(client, sz_xvQueryBestSizeReply, (char *) rep); + WriteToClient(client, sz_xvQueryBestSizeReply, rep); return Success; } @@ -207,7 +207,7 @@ SWriteQueryPortAttributesReply(ClientPtr client, swapl(&rep->num_attributes); swapl(&rep->text_size); - (void) WriteToClient(client, sz_xvQueryPortAttributesReply, (char *) rep); + WriteToClient(client, sz_xvQueryPortAttributesReply, rep); return Success; } @@ -223,7 +223,7 @@ SWriteQueryImageAttributesReply(ClientPtr client, swaps(&rep->width); swaps(&rep->height); - (void) WriteToClient(client, sz_xvQueryImageAttributesReply, (char *) rep); + WriteToClient(client, sz_xvQueryImageAttributesReply, rep); return Success; } @@ -235,66 +235,66 @@ SWriteListImageFormatsReply(ClientPtr client, xvListImageFormatsReply * rep) swapl(&rep->length); swapl(&rep->num_formats); - (void) WriteToClient(client, sz_xvListImageFormatsReply, (char *) rep); + WriteToClient(client, sz_xvListImageFormatsReply, rep); return Success; } #define _WriteQueryAdaptorsReply(_c,_d) \ if ((_c)->swapped) SWriteQueryAdaptorsReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryAdaptorsReply, (char*)_d) + else WriteToClient(_c, sz_xvQueryAdaptorsReply, _d) #define _WriteQueryExtensionReply(_c,_d) \ if ((_c)->swapped) SWriteQueryExtensionReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryExtensionReply, (char*)_d) + else WriteToClient(_c, sz_xvQueryExtensionReply, _d) #define _WriteQueryEncodingsReply(_c,_d) \ if ((_c)->swapped) SWriteQueryEncodingsReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryEncodingsReply, (char*)_d) + else WriteToClient(_c, sz_xvQueryEncodingsReply, _d) #define _WriteAdaptorInfo(_c,_d) \ if ((_c)->swapped) SWriteAdaptorInfo(_c, _d); \ - else WriteToClient(_c, sz_xvAdaptorInfo, (char*)_d) + else WriteToClient(_c, sz_xvAdaptorInfo, _d) #define _WriteAttributeInfo(_c,_d) \ if ((_c)->swapped) SWriteAttributeInfo(_c, _d); \ - else WriteToClient(_c, sz_xvAttributeInfo, (char*)_d) + else WriteToClient(_c, sz_xvAttributeInfo, _d) #define _WriteEncodingInfo(_c,_d) \ if ((_c)->swapped) SWriteEncodingInfo(_c, _d); \ - else WriteToClient(_c, sz_xvEncodingInfo, (char*)_d) + else WriteToClient(_c, sz_xvEncodingInfo, _d) #define _WriteFormat(_c,_d) \ if ((_c)->swapped) SWriteFormat(_c, _d); \ - else WriteToClient(_c, sz_xvFormat, (char*)_d) + else WriteToClient(_c, sz_xvFormat, _d) #define _WriteGrabPortReply(_c,_d) \ if ((_c)->swapped) SWriteGrabPortReply(_c, _d); \ - else WriteToClient(_c, sz_xvGrabPortReply, (char*)_d) + else WriteToClient(_c, sz_xvGrabPortReply, _d) #define _WriteGetPortAttributeReply(_c,_d) \ if ((_c)->swapped) SWriteGetPortAttributeReply(_c, _d); \ - else WriteToClient(_c, sz_xvGetPortAttributeReply, (char*)_d) + else WriteToClient(_c, sz_xvGetPortAttributeReply, _d) #define _WriteQueryBestSizeReply(_c,_d) \ if ((_c)->swapped) SWriteQueryBestSizeReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryBestSizeReply,(char*) _d) + else WriteToClient(_c, sz_xvQueryBestSizeReply, _d) #define _WriteQueryPortAttributesReply(_c,_d) \ if ((_c)->swapped) SWriteQueryPortAttributesReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryPortAttributesReply,(char*) _d) + else WriteToClient(_c, sz_xvQueryPortAttributesReply, _d) #define _WriteQueryImageAttributesReply(_c,_d) \ if ((_c)->swapped) SWriteQueryImageAttributesReply(_c, _d); \ - else WriteToClient(_c, sz_xvQueryImageAttributesReply,(char*) _d) + else WriteToClient(_c, sz_xvQueryImageAttributesReply, _d) #define _WriteListImageFormatsReply(_c,_d) \ if ((_c)->swapped) SWriteListImageFormatsReply(_c, _d); \ - else WriteToClient(_c, sz_xvListImageFormatsReply,(char*) _d) + else WriteToClient(_c, sz_xvListImageFormatsReply, _d) #define _WriteImageFormatInfo(_c,_d) \ if ((_c)->swapped) SWriteImageFormatInfo(_c, _d); \ - else WriteToClient(_c, sz_xvImageFormatInfo, (char*)_d) + else WriteToClient(_c, sz_xvImageFormatInfo, _d) #define _AllocatePort(_i,_p) \ ((_p)->id != _i) ? (* (_p)->pAdaptor->ddAllocatePort)(_i,_p,&_p) : Success @@ -302,17 +302,17 @@ SWriteListImageFormatsReply(ClientPtr client, xvListImageFormatsReply * rep) static int ProcXvQueryExtension(ClientPtr client) { - xvQueryExtensionReply rep; + xvQueryExtensionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .version = XvVersion, + .revision = XvRevision + }; /* REQUEST(xvQueryExtensionReq); */ REQUEST_SIZE_MATCH(xvQueryExtensionReq); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.version = XvVersion; - rep.revision = XvRevision; - _WriteQueryExtensionReply(client, &rep); return Success; @@ -343,10 +343,12 @@ ProcXvQueryAdaptors(ClientPtr client) pxvs = (XvScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XvGetScreenKey()); if (!pxvs) { - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.num_adaptors = 0; - rep.length = 0; + rep = (xvQueryAdaptorsReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .num_adaptors = 0 + }; _WriteQueryAdaptorsReply(client, &rep); @@ -355,9 +357,11 @@ ProcXvQueryAdaptors(ClientPtr client) (*pxvs->ddQueryAdaptors) (pScreen, &pxvs->pAdaptors, &pxvs->nAdaptors); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.num_adaptors = pxvs->nAdaptors; + rep = (xvQueryAdaptorsReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .num_adaptors = pxvs->nAdaptors + }; /* CALCULATE THE TOTAL SIZE OF THE REPLY IN BYTES */ @@ -429,9 +433,11 @@ ProcXvQueryEncodings(ClientPtr client) return status; } - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.num_encodings = pPort->pAdaptor->nEncodings; + rep = (xvQueryEncodingsReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .num_encodings = pPort->pAdaptor->nEncodings + }; /* FOR EACH ENCODING ADD UP THE BYTES FOR ENCODING NAMES */ @@ -662,11 +668,12 @@ ProcXvGrabPort(ClientPtr client) if (status != Success) { return status; } - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.result = result; + rep = (xvGrabPortReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .result = result + }; _WriteGrabPortReply(client, &rep); @@ -777,10 +784,12 @@ ProcXvGetPortAttribute(ClientPtr client) return status; } - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.value = value; + rep = (xvGetPortAttributeReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .value = value + }; _WriteGetPortAttributeReply(client, &rep); @@ -805,17 +814,18 @@ ProcXvQueryBestSize(ClientPtr client) return status; } - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - (*pPort->pAdaptor->ddQueryBestSize) (client, pPort, stuff->motion, stuff->vid_w, stuff->vid_h, stuff->drw_w, stuff->drw_h, &actual_width, &actual_height); - rep.actual_width = actual_width; - rep.actual_height = actual_height; + rep = (xvQueryBestSizeReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .actual_width = actual_width, + .actual_height = actual_height + }; _WriteQueryBestSizeReply(client, &rep); @@ -841,10 +851,12 @@ ProcXvQueryPortAttributes(ClientPtr client) return status; } - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.num_attributes = pPort->pAdaptor->nAttributes; - rep.text_size = 0; + rep = (xvQueryPortAttributesReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .num_attributes = pPort->pAdaptor->nAttributes, + .text_size = 0 + }; for (i = 0, pAtt = pPort->pAdaptor->pAttributes; i < pPort->pAdaptor->nAttributes; i++, pAtt++) { @@ -1017,14 +1029,14 @@ ProcXvShmPutImage(ClientPtr client) stuff->send_event, stuff->width, stuff->height); if ((status == Success) && stuff->send_event) { - xShmCompletionEvent ev; - - ev.type = ShmCompletionCode; - ev.drawable = stuff->drawable; - ev.minorEvent = xv_ShmPutImage; - ev.majorEvent = XvReqCode; - ev.shmseg = stuff->shmseg; - ev.offset = stuff->offset; + xShmCompletionEvent ev = { + .type = ShmCompletionCode, + .drawable = stuff->drawable, + .minorEvent = xv_ShmPutImage, + .majorEvent = XvReqCode, + .shmseg = stuff->shmseg, + .offset = stuff->offset + }; WriteEventsToClient(client, 1, (xEvent *) &ev); } @@ -1089,18 +1101,20 @@ ProcXvQueryImageAttributes(ClientPtr client) &width, &height, offsets, pitches); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = planeLength = num_planes << 1; - rep.num_planes = num_planes; - rep.width = width; - rep.height = height; - rep.data_size = size; + rep = (xvQueryImageAttributesReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = planeLength = num_planes << 1, + .num_planes = num_planes, + .width = width, + .height = height, + .data_size = size + }; _WriteQueryImageAttributesReply(client, &rep); if (client->swapped) SwapLongs((CARD32 *) offsets, planeLength); - WriteToClient(client, planeLength << 2, (char *) offsets); + WriteToClient(client, planeLength << 2, offsets); free(offsets); @@ -1122,11 +1136,13 @@ ProcXvListImageFormats(ClientPtr client) VALIDATE_XV_PORT(stuff->port, pPort, DixReadAccess); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.num_formats = pPort->pAdaptor->nImages; - rep.length = - bytes_to_int32(pPort->pAdaptor->nImages * sz_xvImageFormatInfo); + rep = (xvListImageFormatsReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .num_formats = pPort->pAdaptor->nImages, + .length = + bytes_to_int32(pPort->pAdaptor->nImages * sz_xvImageFormatInfo) + }; _WriteListImageFormatsReply(client, &rep); diff --git a/xserver/Xext/xvdix.h b/xserver/Xext/xvdix.h index d22672620..9c6160c3b 100644 --- a/xserver/Xext/xvdix.h +++ b/xserver/Xext/xvdix.h @@ -55,7 +55,6 @@ SOFTWARE. #include "scrnintstr.h" #include -#ifndef XorgLoader extern _X_EXPORT unsigned long XvExtensionGeneration; extern _X_EXPORT unsigned long XvScreenGeneration; extern _X_EXPORT unsigned long XvResourceGeneration; @@ -70,7 +69,6 @@ extern _X_EXPORT RESTYPE XvRTGrab; extern _X_EXPORT RESTYPE XvRTVideoNotify; extern _X_EXPORT RESTYPE XvRTVideoNotifyList; extern _X_EXPORT RESTYPE XvRTPortNotify; -#endif typedef struct { int numerator; @@ -215,7 +213,7 @@ typedef struct { DestroyWindowProcPtr DestroyWindow; DestroyPixmapProcPtr DestroyPixmap; CloseScreenProcPtr CloseScreen; - Bool (*ddCloseScreen) (int, ScreenPtr); + Bool (*ddCloseScreen) (ScreenPtr); int (*ddQueryAdaptors) (ScreenPtr, XvAdaptorPtr *, int *); DevUnion devPriv; } XvScreenRec, *XvScreenPtr; @@ -231,11 +229,9 @@ typedef struct { #define _XvBadPort (XvBadPort+XvErrorBase) #define _XvBadEncoding (XvBadEncoding+XvErrorBase) -#ifndef XorgLoader extern _X_EXPORT int ProcXvDispatch(ClientPtr); extern _X_EXPORT int SProcXvDispatch(ClientPtr); -extern _X_EXPORT void XvExtensionInit(void); extern _X_EXPORT int XvScreenInit(ScreenPtr); extern _X_EXPORT DevPrivateKey XvGetScreenKey(void); extern _X_EXPORT unsigned long XvGetRTPort(void); @@ -268,6 +264,4 @@ extern _X_EXPORT int XvdiPreemptVideo(ClientPtr, XvPortPtr, DrawablePtr); extern _X_EXPORT int XvdiMatchPort(XvPortPtr, DrawablePtr); extern _X_EXPORT int XvdiGrabPort(ClientPtr, XvPortPtr, Time, int *); extern _X_EXPORT int XvdiUngrabPort(ClientPtr, XvPortPtr, Time); -#endif /* XorgLoader */ - #endif /* XVDIX_H */ diff --git a/xserver/Xext/xvmain.c b/xserver/Xext/xvmain.c index 48061a286..c2860b86a 100644 --- a/xserver/Xext/xvmain.c +++ b/xserver/Xext/xvmain.c @@ -88,6 +88,7 @@ SOFTWARE. #include "pixmapstr.h" #include "gc.h" #include "extnsionst.h" +#include "extinit.h" #include "dixstruct.h" #include "resource.h" #include "opaque.h" @@ -129,7 +130,7 @@ static void WriteSwappedVideoNotifyEvent(xvEvent *, xvEvent *); static void WriteSwappedPortNotifyEvent(xvEvent *, xvEvent *); static Bool CreateResourceTypes(void); -static Bool XvCloseScreen(int, ScreenPtr); +static Bool XvCloseScreen(ScreenPtr); static Bool XvDestroyPixmap(PixmapPtr); static Bool XvDestroyWindow(WindowPtr); static void XvResetProc(ExtensionEntry *); @@ -290,7 +291,7 @@ XvScreenInit(ScreenPtr pScreen) } static Bool -XvCloseScreen(int ii, ScreenPtr pScreen) +XvCloseScreen(ScreenPtr pScreen) { XvScreenPtr pxvs; @@ -301,13 +302,13 @@ XvCloseScreen(int ii, ScreenPtr pScreen) pScreen->DestroyWindow = pxvs->DestroyWindow; pScreen->CloseScreen = pxvs->CloseScreen; - (*pxvs->ddCloseScreen) (ii, pScreen); + (*pxvs->ddCloseScreen) (pScreen); free(pxvs); dixSetPrivate(&pScreen->devPrivates, XvScreenKey, NULL); - return (*pScreen->CloseScreen) (ii, pScreen); + return (*pScreen->CloseScreen) (pScreen); } static void @@ -507,19 +508,20 @@ XvdiDestroyEncoding(pointer value, XID id) static int XvdiSendVideoNotify(XvPortPtr pPort, DrawablePtr pDraw, int reason) { - xvEvent event; XvVideoNotifyPtr pn; dixLookupResourceByType((pointer *) &pn, pDraw->id, XvRTVideoNotifyList, serverClient, DixReadAccess); while (pn) { + xvEvent event = { + .u.videoNotify.reason = reason, + .u.videoNotify.time = currentTime.milliseconds, + .u.videoNotify.drawable = pDraw->id, + .u.videoNotify.port = pPort->id + }; event.u.u.type = XvEventBase + XvVideoNotify; - event.u.videoNotify.time = currentTime.milliseconds; - event.u.videoNotify.drawable = pDraw->id; - event.u.videoNotify.port = pPort->id; - event.u.videoNotify.reason = reason; - WriteEventsToClient(pn->client, 1, (xEventPtr) & event); + WriteEventsToClient(pn->client, 1, (xEventPtr) &event); pn = pn->next; } @@ -530,18 +532,19 @@ XvdiSendVideoNotify(XvPortPtr pPort, DrawablePtr pDraw, int reason) int XvdiSendPortNotify(XvPortPtr pPort, Atom attribute, INT32 value) { - xvEvent event; XvPortNotifyPtr pn; pn = pPort->pNotify; while (pn) { + xvEvent event = { + .u.portNotify.time = currentTime.milliseconds, + .u.portNotify.port = pPort->id, + .u.portNotify.attribute = attribute, + .u.portNotify.value = value + }; event.u.u.type = XvEventBase + XvPortNotify; - event.u.portNotify.time = currentTime.milliseconds; - event.u.portNotify.port = pPort->id; - event.u.portNotify.attribute = attribute; - event.u.portNotify.value = value; - WriteEventsToClient(pn->client, 1, (xEventPtr) & event); + WriteEventsToClient(pn->client, 1, (xEventPtr) &event); pn = pn->next; } diff --git a/xserver/Xext/xvmc.c b/xserver/Xext/xvmc.c index 8a1d94085..5f0123b32 100644 --- a/xserver/Xext/xvmc.c +++ b/xserver/Xext/xvmc.c @@ -13,6 +13,7 @@ #include "resource.h" #include "scrnintstr.h" #include "extnsionst.h" +#include "extinit.h" #include "servermd.h" #include #include "xvdix.h" @@ -36,8 +37,6 @@ static DevPrivateKeyRec XvMCScreenKeyRec; #define XvMCScreenKey (&XvMCScreenKeyRec) static Bool XvMCInUse; -unsigned long XvMCGeneration = 0; - int XvMCReqCode; int XvMCEventBase; @@ -45,6 +44,8 @@ static RESTYPE XvMCRTContext; static RESTYPE XvMCRTSurface; static RESTYPE XvMCRTSubpicture; +int (*XvMCScreenInitProc)(ScreenPtr, int, XvMCAdaptorPtr) = NULL; + typedef struct { int num_adaptors; XvMCAdaptorPtr adaptors; @@ -109,16 +110,18 @@ XvMCDestroySubpictureRes(pointer data, XID id) static int ProcXvMCQueryVersion(ClientPtr client) { - xvmcQueryVersionReply rep; + xvmcQueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .major = SERVER_XVMC_MAJOR_VERSION, + .minor = SERVER_XVMC_MINOR_VERSION + }; /* REQUEST(xvmcQueryVersionReq); */ REQUEST_SIZE_MATCH(xvmcQueryVersionReq); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.major = SERVER_XVMC_MAJOR_VERSION; - rep.minor = SERVER_XVMC_MINOR_VERSION; - WriteToClient(client, sizeof(xvmcQueryVersionReply), (char *) &rep); + + WriteToClient(client, sizeof(xvmcQueryVersionReply), &rep); return Success; } @@ -132,6 +135,7 @@ ProcXvMCListSurfaceTypes(ClientPtr client) xvmcSurfaceInfo info; XvMCAdaptorPtr adaptor = NULL; XvMCSurfaceInfoPtr surface; + int num_surfaces; REQUEST(xvmcListSurfaceTypesReq); REQUEST_SIZE_MATCH(xvmcListSurfaceTypesReq); @@ -151,14 +155,17 @@ ProcXvMCListSurfaceTypes(ClientPtr client) } } - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.num = (adaptor) ? adaptor->num_surfaces : 0; - rep.length = bytes_to_int32(rep.num * sizeof(xvmcSurfaceInfo)); + num_surfaces = (adaptor) ? adaptor->num_surfaces : 0; + rep = (xvmcListSurfaceTypesReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .num = num_surfaces, + .length = bytes_to_int32(num_surfaces * sizeof(xvmcSurfaceInfo)), + }; - WriteToClient(client, sizeof(xvmcListSurfaceTypesReply), (char *) &rep); + WriteToClient(client, sizeof(xvmcListSurfaceTypesReply), &rep); - for (i = 0; i < rep.num; i++) { + for (i = 0; i < num_surfaces; i++) { surface = adaptor->surfaces[i]; info.surface_type_id = surface->surface_type_id; info.chroma_format = surface->chroma_format; @@ -168,7 +175,7 @@ ProcXvMCListSurfaceTypes(ClientPtr client) info.subpicture_max_height = surface->subpicture_max_height; info.mc_type = surface->mc_type; info.flags = surface->flags; - WriteToClient(client, sizeof(xvmcSurfaceInfo), (char *) &info); + WriteToClient(client, sizeof(xvmcSurfaceInfo), &info); } return Success; @@ -247,16 +254,18 @@ ProcXvMCCreateContext(ClientPtr client) return result; } - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.width_actual = pContext->width; - rep.height_actual = pContext->height; - rep.flags_return = pContext->flags; - rep.length = dwords; + rep = (xvmcCreateContextReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = dwords, + .width_actual = pContext->width, + .height_actual = pContext->height, + .flags_return = pContext->flags + }; - WriteToClient(client, sizeof(xvmcCreateContextReply), (char *) &rep); + WriteToClient(client, sizeof(xvmcCreateContextReply), &rep); if (dwords) - WriteToClient(client, dwords << 2, (char *) data); + WriteToClient(client, dwords << 2, data); AddResource(pContext->context_id, XvMCRTContext, pContext); free(data); @@ -320,14 +329,15 @@ ProcXvMCCreateSurface(ClientPtr client) free(pSurface); return result; } + rep = (xvmcCreateSurfaceReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = dwords + }; - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = dwords; - - WriteToClient(client, sizeof(xvmcCreateSurfaceReply), (char *) &rep); + WriteToClient(client, sizeof(xvmcCreateSurfaceReply), &rep); if (dwords) - WriteToClient(client, dwords << 2, (char *) data); + WriteToClient(client, dwords << 2, data); AddResource(pSurface->surface_id, XvMCRTSurface, pSurface); free(data); @@ -435,22 +445,23 @@ ProcXvMCCreateSubpicture(ClientPtr client) free(pSubpicture); return result; } + rep = (xvmcCreateSubpictureReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = dwords, + .width_actual = pSubpicture->width, + .height_actual = pSubpicture->height, + .num_palette_entries = pSubpicture->num_palette_entries, + .entry_bytes = pSubpicture->entry_bytes, + .component_order[0] = pSubpicture->component_order[0], + .component_order[1] = pSubpicture->component_order[1], + .component_order[2] = pSubpicture->component_order[2], + .component_order[3] = pSubpicture->component_order[3] + }; - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.width_actual = pSubpicture->width; - rep.height_actual = pSubpicture->height; - rep.num_palette_entries = pSubpicture->num_palette_entries; - rep.entry_bytes = pSubpicture->entry_bytes; - rep.component_order[0] = pSubpicture->component_order[0]; - rep.component_order[1] = pSubpicture->component_order[1]; - rep.component_order[2] = pSubpicture->component_order[2]; - rep.component_order[3] = pSubpicture->component_order[3]; - rep.length = dwords; - - WriteToClient(client, sizeof(xvmcCreateSubpictureReply), (char *) &rep); + WriteToClient(client, sizeof(xvmcCreateSubpictureReply), &rep); if (dwords) - WriteToClient(client, dwords << 2, (char *) data); + WriteToClient(client, dwords << 2, data); AddResource(pSubpicture->subpicture_id, XvMCRTSubpicture, pSubpicture); free(data); @@ -525,15 +536,17 @@ ProcXvMCListSubpictureTypes(ClientPtr client) if (!surface) return BadMatch; - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.num = 0; + rep = (xvmcListSubpictureTypesReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .num = 0 + }; if (surface->compatible_subpictures) rep.num = surface->compatible_subpictures->num_xvimages; rep.length = bytes_to_int32(rep.num * sizeof(xvImageFormatInfo)); - WriteToClient(client, sizeof(xvmcListSubpictureTypesReply), (char *) &rep); + WriteToClient(client, sizeof(xvmcListSubpictureTypesReply), &rep); for (i = 0; i < rep.num; i++) { pImage = NULL; @@ -569,7 +582,7 @@ ProcXvMCListSubpictureTypes(ClientPtr client) info.vert_v_period = pImage->vert_v_period; memcpy(&info.comp_order, pImage->component_order, 32); info.scanline_order = pImage->scanline_order; - WriteToClient(client, sizeof(xvImageFormatInfo), (char *) &info); + WriteToClient(client, sizeof(xvImageFormatInfo), &info); } return Success; @@ -595,13 +608,16 @@ ProcXvMCGetDRInfo(ClientPtr client) pScreen = pPort->pAdaptor->pScreen; pScreenPriv = XVMC_GET_PRIVATE(pScreen); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.major = pScreenPriv->major; - rep.minor = pScreenPriv->minor; - rep.patchLevel = pScreenPriv->patchLevel; - rep.nameLen = bytes_to_int32(strlen(pScreenPriv->clientDriverName) + 1); - rep.busIDLen = bytes_to_int32(strlen(pScreenPriv->busID) + 1); + rep = (xvmcGetDRInfoReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .major = pScreenPriv->major, + .minor = pScreenPriv->minor, + .patchLevel = pScreenPriv->patchLevel, + .nameLen = bytes_to_int32(strlen(pScreenPriv->clientDriverName) + 1), + .busIDLen = bytes_to_int32(strlen(pScreenPriv->busID) + 1), + .isLocal = 1 + }; rep.length = rep.nameLen + rep.busIDLen; rep.nameLen <<= 2; @@ -612,7 +628,6 @@ ProcXvMCGetDRInfo(ClientPtr client) * segment she prepared for us. */ - rep.isLocal = 1; #ifdef HAS_XVMCSHM patternP = (CARD32 *) shmat(stuff->shmKey, NULL, SHM_RDONLY); if (-1 != (long) patternP) { @@ -634,7 +649,7 @@ ProcXvMCGetDRInfo(ClientPtr client) } #endif /* HAS_XVMCSHM */ - WriteToClient(client, sizeof(xvmcGetDRInfoReply), (char *) &rep); + WriteToClient(client, sizeof(xvmcGetDRInfoReply), &rep); if (rep.length) { WriteToClient(client, rep.nameLen, pScreenPriv->clientDriverName); WriteToClient(client, rep.busIDLen, pScreenPriv->busID); @@ -709,7 +724,7 @@ XvMCExtensionInit(void) } static Bool -XvMCCloseScreen(int i, ScreenPtr pScreen) +XvMCCloseScreen(ScreenPtr pScreen) { XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pScreen); @@ -717,7 +732,7 @@ XvMCCloseScreen(int i, ScreenPtr pScreen) free(pScreenPriv); - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } int diff --git a/xserver/Xext/xvmcext.h b/xserver/Xext/xvmcext.h index 5a4261bbd..2201d7b5b 100644 --- a/xserver/Xext/xvmcext.h +++ b/xserver/Xext/xvmcext.h @@ -84,8 +84,7 @@ typedef struct { XvMCDestroySubpictureProcPtr DestroySubpicture; } XvMCAdaptorRec, *XvMCAdaptorPtr; -#ifndef XorgLoader -extern _X_EXPORT void XvMCExtensionInit(void); +extern int (*XvMCScreenInitProc)(ScreenPtr, int, XvMCAdaptorPtr); extern _X_EXPORT int XvMCScreenInit(ScreenPtr pScreen, int num, XvMCAdaptorPtr adapt); @@ -95,6 +94,5 @@ extern _X_EXPORT XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id); extern _X_EXPORT int xf86XvMCRegisterDRInfo(ScreenPtr pScreen, char *name, char *busID, int major, int minor, int patchLevel); -#endif #endif /* _XVMC_H */ diff --git a/xserver/Xi/Makefile.am b/xserver/Xi/Makefile.am index 69c7886b9..af85bd049 100644 --- a/xserver/Xi/Makefile.am +++ b/xserver/Xi/Makefile.am @@ -78,6 +78,8 @@ libXi_la_SOURCES = \ ungrdevk.h \ xiallowev.c \ xiallowev.h \ + xibarriers.c \ + xibarriers.h \ xichangecursor.c \ xichangecursor.h \ xichangehierarchy.c \ diff --git a/xserver/Xi/Makefile.in b/xserver/Xi/Makefile.in index 2741e68e5..f24ac40c8 100644 --- a/xserver/Xi/Makefile.in +++ b/xserver/Xi/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -81,7 +81,7 @@ am_libXi_la_OBJECTS = allowev.lo chgdctl.lo chgfctl.lo chgkbd.lo \ getvers.lo grabdev.lo grabdevb.lo grabdevk.lo gtmotion.lo \ listdev.lo opendev.lo queryst.lo selectev.lo sendexev.lo \ setbmap.lo setdval.lo setfocus.lo setmmap.lo setmode.lo \ - ungrdev.lo ungrdevb.lo ungrdevk.lo xiallowev.lo \ + ungrdev.lo ungrdevb.lo ungrdevk.lo xiallowev.lo xibarriers.lo \ xichangecursor.lo xichangehierarchy.lo xigetclientpointer.lo \ xigrabdev.lo xipassivegrab.lo xiproperty.lo xiquerydevice.lo \ xiquerypointer.lo xiqueryversion.lo xiselectev.lo \ @@ -192,13 +192,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -220,6 +216,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -244,6 +241,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -259,7 +257,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -358,6 +355,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -535,6 +533,8 @@ libXi_la_SOURCES = \ ungrdevk.h \ xiallowev.c \ xiallowev.h \ + xibarriers.c \ + xibarriers.h \ xichangecursor.c \ xichangecursor.h \ xichangehierarchy.c \ @@ -567,7 +567,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -592,9 +592,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): @@ -655,6 +655,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ungrdevb.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ungrdevk.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xiallowev.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xibarriers.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xichangecursor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xichangehierarchy.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xigetclientpointer.Plo@am__quote@ diff --git a/xserver/Xi/chgdctl.c b/xserver/Xi/chgdctl.c index ff5d69aef..31d3a57f3 100644 --- a/xserver/Xi/chgdctl.c +++ b/xserver/Xi/chgdctl.c @@ -113,7 +113,6 @@ ProcXChangeDeviceControl(ClientPtr client) AxisInfoPtr a; CARD32 *resolution; xDeviceEnableCtl *e; - devicePresenceNotify dpn; REQUEST(xChangeDeviceControlReq); REQUEST_AT_LEAST_SIZE(xChangeDeviceControlReq); @@ -123,10 +122,13 @@ ProcXChangeDeviceControl(ClientPtr client) if (ret != Success) goto out; - rep.repType = X_Reply; - rep.RepType = X_ChangeDeviceControl; - rep.length = 0; - rep.sequenceNumber = client->sequence; + rep = (xChangeDeviceControlReply) { + .repType = X_Reply, + .RepType = X_ChangeDeviceControl, + .sequenceNumber = client->sequence, + .length = 0, + .status = Success, + }; switch (stuff->control) { case DEVICE_RESOLUTION: @@ -185,7 +187,10 @@ ProcXChangeDeviceControl(ClientPtr client) case DEVICE_ENABLE: e = (xDeviceEnableCtl *) &stuff[1]; - status = ChangeDeviceControl(client, dev, (xDeviceCtl *) e); + if (IsXTestDevice(dev, NULL)) + status = !Success; + else + status = ChangeDeviceControl(client, dev, (xDeviceCtl *) e); if (status == Success) { if (e->enable) @@ -209,11 +214,13 @@ ProcXChangeDeviceControl(ClientPtr client) out: if (ret == Success) { - dpn.type = DevicePresenceNotify; - dpn.time = currentTime.milliseconds; - dpn.devchange = DeviceControlChanged; - dpn.deviceid = dev->id; - dpn.control = stuff->control; + devicePresenceNotify dpn = { + .type = DevicePresenceNotify, + .time = currentTime.milliseconds, + .devchange = DeviceControlChanged, + .deviceid = dev->id, + .control = stuff->control + }; SendEventToAllWindows(dev, DevicePresenceNotifyMask, (xEvent *) &dpn, 1); @@ -236,5 +243,5 @@ SRepXChangeDeviceControl(ClientPtr client, int size, { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xserver/Xi/chgptr.h b/xserver/Xi/chgptr.h index 47265b3bc..275511ffc 100644 --- a/xserver/Xi/chgptr.h +++ b/xserver/Xi/chgptr.h @@ -39,10 +39,4 @@ int ProcXChangePointerDevice(ClientPtr /* client */ void DeleteFocusClassDeviceStruct(DeviceIntPtr /* dev */ ); -void SendEventToAllWindows(DeviceIntPtr /* dev */ , - Mask /* mask */ , - xEvent * /* ev */ , - int /* count */ - ); - #endif /* CHGPTR_H */ diff --git a/xserver/Xi/exevents.c b/xserver/Xi/exevents.c index 37ed5c7c0..f05e03d73 100644 --- a/xserver/Xi/exevents.c +++ b/xserver/Xi/exevents.c @@ -269,8 +269,6 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to) } } else if (to->intfeed && !from->intfeed) { - ClassesPtr classes; - classes = to->unused_classes; classes->intfeed = to->intfeed; to->intfeed = NULL; @@ -301,8 +299,6 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to) } } else if (to->stringfeed && !from->stringfeed) { - ClassesPtr classes; - classes = to->unused_classes; classes->stringfeed = to->stringfeed; to->stringfeed = NULL; @@ -334,8 +330,6 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to) } } else if (to->bell && !from->bell) { - ClassesPtr classes; - classes = to->unused_classes; classes->bell = to->bell; to->bell = NULL; @@ -369,8 +363,6 @@ DeepCopyFeedbackClasses(DeviceIntPtr from, DeviceIntPtr to) } } else if (to->leds && !from->leds) { - ClassesPtr classes; - classes = to->unused_classes; classes->leds = to->leds; to->leds = NULL; @@ -417,8 +409,6 @@ DeepCopyKeyboardClasses(DeviceIntPtr from, DeviceIntPtr to) } } else if (to->kbdfeed && !from->kbdfeed) { - ClassesPtr classes; - classes = to->unused_classes; classes->kbdfeed = to->kbdfeed; to->kbdfeed = NULL; @@ -437,8 +427,6 @@ DeepCopyKeyboardClasses(DeviceIntPtr from, DeviceIntPtr to) CopyKeyClass(from, to); } else if (to->key && !from->key) { - ClassesPtr classes; - classes = to->unused_classes; classes->key = to->key; to->key = NULL; @@ -494,8 +482,6 @@ DeepCopyKeyboardClasses(DeviceIntPtr from, DeviceIntPtr to) } } else if (to->focus) { - ClassesPtr classes; - classes = to->unused_classes; classes->focus = to->focus; to->focus = NULL; @@ -536,8 +522,6 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) } } else if (to->ptrfeed && !from->ptrfeed) { - ClassesPtr classes; - classes = to->unused_classes; classes->ptrfeed = to->ptrfeed; to->ptrfeed = NULL; @@ -564,8 +548,6 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) v->sourceid = from->id; } else if (to->valuator && !from->valuator) { - ClassesPtr classes; - classes = to->unused_classes; classes->valuator = to->valuator; to->valuator = NULL; @@ -601,8 +583,6 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) to->button->sourceid = from->id; } else if (to->button && !from->button) { - ClassesPtr classes; - classes = to->unused_classes; classes->button = to->button; to->button = NULL; @@ -624,8 +604,6 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) to->proximity->sourceid = from->id; } else if (to->proximity) { - ClassesPtr classes; - classes = to->unused_classes; classes->proximity = to->proximity; to->proximity = NULL; @@ -948,10 +926,10 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent *event) else if (event->type == ET_ProximityOut) device->proximity->in_proximity = FALSE; else if (event->type == ET_TouchBegin) { - BUG_WARN(!b || !v); - BUG_WARN(!t); + BUG_RETURN_VAL(!b || !v, DONT_PROCESS); + BUG_RETURN_VAL(!t, DONT_PROCESS); - if (!b || !t || !b->map[key]) + if (!b->map[key]) return DONT_PROCESS; if (!(event->flags & TOUCH_POINTER_EMULATED) || @@ -963,16 +941,14 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent *event) UpdateDeviceMotionMask(device, t->state, DeviceButtonMotionMask); } else if (event->type == ET_TouchEnd) { - BUG_WARN(!b || !v); - BUG_WARN(!t); + BUG_RETURN_VAL(!b || !v, DONT_PROCESS); + BUG_RETURN_VAL(!t, DONT_PROCESS); - if (!b || !t || t->buttonsDown <= 0 || !b->map[key]) + if (t->buttonsDown <= 0 || !b->map[key]) return DONT_PROCESS; if (!(event->flags & TOUCH_POINTER_EMULATED)) return DONT_PROCESS; - if (!(event->flags & TOUCH_END)) - return DONT_PROCESS; DecreaseButtonCount(device, key, &t->buttonsDown, &t->motionMask, &t->state); @@ -1090,24 +1066,14 @@ ActivateEarlyAccept(DeviceIntPtr dev, TouchPointInfoPtr ti) static void EmitTouchEnd(DeviceIntPtr dev, TouchPointInfoPtr ti, int flags, XID resource) { - InternalEvent *tel = InitEventList(GetMaximumEventsNum()); - ValuatorMask *mask = valuator_mask_new(2); - int i, nev; - - valuator_mask_set_double(mask, 0, - valuator_mask_get_double(ti->valuators, 0)); - valuator_mask_set_double(mask, 1, - valuator_mask_get_double(ti->valuators, 1)); + InternalEvent event; flags |= TOUCH_CLIENT_ID; if (ti->emulate_pointer) flags |= TOUCH_POINTER_EMULATED; - nev = GetTouchEvents(tel, dev, ti->client_id, XI_TouchEnd, flags, mask); - for (i = 0; i < nev; i++) - DeliverTouchEvents(dev, ti, tel + i, resource); - - valuator_mask_free(&mask); - FreeEventList(tel, GetMaximumEventsNum()); + TouchDeliverDeviceClassesChangedEvent(ti, GetTimeInMillis(), resource); + GetDixTouchEnd(&event, dev, ti, flags); + DeliverTouchEvents(dev, ti, &event, resource); } /** @@ -1221,7 +1187,6 @@ TouchRejected(DeviceIntPtr sourcedev, TouchPointInfoPtr ti, XID resource, TouchOwnershipEvent *ev) { Bool was_owner = (resource == ti->listeners[0].listener); - void *grab; int i; /* Send a TouchEnd event to the resource being removed, but only if they @@ -1236,11 +1201,7 @@ TouchRejected(DeviceIntPtr sourcedev, TouchPointInfoPtr ti, XID resource, /* Remove the resource from the listener list, updating * ti->num_listeners, as well as ti->num_grabs if it was a grab. */ - if (TouchRemoveListener(ti, resource)) { - if (dixLookupResourceByType(&grab, resource, RT_PASSIVEGRAB, - serverClient, DixGetAttrAccess) == Success) - ti->num_grabs--; - } + TouchRemoveListener(ti, resource); /* If the current owner was removed and there are further listeners, deliver * the TouchOwnership or TouchBegin event to the new owner. */ @@ -1288,7 +1249,7 @@ ProcessTouchOwnershipEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, else ti->listeners[0].state = LISTENER_HAS_ACCEPTED; } - else { /* this is the very first ownership event for a grab */ + else { /* this is the very first ownership event for a grab */ DeliverTouchEvents(dev, ti, (InternalEvent *) ev, ev->resource); } } @@ -1302,7 +1263,7 @@ TouchCopyValuatorData(DeviceEvent *ev, TouchPointInfoPtr ti) { int i; - for (i = 0; i < sizeof(ev->valuators.mask) * 8; i++) + for (i = 0; i < ARRAY_SIZE(ev->valuators.data); i++) if (BitIsOn(ev->valuators.mask, i)) valuator_mask_set_double(ti->valuators, i, ev->valuators.data[i]); } @@ -1334,34 +1295,19 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti, if (listener->type == LISTENER_GRAB || listener->type == LISTENER_POINTER_GRAB) { - rc = dixLookupResourceByType((pointer *) grab, listener->listener, - RT_PASSIVEGRAB, - serverClient, DixSendAccess); - if (rc != Success) { - /* the grab doesn't exist but we have a grabbing listener - this - * is an implicit/active grab */ - rc = dixLookupClient(client, listener->listener, serverClient, - DixSendAccess); - if (rc != Success) - return FALSE; - *grab = dev->deviceGrab.grab; - if (!*grab) - return FALSE; - } + *grab = listener->grab; + + BUG_RETURN_VAL(!*grab, FALSE); *client = rClient(*grab); *win = (*grab)->window; *mask = (*grab)->xi2mask; } else { - if (listener->level == CORE) - rc = dixLookupWindow(win, listener->listener, - serverClient, DixSendAccess); - else - rc = dixLookupResourceByType((pointer *) win, listener->listener, - RT_INPUTCLIENT, - serverClient, DixSendAccess); + rc = dixLookupResourceByType((pointer *) win, listener->listener, + listener->resource_type, + serverClient, DixSendAccess); if (rc != Success) return FALSE; @@ -1378,9 +1324,8 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti, wOtherInputMasks(*win)->inputClients, next) if (xi2mask_isset(iclients->xi2mask, dev, evtype)) break; - BUG_WARN(!iclients); - if (!iclients) - return FALSE; + + BUG_RETURN_VAL(!iclients, FALSE); *mask = iclients->xi2mask; *client = rClient(iclients); @@ -1393,9 +1338,7 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti, wOtherInputMasks(*win)->inputClients, next) if (iclients->mask[dev->id] & xi_filter) break; - BUG_WARN(!iclients); - if (!iclients) - return FALSE; + BUG_RETURN_VAL(!iclients, FALSE); *client = rClient(iclients); } @@ -1436,9 +1379,7 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, return Success; nevents = TouchConvertToPointerEvent(ev, &motion, &button); - BUG_WARN(nevents == 0); - if (nevents == 0) - return BadValue; + BUG_RETURN_VAL(nevents == 0, BadValue); if (nevents > 1) ptrev = &button; @@ -1448,7 +1389,7 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, ptrev->device_event.corestate = event_get_corestate(dev, kbd); if (grab) { - /* this side-steps the usual activation mechansims, but... */ + /* this side-steps the usual activation mechanisms, but... */ if (ev->any.type == ET_TouchBegin && !dev->deviceGrab.grab) ActivatePassiveGrab(dev, grab, ptrev, ev); /* also delivers the event */ else { @@ -1461,9 +1402,9 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, if (grab->ownerEvents) { WindowPtr focus = NullWindow; - WindowPtr win = dev->spriteInfo->sprite->win; + WindowPtr sprite_win = dev->spriteInfo->sprite->win; - deliveries = DeliverDeviceEvents(win, ptrev, grab, focus, dev); + deliveries = DeliverDeviceEvents(sprite_win, ptrev, grab, focus, dev); } if (!deliveries) @@ -1494,7 +1435,7 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, * the event. */ if (!devgrab && dev->deviceGrab.grab && dev->deviceGrab.implicitGrab) { - TouchListener *listener; + TouchListener *l; devgrab = dev->deviceGrab.grab; @@ -1504,13 +1445,15 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, * selection. Implicit grab activation occurs through delivering an * event selection. Thus, we update the last listener in the array. */ - listener = &ti->listeners[ti->num_listeners - 1]; - listener->listener = devgrab->resource; + l = &ti->listeners[ti->num_listeners - 1]; + l->listener = devgrab->resource; + l->grab = devgrab; + //l->resource_type = RT_NONE; if (devgrab->grabtype != XI2 || devgrab->type != XI_TouchBegin) - listener->type = LISTENER_POINTER_GRAB; + l->type = LISTENER_POINTER_GRAB; else - listener->type = LISTENER_GRAB; + l->type = LISTENER_GRAB; } } @@ -1588,6 +1531,7 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev) uint32_t touchid; int type = ev->any.type; int emulate_pointer = ! !(ev->device_event.flags & TOUCH_POINTER_EMULATED); + DeviceIntPtr kbd; if (!t) return; @@ -1597,9 +1541,6 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev) else touchid = ev->device_event.touchid; - if (emulate_pointer) - UpdateDeviceState(dev, &ev->device_event); - if (type == ET_TouchBegin) { ti = TouchBeginTouch(dev, ev->device_event.sourceid, touchid, emulate_pointer); @@ -1607,32 +1548,41 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev) else ti = TouchFindByClientID(dev, touchid); - /* Under the following circumstances we create a new touch record for an - * existing touch: - * - * - The touch may be pointer emulated - * - An explicit grab is active on the device - * - The grab is a pointer grab - * - * This allows for an explicit grab to receive pointer events for an already - * active touch. - */ - if (!ti && type != ET_TouchBegin && emulate_pointer && - dev->deviceGrab.grab && !dev->deviceGrab.fromPassiveGrab && + /* Active pointer grab */ + if (emulate_pointer && dev->deviceGrab.grab && !dev->deviceGrab.fromPassiveGrab && (dev->deviceGrab.grab->grabtype == CORE || dev->deviceGrab.grab->grabtype == XI || - !xi2mask_isset(dev->deviceGrab.grab->xi2mask, dev, XI_TouchBegin))) { - ti = TouchBeginTouch(dev, ev->device_event.sourceid, touchid, - emulate_pointer); - if (!ti) { - DebugF("[Xi] %s: Failed to create new dix record for explicitly " - "grabbed touchpoint %d\n", - dev->name, type, touchid); - return; - } + !xi2mask_isset(dev->deviceGrab.grab->xi2mask, dev, XI_TouchBegin))) + { + /* Active pointer grab on touch point and we get a TouchEnd - claim this + * touchpoint accepted, otherwise clients waiting for ownership will + * wait on this touchpoint until this client ungrabs, or the cows come + * home, whichever is earlier */ + if (ti && type == ET_TouchEnd) + TouchListenerAcceptReject(dev, ti, 0, XIAcceptTouch); + else if (!ti && type != ET_TouchBegin) { + /* Under the following circumstances we create a new touch record for an + * existing touch: + * + * - The touch may be pointer emulated + * - An explicit grab is active on the device + * - The grab is a pointer grab + * + * This allows for an explicit grab to receive pointer events for an already + * active touch. + */ + ti = TouchBeginTouch(dev, ev->device_event.sourceid, touchid, + emulate_pointer); + if (!ti) { + DebugF("[Xi] %s: Failed to create new dix record for explicitly " + "grabbed touchpoint %d\n", + dev->name, touchid); + return; + } - TouchBuildSprite(dev, ti, ev); - TouchSetupListeners(dev, ti, ev); + TouchBuildSprite(dev, ti, ev); + TouchSetupListeners(dev, ti, ev); + } } if (!ti) { @@ -1646,9 +1596,14 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev) * events which _only_ emulate motion just work normally */ if (emulate_pointer && ev->any.type != ET_TouchUpdate) DeliverEmulatedMotionEvent(dev, ti, ev); + if (emulate_pointer && IsMaster(dev)) CheckMotion(&ev->device_event, dev); + kbd = GetMaster(dev, KEYBOARD_OR_FLOAT); + event_set_state(NULL, kbd, &ev->device_event); + ev->device_event.corestate = event_get_corestate(NULL, kbd); + /* Make sure we have a valid window trace for event delivery; must be * called after event type mutation. Touch end events are always processed * in order to end touch records. */ @@ -1670,6 +1625,52 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev) if (ev->any.type == ET_TouchEnd) TouchEndTouch(dev, ti); } + + if (emulate_pointer) + UpdateDeviceState(dev, &ev->device_event); +} + +static void +ProcessBarrierEvent(InternalEvent *e, DeviceIntPtr dev) +{ + Mask filter; + WindowPtr pWin; + BarrierEvent *be = &e->barrier_event; + xEvent *ev; + int rc; + GrabPtr grab = dev->deviceGrab.grab; + + if (!IsMaster(dev)) + return; + + if (dixLookupWindow(&pWin, be->window, serverClient, DixReadAccess) != Success) + return; + + if (grab) + be->flags |= XIBarrierDeviceIsGrabbed; + + rc = EventToXI2(e, &ev); + if (rc != Success) { + ErrorF("[Xi] event conversion from %s failed with code %d\n", __func__, rc); + return; + } + + /* A client has a grab, deliver to this client if the grab_window is the + barrier window. + + Otherwise, deliver normally to the client. + */ + if (grab && + CLIENT_ID(be->barrierid) == CLIENT_ID(grab->resource) && + grab->window->drawable.id == be->window) { + DeliverGrabbedEvent(e, dev, FALSE); + } else { + filter = GetEventFilter(dev, ev); + + DeliverEventsToWindow(dev, pWin, ev, 1, + filter, NullGrab); + } + free(ev); } /** @@ -1723,7 +1724,7 @@ ProcessDeviceEvent(InternalEvent *ev, DeviceIntPtr device) GetSpritePosition(device, &rootX, &rootY); event->root_x = rootX; event->root_y = rootY; - NoticeEventTime((InternalEvent *) event); + NoticeEventTime((InternalEvent *) event, device); event->corestate = corestate; key = event->detail.key; break; @@ -1821,6 +1822,10 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device) case ET_TouchEnd: ProcessTouchEvent(ev, device); break; + case ET_BarrierHit: + case ET_BarrierLeave: + ProcessBarrierEvent(ev, device); + break; default: ProcessDeviceEvent(ev, device); break; @@ -1891,6 +1896,12 @@ DeliverTouchEndEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev, goto out; } + /* A client is waiting for the begin, don't give it a TouchEnd */ + if (listener->state == LISTENER_AWAITING_BEGIN) { + listener->state = LISTENER_HAS_END; + goto out; + } + /* Event in response to reject */ if (ev->device_event.flags & TOUCH_REJECT) { if (listener->state != LISTENER_HAS_END) @@ -1915,6 +1926,12 @@ DeliverTouchEndEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev, if (normal_end) listener->state = LISTENER_HAS_END; } + else if (ev->device_event.flags & TOUCH_ACCEPT) { + /* Touch has been accepted by its owner, which is not this listener */ + if (listener->state != LISTENER_HAS_END) + rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev); + listener->state = LISTENER_HAS_END; + } out: return rc; @@ -2114,240 +2131,6 @@ SetScrollValuator(DeviceIntPtr dev, int axnum, enum ScrollType type, return TRUE; } -static void -FixDeviceStateNotify(DeviceIntPtr dev, deviceStateNotify * ev, KeyClassPtr k, - ButtonClassPtr b, ValuatorClassPtr v, int first) -{ - ev->type = DeviceStateNotify; - ev->deviceid = dev->id; - ev->time = currentTime.milliseconds; - ev->classes_reported = 0; - ev->num_keys = 0; - ev->num_buttons = 0; - ev->num_valuators = 0; - - if (b) { - ev->classes_reported |= (1 << ButtonClass); - ev->num_buttons = b->numButtons; - memcpy((char *) ev->buttons, (char *) b->down, 4); - } - else if (k) { - ev->classes_reported |= (1 << KeyClass); - ev->num_keys = k->xkbInfo->desc->max_key_code - - k->xkbInfo->desc->min_key_code; - memmove((char *) &ev->keys[0], (char *) k->down, 4); - } - if (v) { - int nval = v->numAxes - first; - - ev->classes_reported |= (1 << ValuatorClass); - ev->classes_reported |= valuator_get_mode(dev, 0) << ModeBitsShift; - ev->num_valuators = nval < 3 ? nval : 3; - switch (ev->num_valuators) { - case 3: - ev->valuator2 = v->axisVal[first + 2]; - case 2: - ev->valuator1 = v->axisVal[first + 1]; - case 1: - ev->valuator0 = v->axisVal[first]; - break; - } - } -} - -static void -FixDeviceValuator(DeviceIntPtr dev, deviceValuator * ev, ValuatorClassPtr v, - int first) -{ - int nval = v->numAxes - first; - - ev->type = DeviceValuator; - ev->deviceid = dev->id; - ev->num_valuators = nval < 3 ? nval : 3; - ev->first_valuator = first; - switch (ev->num_valuators) { - case 3: - ev->valuator2 = v->axisVal[first + 2]; - case 2: - ev->valuator1 = v->axisVal[first + 1]; - case 1: - ev->valuator0 = v->axisVal[first]; - break; - } - first += ev->num_valuators; -} - -static void -DeliverStateNotifyEvent(DeviceIntPtr dev, WindowPtr win) -{ - int evcount = 1; - deviceStateNotify *ev, *sev; - deviceKeyStateNotify *kev; - deviceButtonStateNotify *bev; - - KeyClassPtr k; - ButtonClassPtr b; - ValuatorClassPtr v; - int nval = 0, nkeys = 0, nbuttons = 0, first = 0; - - if (!(wOtherInputMasks(win)) || - !(wOtherInputMasks(win)->inputEvents[dev->id] & DeviceStateNotifyMask)) - return; - - if ((b = dev->button) != NULL) { - nbuttons = b->numButtons; - if (nbuttons > 32) - evcount++; - } - if ((k = dev->key) != NULL) { - nkeys = k->xkbInfo->desc->max_key_code - k->xkbInfo->desc->min_key_code; - if (nkeys > 32) - evcount++; - if (nbuttons > 0) { - evcount++; - } - } - if ((v = dev->valuator) != NULL) { - nval = v->numAxes; - - if (nval > 3) - evcount++; - if (nval > 6) { - if (!(k && b)) - evcount++; - if (nval > 9) - evcount += ((nval - 7) / 3); - } - } - - sev = ev = (deviceStateNotify *) malloc(evcount * sizeof(xEvent)); - FixDeviceStateNotify(dev, ev, NULL, NULL, NULL, first); - - if (b != NULL) { - FixDeviceStateNotify(dev, ev++, NULL, b, v, first); - first += 3; - nval -= 3; - if (nbuttons > 32) { - (ev - 1)->deviceid |= MORE_EVENTS; - bev = (deviceButtonStateNotify *) ev++; - bev->type = DeviceButtonStateNotify; - bev->deviceid = dev->id; - memcpy((char *) &bev->buttons[4], (char *) &b->down[4], - DOWN_LENGTH - 4); - } - if (nval > 0) { - (ev - 1)->deviceid |= MORE_EVENTS; - FixDeviceValuator(dev, (deviceValuator *) ev++, v, first); - first += 3; - nval -= 3; - } - } - - if (k != NULL) { - FixDeviceStateNotify(dev, ev++, k, NULL, v, first); - first += 3; - nval -= 3; - if (nkeys > 32) { - (ev - 1)->deviceid |= MORE_EVENTS; - kev = (deviceKeyStateNotify *) ev++; - kev->type = DeviceKeyStateNotify; - kev->deviceid = dev->id; - memmove((char *) &kev->keys[0], (char *) &k->down[4], 28); - } - if (nval > 0) { - (ev - 1)->deviceid |= MORE_EVENTS; - FixDeviceValuator(dev, (deviceValuator *) ev++, v, first); - first += 3; - nval -= 3; - } - } - - while (nval > 0) { - FixDeviceStateNotify(dev, ev++, NULL, NULL, v, first); - first += 3; - nval -= 3; - if (nval > 0) { - (ev - 1)->deviceid |= MORE_EVENTS; - FixDeviceValuator(dev, (deviceValuator *) ev++, v, first); - first += 3; - nval -= 3; - } - } - - DeliverEventsToWindow(dev, win, (xEvent *) sev, evcount, - DeviceStateNotifyMask, NullGrab); - free(sev); -} - -void -DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail, - WindowPtr pWin) -{ - deviceFocus event; - xXIFocusInEvent *xi2event; - DeviceIntPtr mouse; - int btlen, len, i; - - mouse = IsFloating(dev) ? dev : GetMaster(dev, MASTER_POINTER); - - /* XI 2 event */ - btlen = (mouse->button) ? bits_to_bytes(mouse->button->numButtons) : 0; - btlen = bytes_to_int32(btlen); - len = sizeof(xXIFocusInEvent) + btlen * 4; - - xi2event = calloc(1, len); - xi2event->type = GenericEvent; - xi2event->extension = IReqCode; - xi2event->evtype = type; - xi2event->length = bytes_to_int32(len - sizeof(xEvent)); - xi2event->buttons_len = btlen; - xi2event->detail = detail; - xi2event->time = currentTime.milliseconds; - xi2event->deviceid = dev->id; - xi2event->sourceid = dev->id; /* a device doesn't change focus by itself */ - xi2event->mode = mode; - xi2event->root_x = FP1616(mouse->spriteInfo->sprite->hot.x, 0); - xi2event->root_y = FP1616(mouse->spriteInfo->sprite->hot.y, 0); - - for (i = 0; mouse && mouse->button && i < mouse->button->numButtons; i++) - if (BitIsOn(mouse->button->down, i)) - SetBit(&xi2event[1], mouse->button->map[i]); - - if (dev->key) { - xi2event->mods.base_mods = dev->key->xkbInfo->state.base_mods; - xi2event->mods.latched_mods = dev->key->xkbInfo->state.latched_mods; - xi2event->mods.locked_mods = dev->key->xkbInfo->state.locked_mods; - xi2event->mods.effective_mods = dev->key->xkbInfo->state.mods; - - xi2event->group.base_group = dev->key->xkbInfo->state.base_group; - xi2event->group.latched_group = dev->key->xkbInfo->state.latched_group; - xi2event->group.locked_group = dev->key->xkbInfo->state.locked_group; - xi2event->group.effective_group = dev->key->xkbInfo->state.group; - } - - FixUpEventFromWindow(dev->spriteInfo->sprite, (xEvent *) xi2event, pWin, - None, FALSE); - - DeliverEventsToWindow(dev, pWin, (xEvent *) xi2event, 1, - GetEventFilter(dev, (xEvent *) xi2event), NullGrab); - - free(xi2event); - - /* XI 1.x event */ - event.deviceid = dev->id; - event.mode = mode; - event.type = (type == XI_FocusIn) ? DeviceFocusIn : DeviceFocusOut; - event.detail = detail; - event.window = pWin->drawable.id; - event.time = currentTime.milliseconds; - - DeliverEventsToWindow(dev, pWin, (xEvent *) &event, 1, - DeviceFocusChangeMask, NullGrab); - - if (event.type == DeviceFocusIn) - DeliverStateNotifyEvent(dev, pWin); -} - int CheckGrabValues(ClientPtr client, GrabParameters *param) { @@ -2573,12 +2356,11 @@ SelectForWindow(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client, check = (mask & exclusivemasks); if (wOtherInputMasks(pWin)) { - if (check & wOtherInputMasks(pWin)->inputEvents[mskidx]) { /* It is illegal for two different - * clients to select on any of the - * events for maskcheck. However, - * it is OK, for some client to - * continue selecting on one of those - * events. */ + if (check & wOtherInputMasks(pWin)->inputEvents[mskidx]) { + /* It is illegal for two different clients to select on any of + * the events for maskcheck. However, it is OK, for some client + * to continue selecting on one of those events. + */ for (others = wOtherInputMasks(pWin)->inputClients; others; others = others->next) { if (!SameClient(others, client) && (check & diff --git a/xserver/Xi/extinit.c b/xserver/Xi/extinit.c index 2637f08e5..619d0e468 100644 --- a/xserver/Xi/extinit.c +++ b/xserver/Xi/extinit.c @@ -49,8 +49,6 @@ SOFTWARE. * Dispatch routines and initialization routines for the X input extension. * */ -#define ARRAY_SIZE(_a) (sizeof((_a)) / sizeof((_a)[0])) - #define NUMTYPES 15 #ifdef HAVE_DIX_CONFIG_H @@ -124,6 +122,7 @@ SOFTWARE. #include "xiqueryversion.h" #include "xisetclientpointer.h" #include "xiwarppointer.h" +#include "xibarriers.h" /* Masks for XI events have to be aligned with core event (partially anyway). * If DeviceButtonMotionMask is != ButtonMotionMask, event delivery @@ -150,10 +149,8 @@ const Mask ChangeDeviceNotifyMask = (1L << 16); const Mask DeviceButtonGrabMask = (1L << 17); const Mask DeviceOwnerGrabButtonMask = (1L << 17); const Mask DevicePresenceNotifyMask = (1L << 18); -const Mask DeviceEnterWindowMask = (1L << 18); -const Mask DeviceLeaveWindowMask = (1L << 19); -const Mask DevicePropertyNotifyMask = (1L << 20); -const Mask XIAllMasks = (1L << 21) - 1; +const Mask DevicePropertyNotifyMask = (1L << 19); +const Mask XIAllMasks = (1L << 20) - 1; int ExtEventIndex; Mask ExtExclusiveMasks[EMASKSIZE]; @@ -162,25 +159,25 @@ static struct dev_type { Atom type; const char *name; } dev_type[] = { - { - 0, XI_KEYBOARD}, { - 0, XI_MOUSE}, { - 0, XI_TABLET}, { - 0, XI_TOUCHSCREEN}, { - 0, XI_TOUCHPAD}, { - 0, XI_BARCODE}, { - 0, XI_BUTTONBOX}, { - 0, XI_KNOB_BOX}, { - 0, XI_ONE_KNOB}, { - 0, XI_NINE_KNOB}, { - 0, XI_TRACKBALL}, { - 0, XI_QUADRATURE}, { - 0, XI_ID_MODULE}, { - 0, XI_SPACEBALL}, { - 0, XI_DATAGLOVE}, { - 0, XI_EYETRACKER}, { - 0, XI_CURSORKEYS}, { -0, XI_FOOTMOUSE}}; + {0, XI_KEYBOARD}, + {0, XI_MOUSE}, + {0, XI_TABLET}, + {0, XI_TOUCHSCREEN}, + {0, XI_TOUCHPAD}, + {0, XI_BARCODE}, + {0, XI_BUTTONBOX}, + {0, XI_KNOB_BOX}, + {0, XI_ONE_KNOB}, + {0, XI_NINE_KNOB}, + {0, XI_TRACKBALL}, + {0, XI_QUADRATURE}, + {0, XI_ID_MODULE}, + {0, XI_SPACEBALL}, + {0, XI_DATAGLOVE}, + {0, XI_EYETRACKER}, + {0, XI_CURSORKEYS}, + {0, XI_FOOTMOUSE} +}; CARD8 event_base[numInputClasses]; XExtEventInfo EventInfo[32]; @@ -255,7 +252,8 @@ static int (*ProcIVector[]) (ClientPtr) = { ProcXIChangeProperty, /* 57 */ ProcXIDeleteProperty, /* 58 */ ProcXIGetProperty, /* 59 */ - ProcXIGetSelectedEvents /* 60 */ + ProcXIGetSelectedEvents, /* 60 */ + ProcXIBarrierReleasePointer /* 61 */ }; /* For swapped clients */ @@ -320,7 +318,8 @@ static int (*SProcIVector[]) (ClientPtr) = { SProcXIChangeProperty, /* 57 */ SProcXIDeleteProperty, /* 58 */ SProcXIGetProperty, /* 59 */ - SProcXIGetSelectedEvents /* 60 */ + SProcXIGetSelectedEvents, /* 60 */ + SProcXIBarrierReleasePointer /* 61 */ }; /***************************************************************** @@ -438,8 +437,9 @@ SProcIDispatch(ClientPtr client) static void SReplyIDispatch(ClientPtr client, int len, xGrabDeviceReply * rep) - /* All we look at is the type field */ -{ /* This is common to all replies */ +{ + /* All we look at is the type field */ + /* This is common to all replies */ if (rep->RepType == X_GetExtensionVersion) SRepXGetExtensionVersion(client, len, (xGetExtensionVersionReply *) rep); @@ -649,7 +649,7 @@ SDeviceChangedEvent(xXIDeviceChangedEvent * from, xXIDeviceChangedEvent * to) *to = *from; memcpy(&to[1], &from[1], from->length * 4); - any = (xXIAnyInfo *) & to[1]; + any = (xXIAnyInfo *) &to[1]; for (i = 0; i < to->num_classes; i++) { int length = any->length; @@ -657,7 +657,7 @@ SDeviceChangedEvent(xXIDeviceChangedEvent * from, xXIDeviceChangedEvent * to) case KeyClass: { xXIKeyInfo *ki = (xXIKeyInfo *) any; - uint32_t *key = (uint32_t *) & ki[1]; + uint32_t *key = (uint32_t *) &ki[1]; for (j = 0; j < ki->num_keycodes; j++, key++) swapl(key); @@ -768,7 +768,7 @@ SDeviceHierarchyEvent(xXIHierarchyEvent * from, xXIHierarchyEvent * to) swapl(&to->flags); swaps(&to->num_info); - info = (xXIHierarchyInfo *) & to[1]; + info = (xXIHierarchyInfo *) &to[1]; for (i = 0; i < from->num_info; i++) { swaps(&info->deviceid); swaps(&info->attachment); @@ -842,6 +842,32 @@ STouchOwnershipEvent(xXITouchOwnershipEvent * from, xXITouchOwnershipEvent * to) swapl(&to->child); } +static void +SBarrierEvent(xXIBarrierEvent * from, + xXIBarrierEvent * to) { + + *to = *from; + + swaps(&from->sequenceNumber); + swapl(&from->length); + swaps(&from->evtype); + swapl(&from->time); + swaps(&from->deviceid); + swaps(&from->sourceid); + swapl(&from->event); + swapl(&from->root); + swapl(&from->root_x); + swapl(&from->root_y); + + swapl(&from->dx.integral); + swapl(&from->dx.frac); + swapl(&from->dy.integral); + swapl(&from->dy.frac); + swapl(&from->dtime); + swapl(&from->barrier); + swapl(&from->eventid); +} + /** Event swapping function for XI2 events. */ void XI2EventSwap(xGenericEvent *from, xGenericEvent *to) @@ -888,6 +914,11 @@ XI2EventSwap(xGenericEvent *from, xGenericEvent *to) case XI_RawTouchEnd: SRawEvent((xXIRawEvent *) from, (xXIRawEvent *) to); break; + case XI_BarrierHit: + case XI_BarrierLeave: + SBarrierEvent((xXIBarrierEvent *) from, + (xXIBarrierEvent *) to); + break; default: ErrorF("[Xi] Unknown event type to swap. This is a bug.\n"); break; @@ -1137,6 +1168,9 @@ IResetProc(ExtensionEntry * unused) EventSwapVector[DevicePresenceNotify] = NotImplemented; EventSwapVector[DevicePropertyNotify] = NotImplemented; RestoreExtensionEvents(); + + free(xi_all_devices.name); + free(xi_all_master_devices.name); } /*********************************************************************** @@ -1263,6 +1297,9 @@ XInputExtensionInit(void) if (!AddCallback(&ClientStateCallback, XIClientCallback, 0)) FatalError("Failed to add callback to XI.\n"); + if (!XIBarrierInit()) + FatalError("Could not initialize barriers.\n"); + extEntry = AddExtension(INAME, IEVENTS, IERRORS, ProcIDispatch, SProcIDispatch, IResetProc, StandardMinorOpcode); if (extEntry) { @@ -1298,9 +1335,9 @@ XInputExtensionInit(void) memset(&xi_all_devices, 0, sizeof(xi_all_devices)); memset(&xi_all_master_devices, 0, sizeof(xi_all_master_devices)); xi_all_devices.id = XIAllDevices; - xi_all_devices.name = "XIAllDevices"; + xi_all_devices.name = strdup("XIAllDevices"); xi_all_master_devices.id = XIAllMasterDevices; - xi_all_master_devices.name = "XIAllMasterDevices"; + xi_all_master_devices.name = strdup("XIAllMasterDevices"); inputInfo.all_devices = &xi_all_devices; inputInfo.all_master_devices = &xi_all_master_devices; diff --git a/xserver/Xi/getbmap.c b/xserver/Xi/getbmap.c index a0ec1a61b..49b868889 100644 --- a/xserver/Xi/getbmap.c +++ b/xserver/Xi/getbmap.c @@ -92,11 +92,13 @@ ProcXGetDeviceButtonMapping(ClientPtr client) REQUEST(xGetDeviceButtonMappingReq); REQUEST_SIZE_MATCH(xGetDeviceButtonMappingReq); - rep.repType = X_Reply; - rep.RepType = X_GetDeviceButtonMapping; - rep.nElts = 0; - rep.length = 0; - rep.sequenceNumber = client->sequence; + rep = (xGetDeviceButtonMappingReply) { + .repType = X_Reply, + .RepType = X_GetDeviceButtonMapping, + .sequenceNumber = client->sequence, + .nElts = 0, + .length = 0 + }; rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess); if (rc != Success) @@ -109,7 +111,7 @@ ProcXGetDeviceButtonMapping(ClientPtr client) rep.nElts = b->numButtons; rep.length = bytes_to_int32(rep.nElts); WriteReplyToClient(client, sizeof(xGetDeviceButtonMappingReply), &rep); - (void) WriteToClient(client, rep.nElts, (char *) &b->map[1]); + WriteToClient(client, rep.nElts, &b->map[1]); return Success; } @@ -126,5 +128,5 @@ SRepXGetDeviceButtonMapping(ClientPtr client, int size, { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xserver/Xi/getdctl.c b/xserver/Xi/getdctl.c index 4d66a4dfc..6f73e0979 100644 --- a/xserver/Xi/getdctl.c +++ b/xserver/Xi/getdctl.c @@ -158,7 +158,7 @@ SRepXGetDeviceControl(ClientPtr client, int size, xGetDeviceControlReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } /*********************************************************************** @@ -182,10 +182,12 @@ ProcXGetDeviceControl(ClientPtr client) if (rc != Success) return rc; - rep.repType = X_Reply; - rep.RepType = X_GetDeviceControl; - rep.length = 0; - rep.sequenceNumber = client->sequence; + rep = (xGetDeviceControlReply) { + .repType = X_Reply, + .RepType = X_GetDeviceControl, + .sequenceNumber = client->sequence, + .length = 0 + }; switch (stuff->control) { case DEVICE_RESOLUTION: diff --git a/xserver/Xi/getfctl.c b/xserver/Xi/getfctl.c index 2772c0c26..599b2ef97 100644 --- a/xserver/Xi/getfctl.c +++ b/xserver/Xi/getfctl.c @@ -265,7 +265,7 @@ SRepXGetFeedbackControl(ClientPtr client, int size, swaps(&rep->sequenceNumber); swapl(&rep->length); swaps(&rep->num_feedbacks); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } /*********************************************************************** @@ -295,11 +295,13 @@ ProcXGetFeedbackControl(ClientPtr client) if (rc != Success) return rc; - rep.repType = X_Reply; - rep.RepType = X_GetFeedbackControl; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.num_feedbacks = 0; + rep = (xGetFeedbackControlReply) { + .repType = X_Reply, + .RepType = X_GetFeedbackControl, + .sequenceNumber = client->sequence, + .length = 0, + .num_feedbacks = 0 + }; for (k = dev->kbdfeed; k; k = k->next) { rep.num_feedbacks++; diff --git a/xserver/Xi/getfocus.c b/xserver/Xi/getfocus.c index ba36e37e3..40546cb84 100644 --- a/xserver/Xi/getfocus.c +++ b/xserver/Xi/getfocus.c @@ -99,10 +99,12 @@ ProcXGetDeviceFocus(ClientPtr client) if (!dev->focus) return BadDevice; - rep.repType = X_Reply; - rep.RepType = X_GetDeviceFocus; - rep.length = 0; - rep.sequenceNumber = client->sequence; + rep = (xGetDeviceFocusReply) { + .repType = X_Reply, + .RepType = X_GetDeviceFocus, + .sequenceNumber = client->sequence, + .length = 0 + }; focus = dev->focus; @@ -135,5 +137,5 @@ SRepXGetDeviceFocus(ClientPtr client, int size, xGetDeviceFocusReply * rep) swapl(&rep->length); swapl(&rep->focus); swapl(&rep->time); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xserver/Xi/getkmap.c b/xserver/Xi/getkmap.c index 006be62a6..87c197759 100644 --- a/xserver/Xi/getkmap.c +++ b/xserver/Xi/getkmap.c @@ -119,11 +119,13 @@ ProcXGetDeviceKeyMapping(ClientPtr client) if (!syms) return BadAlloc; - rep.repType = X_Reply; - rep.RepType = X_GetDeviceKeyMapping; - rep.sequenceNumber = client->sequence; - rep.keySymsPerKeyCode = syms->mapWidth; - rep.length = (syms->mapWidth * stuff->count); /* KeySyms are 4 bytes */ + rep = (xGetDeviceKeyMappingReply) { + .repType = X_Reply, + .RepType = X_GetDeviceKeyMapping, + .sequenceNumber = client->sequence, + .keySymsPerKeyCode = syms->mapWidth, + .length = (syms->mapWidth * stuff->count) /* KeySyms are 4 bytes */ + }; WriteReplyToClient(client, sizeof(xGetDeviceKeyMappingReply), &rep); client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write; @@ -150,5 +152,5 @@ SRepXGetDeviceKeyMapping(ClientPtr client, int size, { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xserver/Xi/getmmap.c b/xserver/Xi/getmmap.c index 3f8424373..f07f2bb5c 100644 --- a/xserver/Xi/getmmap.c +++ b/xserver/Xi/getmmap.c @@ -101,15 +101,17 @@ ProcXGetDeviceModifierMapping(ClientPtr client) if (ret != Success) return ret; - rep.repType = X_Reply; - rep.RepType = X_GetDeviceModifierMapping; - rep.numKeyPerModifier = max_keys_per_mod; - rep.sequenceNumber = client->sequence; + rep = (xGetDeviceModifierMappingReply) { + .repType = X_Reply, + .RepType = X_GetDeviceModifierMapping, + .sequenceNumber = client->sequence, + .numKeyPerModifier = max_keys_per_mod, /* length counts 4 byte quantities - there are 8 modifiers 1 byte big */ - rep.length = max_keys_per_mod << 1; + .length = max_keys_per_mod << 1 + }; WriteReplyToClient(client, sizeof(xGetDeviceModifierMappingReply), &rep); - WriteToClient(client, max_keys_per_mod * 8, (char *) modkeymap); + WriteToClient(client, max_keys_per_mod * 8, modkeymap); free(modkeymap); @@ -129,5 +131,5 @@ SRepXGetDeviceModifierMapping(ClientPtr client, int size, { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xserver/Xi/getprop.c b/xserver/Xi/getprop.c index b7b9e6b5a..4d6ce6338 100644 --- a/xserver/Xi/getprop.c +++ b/xserver/Xi/getprop.c @@ -101,11 +101,13 @@ ProcXGetDeviceDontPropagateList(ClientPtr client) REQUEST(xGetDeviceDontPropagateListReq); REQUEST_SIZE_MATCH(xGetDeviceDontPropagateListReq); - rep.repType = X_Reply; - rep.RepType = X_GetDeviceDontPropagateList; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.count = 0; + rep = (xGetDeviceDontPropagateListReply) { + .repType = X_Reply, + .RepType = X_GetDeviceDontPropagateList, + .sequenceNumber = client->sequence, + .length = 0, + .count = 0 + }; rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) @@ -178,5 +180,5 @@ SRepXGetDeviceDontPropagateList(ClientPtr client, int size, swaps(&rep->sequenceNumber); swapl(&rep->length); swaps(&rep->count); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xserver/Xi/getselev.c b/xserver/Xi/getselev.c index 253c87fb5..60a46c2d1 100644 --- a/xserver/Xi/getselev.c +++ b/xserver/Xi/getselev.c @@ -102,12 +102,14 @@ ProcXGetSelectedExtensionEvents(ClientPtr client) REQUEST(xGetSelectedExtensionEventsReq); REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq); - rep.repType = X_Reply; - rep.RepType = X_GetSelectedExtensionEvents; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.this_client_count = 0; - rep.all_clients_count = 0; + rep = (xGetSelectedExtensionEventsReply) { + .repType = X_Reply, + .RepType = X_GetSelectedExtensionEvents, + .sequenceNumber = client->sequence, + .length = 0, + .this_client_count = 0, + .all_clients_count = 0 + }; rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) @@ -170,5 +172,5 @@ SRepXGetSelectedExtensionEvents(ClientPtr client, int size, swapl(&rep->length); swaps(&rep->this_client_count); swaps(&rep->all_clients_count); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xserver/Xi/getvers.c b/xserver/Xi/getvers.c index eb52c5b93..829e69535 100644 --- a/xserver/Xi/getvers.c +++ b/xserver/Xi/getvers.c @@ -98,14 +98,15 @@ ProcXGetExtensionVersion(ClientPtr client) stuff->nbytes)) return BadLength; - memset(&rep, 0, sizeof(xGetExtensionVersionReply)); - rep.repType = X_Reply; - rep.RepType = X_GetExtensionVersion; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.present = TRUE; - rep.major_version = XIVersion.major_version; - rep.minor_version = XIVersion.minor_version; + rep = (xGetExtensionVersionReply) { + .repType = X_Reply, + .RepType = X_GetExtensionVersion, + .sequenceNumber = client->sequence, + .length = 0, + .major_version = XIVersion.major_version, + .minor_version = XIVersion.minor_version, + .present = TRUE + }; WriteReplyToClient(client, sizeof(xGetExtensionVersionReply), &rep); @@ -127,5 +128,5 @@ SRepXGetExtensionVersion(ClientPtr client, int size, swapl(&rep->length); swaps(&rep->major_version); swaps(&rep->minor_version); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xserver/Xi/grabdev.c b/xserver/Xi/grabdev.c index c904a9707..443ef56c1 100644 --- a/xserver/Xi/grabdev.c +++ b/xserver/Xi/grabdev.c @@ -113,10 +113,12 @@ ProcXGrabDevice(ClientPtr client) bytes_to_int32(sizeof(xGrabDeviceReq)) + stuff->event_count) return BadLength; - rep.repType = X_Reply; - rep.RepType = X_GrabDevice; - rep.sequenceNumber = client->sequence; - rep.length = 0; + rep = (xGrabDeviceReply) { + .repType = X_Reply, + .RepType = X_GrabDevice, + .sequenceNumber = client->sequence, + .length = 0, + }; rc = dixLookupDevice(&dev, stuff->deviceid, client, DixGrabAccess); if (rc != Success) @@ -211,5 +213,5 @@ SRepXGrabDevice(ClientPtr client, int size, xGrabDeviceReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xserver/Xi/grabdevb.c b/xserver/Xi/grabdevb.c index 0f0e975a0..8b4ae698e 100644 --- a/xserver/Xi/grabdevb.c +++ b/xserver/Xi/grabdevb.c @@ -137,13 +137,14 @@ ProcXGrabDeviceButton(ClientPtr client) X_GrabDeviceButton)) != Success) return ret; - memset(¶m, 0, sizeof(param)); - param.grabtype = XI; - param.ownerEvents = stuff->ownerEvents; - param.this_device_mode = stuff->this_device_mode; - param.other_devices_mode = stuff->other_devices_mode; - param.grabWindow = stuff->grabWindow; - param.modifiers = stuff->modifiers; + param = (GrabParameters) { + .grabtype = XI, + .ownerEvents = stuff->ownerEvents, + .this_device_mode = stuff->this_device_mode, + .other_devices_mode = stuff->other_devices_mode, + .grabWindow = stuff->grabWindow, + .modifiers = stuff->modifiers + }; mask.xi = tmp[stuff->grabbed_device].mask; ret = GrabButton(client, dev, mdev, stuff->button, ¶m, XI, &mask); diff --git a/xserver/Xi/grabdevk.c b/xserver/Xi/grabdevk.c index b75518211..8694f9e6d 100644 --- a/xserver/Xi/grabdevk.c +++ b/xserver/Xi/grabdevk.c @@ -135,13 +135,14 @@ ProcXGrabDeviceKey(ClientPtr client) X_GrabDeviceKey)) != Success) return ret; - memset(¶m, 0, sizeof(param)); - param.grabtype = XI; - param.ownerEvents = stuff->ownerEvents; - param.this_device_mode = stuff->this_device_mode; - param.other_devices_mode = stuff->other_devices_mode; - param.grabWindow = stuff->grabWindow; - param.modifiers = stuff->modifiers; + param = (GrabParameters) { + .grabtype = XI, + .ownerEvents = stuff->ownerEvents, + .this_device_mode = stuff->this_device_mode, + .other_devices_mode = stuff->other_devices_mode, + .grabWindow = stuff->grabWindow, + .modifiers = stuff->modifiers + }; mask.xi = tmp[stuff->grabbed_device].mask; ret = GrabKey(client, dev, mdev, stuff->key, ¶m, XI, &mask); diff --git a/xserver/Xi/gtmotion.c b/xserver/Xi/gtmotion.c index 48bc79af4..cde5351a6 100644 --- a/xserver/Xi/gtmotion.c +++ b/xserver/Xi/gtmotion.c @@ -110,13 +110,15 @@ ProcXGetDeviceMotionEvents(ClientPtr client) if (dev->valuator->motionHintWindow) MaybeStopDeviceHint(dev, client); axes = v->numAxes; - rep.repType = X_Reply; - rep.RepType = X_GetDeviceMotionEvents; - rep.sequenceNumber = client->sequence; - rep.nEvents = 0; - rep.axes = axes; - rep.mode = Absolute; /* XXX we don't do relative at the moment */ - rep.length = 0; + rep = (xGetDeviceMotionEventsReply) { + .repType = X_Reply, + .RepType = X_GetDeviceMotionEvents, + .sequenceNumber = client->sequence, + .length = 0, + .nEvents = 0, + .axes = axes, + .mode = Absolute /* XXX we don't do relative at the moment */ + }; start = ClientTimeToServerTime(stuff->start); stop = ClientTimeToServerTime(stuff->stop); if (CompareTimeStamps(start, stop) == LATER || @@ -129,7 +131,7 @@ ProcXGetDeviceMotionEvents(ClientPtr client) num_events = v->numMotionEvents; if (num_events) { size = sizeof(Time) + (axes * sizeof(INT32)); - rep.nEvents = GetMotionHistory(dev, (xTimecoord **) & coords, /* XXX */ + rep.nEvents = GetMotionHistory(dev, (xTimecoord **) &coords, /* XXX */ start.milliseconds, stop.milliseconds, (ScreenPtr) NULL, FALSE); } @@ -147,7 +149,7 @@ ProcXGetDeviceMotionEvents(ClientPtr client) bufptr++; } } - WriteToClient(client, length * 4, (char *) coords); + WriteToClient(client, length * 4, coords); } free(coords); return Success; @@ -167,5 +169,5 @@ SRepXGetDeviceMotionEvents(ClientPtr client, int size, swaps(&rep->sequenceNumber); swapl(&rep->length); swapl(&rep->nEvents); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xserver/Xi/listdev.c b/xserver/Xi/listdev.c index a02112f32..014c61db0 100644 --- a/xserver/Xi/listdev.c +++ b/xserver/Xi/listdev.c @@ -342,11 +342,12 @@ ProcXListInputDevices(ClientPtr client) REQUEST_SIZE_MATCH(xListInputDevicesReq); - memset(&rep, 0, sizeof(xListInputDevicesReply)); - rep.repType = X_Reply; - rep.RepType = X_ListInputDevices; - rep.length = 0; - rep.sequenceNumber = client->sequence; + rep = (xListInputDevicesReply) { + .repType = X_Reply, + .RepType = X_ListInputDevices, + .sequenceNumber = client->sequence, + .length = 0 + }; /* allocate space for saving skip value */ skip = calloc(sizeof(Bool), inputInfo.numDevices); @@ -417,5 +418,5 @@ SRepXListInputDevices(ClientPtr client, int size, xListInputDevicesReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xserver/Xi/opendev.c b/xserver/Xi/opendev.c index e7c00a236..6708bade1 100644 --- a/xserver/Xi/opendev.c +++ b/xserver/Xi/opendev.c @@ -117,10 +117,6 @@ ProcXOpenDevice(ClientPtr client) if (status != Success) return status; - memset(&rep, 0, sizeof(xOpenDeviceReply)); - rep.repType = X_Reply; - rep.RepType = X_OpenDevice; - rep.sequenceNumber = client->sequence; if (dev->key != NULL) { evbase[j].class = KeyClass; evbase[j++].event_type_base = event_base[KeyClass]; @@ -148,10 +144,15 @@ ProcXOpenDevice(ClientPtr client) } evbase[j].class = OtherClass; evbase[j++].event_type_base = event_base[OtherClass]; - rep.length = bytes_to_int32(j * sizeof(xInputClassInfo)); - rep.num_classes = j; + rep = (xOpenDeviceReply) { + .repType = X_Reply, + .RepType = X_OpenDevice, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(j * sizeof(xInputClassInfo)), + .num_classes = j + }; WriteReplyToClient(client, sizeof(xOpenDeviceReply), &rep); - WriteToClient(client, j * sizeof(xInputClassInfo), (char *) evbase); + WriteToClient(client, j * sizeof(xInputClassInfo), evbase); return Success; } @@ -167,5 +168,5 @@ SRepXOpenDevice(ClientPtr client, int size, xOpenDeviceReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xserver/Xi/queryst.c b/xserver/Xi/queryst.c index ffb6de04a..04a652be3 100644 --- a/xserver/Xi/queryst.c +++ b/xserver/Xi/queryst.c @@ -87,11 +87,6 @@ ProcXQueryDeviceState(ClientPtr client) REQUEST(xQueryDeviceStateReq); REQUEST_SIZE_MATCH(xQueryDeviceStateReq); - rep.repType = X_Reply; - rep.RepType = X_QueryDeviceState; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rc = dixLookupDevice(&dev, stuff->deviceid, client, DixReadAccess); if (rc != Success && rc != BadAccess) return rc; @@ -163,8 +158,13 @@ ProcXQueryDeviceState(ClientPtr client) } } - rep.num_classes = num_classes; - rep.length = bytes_to_int32(total_length); + rep = (xQueryDeviceStateReply) { + .repType = X_Reply, + .RepType = X_QueryDeviceState, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(total_length), + .num_classes = num_classes + }; WriteReplyToClient(client, sizeof(xQueryDeviceStateReply), &rep); if (total_length > 0) WriteToClient(client, total_length, savbuf); @@ -184,5 +184,5 @@ SRepXQueryDeviceState(ClientPtr client, int size, xQueryDeviceStateReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xserver/Xi/setbmap.c b/xserver/Xi/setbmap.c index 110f5e91e..94796558d 100644 --- a/xserver/Xi/setbmap.c +++ b/xserver/Xi/setbmap.c @@ -100,11 +100,13 @@ ProcXSetDeviceButtonMapping(ClientPtr client) if (ret != Success) return ret; - rep.repType = X_Reply; - rep.RepType = X_SetDeviceButtonMapping; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.status = MappingSuccess; + rep = (xSetDeviceButtonMappingReply) { + .repType = X_Reply, + .RepType = X_SetDeviceButtonMapping, + .sequenceNumber = client->sequence, + .length = 0, + .status = MappingSuccess + }; ret = ApplyPointerMapping(dev, (CARD8 *) &stuff[1], stuff->map_length, @@ -134,5 +136,5 @@ SRepXSetDeviceButtonMapping(ClientPtr client, int size, { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xserver/Xi/setdval.c b/xserver/Xi/setdval.c index 542f20dd8..4c9c99f55 100644 --- a/xserver/Xi/setdval.c +++ b/xserver/Xi/setdval.c @@ -92,11 +92,13 @@ ProcXSetDeviceValuators(ClientPtr client) REQUEST(xSetDeviceValuatorsReq); REQUEST_AT_LEAST_SIZE(xSetDeviceValuatorsReq); - rep.repType = X_Reply; - rep.RepType = X_SetDeviceValuators; - rep.length = 0; - rep.status = Success; - rep.sequenceNumber = client->sequence; + rep = (xSetDeviceValuatorsReply) { + .repType = X_Reply, + .RepType = X_SetDeviceValuators, + .sequenceNumber = client->sequence, + .length = 0, + .status = Success + }; if (stuff->length != bytes_to_int32(sizeof(xSetDeviceValuatorsReq)) + stuff->num_valuators) @@ -138,5 +140,5 @@ SRepXSetDeviceValuators(ClientPtr client, int size, { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xserver/Xi/setmmap.c b/xserver/Xi/setmmap.c index 36845d706..1320cfec7 100644 --- a/xserver/Xi/setmmap.c +++ b/xserver/Xi/setmmap.c @@ -98,10 +98,12 @@ ProcXSetDeviceModifierMapping(ClientPtr client) (stuff->numKeyPerModifier << 1)) return BadLength; - rep.repType = X_Reply; - rep.RepType = X_SetDeviceModifierMapping; - rep.length = 0; - rep.sequenceNumber = client->sequence; + rep = (xSetDeviceModifierMappingReply) { + .repType = X_Reply, + .RepType = X_SetDeviceModifierMapping, + .sequenceNumber = client->sequence, + .length = 0 + }; ret = dixLookupDevice(&dev, stuff->deviceid, client, DixManageAccess); if (ret != Success) @@ -140,5 +142,5 @@ SRepXSetDeviceModifierMapping(ClientPtr client, int size, { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xserver/Xi/setmode.c b/xserver/Xi/setmode.c index a7bf1eaff..535655257 100644 --- a/xserver/Xi/setmode.c +++ b/xserver/Xi/setmode.c @@ -92,10 +92,12 @@ ProcXSetDeviceMode(ClientPtr client) REQUEST(xSetDeviceModeReq); REQUEST_SIZE_MATCH(xSetDeviceModeReq); - rep.repType = X_Reply; - rep.RepType = X_SetDeviceMode; - rep.length = 0; - rep.sequenceNumber = client->sequence; + rep = (xSetDeviceModeReply) { + .repType = X_Reply, + .RepType = X_SetDeviceMode, + .sequenceNumber = client->sequence, + .length = 0 + }; rc = dixLookupDevice(&dev, stuff->deviceid, client, DixSetAttrAccess); if (rc != Success) @@ -137,5 +139,5 @@ SRepXSetDeviceMode(ClientPtr client, int size, xSetDeviceModeReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xserver/Xi/xibarriers.c b/xserver/Xi/xibarriers.c new file mode 100644 index 000000000..fccab8615 --- /dev/null +++ b/xserver/Xi/xibarriers.c @@ -0,0 +1,919 @@ +/* + * Copyright 2012 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Copyright © 2002 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. Keith Packard makes no + * representations about the suitability of this software for any purpose. It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#include "xibarriers.h" +#include "scrnintstr.h" +#include "cursorstr.h" +#include "dixevents.h" +#include "servermd.h" +#include "mipointer.h" +#include "inputstr.h" +#include "windowstr.h" +#include "xace.h" +#include "list.h" +#include "exglobals.h" +#include "eventstr.h" +#include "mi.h" + +RESTYPE PointerBarrierType; + +static DevPrivateKeyRec BarrierScreenPrivateKeyRec; + +#define BarrierScreenPrivateKey (&BarrierScreenPrivateKeyRec) + +typedef struct PointerBarrierClient *PointerBarrierClientPtr; + +struct PointerBarrierDevice { + struct xorg_list entry; + int deviceid; + Time last_timestamp; + int barrier_event_id; + int release_event_id; + Bool hit; + Bool seen; +}; + +struct PointerBarrierClient { + XID id; + ScreenPtr screen; + Window window; + struct PointerBarrier barrier; + struct xorg_list entry; + /* num_devices/device_ids are devices the barrier applies to */ + int num_devices; + int *device_ids; /* num_devices */ + + /* per_device keeps track of devices actually blocked by barriers */ + struct xorg_list per_device; +}; + +typedef struct _BarrierScreen { + struct xorg_list barriers; +} BarrierScreenRec, *BarrierScreenPtr; + +#define GetBarrierScreen(s) ((BarrierScreenPtr)dixLookupPrivate(&(s)->devPrivates, BarrierScreenPrivateKey)) +#define GetBarrierScreenIfSet(s) GetBarrierScreen(s) +#define SetBarrierScreen(s,p) dixSetPrivate(&(s)->devPrivates, BarrierScreenPrivateKey, p) + +static struct PointerBarrierDevice *AllocBarrierDevice(void) +{ + struct PointerBarrierDevice *pbd = NULL; + + pbd = malloc(sizeof(struct PointerBarrierDevice)); + if (!pbd) + return NULL; + + pbd->deviceid = -1; /* must be set by caller */ + pbd->barrier_event_id = 1; + pbd->release_event_id = 0; + pbd->hit = FALSE; + pbd->seen = FALSE; + xorg_list_init(&pbd->entry); + + return pbd; +} + +static void FreePointerBarrierClient(struct PointerBarrierClient *c) +{ + struct PointerBarrierDevice *pbd = NULL, *tmp = NULL; + + xorg_list_for_each_entry_safe(pbd, tmp, &c->per_device, entry) { + free(pbd); + } + free(c); +} + +static struct PointerBarrierDevice *GetBarrierDevice(struct PointerBarrierClient *c, int deviceid) +{ + struct PointerBarrierDevice *pbd = NULL; + + xorg_list_for_each_entry(pbd, &c->per_device, entry) { + if (pbd->deviceid == deviceid) + break; + } + + BUG_WARN(!pbd); + return pbd; +} + +static BOOL +barrier_is_horizontal(const struct PointerBarrier *barrier) +{ + return barrier->y1 == barrier->y2; +} + +static BOOL +barrier_is_vertical(const struct PointerBarrier *barrier) +{ + return barrier->x1 == barrier->x2; +} + +/** + * @return The set of barrier movement directions the movement vector + * x1/y1 → x2/y2 represents. + */ +int +barrier_get_direction(int x1, int y1, int x2, int y2) +{ + int direction = 0; + + /* which way are we trying to go */ + if (x2 > x1) + direction |= BarrierPositiveX; + if (x2 < x1) + direction |= BarrierNegativeX; + if (y2 > y1) + direction |= BarrierPositiveY; + if (y2 < y1) + direction |= BarrierNegativeY; + + return direction; +} + +/** + * Test if the barrier may block movement in the direction defined by + * x1/y1 → x2/y2. This function only tests whether the directions could be + * blocked, it does not test if the barrier actually blocks the movement. + * + * @return TRUE if the barrier blocks the direction of movement or FALSE + * otherwise. + */ +BOOL +barrier_is_blocking_direction(const struct PointerBarrier * barrier, + int direction) +{ + /* Barriers define which way is ok, not which way is blocking */ + return (barrier->directions & direction) != direction; +} + +static BOOL +inside_segment(int v, int v1, int v2) +{ + if (v1 < 0 && v2 < 0) /* line */ + return TRUE; + else if (v1 < 0) /* ray */ + return v <= v2; + else if (v2 < 0) /* ray */ + return v >= v1; + else /* line segment */ + return v >= v1 && v <= v2; +} + +#define T(v, a, b) (((float)v) - (a)) / ((b) - (a)) +#define F(t, a, b) ((t) * ((a) - (b)) + (a)) + +/** + * Test if the movement vector x1/y1 → x2/y2 is intersecting with the + * barrier. A movement vector with the startpoint or endpoint adjacent to + * the barrier itself counts as intersecting. + * + * @param x1 X start coordinate of movement vector + * @param y1 Y start coordinate of movement vector + * @param x2 X end coordinate of movement vector + * @param y2 Y end coordinate of movement vector + * @param[out] distance The distance between the start point and the + * intersection with the barrier (if applicable). + * @return TRUE if the barrier intersects with the given vector + */ +BOOL +barrier_is_blocking(const struct PointerBarrier * barrier, + int x1, int y1, int x2, int y2, double *distance) +{ + if (barrier_is_vertical(barrier)) { + float t, y; + t = T(barrier->x1, x1, x2); + if (t < 0 || t > 1) + return FALSE; + + /* Edge case: moving away from barrier. */ + if (x2 > x1 && t == 0) + return FALSE; + + y = F(t, y1, y2); + if (!inside_segment(y, barrier->y1, barrier->y2)) + return FALSE; + + *distance = sqrt((pow(y - y1, 2) + pow(barrier->x1 - x1, 2))); + return TRUE; + } + else { + float t, x; + t = T(barrier->y1, y1, y2); + if (t < 0 || t > 1) + return FALSE; + + /* Edge case: moving away from barrier. */ + if (y2 > y1 && t == 0) + return FALSE; + + x = F(t, x1, x2); + if (!inside_segment(x, barrier->x1, barrier->x2)) + return FALSE; + + *distance = sqrt((pow(x - x1, 2) + pow(barrier->y1 - y1, 2))); + return TRUE; + } +} + +#define HIT_EDGE_EXTENTS 2 +static BOOL +barrier_inside_hit_box(struct PointerBarrier *barrier, int x, int y) +{ + int x1, x2, y1, y2; + int dir; + + x1 = barrier->x1; + x2 = barrier->x2; + y1 = barrier->y1; + y2 = barrier->y2; + dir = ~(barrier->directions); + + if (barrier_is_vertical(barrier)) { + if (dir & BarrierPositiveX) + x1 -= HIT_EDGE_EXTENTS; + if (dir & BarrierNegativeX) + x2 += HIT_EDGE_EXTENTS; + } + if (barrier_is_horizontal(barrier)) { + if (dir & BarrierPositiveY) + y1 -= HIT_EDGE_EXTENTS; + if (dir & BarrierNegativeY) + y2 += HIT_EDGE_EXTENTS; + } + + return x >= x1 && x <= x2 && y >= y1 && y <= y2; +} + +static BOOL +barrier_blocks_device(struct PointerBarrierClient *client, + DeviceIntPtr dev) +{ + int i; + int master_id; + + /* Clients with no devices are treated as + * if they specified XIAllDevices. */ + if (client->num_devices == 0) + return TRUE; + + master_id = GetMaster(dev, POINTER_OR_FLOAT)->id; + + for (i = 0; i < client->num_devices; i++) { + int device_id = client->device_ids[i]; + if (device_id == XIAllDevices || + device_id == XIAllMasterDevices || + device_id == master_id) + return TRUE; + } + + return FALSE; +} + +/** + * Find the nearest barrier client that is blocking movement from x1/y1 to x2/y2. + * + * @param dir Only barriers blocking movement in direction dir are checked + * @param x1 X start coordinate of movement vector + * @param y1 Y start coordinate of movement vector + * @param x2 X end coordinate of movement vector + * @param y2 Y end coordinate of movement vector + * @return The barrier nearest to the movement origin that blocks this movement. + */ +static struct PointerBarrierClient * +barrier_find_nearest(BarrierScreenPtr cs, DeviceIntPtr dev, + int dir, + int x1, int y1, int x2, int y2) +{ + struct PointerBarrierClient *c, *nearest = NULL; + double min_distance = INT_MAX; /* can't get higher than that in X anyway */ + + xorg_list_for_each_entry(c, &cs->barriers, entry) { + struct PointerBarrier *b = &c->barrier; + struct PointerBarrierDevice *pbd; + double distance; + + pbd = GetBarrierDevice(c, dev->id); + if (pbd->seen) + continue; + + if (!barrier_is_blocking_direction(b, dir)) + continue; + + if (!barrier_blocks_device(c, dev)) + continue; + + if (barrier_is_blocking(b, x1, y1, x2, y2, &distance)) { + if (min_distance > distance) { + min_distance = distance; + nearest = c; + } + } + } + + return nearest; +} + +/** + * Clamp to the given barrier given the movement direction specified in dir. + * + * @param barrier The barrier to clamp to + * @param dir The movement direction + * @param[out] x The clamped x coordinate. + * @param[out] y The clamped x coordinate. + */ +void +barrier_clamp_to_barrier(struct PointerBarrier *barrier, int dir, int *x, + int *y) +{ + if (barrier_is_vertical(barrier)) { + if ((dir & BarrierNegativeX) & ~barrier->directions) + *x = barrier->x1; + if ((dir & BarrierPositiveX) & ~barrier->directions) + *x = barrier->x1 - 1; + } + if (barrier_is_horizontal(barrier)) { + if ((dir & BarrierNegativeY) & ~barrier->directions) + *y = barrier->y1; + if ((dir & BarrierPositiveY) & ~barrier->directions) + *y = barrier->y1 - 1; + } +} + +void +input_constrain_cursor(DeviceIntPtr dev, ScreenPtr screen, + int current_x, int current_y, + int dest_x, int dest_y, + int *out_x, int *out_y, + int *nevents, InternalEvent* events) +{ + /* Clamped coordinates here refer to screen edge clamping. */ + BarrierScreenPtr cs = GetBarrierScreen(screen); + int x = dest_x, + y = dest_y; + int dir; + struct PointerBarrier *nearest = NULL; + PointerBarrierClientPtr c; + Time ms = GetTimeInMillis(); + BarrierEvent ev = { + .header = ET_Internal, + .type = 0, + .length = sizeof (BarrierEvent), + .time = ms, + .deviceid = dev->id, + .sourceid = dev->id, + .dx = dest_x - current_x, + .dy = dest_y - current_y, + .root = screen->root->drawable.id, + }; + InternalEvent *barrier_events = events; + DeviceIntPtr master; + + if (nevents) + *nevents = 0; + + if (xorg_list_is_empty(&cs->barriers) || IsFloating(dev)) + goto out; + + /** + * This function is only called for slave devices, but pointer-barriers + * are for master-devices only. Flip the device to the master here, + * continue with that. + */ + master = GetMaster(dev, MASTER_POINTER); + + /* How this works: + * Given the origin and the movement vector, get the nearest barrier + * to the origin that is blocking the movement. + * Clamp to that barrier. + * Then, check from the clamped intersection to the original + * destination, again finding the nearest barrier and clamping. + */ + dir = barrier_get_direction(current_x, current_y, x, y); + + while (dir != 0) { + int new_sequence; + struct PointerBarrierDevice *pbd; + + c = barrier_find_nearest(cs, master, dir, current_x, current_y, x, y); + if (!c) + break; + + nearest = &c->barrier; + + pbd = GetBarrierDevice(c, master->id); + new_sequence = !pbd->hit; + + pbd->seen = TRUE; + pbd->hit = TRUE; + + if (pbd->barrier_event_id == pbd->release_event_id) + continue; + + ev.type = ET_BarrierHit; + barrier_clamp_to_barrier(nearest, dir, &x, &y); + + if (barrier_is_vertical(nearest)) { + dir &= ~(BarrierNegativeX | BarrierPositiveX); + current_x = x; + } + else if (barrier_is_horizontal(nearest)) { + dir &= ~(BarrierNegativeY | BarrierPositiveY); + current_y = y; + } + + ev.flags = 0; + ev.event_id = pbd->barrier_event_id; + ev.barrierid = c->id; + + ev.dt = new_sequence ? 0 : ms - pbd->last_timestamp; + ev.window = c->window; + pbd->last_timestamp = ms; + + /* root x/y is filled in later */ + + barrier_events->barrier_event = ev; + barrier_events++; + *nevents += 1; + } + + xorg_list_for_each_entry(c, &cs->barriers, entry) { + struct PointerBarrierDevice *pbd; + int flags = 0; + + pbd = GetBarrierDevice(c, master->id); + pbd->seen = FALSE; + if (!pbd->hit) + continue; + + if (barrier_inside_hit_box(&c->barrier, x, y)) + continue; + + pbd->hit = FALSE; + + ev.type = ET_BarrierLeave; + + if (pbd->barrier_event_id == pbd->release_event_id) + flags |= XIBarrierPointerReleased; + + ev.flags = flags; + ev.event_id = pbd->barrier_event_id; + ev.barrierid = c->id; + + ev.dt = ms - pbd->last_timestamp; + ev.window = c->window; + pbd->last_timestamp = ms; + + /* root x/y is filled in later */ + + barrier_events->barrier_event = ev; + barrier_events++; + *nevents += 1; + + /* If we've left the hit box, this is the + * start of a new event ID. */ + pbd->barrier_event_id++; + } + + out: + *out_x = x; + *out_y = y; +} + +static void +sort_min_max(INT16 *a, INT16 *b) +{ + INT16 A, B; + if (*a < 0 || *b < 0) + return; + A = *a; + B = *b; + *a = min(A, B); + *b = max(A, B); +} + +static int +CreatePointerBarrierClient(ClientPtr client, + xXFixesCreatePointerBarrierReq * stuff, + PointerBarrierClientPtr *client_out) +{ + WindowPtr pWin; + ScreenPtr screen; + BarrierScreenPtr cs; + int err; + int size; + int i; + struct PointerBarrierClient *ret; + CARD16 *in_devices; + DeviceIntPtr dev; + + size = sizeof(*ret) + sizeof(DeviceIntPtr) * stuff->num_devices; + ret = malloc(size); + + if (!ret) { + return BadAlloc; + } + + xorg_list_init(&ret->per_device); + + err = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess); + if (err != Success) { + client->errorValue = stuff->window; + goto error; + } + + screen = pWin->drawable.pScreen; + cs = GetBarrierScreen(screen); + + ret->screen = screen; + ret->window = stuff->window; + ret->num_devices = stuff->num_devices; + if (ret->num_devices > 0) + ret->device_ids = (int*)&ret[1]; + else + ret->device_ids = NULL; + + in_devices = (CARD16 *) &stuff[1]; + for (i = 0; i < stuff->num_devices; i++) { + int device_id = in_devices[i]; + DeviceIntPtr device; + + if ((err = dixLookupDevice (&device, device_id, + client, DixReadAccess))) { + client->errorValue = device_id; + goto error; + } + + if (!IsMaster (device)) { + client->errorValue = device_id; + err = BadDevice; + goto error; + } + + ret->device_ids[i] = device_id; + } + + /* Alloc one per master pointer, they're the ones that can be blocked */ + xorg_list_init(&ret->per_device); + nt_list_for_each_entry(dev, inputInfo.devices, next) { + struct PointerBarrierDevice *pbd; + + if (dev->type != MASTER_POINTER) + continue; + + pbd = AllocBarrierDevice(); + if (!pbd) { + err = BadAlloc; + goto error; + } + pbd->deviceid = dev->id; + + xorg_list_add(&pbd->entry, &ret->per_device); + } + + ret->id = stuff->barrier; + ret->barrier.x1 = stuff->x1; + ret->barrier.x2 = stuff->x2; + ret->barrier.y1 = stuff->y1; + ret->barrier.y2 = stuff->y2; + sort_min_max(&ret->barrier.x1, &ret->barrier.x2); + sort_min_max(&ret->barrier.y1, &ret->barrier.y2); + ret->barrier.directions = stuff->directions & 0x0f; + if (barrier_is_horizontal(&ret->barrier)) + ret->barrier.directions &= ~(BarrierPositiveX | BarrierNegativeX); + if (barrier_is_vertical(&ret->barrier)) + ret->barrier.directions &= ~(BarrierPositiveY | BarrierNegativeY); + xorg_list_add(&ret->entry, &cs->barriers); + + *client_out = ret; + return Success; + + error: + *client_out = NULL; + FreePointerBarrierClient(ret); + return err; +} + +static int +BarrierFreeBarrier(void *data, XID id) +{ + struct PointerBarrierClient *c; + Time ms = GetTimeInMillis(); + DeviceIntPtr dev = NULL; + ScreenPtr screen; + + c = container_of(data, struct PointerBarrierClient, barrier); + screen = c->screen; + + for (dev = inputInfo.devices; dev; dev = dev->next) { + struct PointerBarrierDevice *pbd; + int root_x, root_y; + BarrierEvent ev = { + .header = ET_Internal, + .type = ET_BarrierLeave, + .length = sizeof (BarrierEvent), + .time = ms, + /* .deviceid */ + .sourceid = 0, + .barrierid = c->id, + .window = c->window, + .root = screen->root->drawable.id, + .dx = 0, + .dy = 0, + /* .root_x */ + /* .root_y */ + /* .dt */ + /* .event_id */ + .flags = XIBarrierPointerReleased, + }; + + + if (dev->type != MASTER_POINTER) + continue; + + pbd = GetBarrierDevice(c, dev->id); + if (!pbd->hit) + continue; + + ev.deviceid = dev->id; + ev.event_id = pbd->barrier_event_id; + ev.dt = ms - pbd->last_timestamp; + + GetSpritePosition(dev, &root_x, &root_y); + ev.root_x = root_x; + ev.root_y = root_y; + + mieqEnqueue(dev, (InternalEvent *) &ev); + } + + xorg_list_del(&c->entry); + + FreePointerBarrierClient(c); + return Success; +} + +static void add_master_func(pointer res, XID id, pointer devid) +{ + struct PointerBarrier *b; + struct PointerBarrierClient *barrier; + struct PointerBarrierDevice *pbd; + int *deviceid = devid; + + b = res; + barrier = container_of(b, struct PointerBarrierClient, barrier); + + + pbd = AllocBarrierDevice(); + pbd->deviceid = *deviceid; + + xorg_list_add(&pbd->entry, &barrier->per_device); +} + +static void remove_master_func(pointer res, XID id, pointer devid) +{ + struct PointerBarrierDevice *pbd; + struct PointerBarrierClient *barrier; + struct PointerBarrier *b; + DeviceIntPtr dev; + int *deviceid = devid; + int rc; + Time ms = GetTimeInMillis(); + + rc = dixLookupDevice(&dev, *deviceid, serverClient, DixSendAccess); + if (rc != Success) + return; + + b = res; + barrier = container_of(b, struct PointerBarrierClient, barrier); + + pbd = GetBarrierDevice(barrier, *deviceid); + + if (pbd->hit) { + BarrierEvent ev = { + .header = ET_Internal, + .type =ET_BarrierLeave, + .length = sizeof (BarrierEvent), + .time = ms, + .deviceid = *deviceid, + .sourceid = 0, + .dx = 0, + .dy = 0, + .root = barrier->screen->root->drawable.id, + .window = barrier->window, + .dt = ms - pbd->last_timestamp, + .flags = XIBarrierPointerReleased, + .event_id = pbd->barrier_event_id, + .barrierid = barrier->id, + }; + + mieqEnqueue(dev, (InternalEvent *) &ev); + } + + xorg_list_del(&pbd->entry); + free(pbd); +} + +void XIBarrierNewMasterDevice(ClientPtr client, int deviceid) +{ + FindClientResourcesByType(client, PointerBarrierType, add_master_func, &deviceid); +} + +void XIBarrierRemoveMasterDevice(ClientPtr client, int deviceid) +{ + FindClientResourcesByType(client, PointerBarrierType, remove_master_func, &deviceid); +} + +int +XICreatePointerBarrier(ClientPtr client, + xXFixesCreatePointerBarrierReq * stuff) +{ + int err; + struct PointerBarrierClient *barrier; + struct PointerBarrier b; + + b.x1 = stuff->x1; + b.x2 = stuff->x2; + b.y1 = stuff->y1; + b.y2 = stuff->y2; + + if (!barrier_is_horizontal(&b) && !barrier_is_vertical(&b)) + return BadValue; + + /* no 0-sized barriers */ + if (barrier_is_horizontal(&b) && barrier_is_vertical(&b)) + return BadValue; + + /* no infinite barriers on the wrong axis */ + if (barrier_is_horizontal(&b) && (b.y1 < 0 || b.y2 < 0)) + return BadValue; + + if (barrier_is_vertical(&b) && (b.x1 < 0 || b.x2 < 0)) + return BadValue; + + if ((err = CreatePointerBarrierClient(client, stuff, &barrier))) + return err; + + if (!AddResource(stuff->barrier, PointerBarrierType, &barrier->barrier)) + return BadAlloc; + + return Success; +} + +int +XIDestroyPointerBarrier(ClientPtr client, + xXFixesDestroyPointerBarrierReq * stuff) +{ + int err; + void *barrier; + + err = dixLookupResourceByType((void **) &barrier, stuff->barrier, + PointerBarrierType, client, DixDestroyAccess); + if (err != Success) { + client->errorValue = stuff->barrier; + return err; + } + + if (CLIENT_ID(stuff->barrier) != client->index) + return BadAccess; + + FreeResource(stuff->barrier, RT_NONE); + return Success; +} + +int +SProcXIBarrierReleasePointer(ClientPtr client) +{ + xXIBarrierReleasePointerInfo *info; + REQUEST(xXIBarrierReleasePointerReq); + int i; + + info = (xXIBarrierReleasePointerInfo*) &stuff[1]; + + swaps(&stuff->length); + swapl(&stuff->num_barriers); + for (i = 0; i < stuff->num_barriers; i++, info++) { + swaps(&info->deviceid); + swapl(&info->barrier); + swapl(&info->eventid); + } + + return (ProcXIBarrierReleasePointer(client)); +} + +int +ProcXIBarrierReleasePointer(ClientPtr client) +{ + int i; + int err; + struct PointerBarrierClient *barrier; + struct PointerBarrier *b; + xXIBarrierReleasePointerInfo *info; + + REQUEST(xXIBarrierReleasePointerReq); + REQUEST_AT_LEAST_SIZE(xXIBarrierReleasePointerReq); + + info = (xXIBarrierReleasePointerInfo*) &stuff[1]; + for (i = 0; i < stuff->num_barriers; i++, info++) { + struct PointerBarrierDevice *pbd; + DeviceIntPtr dev; + CARD32 barrier_id, event_id; + _X_UNUSED CARD32 device_id; + + barrier_id = info->barrier; + event_id = info->eventid; + + err = dixLookupDevice(&dev, info->deviceid, client, DixReadAccess); + if (err != Success) { + client->errorValue = BadDevice; + return err; + } + + err = dixLookupResourceByType((void **) &b, barrier_id, + PointerBarrierType, client, DixReadAccess); + if (err != Success) { + client->errorValue = barrier_id; + return err; + } + + if (CLIENT_ID(barrier_id) != client->index) + return BadAccess; + + + barrier = container_of(b, struct PointerBarrierClient, barrier); + + pbd = GetBarrierDevice(barrier, dev->id); + + if (pbd->barrier_event_id == event_id) + pbd->release_event_id = event_id; + } + + return Success; +} + +Bool +XIBarrierInit(void) +{ + int i; + + if (!dixRegisterPrivateKey(&BarrierScreenPrivateKeyRec, PRIVATE_SCREEN, 0)) + return FALSE; + + for (i = 0; i < screenInfo.numScreens; i++) { + ScreenPtr pScreen = screenInfo.screens[i]; + BarrierScreenPtr cs; + + cs = (BarrierScreenPtr) calloc(1, sizeof(BarrierScreenRec)); + if (!cs) + return FALSE; + xorg_list_init(&cs->barriers); + SetBarrierScreen(pScreen, cs); + } + + PointerBarrierType = CreateNewResourceType(BarrierFreeBarrier, + "XIPointerBarrier"); + + return PointerBarrierType; +} diff --git a/xserver/Xi/xibarriers.h b/xserver/Xi/xibarriers.h new file mode 100644 index 000000000..11e84ec9f --- /dev/null +++ b/xserver/Xi/xibarriers.h @@ -0,0 +1,48 @@ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#ifndef _XIBARRIERS_H_ +#define _XIBARRIERS_H_ + +#include "resource.h" + +extern _X_EXPORT RESTYPE PointerBarrierType; + +struct PointerBarrier { + INT16 x1, x2, y1, y2; + CARD32 directions; +}; + +int +barrier_get_direction(int, int, int, int); +BOOL +barrier_is_blocking(const struct PointerBarrier *, int, int, int, int, + double *); +BOOL +barrier_is_blocking_direction(const struct PointerBarrier *, int); +void +barrier_clamp_to_barrier(struct PointerBarrier *barrier, int dir, int *x, + int *y); + +#include + +int +XICreatePointerBarrier(ClientPtr client, + xXFixesCreatePointerBarrierReq * stuff); + +int +XIDestroyPointerBarrier(ClientPtr client, + xXFixesDestroyPointerBarrierReq * stuff); + +Bool +XIBarrierInit(void); + +int SProcXIBarrierReleasePointer(ClientPtr client); +int ProcXIBarrierReleasePointer(ClientPtr client); + +void XIBarrierNewMasterDevice(ClientPtr client, int deviceid); +void XIBarrierRemoveMasterDevice(ClientPtr client, int deviceid); + +#endif /* _XIBARRIERS_H_ */ diff --git a/xserver/Xi/xichangehierarchy.c b/xserver/Xi/xichangehierarchy.c index 756aaac06..e2f4b8a0a 100644 --- a/xserver/Xi/xichangehierarchy.c +++ b/xserver/Xi/xichangehierarchy.c @@ -52,6 +52,7 @@ #include "xkbsrv.h" #include "xichangehierarchy.h" +#include "xibarriers.h" /** * Send the current state of the device hierarchy to all clients. @@ -79,7 +80,7 @@ XISendDeviceHierarchyEvent(int flags[MAXDEVICES]) ev->flags = 0; ev->num_info = inputInfo.numDevices; - info = (xXIHierarchyInfo *) & ev[1]; + info = (xXIHierarchyInfo *) &ev[1]; for (dev = inputInfo.devices; dev; dev = dev->next) { info->deviceid = dev->id; info->enabled = dev->enabled; @@ -189,6 +190,8 @@ add_master(ClientPtr client, xXIAddMasterInfo * c, int flags[MAXDEVICES]) flags[XTestptr->id] |= XISlaveAttached; flags[XTestkeybd->id] |= XISlaveAttached; + XIBarrierNewMasterDevice(client, ptr->id); + unwind: free(name); return rc; @@ -293,11 +296,7 @@ remove_master(ClientPtr client, xXIRemoveMasterInfo * r, int flags[MAXDEVICES]) } } - /* can't disable until we removed pairing */ - keybd->spriteInfo->paired = NULL; - ptr->spriteInfo->paired = NULL; - XTestptr->spriteInfo->paired = NULL; - XTestkeybd->spriteInfo->paired = NULL; + XIBarrierRemoveMasterDevice(client, ptr->id); /* disable the remove the devices, XTest devices must be done first else the sprites they rely on will be destroyed */ @@ -310,15 +309,16 @@ remove_master(ClientPtr client, xXIRemoveMasterInfo * r, int flags[MAXDEVICES]) flags[keybd->id] |= XIDeviceDisabled; flags[ptr->id] |= XIDeviceDisabled; - RemoveDevice(XTestptr, FALSE); - RemoveDevice(XTestkeybd, FALSE); - RemoveDevice(keybd, FALSE); - RemoveDevice(ptr, FALSE); flags[XTestptr->id] |= XISlaveRemoved; flags[XTestkeybd->id] |= XISlaveRemoved; flags[keybd->id] |= XIMasterRemoved; flags[ptr->id] |= XIMasterRemoved; + RemoveDevice(XTestptr, FALSE); + RemoveDevice(XTestkeybd, FALSE); + RemoveDevice(keybd, FALSE); + RemoveDevice(ptr, FALSE); + unwind: return rc; } diff --git a/xserver/Xi/xigetclientpointer.c b/xserver/Xi/xigetclientpointer.c index 07dbf1800..3c90d588d 100644 --- a/xserver/Xi/xigetclientpointer.c +++ b/xserver/Xi/xigetclientpointer.c @@ -75,12 +75,14 @@ ProcXIGetClientPointer(ClientPtr client) else winclient = client; - rep.repType = X_Reply; - rep.RepType = X_XIGetClientPointer; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.set = (winclient->clientPtr != NULL); - rep.deviceid = (winclient->clientPtr) ? winclient->clientPtr->id : 0; + rep = (xXIGetClientPointerReply) { + .repType = X_Reply, + .RepType = X_XIGetClientPointer, + .sequenceNumber = client->sequence, + .length = 0, + .set = (winclient->clientPtr != NULL), + .deviceid = (winclient->clientPtr) ? winclient->clientPtr->id : 0 + }; WriteReplyToClient(client, sizeof(xXIGetClientPointerReply), &rep); return Success; @@ -100,5 +102,5 @@ SRepXIGetClientPointer(ClientPtr client, int size, swaps(&rep->sequenceNumber); swapl(&rep->length); swaps(&rep->deviceid); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xserver/Xi/xigrabdev.c b/xserver/Xi/xigrabdev.c index 8d2cf0bed..09186e84f 100644 --- a/xserver/Xi/xigrabdev.c +++ b/xserver/Xi/xigrabdev.c @@ -104,11 +104,13 @@ ProcXIGrabDevice(ClientPtr client) if (ret != Success) return ret; - rep.repType = X_Reply; - rep.RepType = X_XIGrabDevice; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.status = status; + rep = (xXIGrabDeviceReply) { + .repType = X_Reply, + .RepType = X_XIGrabDevice, + .sequenceNumber = client->sequence, + .length = 0, + .status = status + }; WriteReplyToClient(client, sizeof(rep), &rep); return ret; @@ -156,5 +158,5 @@ SRepXIGrabDevice(ClientPtr client, int size, xXIGrabDeviceReply * rep) { swaps(&rep->sequenceNumber); swapl(&rep->length); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xserver/Xi/xipassivegrab.c b/xserver/Xi/xipassivegrab.c index 7130328ec..62a3a469f 100644 --- a/xserver/Xi/xipassivegrab.c +++ b/xserver/Xi/xipassivegrab.c @@ -50,7 +50,7 @@ int SProcXIPassiveGrabDevice(ClientPtr client) { int i; - xXIModifierInfo *mods; + uint32_t *mods; REQUEST(xXIPassiveGrabDeviceReq); @@ -63,12 +63,10 @@ SProcXIPassiveGrabDevice(ClientPtr client) swaps(&stuff->mask_len); swaps(&stuff->num_modifiers); - mods = (xXIModifierInfo *) &stuff[1]; + mods = (uint32_t *) &stuff[1]; for (i = 0; i < stuff->num_modifiers; i++, mods++) { - swapl(&mods->base_mods); - swapl(&mods->latched_mods); - swapl(&mods->locked_mods); + swapl(mods); } return ProcXIPassiveGrabDevice(client); @@ -78,7 +76,13 @@ int ProcXIPassiveGrabDevice(ClientPtr client) { DeviceIntPtr dev, mod_dev; - xXIPassiveGrabDeviceReply rep; + xXIPassiveGrabDeviceReply rep = { + .repType = X_Reply, + .RepType = X_XIPassiveGrabDevice, + .sequenceNumber = client->sequence, + .length = 0, + .num_modifiers = 0 + }; int i, ret = Success; uint32_t *modifiers; xXIGrabModifierInfo *modifiers_failed; @@ -137,12 +141,6 @@ ProcXIPassiveGrabDevice(ClientPtr client) xi2mask_set_one_mask(mask.xi2mask, stuff->deviceid, (unsigned char *) &stuff[1], mask_len * 4); - rep.repType = X_Reply; - rep.RepType = X_XIPassiveGrabDevice; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.num_modifiers = 0; - memset(¶m, 0, sizeof(param)); param.grabtype = XI2; param.ownerEvents = stuff->owner_events; @@ -224,7 +222,7 @@ ProcXIPassiveGrabDevice(ClientPtr client) WriteReplyToClient(client, sizeof(rep), &rep); if (rep.num_modifiers) - WriteToClient(client, rep.length * 4, (char *) modifiers_failed); + WriteToClient(client, rep.length * 4, modifiers_failed); free(modifiers_failed); out: @@ -240,7 +238,7 @@ SRepXIPassiveGrabDevice(ClientPtr client, int size, swapl(&rep->length); swaps(&rep->num_modifiers); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } int diff --git a/xserver/Xi/xiproperty.c b/xserver/Xi/xiproperty.c index e17efe407..796ba0948 100644 --- a/xserver/Xi/xiproperty.c +++ b/xserver/Xi/xiproperty.c @@ -49,132 +49,134 @@ static struct dev_properties { Atom type; const char *name; } dev_properties[] = { - { - 0, XI_PROP_ENABLED}, { - 0, XI_PROP_XTEST_DEVICE}, { - 0, XATOM_FLOAT}, { - 0, ACCEL_PROP_PROFILE_NUMBER}, { - 0, ACCEL_PROP_CONSTANT_DECELERATION}, { - 0, ACCEL_PROP_ADAPTIVE_DECELERATION}, { - 0, ACCEL_PROP_VELOCITY_SCALING}, { - 0, AXIS_LABEL_PROP}, { - 0, AXIS_LABEL_PROP_REL_X}, { - 0, AXIS_LABEL_PROP_REL_Y}, { - 0, AXIS_LABEL_PROP_REL_Z}, { - 0, AXIS_LABEL_PROP_REL_RX}, { - 0, AXIS_LABEL_PROP_REL_RY}, { - 0, AXIS_LABEL_PROP_REL_RZ}, { - 0, AXIS_LABEL_PROP_REL_HWHEEL}, { - 0, AXIS_LABEL_PROP_REL_DIAL}, { - 0, AXIS_LABEL_PROP_REL_WHEEL}, { - 0, AXIS_LABEL_PROP_REL_MISC}, { - 0, AXIS_LABEL_PROP_REL_VSCROLL}, { - 0, AXIS_LABEL_PROP_REL_HSCROLL}, { - 0, AXIS_LABEL_PROP_ABS_X}, { - 0, AXIS_LABEL_PROP_ABS_Y}, { - 0, AXIS_LABEL_PROP_ABS_Z}, { - 0, AXIS_LABEL_PROP_ABS_RX}, { - 0, AXIS_LABEL_PROP_ABS_RY}, { - 0, AXIS_LABEL_PROP_ABS_RZ}, { - 0, AXIS_LABEL_PROP_ABS_THROTTLE}, { - 0, AXIS_LABEL_PROP_ABS_RUDDER}, { - 0, AXIS_LABEL_PROP_ABS_WHEEL}, { - 0, AXIS_LABEL_PROP_ABS_GAS}, { - 0, AXIS_LABEL_PROP_ABS_BRAKE}, { - 0, AXIS_LABEL_PROP_ABS_HAT0X}, { - 0, AXIS_LABEL_PROP_ABS_HAT0Y}, { - 0, AXIS_LABEL_PROP_ABS_HAT1X}, { - 0, AXIS_LABEL_PROP_ABS_HAT1Y}, { - 0, AXIS_LABEL_PROP_ABS_HAT2X}, { - 0, AXIS_LABEL_PROP_ABS_HAT2Y}, { - 0, AXIS_LABEL_PROP_ABS_HAT3X}, { - 0, AXIS_LABEL_PROP_ABS_HAT3Y}, { - 0, AXIS_LABEL_PROP_ABS_PRESSURE}, { - 0, AXIS_LABEL_PROP_ABS_DISTANCE}, { - 0, AXIS_LABEL_PROP_ABS_TILT_X}, { - 0, AXIS_LABEL_PROP_ABS_TILT_Y}, { - 0, AXIS_LABEL_PROP_ABS_TOOL_WIDTH}, { - 0, AXIS_LABEL_PROP_ABS_VOLUME}, { - 0, AXIS_LABEL_PROP_ABS_MT_TOUCH_MAJOR}, { - 0, AXIS_LABEL_PROP_ABS_MT_TOUCH_MINOR}, { - 0, AXIS_LABEL_PROP_ABS_MT_WIDTH_MAJOR}, { - 0, AXIS_LABEL_PROP_ABS_MT_WIDTH_MINOR}, { - 0, AXIS_LABEL_PROP_ABS_MT_ORIENTATION}, { - 0, AXIS_LABEL_PROP_ABS_MT_POSITION_X}, { - 0, AXIS_LABEL_PROP_ABS_MT_POSITION_Y}, { - 0, AXIS_LABEL_PROP_ABS_MT_TOOL_TYPE}, { - 0, AXIS_LABEL_PROP_ABS_MT_BLOB_ID}, { - 0, AXIS_LABEL_PROP_ABS_MT_TRACKING_ID}, { - 0, AXIS_LABEL_PROP_ABS_MT_PRESSURE}, { - 0, AXIS_LABEL_PROP_ABS_MISC}, { - 0, BTN_LABEL_PROP}, { - 0, BTN_LABEL_PROP_BTN_UNKNOWN}, { - 0, BTN_LABEL_PROP_BTN_WHEEL_UP}, { - 0, BTN_LABEL_PROP_BTN_WHEEL_DOWN}, { - 0, BTN_LABEL_PROP_BTN_HWHEEL_LEFT}, { - 0, BTN_LABEL_PROP_BTN_HWHEEL_RIGHT}, { - 0, BTN_LABEL_PROP_BTN_0}, { - 0, BTN_LABEL_PROP_BTN_1}, { - 0, BTN_LABEL_PROP_BTN_2}, { - 0, BTN_LABEL_PROP_BTN_3}, { - 0, BTN_LABEL_PROP_BTN_4}, { - 0, BTN_LABEL_PROP_BTN_5}, { - 0, BTN_LABEL_PROP_BTN_6}, { - 0, BTN_LABEL_PROP_BTN_7}, { - 0, BTN_LABEL_PROP_BTN_8}, { - 0, BTN_LABEL_PROP_BTN_9}, { - 0, BTN_LABEL_PROP_BTN_LEFT}, { - 0, BTN_LABEL_PROP_BTN_RIGHT}, { - 0, BTN_LABEL_PROP_BTN_MIDDLE}, { - 0, BTN_LABEL_PROP_BTN_SIDE}, { - 0, BTN_LABEL_PROP_BTN_EXTRA}, { - 0, BTN_LABEL_PROP_BTN_FORWARD}, { - 0, BTN_LABEL_PROP_BTN_BACK}, { - 0, BTN_LABEL_PROP_BTN_TASK}, { - 0, BTN_LABEL_PROP_BTN_TRIGGER}, { - 0, BTN_LABEL_PROP_BTN_THUMB}, { - 0, BTN_LABEL_PROP_BTN_THUMB2}, { - 0, BTN_LABEL_PROP_BTN_TOP}, { - 0, BTN_LABEL_PROP_BTN_TOP2}, { - 0, BTN_LABEL_PROP_BTN_PINKIE}, { - 0, BTN_LABEL_PROP_BTN_BASE}, { - 0, BTN_LABEL_PROP_BTN_BASE2}, { - 0, BTN_LABEL_PROP_BTN_BASE3}, { - 0, BTN_LABEL_PROP_BTN_BASE4}, { - 0, BTN_LABEL_PROP_BTN_BASE5}, { - 0, BTN_LABEL_PROP_BTN_BASE6}, { - 0, BTN_LABEL_PROP_BTN_DEAD}, { - 0, BTN_LABEL_PROP_BTN_A}, { - 0, BTN_LABEL_PROP_BTN_B}, { - 0, BTN_LABEL_PROP_BTN_C}, { - 0, BTN_LABEL_PROP_BTN_X}, { - 0, BTN_LABEL_PROP_BTN_Y}, { - 0, BTN_LABEL_PROP_BTN_Z}, { - 0, BTN_LABEL_PROP_BTN_TL}, { - 0, BTN_LABEL_PROP_BTN_TR}, { - 0, BTN_LABEL_PROP_BTN_TL2}, { - 0, BTN_LABEL_PROP_BTN_TR2}, { - 0, BTN_LABEL_PROP_BTN_SELECT}, { - 0, BTN_LABEL_PROP_BTN_START}, { - 0, BTN_LABEL_PROP_BTN_MODE}, { - 0, BTN_LABEL_PROP_BTN_THUMBL}, { - 0, BTN_LABEL_PROP_BTN_THUMBR}, { - 0, BTN_LABEL_PROP_BTN_TOOL_PEN}, { - 0, BTN_LABEL_PROP_BTN_TOOL_RUBBER}, { - 0, BTN_LABEL_PROP_BTN_TOOL_BRUSH}, { - 0, BTN_LABEL_PROP_BTN_TOOL_PENCIL}, { - 0, BTN_LABEL_PROP_BTN_TOOL_AIRBRUSH}, { - 0, BTN_LABEL_PROP_BTN_TOOL_FINGER}, { - 0, BTN_LABEL_PROP_BTN_TOOL_MOUSE}, { - 0, BTN_LABEL_PROP_BTN_TOOL_LENS}, { - 0, BTN_LABEL_PROP_BTN_TOUCH}, { - 0, BTN_LABEL_PROP_BTN_STYLUS}, { - 0, BTN_LABEL_PROP_BTN_STYLUS2}, { - 0, BTN_LABEL_PROP_BTN_TOOL_DOUBLETAP}, { - 0, BTN_LABEL_PROP_BTN_TOOL_TRIPLETAP}, { - 0, BTN_LABEL_PROP_BTN_GEAR_DOWN}, { - 0, BTN_LABEL_PROP_BTN_GEAR_UP}, { - 0, XI_PROP_TRANSFORM} + {0, XI_PROP_ENABLED}, + {0, XI_PROP_XTEST_DEVICE}, + {0, XATOM_FLOAT}, + {0, ACCEL_PROP_PROFILE_NUMBER}, + {0, ACCEL_PROP_CONSTANT_DECELERATION}, + {0, ACCEL_PROP_ADAPTIVE_DECELERATION}, + {0, ACCEL_PROP_VELOCITY_SCALING}, + {0, AXIS_LABEL_PROP}, + {0, AXIS_LABEL_PROP_REL_X}, + {0, AXIS_LABEL_PROP_REL_Y}, + {0, AXIS_LABEL_PROP_REL_Z}, + {0, AXIS_LABEL_PROP_REL_RX}, + {0, AXIS_LABEL_PROP_REL_RY}, + {0, AXIS_LABEL_PROP_REL_RZ}, + {0, AXIS_LABEL_PROP_REL_HWHEEL}, + {0, AXIS_LABEL_PROP_REL_DIAL}, + {0, AXIS_LABEL_PROP_REL_WHEEL}, + {0, AXIS_LABEL_PROP_REL_MISC}, + {0, AXIS_LABEL_PROP_REL_VSCROLL}, + {0, AXIS_LABEL_PROP_REL_HSCROLL}, + {0, AXIS_LABEL_PROP_ABS_X}, + {0, AXIS_LABEL_PROP_ABS_Y}, + {0, AXIS_LABEL_PROP_ABS_Z}, + {0, AXIS_LABEL_PROP_ABS_RX}, + {0, AXIS_LABEL_PROP_ABS_RY}, + {0, AXIS_LABEL_PROP_ABS_RZ}, + {0, AXIS_LABEL_PROP_ABS_THROTTLE}, + {0, AXIS_LABEL_PROP_ABS_RUDDER}, + {0, AXIS_LABEL_PROP_ABS_WHEEL}, + {0, AXIS_LABEL_PROP_ABS_GAS}, + {0, AXIS_LABEL_PROP_ABS_BRAKE}, + {0, AXIS_LABEL_PROP_ABS_HAT0X}, + {0, AXIS_LABEL_PROP_ABS_HAT0Y}, + {0, AXIS_LABEL_PROP_ABS_HAT1X}, + {0, AXIS_LABEL_PROP_ABS_HAT1Y}, + {0, AXIS_LABEL_PROP_ABS_HAT2X}, + {0, AXIS_LABEL_PROP_ABS_HAT2Y}, + {0, AXIS_LABEL_PROP_ABS_HAT3X}, + {0, AXIS_LABEL_PROP_ABS_HAT3Y}, + {0, AXIS_LABEL_PROP_ABS_PRESSURE}, + {0, AXIS_LABEL_PROP_ABS_DISTANCE}, + {0, AXIS_LABEL_PROP_ABS_TILT_X}, + {0, AXIS_LABEL_PROP_ABS_TILT_Y}, + {0, AXIS_LABEL_PROP_ABS_TOOL_WIDTH}, + {0, AXIS_LABEL_PROP_ABS_VOLUME}, + {0, AXIS_LABEL_PROP_ABS_MT_TOUCH_MAJOR}, + {0, AXIS_LABEL_PROP_ABS_MT_TOUCH_MINOR}, + {0, AXIS_LABEL_PROP_ABS_MT_WIDTH_MAJOR}, + {0, AXIS_LABEL_PROP_ABS_MT_WIDTH_MINOR}, + {0, AXIS_LABEL_PROP_ABS_MT_ORIENTATION}, + {0, AXIS_LABEL_PROP_ABS_MT_POSITION_X}, + {0, AXIS_LABEL_PROP_ABS_MT_POSITION_Y}, + {0, AXIS_LABEL_PROP_ABS_MT_TOOL_TYPE}, + {0, AXIS_LABEL_PROP_ABS_MT_BLOB_ID}, + {0, AXIS_LABEL_PROP_ABS_MT_TRACKING_ID}, + {0, AXIS_LABEL_PROP_ABS_MT_PRESSURE}, + {0, AXIS_LABEL_PROP_ABS_MT_DISTANCE}, + {0, AXIS_LABEL_PROP_ABS_MT_TOOL_X}, + {0, AXIS_LABEL_PROP_ABS_MT_TOOL_Y}, + {0, AXIS_LABEL_PROP_ABS_MISC}, + {0, BTN_LABEL_PROP}, + {0, BTN_LABEL_PROP_BTN_UNKNOWN}, + {0, BTN_LABEL_PROP_BTN_WHEEL_UP}, + {0, BTN_LABEL_PROP_BTN_WHEEL_DOWN}, + {0, BTN_LABEL_PROP_BTN_HWHEEL_LEFT}, + {0, BTN_LABEL_PROP_BTN_HWHEEL_RIGHT}, + {0, BTN_LABEL_PROP_BTN_0}, + {0, BTN_LABEL_PROP_BTN_1}, + {0, BTN_LABEL_PROP_BTN_2}, + {0, BTN_LABEL_PROP_BTN_3}, + {0, BTN_LABEL_PROP_BTN_4}, + {0, BTN_LABEL_PROP_BTN_5}, + {0, BTN_LABEL_PROP_BTN_6}, + {0, BTN_LABEL_PROP_BTN_7}, + {0, BTN_LABEL_PROP_BTN_8}, + {0, BTN_LABEL_PROP_BTN_9}, + {0, BTN_LABEL_PROP_BTN_LEFT}, + {0, BTN_LABEL_PROP_BTN_RIGHT}, + {0, BTN_LABEL_PROP_BTN_MIDDLE}, + {0, BTN_LABEL_PROP_BTN_SIDE}, + {0, BTN_LABEL_PROP_BTN_EXTRA}, + {0, BTN_LABEL_PROP_BTN_FORWARD}, + {0, BTN_LABEL_PROP_BTN_BACK}, + {0, BTN_LABEL_PROP_BTN_TASK}, + {0, BTN_LABEL_PROP_BTN_TRIGGER}, + {0, BTN_LABEL_PROP_BTN_THUMB}, + {0, BTN_LABEL_PROP_BTN_THUMB2}, + {0, BTN_LABEL_PROP_BTN_TOP}, + {0, BTN_LABEL_PROP_BTN_TOP2}, + {0, BTN_LABEL_PROP_BTN_PINKIE}, + {0, BTN_LABEL_PROP_BTN_BASE}, + {0, BTN_LABEL_PROP_BTN_BASE2}, + {0, BTN_LABEL_PROP_BTN_BASE3}, + {0, BTN_LABEL_PROP_BTN_BASE4}, + {0, BTN_LABEL_PROP_BTN_BASE5}, + {0, BTN_LABEL_PROP_BTN_BASE6}, + {0, BTN_LABEL_PROP_BTN_DEAD}, + {0, BTN_LABEL_PROP_BTN_A}, + {0, BTN_LABEL_PROP_BTN_B}, + {0, BTN_LABEL_PROP_BTN_C}, + {0, BTN_LABEL_PROP_BTN_X}, + {0, BTN_LABEL_PROP_BTN_Y}, + {0, BTN_LABEL_PROP_BTN_Z}, + {0, BTN_LABEL_PROP_BTN_TL}, + {0, BTN_LABEL_PROP_BTN_TR}, + {0, BTN_LABEL_PROP_BTN_TL2}, + {0, BTN_LABEL_PROP_BTN_TR2}, + {0, BTN_LABEL_PROP_BTN_SELECT}, + {0, BTN_LABEL_PROP_BTN_START}, + {0, BTN_LABEL_PROP_BTN_MODE}, + {0, BTN_LABEL_PROP_BTN_THUMBL}, + {0, BTN_LABEL_PROP_BTN_THUMBR}, + {0, BTN_LABEL_PROP_BTN_TOOL_PEN}, + {0, BTN_LABEL_PROP_BTN_TOOL_RUBBER}, + {0, BTN_LABEL_PROP_BTN_TOOL_BRUSH}, + {0, BTN_LABEL_PROP_BTN_TOOL_PENCIL}, + {0, BTN_LABEL_PROP_BTN_TOOL_AIRBRUSH}, + {0, BTN_LABEL_PROP_BTN_TOOL_FINGER}, + {0, BTN_LABEL_PROP_BTN_TOOL_MOUSE}, + {0, BTN_LABEL_PROP_BTN_TOOL_LENS}, + {0, BTN_LABEL_PROP_BTN_TOUCH}, + {0, BTN_LABEL_PROP_BTN_STYLUS}, + {0, BTN_LABEL_PROP_BTN_STYLUS2}, + {0, BTN_LABEL_PROP_BTN_TOOL_DOUBLETAP}, + {0, BTN_LABEL_PROP_BTN_TOOL_TRIPLETAP}, + {0, BTN_LABEL_PROP_BTN_GEAR_DOWN}, + {0, BTN_LABEL_PROP_BTN_GEAR_UP}, + {0, XI_PROP_TRANSFORM} }; static long XIPropHandlerID = 1; @@ -182,30 +184,27 @@ static long XIPropHandlerID = 1; static void send_property_event(DeviceIntPtr dev, Atom property, int what) { - devicePropertyNotify event; - xXIPropertyEvent xi2; - int state; + int state = (what == XIPropertyDeleted) ? PropertyDelete : PropertyNewValue; + devicePropertyNotify event = { + .type = DevicePropertyNotify, + .deviceid = dev->id, + .state = state, + .atom = property, + .time = currentTime.milliseconds + }; + xXIPropertyEvent xi2 = { + .type = GenericEvent, + .extension = IReqCode, + .length = 0, + .evtype = XI_PropertyEvent, + .deviceid = dev->id, + .time = currentTime.milliseconds, + .property = property, + .what = what + }; - if (what == XIPropertyDeleted) - state = PropertyDelete; - else - state = PropertyNewValue; - - event.type = DevicePropertyNotify; - event.deviceid = dev->id; - event.state = state; - event.atom = property; - event.time = currentTime.milliseconds; SendEventToAllWindows(dev, DevicePropertyNotifyMask, (xEvent *) &event, 1); - xi2.type = GenericEvent; - xi2.extension = IReqCode; - xi2.length = 0; - xi2.evtype = XI_PropertyEvent; - xi2.deviceid = dev->id; - xi2.time = currentTime.milliseconds; - xi2.property = property; - xi2.what = what; SendEventToAllWindows(dev, GetEventFilter(dev, (xEvent *) &xi2), (xEvent *) &xi2, 1); } @@ -754,7 +753,7 @@ XIChangeDeviceProperty(DeviceIntPtr dev, Atom property, Atom type, break; } if (new_data) - memcpy((char *) new_data, (char *) value, len * size_in_bytes); + memcpy((char *) new_data, value, len * size_in_bytes); if (old_data) memcpy((char *) old_data, (char *) prop_value->data, prop_value->size * size_in_bytes); @@ -774,6 +773,8 @@ XIChangeDeviceProperty(DeviceIntPtr dev, Atom property, Atom type, &new_value, checkonly); if (checkonly && rc != Success) { free(new_value.data); + if (add) + XIDestroyDeviceProperty(prop); return rc; } } @@ -864,11 +865,13 @@ ProcXListDeviceProperties(ClientPtr client) if (rc != Success) return rc; - rep.repType = X_Reply; - rep.RepType = X_ListDeviceProperties; - rep.length = natoms; - rep.sequenceNumber = client->sequence; - rep.nAtoms = natoms; + rep = (xListDevicePropertiesReply) { + .repType = X_Reply, + .RepType = X_ListDeviceProperties, + .sequenceNumber = client->sequence, + .length = natoms, + .nAtoms = natoms + }; WriteReplyToClient(client, sizeof(xListDevicePropertiesReply), &rep); if (natoms) { @@ -958,15 +961,17 @@ ProcXGetDeviceProperty(ClientPtr client) if (rc != Success) return rc; - reply.repType = X_Reply; - reply.RepType = X_GetDeviceProperty; - reply.sequenceNumber = client->sequence; - reply.deviceid = dev->id; - reply.nItems = nitems; - reply.format = format; - reply.bytesAfter = bytes_after; - reply.propertyType = type; - reply.length = bytes_to_int32(length); + reply = (xGetDevicePropertyReply) { + .repType = X_Reply, + .RepType = X_GetDeviceProperty, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(length), + .propertyType = type, + .bytesAfter = bytes_after, + .nItems = nitems, + .format = format, + .deviceid = dev->id + }; if (stuff->delete && (reply.bytesAfter == 0)) send_property_event(dev, stuff->property, XIPropertyDeleted); @@ -1063,7 +1068,7 @@ SRepXListDeviceProperties(ClientPtr client, int size, swapl(&rep->length); swaps(&rep->nAtoms); /* properties will be swapped later, see ProcXListDeviceProperties */ - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } void @@ -1076,7 +1081,7 @@ SRepXGetDeviceProperty(ClientPtr client, int size, swapl(&rep->bytesAfter); swapl(&rep->nItems); /* data will be swapped, see ProcXGetDeviceProperty */ - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } /* XI2 Request/reply handling */ @@ -1100,11 +1105,13 @@ ProcXIListProperties(ClientPtr client) if (rc != Success) return rc; - rep.repType = X_Reply; - rep.RepType = X_XIListProperties; - rep.length = natoms; - rep.sequenceNumber = client->sequence; - rep.num_properties = natoms; + rep = (xXIListPropertiesReply) { + .repType = X_Reply, + .RepType = X_XIListProperties, + .sequenceNumber = client->sequence, + .length = natoms, + .num_properties = natoms + }; WriteReplyToClient(client, sizeof(xXIListPropertiesReply), &rep); if (natoms) { @@ -1194,14 +1201,16 @@ ProcXIGetProperty(ClientPtr client) if (rc != Success) return rc; - reply.repType = X_Reply; - reply.RepType = X_XIGetProperty; - reply.sequenceNumber = client->sequence; - reply.num_items = nitems; - reply.format = format; - reply.bytes_after = bytes_after; - reply.type = type; - reply.length = bytes_to_int32(length); + reply = (xXIGetPropertyReply) { + .repType = X_Reply, + .RepType = X_XIGetProperty, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(length), + .type = type, + .bytes_after = bytes_after, + .num_items = nitems, + .format = format + }; if (length && stuff->delete && (reply.bytes_after == 0)) send_property_event(dev, stuff->property, XIPropertyDeleted); @@ -1300,7 +1309,7 @@ SRepXIListProperties(ClientPtr client, int size, xXIListPropertiesReply * rep) swapl(&rep->length); swaps(&rep->num_properties); /* properties will be swapped later, see ProcXIListProperties */ - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } void @@ -1312,5 +1321,5 @@ SRepXIGetProperty(ClientPtr client, int size, xXIGetPropertyReply * rep) swapl(&rep->bytes_after); swapl(&rep->num_items); /* data will be swapped, see ProcXIGetProperty */ - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xserver/Xi/xiquerydevice.c b/xserver/Xi/xiquerydevice.c index 15c8b2a7b..4e544f0f5 100644 --- a/xserver/Xi/xiquerydevice.c +++ b/xserver/Xi/xiquerydevice.c @@ -107,12 +107,13 @@ ProcXIQueryDevice(ClientPtr client) return BadAlloc; } - memset(&rep, 0, sizeof(xXIQueryDeviceReply)); - rep.repType = X_Reply; - rep.RepType = X_XIQueryDevice; - rep.sequenceNumber = client->sequence; - rep.length = len / 4; - rep.num_devices = 0; + rep = (xXIQueryDeviceReply) { + .repType = X_Reply, + .RepType = X_XIQueryDevice, + .sequenceNumber = client->sequence, + .length = len / 4, + .num_devices = 0 + }; ptr = info; if (dev) { @@ -162,7 +163,7 @@ SRepXIQueryDevice(ClientPtr client, int size, xXIQueryDeviceReply * rep) /* Device info is already swapped, see ProcXIQueryDevice */ - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } /** @@ -303,7 +304,7 @@ ListKeyInfo(DeviceIntPtr dev, xXIKeyInfo * info) info->length = sizeof(xXIKeyInfo) / 4 + info->num_keycodes; info->sourceid = dev->key->sourceid; - kc = (uint32_t *) & info[1]; + kc = (uint32_t *) &info[1]; for (i = xkb->min_key_code; i <= xkb->max_key_code; i++, kc++) *kc = i; @@ -320,7 +321,7 @@ SwapKeyInfo(DeviceIntPtr dev, xXIKeyInfo * info) swaps(&info->length); swaps(&info->sourceid); - for (i = 0, key = (uint32_t *) & info[1]; i < info->num_keycodes; + for (i = 0, key = (uint32_t *) &info[1]; i < info->num_keycodes; i++, key++) swapl(key); diff --git a/xserver/Xi/xiquerypointer.c b/xserver/Xi/xiquerypointer.c index 169436e14..e9bdd428d 100644 --- a/xserver/Xi/xiquerypointer.c +++ b/xserver/Xi/xiquerypointer.c @@ -50,6 +50,7 @@ #include "panoramiXsrv.h" #endif +#include "inpututils.h" #include "xiquerypointer.h" /*********************************************************************** @@ -121,15 +122,16 @@ ProcXIQueryPointer(ClientPtr client) pSprite = pDev->spriteInfo->sprite; - memset(&rep, 0, sizeof(rep)); - rep.repType = X_Reply; - rep.RepType = X_XIQueryPointer; - rep.length = 6; - rep.sequenceNumber = client->sequence; - rep.root = (GetCurrentRootWindow(pDev))->drawable.id; - rep.root_x = FP1616(pSprite->hot.x, 0); - rep.root_y = FP1616(pSprite->hot.y, 0); - rep.child = None; + rep = (xXIQueryPointerReply) { + .repType = X_Reply, + .RepType = X_XIQueryPointer, + .sequenceNumber = client->sequence, + .length = 6, + .root = (GetCurrentRootWindow(pDev))->drawable.id, + .root_x = double_to_fp1616(pSprite->hot.x), + .root_y = double_to_fp1616(pSprite->hot.y), + .child = None + }; if (kbd) { state = &kbd->key->xkbInfo->state; @@ -165,8 +167,8 @@ ProcXIQueryPointer(ClientPtr client) if (pSprite->hot.pScreen == pWin->drawable.pScreen) { rep.same_screen = xTrue; - rep.win_x = FP1616(pSprite->hot.x - pWin->drawable.x, 0); - rep.win_y = FP1616(pSprite->hot.y - pWin->drawable.y, 0); + rep.win_x = double_to_fp1616(pSprite->hot.x - pWin->drawable.x); + rep.win_y = double_to_fp1616(pSprite->hot.y - pWin->drawable.y); for (t = pSprite->win; t; t = t->parent) if (t->parent == pWin) { rep.child = t->drawable.id; @@ -181,11 +183,11 @@ ProcXIQueryPointer(ClientPtr client) #ifdef PANORAMIX if (!noPanoramiXExtension) { - rep.root_x += FP1616(screenInfo.screens[0]->x, 0); - rep.root_y += FP1616(screenInfo.screens[0]->y, 0); + rep.root_x += double_to_fp1616(screenInfo.screens[0]->x); + rep.root_y += double_to_fp1616(screenInfo.screens[0]->y); if (stuff->win == rep.root) { - rep.win_x += FP1616(screenInfo.screens[0]->x, 0); - rep.win_y += FP1616(screenInfo.screens[0]->y, 0); + rep.win_x += double_to_fp1616(screenInfo.screens[0]->x); + rep.win_y += double_to_fp1616(screenInfo.screens[0]->y); } } #endif @@ -219,5 +221,5 @@ SRepXIQueryPointer(ClientPtr client, int size, xXIQueryPointerReply * rep) swapl(&rep->win_y); swaps(&rep->buttons_len); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xserver/Xi/xiqueryversion.c b/xserver/Xi/xiqueryversion.c index 95a8efa44..b807a53ce 100644 --- a/xserver/Xi/xiqueryversion.c +++ b/xserver/Xi/xiqueryversion.c @@ -70,26 +70,37 @@ ProcXIQueryVersion(ClientPtr client) pXIClient = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey); - if (version_compare(XIVersion.major_version, XIVersion.minor_version, - stuff->major_version, stuff->minor_version) > 0) { - major = stuff->major_version; - minor = stuff->minor_version; - } - else { - major = XIVersion.major_version; - minor = XIVersion.minor_version; + if (pXIClient->major_version) { + if (version_compare(stuff->major_version, stuff->minor_version, + pXIClient->major_version, pXIClient->minor_version) < 0) { + client->errorValue = stuff->major_version; + return BadValue; + } + major = pXIClient->major_version; + minor = pXIClient->minor_version; + } else { + if (version_compare(XIVersion.major_version, XIVersion.minor_version, + stuff->major_version, stuff->minor_version) > 0) { + major = stuff->major_version; + minor = stuff->minor_version; + } + else { + major = XIVersion.major_version; + minor = XIVersion.minor_version; + } + + pXIClient->major_version = major; + pXIClient->minor_version = minor; } - pXIClient->major_version = major; - pXIClient->minor_version = minor; - - memset(&rep, 0, sizeof(xXIQueryVersionReply)); - rep.repType = X_Reply; - rep.RepType = X_XIQueryVersion; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.major_version = major; - rep.minor_version = minor; + rep = (xXIQueryVersionReply) { + .repType = X_Reply, + .RepType = X_XIQueryVersion, + .sequenceNumber = client->sequence, + .length = 0, + .major_version = major, + .minor_version = minor + }; WriteReplyToClient(client, sizeof(xXIQueryVersionReply), &rep); @@ -116,5 +127,5 @@ SRepXIQueryVersion(ClientPtr client, int size, xXIQueryVersionReply * rep) swapl(&rep->length); swaps(&rep->major_version); swaps(&rep->minor_version); - WriteToClient(client, size, (char *) rep); + WriteToClient(client, size, rep); } diff --git a/xserver/Xi/xiselectev.c b/xserver/Xi/xiselectev.c index c71dcc0db..45a996e4c 100644 --- a/xserver/Xi/xiselectev.c +++ b/xserver/Xi/xiselectev.c @@ -36,6 +36,57 @@ #include "xiselectev.h" +/** + * Ruleset: + * - if A has XIAllDevices, B may select on device X + * - If A has XIAllDevices, B may select on XIAllMasterDevices + * - If A has XIAllMasterDevices, B may select on device X + * - If A has XIAllMasterDevices, B may select on XIAllDevices + * - if A has device X, B may select on XIAllDevices/XIAllMasterDevices + */ +static int check_for_touch_selection_conflicts(ClientPtr B, WindowPtr win, int deviceid) +{ + OtherInputMasks *inputMasks = wOtherInputMasks(win); + InputClients *A = NULL; + + if (inputMasks) + A = inputMasks->inputClients; + for (; A; A = A->next) { + DeviceIntPtr tmp; + + if (CLIENT_ID(A->resource) == B->index) + continue; + + if (deviceid == XIAllDevices) + tmp = inputInfo.all_devices; + else if (deviceid == XIAllMasterDevices) + tmp = inputInfo.all_master_devices; + else + dixLookupDevice(&tmp, deviceid, serverClient, DixReadAccess); + if (!tmp) + return BadImplementation; /* this shouldn't happen */ + + /* A has XIAllDevices */ + if (xi2mask_isset_for_device(A->xi2mask, inputInfo.all_devices, XI_TouchBegin)) { + if (deviceid == XIAllDevices) + return BadAccess; + } + + /* A has XIAllMasterDevices */ + if (xi2mask_isset_for_device(A->xi2mask, inputInfo.all_master_devices, XI_TouchBegin)) { + if (deviceid == XIAllMasterDevices) + return BadAccess; + } + + /* A has this device */ + if (xi2mask_isset_for_device(A->xi2mask, tmp, XI_TouchBegin)) + return BadAccess; + } + + return Success; +} + + /** * Check the given mask (in len bytes) for invalid mask bits. * Invalid mask bits are any bits above XI2LastEvent. @@ -169,31 +220,11 @@ ProcXISelectEvents(ClientPtr client) * same devices, including master devices. * XXX: This breaks if a device goes from floating to attached. */ if (BitIsOn(bits, XI_TouchBegin)) { - OtherInputMasks *inputMasks = wOtherInputMasks(win); - InputClients *iclient = NULL; - - if (inputMasks) - iclient = inputMasks->inputClients; - for (; iclient; iclient = iclient->next) { - DeviceIntPtr dummy; - - if (CLIENT_ID(iclient->resource) == client->index) - continue; - - if (evmask->deviceid == XIAllDevices) - dummy = inputInfo.all_devices; - else if (evmask->deviceid == XIAllMasterDevices) - dummy = inputInfo.all_master_devices; - else - dixLookupDevice(&dummy, evmask->deviceid, serverClient, - DixReadAccess); - - if (!dummy) - return BadImplementation; /* this shouldn't happen */ - - if (xi2mask_isset(iclient->xi2mask, dummy, XI_TouchBegin)) - return BadAccess; - } + rc = check_for_touch_selection_conflicts(client, + win, + evmask->deviceid); + if (rc != Success) + return rc; } } @@ -266,11 +297,13 @@ ProcXIGetSelectedEvents(ClientPtr client) if (rc != Success) return rc; - reply.repType = X_Reply; - reply.RepType = X_XIGetSelectedEvents; - reply.length = 0; - reply.sequenceNumber = client->sequence; - reply.num_masks = 0; + reply = (xXIGetSelectedEventsReply) { + .repType = X_Reply, + .RepType = X_XIGetSelectedEvents, + .sequenceNumber = client->sequence, + .length = 0, + .num_masks = 0 + }; masks = wOtherInputMasks(win); if (masks) { @@ -341,5 +374,5 @@ SRepXIGetSelectedEvents(ClientPtr client, swaps(&rep->sequenceNumber); swapl(&rep->length); swaps(&rep->num_masks); - WriteToClient(client, len, (char *) rep); + WriteToClient(client, len, rep); } diff --git a/xserver/Xi/xisetdevfocus.c b/xserver/Xi/xisetdevfocus.c index b52c9cc99..372ec248a 100644 --- a/xserver/Xi/xisetdevfocus.c +++ b/xserver/Xi/xisetdevfocus.c @@ -97,10 +97,12 @@ ProcXIGetFocus(ClientPtr client) if (!dev->focus) return BadDevice; - rep.repType = X_Reply; - rep.RepType = X_XIGetFocus; - rep.length = 0; - rep.sequenceNumber = client->sequence; + rep = (xXIGetFocusReply) { + .repType = X_Reply, + .RepType = X_XIGetFocus, + .sequenceNumber = client->sequence, + .length = 0 + }; if (dev->focus->win == NoneWin) rep.focus = None; @@ -121,5 +123,5 @@ SRepXIGetFocus(ClientPtr client, int len, xXIGetFocusReply * rep) swaps(&rep->sequenceNumber); swapl(&rep->length); swapl(&rep->focus); - WriteToClient(client, len, (char *) rep); + WriteToClient(client, len, rep); } diff --git a/xserver/aclocal.m4 b/xserver/aclocal.m4 index a603bf1c3..2e70d10fa 100644 --- a/xserver/aclocal.m4 +++ b/xserver/aclocal.m4 @@ -1,4 +1,4 @@ -# generated automatically by aclocal 1.12.3 -*- Autoconf -*- +# generated automatically by aclocal 1.12.6 -*- Autoconf -*- # Copyright (C) 1996-2012 Free Software Foundation, Inc. @@ -192,7 +192,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.12' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.12.3], [], +m4_if([$1], [1.12.6], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -208,7 +208,7 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.12.3])dnl +[AM_AUTOMAKE_VERSION([1.12.6])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) @@ -777,44 +777,6 @@ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) -# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- -# From Jim Meyering - -# Copyright (C) 1996-2012 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_MAINTAINER_MODE([DEFAULT-MODE]) -# ---------------------------------- -# Control maintainer-specific portions of Makefiles. -# Default is to disable them, unless 'enable' is passed literally. -# For symmetry, 'disable' may be passed as well. Anyway, the user -# can override the default with the --enable/--disable switch. -AC_DEFUN([AM_MAINTAINER_MODE], -[m4_case(m4_default([$1], [disable]), - [enable], [m4_define([am_maintainer_other], [disable])], - [disable], [m4_define([am_maintainer_other], [enable])], - [m4_define([am_maintainer_other], [enable]) - m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) -AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) - dnl maintainer-mode's default is 'disable' unless 'enable' is passed - AC_ARG_ENABLE([maintainer-mode], - [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], - am_maintainer_other[ make rules and dependencies not useful - (and sometimes confusing) to the casual installer])], - [USE_MAINTAINER_MODE=$enableval], - [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) - AC_MSG_RESULT([$USE_MAINTAINER_MODE]) - AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) - MAINT=$MAINTAINER_MODE_TRUE - AC_SUBST([MAINT])dnl -] -) - -AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) - # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2012 Free Software Foundation, Inc. @@ -1653,7 +1615,7 @@ dnl DEALINGS IN THE SOFTWARE. # See the "minimum version" comment for each macro you use to see what # version you require. m4_defun([XORG_MACROS_VERSION],[ -m4_define([vers_have], [1.17]) +m4_define([vers_have], [1.16.2]) m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) m4_if(m4_cmp(maj_have, maj_needed), 0,, diff --git a/xserver/autogen.sh b/xserver/autogen.sh index 4e8b11ba9..dd0731ad9 100644 --- a/xserver/autogen.sh +++ b/xserver/autogen.sh @@ -9,4 +9,6 @@ cd $srcdir autoreconf --force -v --install || exit 1 cd $ORIGDIR || exit $? -$srcdir/configure --enable-maintainer-mode "$@" +if test -z "$NOCONFIGURE"; then + exec $srcdir/configure "$@" +fi diff --git a/xserver/compile b/xserver/compile deleted file mode 100644 index 1b1d23216..000000000 --- a/xserver/compile +++ /dev/null @@ -1,142 +0,0 @@ -#! /bin/sh -# Wrapper for compilers which do not understand `-c -o'. - -scriptversion=2005-05-14.22 - -# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. -# Written by Tom Tromey . -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - -case $1 in - '') - echo "$0: No command. Try \`$0 --help' for more information." 1>&2 - exit 1; - ;; - -h | --h*) - cat <<\EOF -Usage: compile [--help] [--version] PROGRAM [ARGS] - -Wrapper for compilers which do not understand `-c -o'. -Remove `-o dest.o' from ARGS, run PROGRAM with the remaining -arguments, and rename the output as expected. - -If you are trying to build a whole package this is not the -right script to run: please start by reading the file `INSTALL'. - -Report bugs to . -EOF - exit $? - ;; - -v | --v*) - echo "compile $scriptversion" - exit $? - ;; -esac - -ofile= -cfile= -eat= - -for arg -do - if test -n "$eat"; then - eat= - else - case $1 in - -o) - # configure might choose to run compile as `compile cc -o foo foo.c'. - # So we strip `-o arg' only if arg is an object. - eat=1 - case $2 in - *.o | *.obj) - ofile=$2 - ;; - *) - set x "$@" -o "$2" - shift - ;; - esac - ;; - *.c) - cfile=$1 - set x "$@" "$1" - shift - ;; - *) - set x "$@" "$1" - shift - ;; - esac - fi - shift -done - -if test -z "$ofile" || test -z "$cfile"; then - # If no `-o' option was seen then we might have been invoked from a - # pattern rule where we don't need one. That is ok -- this is a - # normal compilation that the losing compiler can handle. If no - # `.c' file was seen then we are probably linking. That is also - # ok. - exec "$@" -fi - -# Name of file we expect compiler to create. -cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` - -# Create the lock directory. -# Note: use `[/.-]' here to ensure that we don't use the same name -# that we are using for the .o file. Also, base the name on the expected -# object file name, since that is what matters with a parallel build. -lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d -while true; do - if mkdir "$lockdir" >/dev/null 2>&1; then - break - fi - sleep 1 -done -# FIXME: race condition here if user kills between mkdir and trap. -trap "rmdir '$lockdir'; exit 1" 1 2 15 - -# Run the compile. -"$@" -ret=$? - -if test -f "$cofile"; then - mv "$cofile" "$ofile" -elif test -f "${cofile}bj"; then - mv "${cofile}bj" "$ofile" -fi - -rmdir "$lockdir" -exit $ret - -# Local Variables: -# mode: shell-script -# sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "scriptversion=" -# time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-end: "$" -# End: diff --git a/xserver/composite/Makefile.in b/xserver/composite/Makefile.in index 350a01c5c..995f52536 100644 --- a/xserver/composite/Makefile.in +++ b/xserver/composite/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -213,13 +213,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -241,6 +237,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -265,6 +262,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -280,7 +278,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -379,6 +376,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -493,7 +491,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -518,9 +516,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/composite/compalloc.c b/xserver/composite/compalloc.c index 15a6cd24f..cc69c68f2 100644 --- a/xserver/composite/compalloc.c +++ b/xserver/composite/compalloc.c @@ -55,14 +55,13 @@ compScreenUpdate(ScreenPtr pScreen) } static void -compBlockHandler(int i, pointer blockData, pointer pTimeout, pointer pReadmask) +compBlockHandler(ScreenPtr pScreen, pointer pTimeout, pointer pReadmask) { - ScreenPtr pScreen = screenInfo.screens[i]; CompScreenPtr cs = GetCompScreen(pScreen); pScreen->BlockHandler = cs->BlockHandler; compScreenUpdate(pScreen); - (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask); + (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); /* Next damage will restore the block handler */ cs->BlockHandler = NULL; @@ -561,8 +560,8 @@ compNewPixmap(WindowPtr pWin, int x, int y, int w, int h) } } else { - PictFormatPtr pSrcFormat = compWindowFormat(pParent); - PictFormatPtr pDstFormat = compWindowFormat(pWin); + PictFormatPtr pSrcFormat = PictureWindowFormat(pParent); + PictFormatPtr pDstFormat = PictureWindowFormat(pWin); XID inferiors = IncludeInferiors; int error; diff --git a/xserver/composite/compext.c b/xserver/composite/compext.c index 940eed1fc..8641eff5e 100644 --- a/xserver/composite/compext.c +++ b/xserver/composite/compext.c @@ -48,6 +48,7 @@ #include "compint.h" #include "xace.h" #include "protocol-versions.h" +#include "extinit.h" static CARD8 CompositeReqCode; static DevPrivateKeyRec CompositeClientPrivateKeyRec; @@ -107,14 +108,15 @@ static int ProcCompositeQueryVersion(ClientPtr client) { CompositeClientPtr pCompositeClient = GetCompositeClient(client); - xCompositeQueryVersionReply rep; + xCompositeQueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; REQUEST(xCompositeQueryVersionReq); REQUEST_SIZE_MATCH(xCompositeQueryVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; if (stuff->majorVersion < SERVER_COMPOSITE_MAJOR_VERSION) { rep.majorVersion = stuff->majorVersion; rep.minorVersion = stuff->minorVersion; @@ -131,7 +133,7 @@ ProcCompositeQueryVersion(ClientPtr client) swapl(&rep.majorVersion); swapl(&rep.minorVersion); } - WriteToClient(client, sizeof(xCompositeQueryVersionReply), (char *) &rep); + WriteToClient(client, sizeof(xCompositeQueryVersionReply), &rep); return Success; } @@ -311,18 +313,19 @@ ProcCompositeGetOverlayWindow(ClientPtr client) return rc; } - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.overlayWin = cs->pOverlayWin->drawable.id; + rep = (xCompositeGetOverlayWindowReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .overlayWin = cs->pOverlayWin->drawable.id + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.overlayWin); } - (void) WriteToClient(client, sz_xCompositeGetOverlayWindowReply, - (char *) &rep); + WriteToClient(client, sz_xCompositeGetOverlayWindowReply, &rep); return Success; } @@ -497,6 +500,28 @@ SProcCompositeDispatch(ClientPtr client) return BadRequest; } +/** @see GetDefaultBytes */ +static void +GetCompositeClientWindowBytes(pointer value, XID id, ResourceSizePtr size) +{ + WindowPtr window = value; + + /* Currently only pixmap bytes are reported to clients. */ + size->resourceSize = 0; + + /* Calculate pixmap reference sizes. */ + size->pixmapRefSize = 0; + if (window->redirectDraw != RedirectDrawNone) + { + SizeType pixmapSizeFunc = GetResourceTypeSizeFunc(RT_PIXMAP); + ResourceSizeRec pixmapSize = { 0, 0 }; + ScreenPtr screen = window->drawable.pScreen; + PixmapPtr pixmap = screen->GetWindowPixmap(window); + pixmapSizeFunc(pixmap, pixmap->drawable.id, &pixmapSize); + size->pixmapRefSize += pixmapSize.pixmapRefSize; + } +} + void CompositeExtensionInit(void) { @@ -529,6 +554,9 @@ CompositeExtensionInit(void) if (!CompositeClientWindowType) return; + SetResourceTypeSizeFunc(CompositeClientWindowType, + GetCompositeClientWindowBytes); + CompositeClientSubwindowsType = CreateNewResourceType (FreeCompositeClientSubwindows, "CompositeClientSubwindows"); if (!CompositeClientSubwindowsType) @@ -818,18 +846,19 @@ PanoramiXCompositeGetOverlayWindow(ClientPtr client) cs = GetCompScreen(screenInfo.screens[0]); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.overlayWin = cs->pOverlayWin->drawable.id; + rep = (xCompositeGetOverlayWindowReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .overlayWin = cs->pOverlayWin->drawable.id + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.overlayWin); } - (void) WriteToClient(client, sz_xCompositeGetOverlayWindowReply, - (char *) &rep); + WriteToClient(client, sz_xCompositeGetOverlayWindowReply, &rep); return Success; } diff --git a/xserver/composite/compinit.c b/xserver/composite/compinit.c index eaa125681..bc1130e78 100644 --- a/xserver/composite/compinit.c +++ b/xserver/composite/compinit.c @@ -53,7 +53,7 @@ DevPrivateKeyRec CompWindowPrivateKeyRec; DevPrivateKeyRec CompSubwindowsPrivateKeyRec; static Bool -compCloseScreen(int index, ScreenPtr pScreen) +compCloseScreen(ScreenPtr pScreen) { CompScreenPtr cs = GetCompScreen(pScreen); Bool ret; @@ -82,7 +82,7 @@ compCloseScreen(int index, ScreenPtr pScreen) free(cs); dixSetPrivate(&pScreen->devPrivates, CompScreenPrivateKey, NULL); - ret = (*pScreen->CloseScreen) (index, pScreen); + ret = (*pScreen->CloseScreen) (pScreen); return ret; } diff --git a/xserver/composite/compint.h b/xserver/composite/compint.h index 6c4272e5b..45b5824a9 100644 --- a/xserver/composite/compint.h +++ b/xserver/composite/compint.h @@ -71,6 +71,7 @@ #include "damageextint.h" #include "xfixes.h" #include +#include "compositeext.h" #include /* @@ -182,7 +183,6 @@ extern DevPrivateKeyRec CompSubwindowsPrivateKeyRec; #define GetCompSubwindows(w) ((CompSubwindowsPtr) \ dixLookupPrivate(&(w)->devPrivates, CompSubwindowsPrivateKey)) -extern RESTYPE CompositeClientWindowType; extern RESTYPE CompositeClientSubwindowsType; extern RESTYPE CompositeClientOverlayType; @@ -228,13 +228,6 @@ Bool compReallocPixmap(WindowPtr pWin, int x, int y, unsigned int w, unsigned int h, int bw); -/* - * compext.c - */ - -void - CompositeExtensionInit(void); - /* * compinit.c */ @@ -272,8 +265,6 @@ void #define compCheckTree(s) #endif -PictFormatPtr compWindowFormat(WindowPtr pWin); - void compSetPixmap(WindowPtr pWin, PixmapPtr pPixmap); diff --git a/xserver/composite/compositeext.h b/xserver/composite/compositeext.h index 600604d8d..0b148f029 100644 --- a/xserver/composite/compositeext.h +++ b/xserver/composite/compositeext.h @@ -35,4 +35,6 @@ extern _X_EXPORT Bool CompositeRegisterAlternateVisuals(ScreenPtr pScreen, VisualID * vids, int nVisuals); +extern _X_EXPORT RESTYPE CompositeClientWindowType; + #endif /* _COMPOSITEEXT_H_ */ diff --git a/xserver/composite/compwindow.c b/xserver/composite/compwindow.c index 6eb624b11..0be7a1b34 100644 --- a/xserver/composite/compwindow.c +++ b/xserver/composite/compwindow.c @@ -208,7 +208,8 @@ updateOverlayWindow(ScreenPtr pScreen) return ConfigureWindow(pWin, CWWidth | CWHeight, vlist, wClient(pWin)); } - /* Let's be on the safe side and not assume an overlay window is always allocated. */ + /* Let's be on the safe side and not assume an overlay window is + always allocated. */ return Success; } @@ -631,28 +632,6 @@ compGetRedirectBorderClip(WindowPtr pWin) return &cw->borderClip; } -static VisualPtr -compGetWindowVisual(WindowPtr pWin) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - VisualID vid = wVisual(pWin); - int i; - - for (i = 0; i < pScreen->numVisuals; i++) - if (pScreen->visuals[i].vid == vid) - return &pScreen->visuals[i]; - return 0; -} - -PictFormatPtr -compWindowFormat(WindowPtr pWin) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - - return PictureMatchVisual(pScreen, pWin->drawable.depth, - compGetWindowVisual(pWin)); -} - static void compWindowUpdateAutomatic(WindowPtr pWin) { @@ -660,8 +639,8 @@ compWindowUpdateAutomatic(WindowPtr pWin) ScreenPtr pScreen = pWin->drawable.pScreen; WindowPtr pParent = pWin->parent; PixmapPtr pSrcPixmap = (*pScreen->GetWindowPixmap) (pWin); - PictFormatPtr pSrcFormat = compWindowFormat(pWin); - PictFormatPtr pDstFormat = compWindowFormat(pWin->parent); + PictFormatPtr pSrcFormat = PictureWindowFormat(pWin); + PictFormatPtr pDstFormat = PictureWindowFormat(pWin->parent); int error; RegionPtr pRegion = DamageRegion(cw->damage); PicturePtr pSrcPicture = CreatePicture(0, &pSrcPixmap->drawable, @@ -700,7 +679,8 @@ compWindowUpdateAutomatic(WindowPtr pWin) /* * And paint */ - CompositePicture(PictOpSrc, pSrcPicture, 0, pDstPicture, 0, 0, /* src_x, src_y */ + CompositePicture(PictOpSrc, pSrcPicture, 0, pDstPicture, + 0, 0, /* src_x, src_y */ 0, 0, /* msk_x, msk_y */ pSrcPixmap->screen_x - pParent->drawable.x, pSrcPixmap->screen_y - pParent->drawable.y, diff --git a/xserver/config.guess b/xserver/config.guess index aa04f04bd..872b96a16 100644 --- a/xserver/config.guess +++ b/xserver/config.guess @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, # 2011, 2012 Free Software Foundation, Inc. -timestamp='2012-06-17' +timestamp='2012-09-25' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -306,7 +306,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; - arm:riscos:*:*|arm:RISCOS:*:*) + arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) @@ -805,6 +805,9 @@ EOF i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; + *:MINGW64*:*) + echo ${UNAME_MACHINE}-pc-mingw64 + exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; @@ -1205,6 +1208,9 @@ EOF BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; + x86_64:Haiku:*:*) + echo x86_64-unknown-haiku + exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; @@ -1334,9 +1340,6 @@ EOF exit ;; esac -#echo '(No uname command or uname output not recognized.)' 1>&2 -#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 - eval $set_cc_for_build cat >$dummy.c <list); + return attriblist; +} + +void +config_odev_free_attribute_list(struct OdevAttributes *attribs) +{ + config_odev_free_attributes(attribs); + free(attribs); +} + +Bool +config_odev_add_attribute(struct OdevAttributes *attribs, int attrib, + const char *attrib_name) +{ + struct OdevAttribute *oa; + + oa = malloc(sizeof(struct OdevAttribute)); + if (!oa) + return FALSE; + + oa->attrib_id = attrib; + oa->attrib_name = strdup(attrib_name); + xorg_list_append(&oa->member, &attribs->list); + return TRUE; +} + +void +config_odev_free_attributes(struct OdevAttributes *attribs) +{ + struct OdevAttribute *iter, *safe; + + xorg_list_for_each_entry_safe(iter, safe, &attribs->list, member) { + xorg_list_del(&iter->member); + free(iter->attrib_name); + free(iter); + } +} diff --git a/xserver/config/udev.c b/xserver/config/udev.c index 8b3ca0475..de8924143 100644 --- a/xserver/config/udev.c +++ b/xserver/config/udev.c @@ -52,6 +52,12 @@ static struct udev_monitor *udev_monitor; +#ifdef CONFIG_UDEV_KMS +static Bool +config_udev_odev_setup_attribs(const char *path, const char *syspath, + config_odev_probe_proc_ptr probe_callback); +#endif + static void device_added(struct udev_device *udev_device) { @@ -85,6 +91,20 @@ device_added(struct udev_device *udev_device) if (!SeatId && strcmp(dev_seat, "seat0")) return; +#ifdef CONFIG_UDEV_KMS + if (!strcmp(udev_device_get_subsystem(udev_device), "drm")) { + const char *sysname = udev_device_get_sysname(udev_device); + + if (strncmp(sysname, "card", 4) != 0) + return; + + LogMessage(X_INFO, "config/udev: Adding drm device (%s)\n", path); + + config_udev_odev_setup_attribs(path, syspath, NewGPUDeviceRequest); + return; + } +#endif + if (!udev_device_get_property_value(udev_device, "ID_INPUT")) { LogMessageVerb(X_INFO, 10, "config/udev: ignoring device %s without " @@ -240,6 +260,22 @@ device_removed(struct udev_device *device) char *value; const char *syspath = udev_device_get_syspath(device); +#ifdef CONFIG_UDEV_KMS + if (!strcmp(udev_device_get_subsystem(device), "drm")) { + const char *sysname = udev_device_get_sysname(device); + const char *path = udev_device_get_devnode(device); + + if (strncmp(sysname,"card", 4) != 0) + return; + ErrorF("removing GPU device %s %s\n", syspath, path); + if (!path) + return; + + config_udev_odev_setup_attribs(path, syspath, DeleteGPUDeviceRequest); + return; + } +#endif + if (asprintf(&value, "udev:%s", syspath) == -1) return; @@ -264,9 +300,15 @@ wakeup_handler(pointer data, int err, pointer read_mask) return; action = udev_device_get_action(udev_device); if (action) { - if (!strcmp(action, "add") || !strcmp(action, "change")) { + if (!strcmp(action, "add")) { device_removed(udev_device); device_added(udev_device); + } else if (!strcmp(action, "change")) { + /* ignore change for the drm devices */ + if (strcmp(udev_device_get_subsystem(udev_device), "drm")) { + device_removed(udev_device); + device_added(udev_device); + } } else if (!strcmp(action, "remove")) device_removed(udev_device); @@ -281,42 +323,58 @@ block_handler(pointer data, struct timeval **tv, pointer read_mask) } int -config_udev_init(void) +config_udev_pre_init(void) { struct udev *udev; - struct udev_enumerate *enumerate; - struct udev_list_entry *devices, *device; udev = udev_new(); if (!udev) return 0; + udev_monitor = udev_monitor_new_from_netlink(udev, "udev"); if (!udev_monitor) return 0; udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, "input", NULL); - udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, "tty", NULL); /* For Wacom serial devices */ - -#ifdef HAVE_UDEV_MONITOR_FILTER_ADD_MATCH_TAG - if (SeatId && strcmp(SeatId, "seat0")) - udev_monitor_filter_add_match_tag(udev_monitor, SeatId); + /* For Wacom serial devices */ + udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, "tty", NULL); +#ifdef CONFIG_UDEV_KMS + /* For output GPU devices */ + udev_monitor_filter_add_match_subsystem_devtype(udev_monitor, "drm", NULL); #endif +#ifdef HAVE_UDEV_MONITOR_FILTER_ADD_MATCH_TAG + if (ServerIsNotSeat0()) + udev_monitor_filter_add_match_tag(udev_monitor, SeatId); +#endif if (udev_monitor_enable_receiving(udev_monitor)) { ErrorF("config/udev: failed to bind the udev monitor\n"); return 0; } + return 1; +} +int +config_udev_init(void) +{ + struct udev *udev; + struct udev_enumerate *enumerate; + struct udev_list_entry *devices, *device; + + udev = udev_monitor_get_udev(udev_monitor); enumerate = udev_enumerate_new(udev); if (!enumerate) return 0; udev_enumerate_add_match_subsystem(enumerate, "input"); udev_enumerate_add_match_subsystem(enumerate, "tty"); +#ifdef CONFIG_UDEV_KMS + udev_enumerate_add_match_subsystem(enumerate, "drm"); +#endif #ifdef HAVE_UDEV_ENUMERATE_ADD_MATCH_TAG - if (SeatId && strcmp(SeatId, "seat0")) + if (ServerIsNotSeat0()) udev_enumerate_add_match_tag(enumerate, SeatId); #endif @@ -358,3 +416,76 @@ config_udev_fini(void) udev_monitor = NULL; udev_unref(udev); } + +#ifdef CONFIG_UDEV_KMS + +static Bool +config_udev_odev_setup_attribs(const char *path, const char *syspath, + config_odev_probe_proc_ptr probe_callback) +{ + struct OdevAttributes *attribs = config_odev_allocate_attribute_list(); + int ret; + + if (!attribs) + return FALSE; + + ret = config_odev_add_attribute(attribs, ODEV_ATTRIB_PATH, path); + if (ret == FALSE) + goto fail; + + ret = config_odev_add_attribute(attribs, ODEV_ATTRIB_SYSPATH, syspath); + if (ret == FALSE) + goto fail; + + /* ownership of attribs is passed to probe layer */ + probe_callback(attribs); + return TRUE; +fail: + config_odev_free_attributes(attribs); + free(attribs); + return FALSE; +} + +void +config_udev_odev_probe(config_odev_probe_proc_ptr probe_callback) +{ + struct udev *udev; + struct udev_enumerate *enumerate; + struct udev_list_entry *devices, *device; + + udev = udev_monitor_get_udev(udev_monitor); + enumerate = udev_enumerate_new(udev); + if (!enumerate) + return; + + udev_enumerate_add_match_subsystem(enumerate, "drm"); + udev_enumerate_add_match_sysname(enumerate, "card[0-9]*"); +#ifdef HAVE_UDEV_ENUMERATE_ADD_MATCH_TAG + if (ServerIsNotSeat0()) + udev_enumerate_add_match_tag(enumerate, SeatId); +#endif + udev_enumerate_scan_devices(enumerate); + devices = udev_enumerate_get_list_entry(enumerate); + udev_list_entry_foreach(device, devices) { + const char *syspath = udev_list_entry_get_name(device); + struct udev_device *udev_device = udev_device_new_from_syspath(udev, syspath); + const char *path = udev_device_get_devnode(udev_device); + const char *sysname = udev_device_get_sysname(udev_device); + + if (!path || !syspath) + goto no_probe; + else if (strcmp(udev_device_get_subsystem(udev_device), "drm") != 0) + goto no_probe; + else if (strncmp(sysname, "card", 4) != 0) + goto no_probe; + + config_udev_odev_setup_attribs(path, syspath, probe_callback); + + no_probe: + udev_device_unref(udev_device); + } + udev_enumerate_unref(enumerate); + return; +} +#endif + diff --git a/xserver/config/wscons.c b/xserver/config/wscons.c index d94b88eb8..7f5f85e3b 100644 --- a/xserver/config/wscons.c +++ b/xserver/config/wscons.c @@ -42,19 +42,21 @@ #define WSCONS_MOUSE_PREFIX "/dev/wsmouse" #define KB_OVRENC \ - { KB_UK, "gb" }, \ - { KB_SV, "se" }, \ - { KB_SG, "ch" }, \ - { KB_SF, "ch" }, \ - { KB_LA, "latam" }, \ - { KB_CF, "ca" } + { KB_UK, "gb" }, \ + { KB_SV, "se" }, \ + { KB_SG, "ch" }, \ + { KB_SF, "ch" }, \ + { KB_LA, "latam" }, \ + { KB_CF, "ca" } struct nameint { int val; char *name; } kbdenc[] = { - KB_OVRENC, KB_ENCTAB, { -0}}; + KB_OVRENC, + KB_ENCTAB, + {0} +}; struct nameint kbdvar[] = { {KB_NODEAD | KB_SG, "de_nodeadkeys"}, diff --git a/xserver/configure b/xserver/configure index dee14cea1..692cfb8ce 100644 --- a/xserver/configure +++ b/xserver/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for xorg-server 1.12.3. +# Generated by GNU Autoconf 2.69 for xorg-server 1.14.1. # # Report bugs to . # @@ -651,8 +651,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='xorg-server' PACKAGE_TARNAME='xorg-server' -PACKAGE_VERSION='1.12.3' -PACKAGE_STRING='xorg-server 1.12.3' +PACKAGE_VERSION='1.14.1' +PACKAGE_STRING='xorg-server 1.14.1' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' PACKAGE_URL='' @@ -808,6 +808,8 @@ XWINMODULES_CFLAGS WINDRES DEFAULT_LOGDIR SYSCONFDIR +XORG_BUS_PLATFORM_FALSE +XORG_BUS_PLATFORM_TRUE XF86VIDMODE_FALSE XF86VIDMODE_TRUE DGA_FALSE @@ -872,6 +874,12 @@ XVFB_SYS_LIBS XVFB_LIBS XVFB_FALSE XVFB_TRUE +NO_UNDEFINED_FALSE +NO_UNDEFINED_TRUE +CYGWIN_FALSE +CYGWIN_TRUE +XORG_DRIVER_LIBS +LD_NO_UNDEFINED_FLAG LD_EXPORT_SYMBOLS_FLAG UTILS_SYS_LIBS XSERVER_SYS_LIBS @@ -917,8 +925,6 @@ VBE_FALSE VBE_TRUE VGAHW_FALSE VGAHW_TRUE -XAA_FALSE -XAA_TRUE XF86UTILS_FALSE XF86UTILS_TRUE DPMSExtension_FALSE @@ -945,12 +951,9 @@ DRI2_FALSE DRI2_TRUE DRI2PROTO_LIBS DRI2PROTO_CFLAGS -DRI_LIBS -DRI_CFLAGS -DRIPROTO_LIBS -DRIPROTO_CFLAGS DRI_FALSE DRI_TRUE +GLX_SYS_LIBS GLX_DEFINES AIGLX_DRI_LOADER_FALSE AIGLX_DRI_LOADER_TRUE @@ -992,6 +995,8 @@ HAVE_DBUS_FALSE HAVE_DBUS_TRUE DBUS_LIBS DBUS_CFLAGS +CONFIG_UDEV_KMS_FALSE +CONFIG_UDEV_KMS_TRUE CONFIG_UDEV_FALSE CONFIG_UDEV_TRUE UDEV_LIBS @@ -1173,9 +1178,6 @@ CPPFLAGS LDFLAGS CFLAGS CC -MAINT -MAINTAINER_MODE_FALSE -MAINTAINER_MODE_TRUE am__untar am__tar AMTAR @@ -1240,7 +1242,6 @@ SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking -enable_maintainer_mode enable_dependency_tracking enable_selective_werror enable_strict_compilation @@ -1325,11 +1326,11 @@ enable_dbe enable_xf86bigfont enable_dpms enable_config_udev +enable_config_udev_kms enable_config_dbus enable_config_hal enable_config_wscons enable_xfree86_utils -enable_xaa enable_vgahw enable_vbe enable_int10_module @@ -1391,10 +1392,6 @@ XLIB_CFLAGS XLIB_LIBS GL_CFLAGS GL_LIBS -DRIPROTO_CFLAGS -DRIPROTO_LIBS -DRI_CFLAGS -DRI_LIBS DRI2PROTO_CFLAGS DRI2PROTO_LIBS LIBDRM_CFLAGS @@ -1989,7 +1986,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures xorg-server 1.12.3 to adapt to many kinds of systems. +\`configure' configures xorg-server 1.14.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -2059,7 +2056,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xorg-server 1.12.3:";; + short | recursive ) echo "Configuration of xorg-server 1.14.1:";; esac cat <<\_ACEOF @@ -2067,9 +2064,6 @@ Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-maintainer-mode - enable make rules and dependencies not useful (and - sometimes confusing) to the casual installer --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking @@ -2108,7 +2102,7 @@ Optional Features: (default is NO) --disable-registry Build string registry module (default: enabled) --disable-composite Build Composite extension (default: enabled) - --disable-mitshm Build SHM extension (default: enabled) + --disable-mitshm Build SHM extension (default: auto) --disable-xres Build XRes extension (default: enabled) --disable-record Build Record extension (default: enabled) --disable-xv Build Xv extension (default: enabled) @@ -2131,11 +2125,12 @@ Optional Features: --enable-xf86bigfont Build XF86 Big Font extension (default: disabled) --disable-dpms Build DPMS extension (default: enabled) --enable-config-udev Build udev support (default: auto) + --enable-config-udev-kms + Build udev kms support (default: auto) --enable-config-dbus Build D-BUS API support (default: no) --disable-config-hal Build HAL support (default: auto) --enable-config-wscons Build wscons config support (default: auto) --enable-xfree86-utils Build xfree86 DDX utilities (default: enabled) - --enable-xaa Build XAA (default: enabled) --enable-vgahw Build Xorg with vga access (default: enabled) --enable-vbe Build Xorg with VBE module (default: enabled) --enable-int10-module Build Xorg with int10 module (default: enabled) @@ -2248,7 +2243,7 @@ Optional Packages: (default: auto) --with-xkb-bin-directory=DIR Directory containing xkbcomp program - --with-sha1=libc|libmd|libgcrypt|libcrypto|libsha1|CommonCrypto + --with-sha1=libc|libmd|libnettle|libgcrypt|libcrypto|libsha1|CommonCrypto|CryptoAPI choose SHA1 implementation Some influential environment variables: @@ -2288,12 +2283,6 @@ Some influential environment variables: XLIB_LIBS linker flags for XLIB, overriding pkg-config GL_CFLAGS C compiler flags for GL, overriding pkg-config GL_LIBS linker flags for GL, overriding pkg-config - DRIPROTO_CFLAGS - C compiler flags for DRIPROTO, overriding pkg-config - DRIPROTO_LIBS - linker flags for DRIPROTO, overriding pkg-config - DRI_CFLAGS C compiler flags for DRI, overriding pkg-config - DRI_LIBS linker flags for DRI, overriding pkg-config DRI2PROTO_CFLAGS C compiler flags for DRI2PROTO, overriding pkg-config DRI2PROTO_LIBS @@ -2464,7 +2453,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xorg-server configure 1.12.3 +xorg-server configure 1.14.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -3173,7 +3162,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by xorg-server $as_me 1.12.3, which was +It was created by xorg-server $as_me 1.14.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3521,7 +3510,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -RELEASE_DATE="2012-07-09" +RELEASE_DATE="2013-04-17" +RELEASE_NAME="Act Normal" am__api_version='1.12' @@ -3999,7 +3989,7 @@ fi # Define the identity of the package. PACKAGE='xorg-server' - VERSION='1.12.3' + VERSION='1.14.1' cat >>confdefs.h <<_ACEOF @@ -4046,29 +4036,6 @@ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 -$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } - # Check whether --enable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then : - enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval -else - USE_MAINTAINER_MODE=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 -$as_echo "$USE_MAINTAINER_MODE" >&6; } - if test $USE_MAINTAINER_MODE = yes; then - MAINTAINER_MODE_TRUE= - MAINTAINER_MODE_FALSE='#' -else - MAINTAINER_MODE_TRUE='#' - MAINTAINER_MODE_FALSE= -fi - - MAINT=$MAINTAINER_MODE_TRUE - - - # Require xorg-macros minimum of 1.14 for XORG_COMPILER_BRAND in XORG_DEFAULT_OPTIONS @@ -21220,6 +21187,60 @@ $as_echo "#define const /**/" >>confdefs.h fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for typeof syntax and keyword spelling" >&5 +$as_echo_n "checking for typeof syntax and keyword spelling... " >&6; } +if ${ac_cv_c_typeof+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_c_typeof=no + for ac_kw in typeof __typeof__ no; do + test $ac_kw = no && break + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + int value; + typedef struct { + char a [1 + + ! (($ac_kw (value)) + (($ac_kw (value)) 0 < ($ac_kw (value)) -1 + ? ($ac_kw (value)) - 1 + : ~ (~ ($ac_kw (value)) 0 + << sizeof ($ac_kw (value)))))]; } + ac__typeof_type_; + return + (! ((void) ((ac__typeof_type_ *) 0), 0)); + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_typeof=$ac_kw +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + test $ac_cv_c_typeof != no && break + done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_typeof" >&5 +$as_echo "$ac_cv_c_typeof" >&6; } + if test $ac_cv_c_typeof != no; then + +$as_echo "#define HAVE_TYPEOF 1" >>confdefs.h + + if test $ac_cv_c_typeof != typeof; then + +cat >>confdefs.h <<_ACEOF +#define typeof $ac_cv_c_typeof +_ACEOF + + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 $as_echo_n "checking whether byte ordering is bigendian... " >&6; } if ${ac_cv_c_bigendian+:} false; then : @@ -21976,6 +21997,7 @@ else #include #include #include +#include int main () @@ -21983,7 +22005,7 @@ main () { int id; - id = shmget(IPC_PRIVATE, 512, SHM_W | SHM_R); + id = shmget(IPC_PRIVATE, 512, S_IRUSR | S_IWUSR); if (id < 0) return -1; return shmctl(id, IPC_RMID, 0); } @@ -22331,7 +22353,7 @@ fi $as_echo "#define CSRG_BASED 1" >>confdefs.h ;; - cygwin*) + cygwin*|mingw*) CFLAGS="$CFLAGS -DFD_SETSIZE=256" ;; esac @@ -22766,7 +22788,7 @@ main () } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_tls=$kw + ac_cv_tls=$kw ; break ; fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done @@ -22885,7 +22907,7 @@ fi if test "${enable_mitshm+set}" = set; then : enableval=$enable_mitshm; MITSHM=$enableval else - MITSHM=yes + MITSHM=auto fi # Check whether --enable-xres was given. @@ -23033,6 +23055,13 @@ else CONFIG_UDEV=auto fi +# Check whether --enable-config-udev-kms was given. +if test "${enable_config_udev_kms+set}" = set; then : + enableval=$enable_config_udev_kms; CONFIG_UDEV_KMS=$enableval +else + CONFIG_UDEV_KMS=auto +fi + # Check whether --enable-config-dbus was given. if test "${enable_config_dbus+set}" = set; then : enableval=$enable_config_dbus; CONFIG_DBUS_API=$enableval @@ -23061,13 +23090,6 @@ else XF86UTILS=yes fi -# Check whether --enable-xaa was given. -if test "${enable_xaa+set}" = set; then : - enableval=$enable_xaa; XAA=$enableval -else - XAA=yes -fi - # Check whether --enable-vgahw was given. if test "${enable_vgahw+set}" = set; then : enableval=$enable_vgahw; VGAHW=$enableval @@ -23230,6 +23252,7 @@ $as_echo_n "checking to see if we can install the Xorg server as root... " >&6; if test "x$SETUID" = "xauto" ; then case $host_os in cygwin*) SETUID="no" ;; + mingw*) SETUID="no" ;; darwin*) SETUID="no" ;; *) case $host_cpu in @@ -23706,12 +23729,22 @@ fi case $host_os in - cygwin*) + cygwin* | mingw*) + CONFIG_DBUS_API=no + CONFIG_HAL=no + CONFIG_UDEV=no + CONFIG_UDEV_KMS=no DGA=no DRI2=no + INT10MODULE=no + PCI=no + VGAHW=no + VBE=no + XF86UTILS=no XF86VIDMODE=no XSELINUX=no XV=no + SYMBOL_VISIBILITY=no ;; darwin*) PCI=no @@ -23777,29 +23810,28 @@ esac XEXT_INC='-I$(top_srcdir)/Xext' XEXT_LIB='$(top_builddir)/Xext/libXext.la' -XEXTXORG_LIB='$(top_builddir)/Xext/libXextbuiltin.la' VIDEOPROTO="videoproto" COMPOSITEPROTO="compositeproto >= 0.4" RECORDPROTO="recordproto >= 1.13.99.1" SCRNSAVERPROTO="scrnsaverproto >= 1.1" -RESOURCEPROTO="resourceproto" +RESOURCEPROTO="resourceproto >= 1.2.0" DRIPROTO="xf86driproto >= 2.1.0" -DRI2PROTO="dri2proto >= 2.6" +DRI2PROTO="dri2proto >= 2.8" XINERAMAPROTO="xineramaproto" BIGFONTPROTO="xf86bigfontproto >= 1.2.0" DGAPROTO="xf86dgaproto >= 2.0.99.1" -GLPROTO="glproto >= 1.4.14" +GLPROTO="glproto >= 1.4.16" DMXPROTO="dmxproto >= 2.2.99.1" VIDMODEPROTO="xf86vidmodeproto >= 2.2.99.1" WINDOWSWMPROTO="windowswmproto" APPLEWMPROTO="applewmproto >= 1.4" XPROTO="xproto >= 7.0.22" -RANDRPROTO="randrproto >= 1.2.99.3" +RANDRPROTO="randrproto >= 1.4.0" RENDERPROTO="renderproto >= 0.11" XEXTPROTO="xextproto >= 7.1.99" -INPUTPROTO="inputproto >= 2.1.99.6" +INPUTPROTO="inputproto >= 2.3" KBPROTO="kbproto >= 1.0.3" FONTSPROTO="fontsproto" FIXESPROTO="fixesproto >= 5.0" @@ -23821,7 +23853,7 @@ LIBPCIACCESS="pciaccess >= 0.12.901" LIBUDEV="libudev >= 143" LIBSELINUX="libselinux >= 2.0.86" LIBDBUS="dbus-1 >= 1.0" -LIBPIXMAN="pixman-1 >= 0.21.8" +LIBPIXMAN="pixman-1 >= 0.27.2" pkg_failed=no @@ -24011,13 +24043,20 @@ fi if test "x$CONFIG_UDEV" = xyes; then CONFIG_DBUS_API=no CONFIG_HAL=no + if test "x$CONFIG_UDEV_KMS" = xauto; then + CONFIG_UDEV_KMS="$HAVE_LIBUDEV" + fi if ! test "x$HAVE_LIBUDEV" = xyes; then as_fn_error $? "udev configuration API requested, but libudev is not installed" "$LINENO" 5 fi $as_echo "#define CONFIG_UDEV 1" >>confdefs.h + if test "x$CONFIG_UDEV_KMS" = xyes; then +$as_echo "#define CONFIG_UDEV_KMS 1" >>confdefs.h + + fi SAVE_LIBS=$LIBS SAVE_CFLAGS=$CFLAGS CFLAGS=$UDEV_CFLAGS @@ -24047,6 +24086,14 @@ done LIBS=$SAVE_LIBS CFLAGS=$SAVE_CFLAGS fi + if test "x$CONFIG_UDEV_KMS" = xyes; then + CONFIG_UDEV_KMS_TRUE= + CONFIG_UDEV_KMS_FALSE='#' +else + CONFIG_UDEV_KMS_TRUE='#' + CONFIG_UDEV_KMS_FALSE= +fi + pkg_failed=no @@ -24500,6 +24547,9 @@ $as_echo "#define COMPOSITE 1" >>confdefs.h COMPOSITE_INC='-I$(top_srcdir)/composite' fi +if test "x$MITSHM" = xauto; then + MITSHM="$ac_cv_sysv_ipc" +fi if test "x$MITSHM" = xyes; then MITSHM_TRUE= MITSHM_FALSE='#' @@ -24816,6 +24866,7 @@ if test "x$GLX_USE_TLS" = xyes ; then fi + if test "x$DRI" = xyes; then DRI_TRUE= DRI_FALSE='#' @@ -24828,187 +24879,8 @@ if test "x$DRI" = xyes; then $as_echo "#define XF86DRI 1" >>confdefs.h - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DRIPROTO" >&5 -$as_echo_n "checking for DRIPROTO... " >&6; } - -if test -n "$PKG_CONFIG"; then - if test -n "$DRIPROTO_CFLAGS"; then - pkg_cv_DRIPROTO_CFLAGS="$DRIPROTO_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$DRIPROTO\""; } >&5 - ($PKG_CONFIG --exists --print-errors "$DRIPROTO") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_DRIPROTO_CFLAGS=`$PKG_CONFIG --cflags "$DRIPROTO" 2>/dev/null` -else - pkg_failed=yes -fi - fi -else - pkg_failed=untried -fi -if test -n "$PKG_CONFIG"; then - if test -n "$DRIPROTO_LIBS"; then - pkg_cv_DRIPROTO_LIBS="$DRIPROTO_LIBS" - else - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$DRIPROTO\""; } >&5 - ($PKG_CONFIG --exists --print-errors "$DRIPROTO") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_DRIPROTO_LIBS=`$PKG_CONFIG --libs "$DRIPROTO" 2>/dev/null` -else - pkg_failed=yes -fi - fi -else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - DRIPROTO_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$DRIPROTO"` - else - DRIPROTO_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$DRIPROTO"` - fi - # Put the nasty error message in config.log where it belongs - echo "$DRIPROTO_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements ($DRIPROTO) were not met: - -$DRIPROTO_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -Alternatively, you may set the environment variables DRIPROTO_CFLAGS -and DRIPROTO_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -" "$LINENO" 5 -elif test $pkg_failed = untried; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -Alternatively, you may set the environment variables DRIPROTO_CFLAGS -and DRIPROTO_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. - -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } -else - DRIPROTO_CFLAGS=$pkg_cv_DRIPROTO_CFLAGS - DRIPROTO_LIBS=$pkg_cv_DRIPROTO_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - : -fi - -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DRI" >&5 -$as_echo_n "checking for DRI... " >&6; } - -if test -n "$PKG_CONFIG"; then - if test -n "$DRI_CFLAGS"; then - pkg_cv_DRI_CFLAGS="$DRI_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$GLPROTO \$LIBDRI\""; } >&5 - ($PKG_CONFIG --exists --print-errors "$GLPROTO $LIBDRI") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_DRI_CFLAGS=`$PKG_CONFIG --cflags "$GLPROTO $LIBDRI" 2>/dev/null` -else - pkg_failed=yes -fi - fi -else - pkg_failed=untried -fi -if test -n "$PKG_CONFIG"; then - if test -n "$DRI_LIBS"; then - pkg_cv_DRI_LIBS="$DRI_LIBS" - else - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"\$GLPROTO \$LIBDRI\""; } >&5 - ($PKG_CONFIG --exists --print-errors "$GLPROTO $LIBDRI") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_DRI_LIBS=`$PKG_CONFIG --libs "$GLPROTO $LIBDRI" 2>/dev/null` -else - pkg_failed=yes -fi - fi -else - pkg_failed=untried -fi - - - -if test $pkg_failed = yes; then - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - DRI_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$GLPROTO $LIBDRI"` - else - DRI_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$GLPROTO $LIBDRI"` - fi - # Put the nasty error message in config.log where it belongs - echo "$DRI_PKG_ERRORS" >&5 - - as_fn_error $? "Package requirements ($GLPROTO $LIBDRI) were not met: - -$DRI_PKG_ERRORS - -Consider adjusting the PKG_CONFIG_PATH environment variable if you -installed software in a non-standard prefix. - -Alternatively, you may set the environment variables DRI_CFLAGS -and DRI_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. -" "$LINENO" 5 -elif test $pkg_failed = untried; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it -is in your PATH or set the PKG_CONFIG environment variable to the full -path to pkg-config. - -Alternatively, you may set the environment variables DRI_CFLAGS -and DRI_LIBS to avoid the need to call pkg-config. -See the pkg-config man page for more details. - -To get pkg-config, see . -See \`config.log' for more details" "$LINENO" 5; } -else - DRI_CFLAGS=$pkg_cv_DRI_CFLAGS - DRI_LIBS=$pkg_cv_DRI_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - : -fi - + REQUIRED_MODULES="$REQUIRED_MODULES $DRIPROTO $GLPROTO $LIBDRI" + SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $DRIPROTO $GLPROTO $LIBDRI" fi @@ -25103,7 +24975,7 @@ else fi -if test "x$DRI" = xyes || test "x$DRI2" = xyes; then +if test "x$DRI" = xyes || test "x$DRI2" = xyes || test "x$CONFIG_UDEV_KMS" = xyes; then if test "x$DRM" = xyes; then $as_echo "#define WITH_LIBDRM 1" >>confdefs.h @@ -25243,8 +25115,8 @@ fi if test "x$DRI2" = xyes; then case $host_os in openbsd*) - XORG_SYS_LIBS="-lpthread" - ;; + XORG_SYS_LIBS="-lpthread" + ;; esac fi @@ -25480,6 +25352,7 @@ if test "x$DBE" = xyes; then $as_echo "#define DBE 1" >>confdefs.h DBE_LIB='$(top_builddir)/dbe/libdbe.la' + DBE_INC='-I$(top_srcdir)/dbe' fi if test "x$XF86BIGFONT" = xyes; then @@ -25552,14 +25425,6 @@ else XF86UTILS_FALSE= fi - if test "x$XAA" = xyes; then - XAA_TRUE= - XAA_FALSE='#' -else - XAA_TRUE='#' - XAA_FALSE= -fi - if test "x$VGAHW" = xyes; then VGAHW_TRUE= VGAHW_FALSE='#' @@ -26102,6 +25967,25 @@ $as_echo "#define HAVE_SHA1_IN_COMMONCRYPTO 1" >>confdefs.h SHA1_LIBS="" fi +ac_fn_c_check_header_compile "$LINENO" "wincrypt.h" "ac_cv_header_wincrypt_h" "#include +" +if test "x$ac_cv_header_wincrypt_h" = xyes; then : + HAVE_SHA1_IN_CRYPTOAPI=yes +fi + + +if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_CRYPTOAPI" = xyes; then + with_sha1=CryptoAPI +fi +if test "x$with_sha1" = xCryptoAPI && test "x$HAVE_SHA1_IN_CRYPTOAPI" != xyes; then + as_fn_error $? "CryptoAPI requested but not found" "$LINENO" 5 +fi +if test "x$with_sha1" = xCryptoAPI; then + +$as_echo "#define HAVE_SHA1_IN_CRYPTOAPI 1" >>confdefs.h + + SHA1_LIBS="" +fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SHA1Init in -lmd" >&5 $as_echo_n "checking for SHA1Init in -lmd... " >&6; } if ${ac_cv_lib_md_SHA1Init+:} false; then : @@ -26237,6 +26121,58 @@ $as_echo "#define HAVE_SHA1_IN_LIBSHA1 1" >>confdefs.h SHA1_LIBS=-lsha1 fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for nettle_sha1_init in -lnettle" >&5 +$as_echo_n "checking for nettle_sha1_init in -lnettle... " >&6; } +if ${ac_cv_lib_nettle_nettle_sha1_init+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnettle $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char nettle_sha1_init (); +int +main () +{ +return nettle_sha1_init (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_nettle_nettle_sha1_init=yes +else + ac_cv_lib_nettle_nettle_sha1_init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nettle_nettle_sha1_init" >&5 +$as_echo "$ac_cv_lib_nettle_nettle_sha1_init" >&6; } +if test "x$ac_cv_lib_nettle_nettle_sha1_init" = xyes; then : + HAVE_LIBNETTLE=yes +fi + +if test "x$with_sha1" = x && test "x$HAVE_LIBNETTLE" = xyes; then + with_sha1=libnettle +fi +if test "x$with_sha1" = xlibnettle && test "x$HAVE_LIBNETTLE" != xyes; then + as_fn_error $? "libnettle requested but not found" "$LINENO" 5 +fi +if test "x$with_sha1" = xlibnettle; then + +$as_echo "#define HAVE_SHA1_IN_LIBNETTLE 1" >>confdefs.h + + SHA1_LIBS=-lnettle +fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcry_md_open in -lgcrypt" >&5 $as_echo_n "checking for gcry_md_open in -lgcrypt... " >&6; } if ${ac_cv_lib_gcrypt_gcry_md_open+:} false; then : @@ -26649,6 +26585,88 @@ case $host_os in esac ;; esac +LD_NO_UNDEFINED_FLAG= +XORG_DRIVER_LIBS= +case "$host_os" in + cygwin*) + LD_EXPORT_SYMBOLS_FLAG="-Wl,--export-all,--out-implib,lib\$@.a" + LD_NO_UNDEFINED_FLAG="-no-undefined -Wl,\$(top_builddir)/hw/xfree86/libXorg.exe.a" + XORG_DRIVER_LIBS="-lXorg.exe -L\${moduledir} -lshadow -lfb -no-undefined" + CYGWIN=yes + ;; + solaris*) + # We use AC_LINK_IFELSE to generate a temporary program conftest$EXEEXT + # that we can link against for testing if the system linker is new + # enough to support -z parent= for verifying loadable modules + # are only calling functions defined in either the loading program or + # the libraries they're linked with. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int main(int argc, char **argv) { return 0; } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + mv conftest$EXEEXT conftest.parent + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the linker accepts -Wl,-z,parent=conftest.parent -G" >&5 +$as_echo_n "checking whether the linker accepts -Wl,-z,parent=conftest.parent -G... " >&6; } +if ${xorg_cv_linker_flags__Wl__z_parent_conftest_parent__G+:} false; then : + $as_echo_n "(cached) " >&6 +else + + ax_save_FLAGS=$LDFLAGS + LDFLAGS="-Wl,-z,parent=conftest.parent -G" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +extern int main(int argc, char **argv); + int call_main(void) { return main(0, NULL); } +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + xorg_cv_linker_flags__Wl__z_parent_conftest_parent__G=yes +else + xorg_cv_linker_flags__Wl__z_parent_conftest_parent__G=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$ax_save_FLAGS +fi + +eval xorg_check_linker_flags=$xorg_cv_linker_flags__Wl__z_parent_conftest_parent__G +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_check_linker_flags" >&5 +$as_echo "$xorg_check_linker_flags" >&6; } +if test "x$xorg_check_linker_flags" = xyes; then + LD_NO_UNDEFINED_FLAG="-Wl,-z,defs -Wl,-z,parent=\$(top_builddir)/hw/xfree86/Xorg" +# Not set yet, since this gets exported in xorg-server.pc to all the drivers, +# and they're not all fixed to build correctly with it yet. +# XORG_DRIVER_LIBS="-Wl,-z,defs -Wl,-z,parent=${bindir}/Xorg" + +else + : +fi + + rm -f conftest.parent + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ;; +esac + + + + if test x"$CYGWIN" = xyes; then + CYGWIN_TRUE= + CYGWIN_FALSE='#' +else + CYGWIN_TRUE='#' + CYGWIN_FALSE= +fi + + if test x"$LD_NO_UNDEFINED_FLAG" != x; then + NO_UNDEFINED_TRUE= + NO_UNDEFINED_FALSE='#' +else + NO_UNDEFINED_TRUE='#' + NO_UNDEFINED_FALSE= +fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if SVR4 needs to be defined" >&5 @@ -26676,7 +26694,7 @@ fi rm -f conftest* -XSERVER_CFLAGS="$XSERVER_CFLAGS $CORE_INCS $XEXT_INC $COMPOSITE_INC $DAMAGE_INC $FIXES_INC $XI_INC $MI_INC $MIEXT_SYNC_INC $MIEXT_SHADOW_INC $MIEXT_LAYER_INC $MIEXT_DAMAGE_INC $RENDER_INC $RANDR_INC $FB_INC" +XSERVER_CFLAGS="$XSERVER_CFLAGS $CORE_INCS $XEXT_INC $COMPOSITE_INC $DAMAGE_INC $FIXES_INC $XI_INC $MI_INC $MIEXT_SYNC_INC $MIEXT_SHADOW_INC $MIEXT_LAYER_INC $MIEXT_DAMAGE_INC $RENDER_INC $RANDR_INC $FB_INC $DBE_INC" @@ -26807,6 +26825,7 @@ if test "x$XORG" = xauto; then XORG="yes" case $host_os in cygwin*) XORG="no" ;; + mingw*) XORG="no" ;; darwin*) XORG="no" ;; esac fi @@ -26818,7 +26837,7 @@ if test "x$XORG" = xyes; then XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os' XORG_INCS="$XORG_DDXINCS $XORG_OSINCS" XORG_CFLAGS="$XORGSERVER_CFLAGS -DHAVE_XORG_CONFIG_H" - XORG_LIBS="$COMPOSITE_LIB $FIXES_LIB $XEXTXORG_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $XI_LIB $XKB_LIB" + XORG_LIBS="$COMPOSITE_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $XI_LIB $XKB_LIB" symbol_visibility= have_visibility=disabled @@ -26969,8 +26988,8 @@ $as_echo "yes" >&6; } : fi SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $LIBPCIACCESS" - XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $GLX_SYS_LIBS" - XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS" + XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $GLX_SYS_LIBS $LIBDRM_LIBS" + XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS $LIBDRM_CFLAGS" $as_echo "#define XSERVER_LIBPCIACCESS 1" >>confdefs.h @@ -27013,6 +27032,13 @@ _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PCI" >&5 $as_echo "$PCI" >&6; } + if test "x$CONFIG_UDEV_KMS" = xyes; then + +$as_echo "#define XSERVER_PLATFORM_BUS 1" >>confdefs.h + + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $XSERVER_PLATFORM_BUS" >&5 +$as_echo "$XSERVER_PLATFORM_BUS" >&6; } case $host_os in linux*) @@ -27598,9 +27624,6 @@ $as_echo "#define XORGSERVER 1" >>confdefs.h $as_echo "#define XFree86Server 1" >>confdefs.h -$as_echo "#define XFree86LOADER 1" >>confdefs.h - - cat >>confdefs.h <<_ACEOF #define XORG_VERSION_CURRENT $VENDOR_RELEASE _ACEOF @@ -27831,6 +27854,13 @@ else XF86VIDMODE_FALSE= fi + if test "x$CONFIG_UDEV_KMS" = xyes; then + XORG_BUS_PLATFORM_TRUE= + XORG_BUS_PLATFORM_FALSE='#' +else + XORG_BUS_PLATFORM_TRUE='#' + XORG_BUS_PLATFORM_FALSE= +fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build XWin DDX" >&5 @@ -28198,11 +28228,12 @@ $as_echo "#define RELOCATE_PROJECTROOT 1" >>confdefs.h $as_echo "#define HAS_WINSOCK 1" >>confdefs.h - XWIN_SYS_LIBS=-lwinsock2 + XWIN_SYS_LIBS="-lpthread -lws2_32" ;; esac + XWIN_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $RANDR_LIB $RENDER_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $OS_LIB" - XWIN_SYS_LIBS="$XWIN_SYS_LIBS $XWINMODULES_LIBS" + XWIN_SYS_LIBS="$XWIN_SYS_LIBS $XWINMODULES_LIBS $GLX_SYS_LIBS" @@ -28864,6 +28895,7 @@ if test "x$DMX" = xauto; then DMX="$have_dmx" case $host_os in cygwin*) DMX="no" ;; + mingw*) DMX="no" ;; darwin*) DMX="no" ;; esac fi @@ -30099,7 +30131,7 @@ DIX_CFLAGS="-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS" ac_config_commands="$ac_config_commands sdksyms" -ac_config_files="$ac_config_files Makefile glx/Makefile include/Makefile composite/Makefile damageext/Makefile dbe/Makefile dix/Makefile doc/Makefile doc/dtrace/Makefile man/Makefile fb/Makefile record/Makefile config/Makefile mi/Makefile miext/Makefile miext/sync/Makefile miext/damage/Makefile miext/shadow/Makefile miext/cw/Makefile miext/rootless/Makefile os/Makefile randr/Makefile render/Makefile xkb/Makefile Xext/Makefile Xi/Makefile xfixes/Makefile exa/Makefile hw/Makefile hw/xfree86/Makefile hw/xfree86/common/Makefile hw/xfree86/common/xf86Build.h hw/xfree86/ddc/Makefile hw/xfree86/dixmods/Makefile hw/xfree86/dixmods/extmod/Makefile hw/xfree86/doc/Makefile hw/xfree86/dri/Makefile hw/xfree86/dri2/Makefile hw/xfree86/exa/Makefile hw/xfree86/exa/man/Makefile hw/xfree86/fbdevhw/Makefile hw/xfree86/fbdevhw/man/Makefile hw/xfree86/i2c/Makefile hw/xfree86/int10/Makefile hw/xfree86/loader/Makefile hw/xfree86/man/Makefile hw/xfree86/modes/Makefile hw/xfree86/os-support/Makefile hw/xfree86/os-support/bsd/Makefile hw/xfree86/os-support/bus/Makefile hw/xfree86/os-support/hurd/Makefile hw/xfree86/os-support/misc/Makefile hw/xfree86/os-support/linux/Makefile hw/xfree86/os-support/solaris/Makefile hw/xfree86/os-support/stub/Makefile hw/xfree86/parser/Makefile hw/xfree86/ramdac/Makefile hw/xfree86/shadowfb/Makefile hw/xfree86/vbe/Makefile hw/xfree86/vgahw/Makefile hw/xfree86/x86emu/Makefile hw/xfree86/xaa/Makefile hw/xfree86/utils/Makefile hw/xfree86/utils/man/Makefile hw/xfree86/utils/cvt/Makefile hw/xfree86/utils/gtf/Makefile hw/dmx/config/Makefile hw/dmx/config/man/Makefile hw/dmx/doc/Makefile hw/dmx/doxygen/doxygen.conf hw/dmx/doxygen/Makefile hw/dmx/examples/Makefile hw/dmx/input/Makefile hw/dmx/glxProxy/Makefile hw/dmx/Makefile hw/dmx/man/Makefile hw/vfb/Makefile hw/vfb/man/Makefile hw/xnest/Makefile hw/xnest/man/Makefile hw/xwin/Makefile hw/xwin/glx/Makefile hw/xwin/man/Makefile hw/xquartz/Makefile hw/xquartz/GL/Makefile hw/xquartz/bundle/Makefile hw/xquartz/man/Makefile hw/xquartz/mach-startup/Makefile hw/xquartz/pbproxy/Makefile hw/xquartz/xpr/Makefile hw/kdrive/Makefile hw/kdrive/ephyr/Makefile hw/kdrive/ephyr/man/Makefile hw/kdrive/fake/Makefile hw/kdrive/fbdev/Makefile hw/kdrive/linux/Makefile hw/kdrive/openbsd/Makefile hw/kdrive/src/Makefile hw/kdrive/wscons/Makefile test/Makefile test/xi2/Makefile xserver.ent xorg-server.pc" +ac_config_files="$ac_config_files Makefile glx/Makefile include/Makefile composite/Makefile damageext/Makefile dbe/Makefile dix/Makefile doc/Makefile doc/dtrace/Makefile man/Makefile fb/Makefile record/Makefile config/Makefile mi/Makefile miext/Makefile miext/sync/Makefile miext/damage/Makefile miext/shadow/Makefile miext/rootless/Makefile os/Makefile randr/Makefile render/Makefile xkb/Makefile Xext/Makefile Xi/Makefile xfixes/Makefile exa/Makefile hw/Makefile hw/xfree86/Makefile hw/xfree86/common/Makefile hw/xfree86/common/xf86Build.h hw/xfree86/ddc/Makefile hw/xfree86/dixmods/Makefile hw/xfree86/doc/Makefile hw/xfree86/dri/Makefile hw/xfree86/dri2/Makefile hw/xfree86/exa/Makefile hw/xfree86/exa/man/Makefile hw/xfree86/fbdevhw/Makefile hw/xfree86/fbdevhw/man/Makefile hw/xfree86/i2c/Makefile hw/xfree86/int10/Makefile hw/xfree86/loader/Makefile hw/xfree86/man/Makefile hw/xfree86/modes/Makefile hw/xfree86/os-support/Makefile hw/xfree86/os-support/bsd/Makefile hw/xfree86/os-support/bus/Makefile hw/xfree86/os-support/hurd/Makefile hw/xfree86/os-support/misc/Makefile hw/xfree86/os-support/linux/Makefile hw/xfree86/os-support/solaris/Makefile hw/xfree86/os-support/stub/Makefile hw/xfree86/parser/Makefile hw/xfree86/ramdac/Makefile hw/xfree86/shadowfb/Makefile hw/xfree86/vbe/Makefile hw/xfree86/vgahw/Makefile hw/xfree86/x86emu/Makefile hw/xfree86/utils/Makefile hw/xfree86/utils/man/Makefile hw/xfree86/utils/cvt/Makefile hw/xfree86/utils/gtf/Makefile hw/dmx/config/Makefile hw/dmx/config/man/Makefile hw/dmx/doc/Makefile hw/dmx/doxygen/doxygen.conf hw/dmx/doxygen/Makefile hw/dmx/examples/Makefile hw/dmx/input/Makefile hw/dmx/glxProxy/Makefile hw/dmx/Makefile hw/dmx/man/Makefile hw/vfb/Makefile hw/vfb/man/Makefile hw/xnest/Makefile hw/xnest/man/Makefile hw/xwin/Makefile hw/xwin/glx/Makefile hw/xwin/man/Makefile hw/xquartz/Makefile hw/xquartz/GL/Makefile hw/xquartz/bundle/Makefile hw/xquartz/man/Makefile hw/xquartz/mach-startup/Makefile hw/xquartz/pbproxy/Makefile hw/xquartz/xpr/Makefile hw/kdrive/Makefile hw/kdrive/ephyr/Makefile hw/kdrive/ephyr/man/Makefile hw/kdrive/fake/Makefile hw/kdrive/fbdev/Makefile hw/kdrive/linux/Makefile hw/kdrive/openbsd/Makefile hw/kdrive/src/Makefile hw/kdrive/wscons/Makefile test/Makefile test/xi2/Makefile xserver.ent xorg-server.pc" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -30226,10 +30258,6 @@ else am__EXEEXT_FALSE= fi -if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then - as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -30379,6 +30407,10 @@ if test -z "${CONFIG_UDEV_TRUE}" && test -z "${CONFIG_UDEV_FALSE}"; then as_fn_error $? "conditional \"CONFIG_UDEV\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${CONFIG_UDEV_KMS_TRUE}" && test -z "${CONFIG_UDEV_KMS_FALSE}"; then + as_fn_error $? "conditional \"CONFIG_UDEV_KMS\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${HAVE_DBUS_TRUE}" && test -z "${HAVE_DBUS_FALSE}"; then as_fn_error $? "conditional \"HAVE_DBUS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -30487,10 +30519,6 @@ if test -z "${XF86UTILS_TRUE}" && test -z "${XF86UTILS_FALSE}"; then as_fn_error $? "conditional \"XF86UTILS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi -if test -z "${XAA_TRUE}" && test -z "${XAA_FALSE}"; then - as_fn_error $? "conditional \"XAA\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${VGAHW_TRUE}" && test -z "${VGAHW_FALSE}"; then as_fn_error $? "conditional \"VGAHW\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -30515,6 +30543,14 @@ if test -z "${DEBUG_TRUE}" && test -z "${DEBUG_FALSE}"; then as_fn_error $? "conditional \"DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${CYGWIN_TRUE}" && test -z "${CYGWIN_FALSE}"; then + as_fn_error $? "conditional \"CYGWIN\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${NO_UNDEFINED_TRUE}" && test -z "${NO_UNDEFINED_FALSE}"; then + as_fn_error $? "conditional \"NO_UNDEFINED\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${XVFB_TRUE}" && test -z "${XVFB_FALSE}"; then as_fn_error $? "conditional \"XVFB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -30563,6 +30599,10 @@ if test -z "${XF86VIDMODE_TRUE}" && test -z "${XF86VIDMODE_FALSE}"; then as_fn_error $? "conditional \"XF86VIDMODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${XORG_BUS_PLATFORM_TRUE}" && test -z "${XORG_BUS_PLATFORM_FALSE}"; then + as_fn_error $? "conditional \"XORG_BUS_PLATFORM\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${XWIN_TRUE}" && test -z "${XWIN_FALSE}"; then as_fn_error $? "conditional \"XWIN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -31072,7 +31112,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by xorg-server $as_me 1.12.3, which was +This file was extended by xorg-server $as_me 1.14.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -31138,7 +31178,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -xorg-server config.status 1.12.3 +xorg-server config.status 1.14.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -31575,7 +31615,6 @@ do "miext/sync/Makefile") CONFIG_FILES="$CONFIG_FILES miext/sync/Makefile" ;; "miext/damage/Makefile") CONFIG_FILES="$CONFIG_FILES miext/damage/Makefile" ;; "miext/shadow/Makefile") CONFIG_FILES="$CONFIG_FILES miext/shadow/Makefile" ;; - "miext/cw/Makefile") CONFIG_FILES="$CONFIG_FILES miext/cw/Makefile" ;; "miext/rootless/Makefile") CONFIG_FILES="$CONFIG_FILES miext/rootless/Makefile" ;; "os/Makefile") CONFIG_FILES="$CONFIG_FILES os/Makefile" ;; "randr/Makefile") CONFIG_FILES="$CONFIG_FILES randr/Makefile" ;; @@ -31591,7 +31630,6 @@ do "hw/xfree86/common/xf86Build.h") CONFIG_FILES="$CONFIG_FILES hw/xfree86/common/xf86Build.h" ;; "hw/xfree86/ddc/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/ddc/Makefile" ;; "hw/xfree86/dixmods/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/dixmods/Makefile" ;; - "hw/xfree86/dixmods/extmod/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/dixmods/extmod/Makefile" ;; "hw/xfree86/doc/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/doc/Makefile" ;; "hw/xfree86/dri/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/dri/Makefile" ;; "hw/xfree86/dri2/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/dri2/Makefile" ;; @@ -31618,7 +31656,6 @@ do "hw/xfree86/vbe/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/vbe/Makefile" ;; "hw/xfree86/vgahw/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/vgahw/Makefile" ;; "hw/xfree86/x86emu/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/x86emu/Makefile" ;; - "hw/xfree86/xaa/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/xaa/Makefile" ;; "hw/xfree86/utils/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/utils/Makefile" ;; "hw/xfree86/utils/man/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/utils/man/Makefile" ;; "hw/xfree86/utils/cvt/Makefile") CONFIG_FILES="$CONFIG_FILES hw/xfree86/utils/cvt/Makefile" ;; diff --git a/xserver/configure.ac b/xserver/configure.ac index 773b9dbf9..f75b4bb96 100644 --- a/xserver/configure.ac +++ b/xserver/configure.ac @@ -26,11 +26,11 @@ dnl dnl Process this file with autoconf to create configure. AC_PREREQ(2.60) -AC_INIT([xorg-server], 1.12.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) -RELEASE_DATE="2012-07-09" +AC_INIT([xorg-server], 1.14.1, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server) +RELEASE_DATE="2013-04-17" +RELEASE_NAME="Act Normal" AC_CONFIG_SRCDIR([Makefile.am]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) -AM_MAINTAINER_MODE # Require xorg-macros minimum of 1.14 for XORG_COMPILER_BRAND in XORG_DEFAULT_OPTIONS m4_ifndef([XORG_MACROS_VERSION], @@ -136,6 +136,7 @@ AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h dlfcn.h stropts.h fnmatch.h dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST +AC_C_TYPEOF AC_C_BIGENDIAN([ENDIAN="X_BIG_ENDIAN"], [ENDIAN="X_LITTLE_ENDIAN"]) AC_CHECK_SIZEOF([unsigned long]) @@ -271,10 +272,11 @@ AC_CACHE_CHECK([for SYSV IPC], #include #include #include +#include ],[ { int id; - id = shmget(IPC_PRIVATE, 512, SHM_W | SHM_R); + id = shmget(IPC_PRIVATE, 512, S_IRUSR | S_IWUSR); if (id < 0) return -1; return shmctl(id, IPC_RMID, 0); }], @@ -441,7 +443,7 @@ case $host_os in darwin*) AC_DEFINE(CSRG_BASED, 1, [System is BSD-like]) ;; - cygwin*) + cygwin*|mingw*) CFLAGS="$CFLAGS -DFD_SETSIZE=256" ;; esac @@ -625,7 +627,7 @@ AM_CONDITIONAL(X_PRIVSEP, [test x$ENABLE_PRIVSEP = xyes]) dnl Extensions. AC_ARG_ENABLE(registry, AS_HELP_STRING([--disable-registry], [Build string registry module (default: enabled)]), [XREGISTRY=$enableval], [XREGISTRY=yes]) AC_ARG_ENABLE(composite, AS_HELP_STRING([--disable-composite], [Build Composite extension (default: enabled)]), [COMPOSITE=$enableval], [COMPOSITE=yes]) -AC_ARG_ENABLE(mitshm, AS_HELP_STRING([--disable-mitshm], [Build SHM extension (default: enabled)]), [MITSHM=$enableval], [MITSHM=yes]) +AC_ARG_ENABLE(mitshm, AS_HELP_STRING([--disable-mitshm], [Build SHM extension (default: auto)]), [MITSHM=$enableval], [MITSHM=auto]) AC_ARG_ENABLE(xres, AS_HELP_STRING([--disable-xres], [Build XRes extension (default: enabled)]), [RES=$enableval], [RES=yes]) AC_ARG_ENABLE(record, AS_HELP_STRING([--disable-record], [Build Record extension (default: enabled)]), [RECORD=$enableval], [RECORD=yes]) AC_ARG_ENABLE(xv, AS_HELP_STRING([--disable-xv], [Build Xv extension (default: enabled)]), [XV=$enableval], [XV=yes]) @@ -647,11 +649,11 @@ AC_ARG_ENABLE(dbe, AS_HELP_STRING([--disable-dbe], [Build DBE extensi AC_ARG_ENABLE(xf86bigfont, AS_HELP_STRING([--enable-xf86bigfont], [Build XF86 Big Font extension (default: disabled)]), [XF86BIGFONT=$enableval], [XF86BIGFONT=no]) AC_ARG_ENABLE(dpms, AS_HELP_STRING([--disable-dpms], [Build DPMS extension (default: enabled)]), [DPMSExtension=$enableval], [DPMSExtension=yes]) AC_ARG_ENABLE(config-udev, AS_HELP_STRING([--enable-config-udev], [Build udev support (default: auto)]), [CONFIG_UDEV=$enableval], [CONFIG_UDEV=auto]) +AC_ARG_ENABLE(config-udev-kms, AS_HELP_STRING([--enable-config-udev-kms], [Build udev kms support (default: auto)]), [CONFIG_UDEV_KMS=$enableval], [CONFIG_UDEV_KMS=auto]) AC_ARG_ENABLE(config-dbus, AS_HELP_STRING([--enable-config-dbus], [Build D-BUS API support (default: no)]), [CONFIG_DBUS_API=$enableval], [CONFIG_DBUS_API=no]) AC_ARG_ENABLE(config-hal, AS_HELP_STRING([--disable-config-hal], [Build HAL support (default: auto)]), [CONFIG_HAL=$enableval], [CONFIG_HAL=auto]) AC_ARG_ENABLE(config-wscons, AS_HELP_STRING([--enable-config-wscons], [Build wscons config support (default: auto)]), [CONFIG_WSCONS=$enableval], [CONFIG_WSCONS=auto]) AC_ARG_ENABLE(xfree86-utils, AS_HELP_STRING([--enable-xfree86-utils], [Build xfree86 DDX utilities (default: enabled)]), [XF86UTILS=$enableval], [XF86UTILS=yes]) -AC_ARG_ENABLE(xaa, AS_HELP_STRING([--enable-xaa], [Build XAA (default: enabled)]), [XAA=$enableval], [XAA=yes]) AC_ARG_ENABLE(vgahw, AS_HELP_STRING([--enable-vgahw], [Build Xorg with vga access (default: enabled)]), [VGAHW=$enableval], [VGAHW=yes]) AC_ARG_ENABLE(vbe, AS_HELP_STRING([--enable-vbe], [Build Xorg with VBE module (default: enabled)]), [VBE=$enableval], [VBE=yes]) AC_ARG_ENABLE(int10-module, AS_HELP_STRING([--enable-int10-module], [Build Xorg with int10 module (default: enabled)]), [INT10MODULE=$enableval], [INT10MODULE=yes]) @@ -689,6 +691,7 @@ AC_MSG_CHECKING([to see if we can install the Xorg server as root]) if test "x$SETUID" = "xauto" ; then case $host_os in cygwin*) SETUID="no" ;; + mingw*) SETUID="no" ;; darwin*) SETUID="no" ;; *) case $host_cpu in @@ -731,12 +734,22 @@ AM_CONDITIONAL(INSTALL_LIBXF86CONFIG, [test "x$INSTALL_LIBXF86CONFIG" = xyes]) dnl DDX Detection... Yes, it's ugly to have it here... but we need to dnl handle this early on so that we don't require unsupported extensions case $host_os in - cygwin*) + cygwin* | mingw*) + CONFIG_DBUS_API=no + CONFIG_HAL=no + CONFIG_UDEV=no + CONFIG_UDEV_KMS=no DGA=no DRI2=no + INT10MODULE=no + PCI=no + VGAHW=no + VBE=no + XF86UTILS=no XF86VIDMODE=no XSELINUX=no XV=no + SYMBOL_VISIBILITY=no ;; darwin*) PCI=no @@ -785,20 +798,19 @@ dnl Extension section dnl --------------------------------------------------------------------------- XEXT_INC='-I$(top_srcdir)/Xext' XEXT_LIB='$(top_builddir)/Xext/libXext.la' -XEXTXORG_LIB='$(top_builddir)/Xext/libXextbuiltin.la' dnl Optional modules VIDEOPROTO="videoproto" COMPOSITEPROTO="compositeproto >= 0.4" RECORDPROTO="recordproto >= 1.13.99.1" SCRNSAVERPROTO="scrnsaverproto >= 1.1" -RESOURCEPROTO="resourceproto" +RESOURCEPROTO="resourceproto >= 1.2.0" DRIPROTO="xf86driproto >= 2.1.0" -DRI2PROTO="dri2proto >= 2.6" +DRI2PROTO="dri2proto >= 2.8" XINERAMAPROTO="xineramaproto" BIGFONTPROTO="xf86bigfontproto >= 1.2.0" DGAPROTO="xf86dgaproto >= 2.0.99.1" -GLPROTO="glproto >= 1.4.14" +GLPROTO="glproto >= 1.4.16" DMXPROTO="dmxproto >= 2.2.99.1" VIDMODEPROTO="xf86vidmodeproto >= 2.2.99.1" WINDOWSWMPROTO="windowswmproto" @@ -806,10 +818,10 @@ APPLEWMPROTO="applewmproto >= 1.4" dnl Required modules XPROTO="xproto >= 7.0.22" -RANDRPROTO="randrproto >= 1.2.99.3" +RANDRPROTO="randrproto >= 1.4.0" RENDERPROTO="renderproto >= 0.11" XEXTPROTO="xextproto >= 7.1.99" -INPUTPROTO="inputproto >= 2.1.99.6" +INPUTPROTO="inputproto >= 2.3" KBPROTO="kbproto >= 1.0.3" FONTSPROTO="fontsproto" FIXESPROTO="fixesproto >= 5.0" @@ -832,7 +844,7 @@ LIBPCIACCESS="pciaccess >= 0.12.901" LIBUDEV="libudev >= 143" LIBSELINUX="libselinux >= 2.0.86" LIBDBUS="dbus-1 >= 1.0" -LIBPIXMAN="pixman-1 >= 0.21.8" +LIBPIXMAN="pixman-1 >= 0.27.2" dnl Pixman is always required, but we separate it out so we can link dnl specific modules against it @@ -859,11 +871,16 @@ AM_CONDITIONAL(CONFIG_UDEV, [test "x$CONFIG_UDEV" = xyes]) if test "x$CONFIG_UDEV" = xyes; then CONFIG_DBUS_API=no CONFIG_HAL=no + if test "x$CONFIG_UDEV_KMS" = xauto; then + CONFIG_UDEV_KMS="$HAVE_LIBUDEV" + fi if ! test "x$HAVE_LIBUDEV" = xyes; then AC_MSG_ERROR([udev configuration API requested, but libudev is not installed]) fi AC_DEFINE(CONFIG_UDEV, 1, [Use libudev for input hotplug]) - + if test "x$CONFIG_UDEV_KMS" = xyes; then + AC_DEFINE(CONFIG_UDEV_KMS, 1, [Use libudev for kms enumeration]) + fi SAVE_LIBS=$LIBS SAVE_CFLAGS=$CFLAGS CFLAGS=$UDEV_CFLAGS @@ -873,6 +890,7 @@ if test "x$CONFIG_UDEV" = xyes; then LIBS=$SAVE_LIBS CFLAGS=$SAVE_CFLAGS fi +AM_CONDITIONAL(CONFIG_UDEV_KMS, [test "x$CONFIG_UDEV_KMS" = xyes]) dnl HAVE_DBUS is true if we actually have the D-Bus library, whereas dnl CONFIG_DBUS_API is true if we want to enable the D-Bus config @@ -1023,6 +1041,9 @@ if test "x$COMPOSITE" = xyes; then COMPOSITE_INC='-I$(top_srcdir)/composite' fi +if test "x$MITSHM" = xauto; then + MITSHM="$ac_cv_sysv_ipc" +fi AM_CONDITIONAL(MITSHM, [test "x$MITSHM" = xyes]) if test "x$MITSHM" = xyes; then AC_DEFINE(MITSHM, 1, [Support MIT-SHM extension]) @@ -1093,13 +1114,13 @@ if test "x$GLX_USE_TLS" = xyes ; then GLX_SYS_LIBS="$GLX_SYS_LIBS -lpthread" fi AC_SUBST([GLX_DEFINES]) +AC_SUBST([GLX_SYS_LIBS]) AM_CONDITIONAL(DRI, test "x$DRI" = xyes) if test "x$DRI" = xyes; then AC_DEFINE(XF86DRI, 1, [Build DRI extension]) - PKG_CHECK_MODULES([DRIPROTO], [$DRIPROTO]) - PKG_CHECK_MODULES([DRI], $GLPROTO $LIBDRI) - AC_SUBST(DRIPROTO_CFLAGS) + REQUIRED_MODULES="$REQUIRED_MODULES $DRIPROTO $GLPROTO $LIBDRI" + SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $DRIPROTO $GLPROTO $LIBDRI" fi PKG_CHECK_MODULES([DRI2PROTO], $DRI2PROTO, @@ -1116,7 +1137,7 @@ case "$DRI2,$HAVE_DRI2PROTO" in esac AM_CONDITIONAL(DRI2, test "x$DRI2" = xyes) -if test "x$DRI" = xyes || test "x$DRI2" = xyes; then +if test "x$DRI" = xyes || test "x$DRI2" = xyes || test "x$CONFIG_UDEV_KMS" = xyes; then if test "x$DRM" = xyes; then AC_DEFINE(WITH_LIBDRM, 1, [Building with libdrm support]) PKG_CHECK_MODULES([LIBDRM], $LIBDRM) @@ -1148,8 +1169,8 @@ AM_CONDITIONAL(DRI2_AIGLX, test "x$DRI2_AIGLX" = xyes) if test "x$DRI2" = xyes; then case $host_os in openbsd*) - XORG_SYS_LIBS="-lpthread" - ;; + XORG_SYS_LIBS="-lpthread" + ;; esac fi @@ -1190,6 +1211,7 @@ AM_CONDITIONAL(DBE, [test "x$DBE" = xyes]) if test "x$DBE" = xyes; then AC_DEFINE(DBE, 1, [Support DBE extension]) DBE_LIB='$(top_builddir)/dbe/libdbe.la' + DBE_INC='-I$(top_srcdir)/dbe' fi AM_CONDITIONAL(XF86BIGFONT, [test "x$XF86BIGFONT" = xyes]) @@ -1227,7 +1249,6 @@ XI_LIB='$(top_builddir)/Xi/libXi.la' XI_INC='-I$(top_srcdir)/Xi' AM_CONDITIONAL(XF86UTILS, test "x$XF86UTILS" = xyes) -AM_CONDITIONAL(XAA, test "x$XAA" = xyes) AM_CONDITIONAL(VGAHW, test "x$VGAHW" = xyes) AM_CONDITIONAL(VBE, test "x$VBE" = xyes) AM_CONDITIONAL(INT10MODULE, test "x$INT10MODULE" = xyes) @@ -1380,7 +1401,7 @@ CORE_INCS='-I$(top_srcdir)/include -I$(top_builddir)/include' # SHA1 hashing AC_ARG_WITH([sha1], - [AS_HELP_STRING([--with-sha1=libc|libmd|libgcrypt|libcrypto|libsha1|CommonCrypto], + [AS_HELP_STRING([--with-sha1=libc|libmd|libnettle|libgcrypt|libcrypto|libsha1|CommonCrypto|CryptoAPI], [choose SHA1 implementation])]) AC_CHECK_FUNC([SHA1Init], [HAVE_SHA1_IN_LIBC=yes]) if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_LIBC" = xyes; then @@ -1406,6 +1427,19 @@ if test "x$with_sha1" = xCommonCrypto; then [Use CommonCrypto SHA1 functions]) SHA1_LIBS="" fi +dnl stdcall functions cannot be tested with AC_CHECK_LIB +AC_CHECK_HEADER([wincrypt.h], [HAVE_SHA1_IN_CRYPTOAPI=yes], [], [#include ]) +if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_CRYPTOAPI" = xyes; then + with_sha1=CryptoAPI +fi +if test "x$with_sha1" = xCryptoAPI && test "x$HAVE_SHA1_IN_CRYPTOAPI" != xyes; then + AC_MSG_ERROR([CryptoAPI requested but not found]) +fi +if test "x$with_sha1" = xCryptoAPI; then + AC_DEFINE([HAVE_SHA1_IN_CRYPTOAPI], [1], + [Use CryptoAPI SHA1 functions]) + SHA1_LIBS="" +fi AC_CHECK_LIB([md], [SHA1Init], [HAVE_LIBMD=yes]) if test "x$with_sha1" = x && test "x$HAVE_LIBMD" = xyes; then with_sha1=libmd @@ -1430,6 +1464,18 @@ if test "x$with_sha1" = xlibsha1; then [Use libsha1 for SHA1]) SHA1_LIBS=-lsha1 fi +AC_CHECK_LIB([nettle], [nettle_sha1_init], [HAVE_LIBNETTLE=yes]) +if test "x$with_sha1" = x && test "x$HAVE_LIBNETTLE" = xyes; then + with_sha1=libnettle +fi +if test "x$with_sha1" = xlibnettle && test "x$HAVE_LIBNETTLE" != xyes; then + AC_MSG_ERROR([libnettle requested but not found]) +fi +if test "x$with_sha1" = xlibnettle; then + AC_DEFINE([HAVE_SHA1_IN_LIBNETTLE], [1], + [Use libnettle SHA1 functions]) + SHA1_LIBS=-lnettle +fi AC_CHECK_LIB([gcrypt], [gcry_md_open], [HAVE_LIBGCRYPT=yes]) if test "x$with_sha1" = x && test "x$HAVE_LIBGCRYPT" = xyes; then with_sha1=libgcrypt @@ -1514,7 +1560,41 @@ case $host_os in esac ;; esac +LD_NO_UNDEFINED_FLAG= +XORG_DRIVER_LIBS= +case "$host_os" in + cygwin*) + LD_EXPORT_SYMBOLS_FLAG="-Wl,--export-all,--out-implib,lib\$@.a" + LD_NO_UNDEFINED_FLAG="-no-undefined -Wl,\$(top_builddir)/hw/xfree86/libXorg.exe.a" + XORG_DRIVER_LIBS="-lXorg.exe -L\${moduledir} -lshadow -lfb -no-undefined" + CYGWIN=yes + ;; + solaris*) + # We use AC_LINK_IFELSE to generate a temporary program conftest$EXEEXT + # that we can link against for testing if the system linker is new + # enough to support -z parent= for verifying loadable modules + # are only calling functions defined in either the loading program or + # the libraries they're linked with. + AC_LINK_IFELSE( + [AC_LANG_SOURCE([int main(int argc, char **argv) { return 0; }])], + [mv conftest$EXEEXT conftest.parent + XORG_CHECK_LINKER_FLAGS([-Wl,-z,parent=conftest.parent -G], + [LD_NO_UNDEFINED_FLAG="-Wl,-z,defs -Wl,-z,parent=\$(top_builddir)/hw/xfree86/Xorg" +# Not set yet, since this gets exported in xorg-server.pc to all the drivers, +# and they're not all fixed to build correctly with it yet. +# XORG_DRIVER_LIBS="-Wl,-z,defs -Wl,-z,parent=${bindir}/Xorg" + ],[], + [AC_LANG_SOURCE([extern int main(int argc, char **argv); + int call_main(void) { return main(0, NULL); }])]) + rm -f conftest.parent + ]) + ;; +esac AC_SUBST([LD_EXPORT_SYMBOLS_FLAG]) +AC_SUBST([LD_NO_UNDEFINED_FLAG]) +AC_SUBST([XORG_DRIVER_LIBS]) +AM_CONDITIONAL([CYGWIN], [test x"$CYGWIN" = xyes]) +AM_CONDITIONAL([NO_UNDEFINED], [test x"$LD_NO_UNDEFINED_FLAG" != x]) dnl Imake defines SVR4 on SVR4 systems, and many files check for it, so dnl we need to replicate that here until those can all be fixed @@ -1527,7 +1607,7 @@ AC_EGREP_CPP([I_AM_SVR4],[ AC_DEFINE([SVR4],1,[Define to 1 on systems derived from System V Release 4]) AC_MSG_RESULT([yes])], AC_MSG_RESULT([no])) -XSERVER_CFLAGS="$XSERVER_CFLAGS $CORE_INCS $XEXT_INC $COMPOSITE_INC $DAMAGE_INC $FIXES_INC $XI_INC $MI_INC $MIEXT_SYNC_INC $MIEXT_SHADOW_INC $MIEXT_LAYER_INC $MIEXT_DAMAGE_INC $RENDER_INC $RANDR_INC $FB_INC" +XSERVER_CFLAGS="$XSERVER_CFLAGS $CORE_INCS $XEXT_INC $COMPOSITE_INC $DAMAGE_INC $FIXES_INC $XI_INC $MI_INC $MIEXT_SYNC_INC $MIEXT_SHADOW_INC $MIEXT_LAYER_INC $MIEXT_DAMAGE_INC $RENDER_INC $RANDR_INC $FB_INC $DBE_INC" dnl --------------------------------------------------------------------------- dnl DDX section. @@ -1575,6 +1655,7 @@ if test "x$XORG" = xauto; then XORG="yes" case $host_os in cygwin*) XORG="no" ;; + mingw*) XORG="no" ;; darwin*) XORG="no" ;; esac fi @@ -1585,7 +1666,7 @@ if test "x$XORG" = xyes; then XORG_OSINCS='-I$(top_srcdir)/hw/xfree86/os-support -I$(top_srcdir)/hw/xfree86/os-support/bus -I$(top_srcdir)/os' XORG_INCS="$XORG_DDXINCS $XORG_OSINCS" XORG_CFLAGS="$XORGSERVER_CFLAGS -DHAVE_XORG_CONFIG_H" - XORG_LIBS="$COMPOSITE_LIB $FIXES_LIB $XEXTXORG_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $XI_LIB $XKB_LIB" + XORG_LIBS="$COMPOSITE_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $XI_LIB $XKB_LIB" dnl ================================================================== dnl symbol visibility @@ -1639,8 +1720,8 @@ if test "x$XORG" = xyes; then PKG_CHECK_MODULES([PCIACCESS], $LIBPCIACCESS) SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $LIBPCIACCESS" - XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $GLX_SYS_LIBS" - XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS" + XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $GLX_SYS_LIBS $LIBDRM_LIBS" + XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS $LIBDRM_CFLAGS" AC_DEFINE(XSERVER_LIBPCIACCESS, 1, [Use libpciaccess for all pci manipulation]) AC_DEFINE_DIR(PCI_TXT_IDS_PATH, PCI_TXT_IDS_DIR, [Default PCI text file ID path]) @@ -1664,6 +1745,10 @@ if test "x$XORG" = xyes; then fi AC_MSG_RESULT([$PCI]) + if test "x$CONFIG_UDEV_KMS" = xyes; then + AC_DEFINE(XSERVER_PLATFORM_BUS, 1, [X server supports platform device enumeration]) + fi + AC_MSG_RESULT([$XSERVER_PLATFORM_BUS]) dnl =================================================================== dnl ==================== end of PCI configuration ===================== dnl =================================================================== @@ -1797,7 +1882,6 @@ if test "x$XORG" = xyes; then AC_DEFINE(XORG_SERVER, 1, [Building Xorg server]) AC_DEFINE(XORGSERVER, 1, [Building Xorg server]) AC_DEFINE(XFree86Server, 1, [Building XFree86 server]) - AC_DEFINE(XFree86LOADER, 1, [Building loadable XFree86 server]) AC_DEFINE_UNQUOTED(XORG_VERSION_CURRENT, [$VENDOR_RELEASE], [Current Xorg version]) AC_DEFINE(NEED_XF86_TYPES, 1, [Need XFree86 typedefs]) AC_DEFINE(NEED_XF86_PROTOTYPES, 1, [Need XFree86 helper functions]) @@ -1847,7 +1931,7 @@ AM_CONDITIONAL([SOLARIS_ASM_INLINE], [test "x$solaris_asm_inline" = xyes]) AM_CONDITIONAL([SOLARIS_VT], [test "x$solaris_vt" = xyes]) AM_CONDITIONAL([DGA], [test "x$DGA" = xyes]) AM_CONDITIONAL([XF86VIDMODE], [test "x$XF86VIDMODE" = xyes]) - +AM_CONDITIONAL([XORG_BUS_PLATFORM], [test "x$CONFIG_UDEV_KMS" = xyes]) dnl XWin DDX AC_MSG_CHECKING([whether to build XWin DDX]) @@ -1887,11 +1971,12 @@ if test "x$XWIN" = xyes; then XWIN_SERVER_NAME=Xming AC_DEFINE(RELOCATE_PROJECTROOT,1,[Make PROJECT_ROOT relative to the xserver location]) AC_DEFINE(HAS_WINSOCK,1,[Use Windows sockets]) - XWIN_SYS_LIBS=-lwinsock2 + XWIN_SYS_LIBS="-lpthread -lws2_32" ;; esac + XWIN_LIBS="$FB_LIB $MI_LIB $FIXES_LIB $XEXT_LIB $RANDR_LIB $RENDER_LIB $DBE_LIB $RECORD_LIB $GLX_LIBS $XKB_LIB $XKB_STUB_LIB $COMPOSITE_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $OS_LIB" - XWIN_SYS_LIBS="$XWIN_SYS_LIBS $XWINMODULES_LIBS" + XWIN_SYS_LIBS="$XWIN_SYS_LIBS $XWINMODULES_LIBS $GLX_SYS_LIBS" AC_SUBST(XWIN_LIBS) AC_SUBST(XWIN_SERVER_NAME) AC_SUBST(XWIN_SYS_LIBS) @@ -1978,6 +2063,7 @@ if test "x$DMX" = xauto; then DMX="$have_dmx" case $host_os in cygwin*) DMX="no" ;; + mingw*) DMX="no" ;; darwin*) DMX="no" ;; esac fi @@ -2219,7 +2305,6 @@ miext/Makefile miext/sync/Makefile miext/damage/Makefile miext/shadow/Makefile -miext/cw/Makefile miext/rootless/Makefile os/Makefile randr/Makefile @@ -2235,7 +2320,6 @@ hw/xfree86/common/Makefile hw/xfree86/common/xf86Build.h hw/xfree86/ddc/Makefile hw/xfree86/dixmods/Makefile -hw/xfree86/dixmods/extmod/Makefile hw/xfree86/doc/Makefile hw/xfree86/dri/Makefile hw/xfree86/dri2/Makefile @@ -2262,7 +2346,6 @@ hw/xfree86/shadowfb/Makefile hw/xfree86/vbe/Makefile hw/xfree86/vgahw/Makefile hw/xfree86/x86emu/Makefile -hw/xfree86/xaa/Makefile hw/xfree86/utils/Makefile hw/xfree86/utils/man/Makefile hw/xfree86/utils/cvt/Makefile diff --git a/xserver/damageext/Makefile.am b/xserver/damageext/Makefile.am index 35f7620fb..4d4cf4478 100644 --- a/xserver/damageext/Makefile.am +++ b/xserver/damageext/Makefile.am @@ -4,5 +4,4 @@ AM_CFLAGS = $(DIX_CFLAGS) libdamageext_la_SOURCES = \ damageext.c \ - damageext.h \ damageextint.h diff --git a/xserver/damageext/Makefile.in b/xserver/damageext/Makefile.in index 7a0333bef..884810db3 100644 --- a/xserver/damageext/Makefile.in +++ b/xserver/damageext/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -181,13 +181,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -209,6 +205,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -233,6 +230,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -248,7 +246,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -347,6 +344,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -450,14 +448,13 @@ noinst_LTLIBRARIES = libdamageext.la AM_CFLAGS = $(DIX_CFLAGS) libdamageext_la_SOURCES = \ damageext.c \ - damageext.h \ damageextint.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -482,9 +479,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/damageext/damageext.c b/xserver/damageext/damageext.c index f21f71ca8..a942ffa68 100644 --- a/xserver/damageext/damageext.c +++ b/xserver/damageext/damageext.c @@ -26,6 +26,7 @@ #include "damageextint.h" #include "protocol-versions.h" +#include "extinit.h" static unsigned char DamageReqCode; static int DamageEventBase; @@ -46,15 +47,17 @@ DamageExtNotify(DamageExtPtr pDamageExt, BoxPtr pBoxes, int nBoxes) int i; UpdateCurrentTimeIf(); - ev.type = DamageEventBase + XDamageNotify; - ev.level = pDamageExt->level; - ev.drawable = pDamageExt->drawable; - ev.damage = pDamageExt->id; - ev.timestamp = currentTime.milliseconds; - ev.geometry.x = pDrawable->x; - ev.geometry.y = pDrawable->y; - ev.geometry.width = pDrawable->width; - ev.geometry.height = pDrawable->height; + ev = (xDamageNotifyEvent) { + .type = DamageEventBase + XDamageNotify, + .level = pDamageExt->level, + .drawable = pDamageExt->drawable, + .damage = pDamageExt->id, + .timestamp = currentTime.milliseconds, + .geometry.x = pDrawable->x, + .geometry.y = pDrawable->y, + .geometry.width = pDrawable->width, + .geometry.height = pDrawable->height + }; if (pBoxes) { for (i = 0; i < nBoxes; i++) { ev.level = pDamageExt->level; @@ -126,14 +129,16 @@ static int ProcDamageQueryVersion(ClientPtr client) { DamageClientPtr pDamageClient = GetDamageClient(client); - xDamageQueryVersionReply rep; + xDamageQueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; REQUEST(xDamageQueryVersionReq); REQUEST_SIZE_MATCH(xDamageQueryVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; + if (stuff->majorVersion < SERVER_DAMAGE_MAJOR_VERSION) { rep.majorVersion = stuff->majorVersion; rep.minorVersion = stuff->minorVersion; @@ -154,7 +159,7 @@ ProcDamageQueryVersion(ClientPtr client) swapl(&rep.majorVersion); swapl(&rep.minorVersion); } - WriteToClient(client, sizeof(xDamageQueryVersionReply), (char *) &rep); + WriteToClient(client, sizeof(xDamageQueryVersionReply), &rep); return Success; } diff --git a/xserver/damageext/damageextint.h b/xserver/damageext/damageextint.h index b7e63e077..272337922 100644 --- a/xserver/damageext/damageextint.h +++ b/xserver/damageext/damageextint.h @@ -37,7 +37,6 @@ #include "windowstr.h" #include "selection.h" #include "scrnintstr.h" -#include "damageext.h" #include "damage.h" #include "xfixes.h" diff --git a/xserver/dbe/Makefile.in b/xserver/dbe/Makefile.in index 99c5bb013..4839fdcfe 100644 --- a/xserver/dbe/Makefile.in +++ b/xserver/dbe/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -212,13 +212,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -240,6 +236,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -264,6 +261,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -279,7 +277,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -378,6 +375,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -490,7 +488,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -515,9 +513,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/dbe/dbe.c b/xserver/dbe/dbe.c index ca7f3e278..9039d8045 100644 --- a/xserver/dbe/dbe.c +++ b/xserver/dbe/dbe.c @@ -42,6 +42,7 @@ #include #include "scrnintstr.h" #include "extnsionst.h" +#include "extinit.h" #include "gcstruct.h" #include "dixstruct.h" #define NEED_DBE_PROTOCOL @@ -118,21 +119,21 @@ static int ProcDbeGetVersion(ClientPtr client) { /* REQUEST(xDbeGetVersionReq); */ - xDbeGetVersionReply rep; + xDbeGetVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .majorVersion = DBE_MAJOR_VERSION, + .minorVersion = DBE_MINOR_VERSION + }; REQUEST_SIZE_MATCH(xDbeGetVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = DBE_MAJOR_VERSION; - rep.minorVersion = DBE_MINOR_VERSION; - if (client->swapped) { swaps(&rep.sequenceNumber); } - WriteToClient(client, sizeof(xDbeGetVersionReply), (char *) &rep); + WriteToClient(client, sizeof(xDbeGetVersionReply), &rep); return Success; @@ -667,10 +668,12 @@ ProcDbeGetVisualInfo(ClientPtr client) length += pScrVisInfo[i].count * sizeof(xDbeVisInfo); } - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = bytes_to_int32(length); - rep.m = count; + rep = (xDbeGetVisualInfoReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(length), + .m = count + }; if (client->swapped) { swaps(&rep.sequenceNumber); @@ -679,7 +682,7 @@ ProcDbeGetVisualInfo(ClientPtr client) } /* Send off reply. */ - WriteToClient(client, sizeof(xDbeGetVisualInfoReply), (char *) &rep); + WriteToClient(client, sizeof(xDbeGetVisualInfoReply), &rep); for (i = 0; i < count; i++) { CARD32 data32; @@ -693,7 +696,7 @@ ProcDbeGetVisualInfo(ClientPtr client) swapl(&data32); } - WriteToClient(client, sizeof(CARD32), (char *) &data32); + WriteToClient(client, sizeof(CARD32), &data32); /* Now send off visual info items. */ for (j = 0; j < pScrVisInfo[i].count; j++) { @@ -717,8 +720,7 @@ ProcDbeGetVisualInfo(ClientPtr client) } /* Write visualID(32), depth(8), perfLevel(8), and pad(16). */ - WriteToClient(client, 2 * sizeof(CARD32), - (char *) &visInfo.visualID); + WriteToClient(client, 2 * sizeof(CARD32), &visInfo.visualID); } } @@ -756,7 +758,11 @@ static int ProcDbeGetBackBufferAttributes(ClientPtr client) { REQUEST(xDbeGetBackBufferAttributesReq); - xDbeGetBackBufferAttributesReply rep; + xDbeGetBackBufferAttributesReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; DbeWindowPrivPtr pDbeWindowPriv; int rc; @@ -772,18 +778,13 @@ ProcDbeGetBackBufferAttributes(ClientPtr client) rep.attributes = None; } - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.attributes); } - WriteToClient(client, sizeof(xDbeGetBackBufferAttributesReply), - (char *) &rep); + WriteToClient(client, sizeof(xDbeGetBackBufferAttributesReply), &rep); return Success; } /* ProcDbeGetbackBufferAttributes() */ diff --git a/xserver/dbe/dbestruct.h b/xserver/dbe/dbestruct.h index 9ea9eb695..f9d938af1 100644 --- a/xserver/dbe/dbestruct.h +++ b/xserver/dbe/dbestruct.h @@ -83,8 +83,6 @@ typedef struct { /* Marker for free elements in the buffer ID array. */ #define DBE_FREE_ID_ELEMENT 0 -extern _X_EXPORT void DbeExtensionInit(void); - /* TYPEDEFS */ /* Record used to pass swap information between DIX and DDX swapping diff --git a/xserver/depcomp b/xserver/depcomp index 0544c6835..e1f51f482 100644 --- a/xserver/depcomp +++ b/xserver/depcomp @@ -74,6 +74,9 @@ tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" +# Avoid interferences from the environment. +gccflag= dashmflag= + # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case @@ -108,7 +111,7 @@ if test "$depmode" = msvc7msys; then fi if test "$depmode" = xlc; then - # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency informations. + # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi @@ -142,13 +145,17 @@ gcc3) ;; gcc) +## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. +## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. +## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like -## -MM, not -M (despite what the docs say). +## -MM, not -M (despite what the docs say). Also, it might not be +## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then diff --git a/xserver/dix/Makefile.in b/xserver/dix/Makefile.in index 09f1e2231..580e662e9 100644 --- a/xserver/dix/Makefile.in +++ b/xserver/dix/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -227,13 +227,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -255,6 +251,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -279,6 +276,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -294,7 +292,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -393,6 +390,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -549,7 +547,7 @@ all: $(BUILT_SOURCES) .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -574,9 +572,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/dix/Xserver-dtrace.h.in b/xserver/dix/Xserver-dtrace.h.in index daf3faf1d..60ebbcdd9 100644 --- a/xserver/dix/Xserver-dtrace.h.in +++ b/xserver/dix/Xserver-dtrace.h.in @@ -54,7 +54,8 @@ extern "C" { __dtrace_Xserver___resource__free(arg0, arg1, arg2, arg3) #define XSERVER_SEND_EVENT(arg0, arg1, arg2) \ __dtrace_Xserver___send__event(arg0, arg1, arg2) - +#define XSERVER_INPUT_EVENT(arg0, arg1, arg2, arg3, arg4, arg5, arg6) \ + __dtrace_Xserver___input__event(arg0, arg1, arg2, arg3, arg4, arg5, arg6) extern void __dtrace_Xserver___client__auth(int, string, pid_t, zoneid_t); extern void __dtrace_Xserver___client__connect(int, int); @@ -64,6 +65,8 @@ extern void __dtrace_Xserver___request__start(string, uint8_t, uint16_t, int, vo extern void __dtrace_Xserver___resource__alloc(uint32_t, uint32_t, void *, string); extern void __dtrace_Xserver___resource__free(uint32_t, uint32_t, void *, string); extern void __dtrace_Xserver___send__event(int, uint8_t, void *); +extern void __dtrace_Xserver___input__event(int, uint16_t, uint32_t, uint32_t, int8_t, uint8_t *, double *); + #else @@ -75,6 +78,7 @@ extern void __dtrace_Xserver___send__event(int, uint8_t, void *); #define XSERVER_RESOURCE_ALLOC(arg0, arg1, arg2, arg3) #define XSERVER_RESOURCE_FREE(arg0, arg1, arg2, arg3) #define XSERVER_SEND_EVENT(arg0, arg1, arg2) +#define XSERVER_INPUT_EVENT(arg0, arg1, arg2, arg3, arg4, arg5, arg6) #endif @@ -86,6 +90,7 @@ extern void __dtrace_Xserver___send__event(int, uint8_t, void *); #define XSERVER_RESOURCE_ALLOC_ENABLED() (1) #define XSERVER_RESOURCE_FREE_ENABLED() (1) #define XSERVER_SEND_EVENT_ENABLED() (1) +#define XSERVER_INPUT_EVENT_ENABLED() (1) #ifdef __cplusplus } diff --git a/xserver/dix/Xserver.d b/xserver/dix/Xserver.d index 2ad337351..248d48e24 100644 --- a/xserver/dix/Xserver.d +++ b/xserver/dix/Xserver.d @@ -48,6 +48,8 @@ provider Xserver { probe resource__free(uint32_t, uint32_t, void *, string); /* client id, event type, event* */ probe send__event(int, uint8_t, void *); + /* deviceid, type, button/keycode/touchid, flags, nvalues, mask, values */ + probe input__event(int, int, uint32_t, uint32_t, int8_t, uint8_t*, double*); }; #pragma D attributes Unstable/Unstable/Common provider Xserver provider diff --git a/xserver/dix/colormap.c b/xserver/dix/colormap.c index 10306285e..39fddc9b1 100644 --- a/xserver/dix/colormap.c +++ b/xserver/dix/colormap.c @@ -450,15 +450,15 @@ FreeColormap(pointer value, XID mid) static int TellNoMap(WindowPtr pwin, Colormap * pmid) { - xEvent xE; - if (wColormap(pwin) == *pmid) { /* This should be call to DeliverEvent */ + xEvent xE = { + .u.colormap.window = pwin->drawable.id, + .u.colormap.colormap = None, + .u.colormap.new = TRUE, + .u.colormap.state = ColormapUninstalled + }; xE.u.u.type = ColormapNotify; - xE.u.colormap.window = pwin->drawable.id; - xE.u.colormap.colormap = None; - xE.u.colormap.new = TRUE; - xE.u.colormap.state = ColormapUninstalled; #ifdef PANORAMIX if (noPanoramiXExtension || !pwin->drawable.pScreen->myNum) #endif @@ -477,7 +477,6 @@ int TellLostMap(WindowPtr pwin, pointer value) { Colormap *pmid = (Colormap *) value; - xEvent xE; #ifdef PANORAMIX if (!noPanoramiXExtension && pwin->drawable.pScreen->myNum) @@ -485,11 +484,13 @@ TellLostMap(WindowPtr pwin, pointer value) #endif if (wColormap(pwin) == *pmid) { /* This should be call to DeliverEvent */ + xEvent xE = { + .u.colormap.window = pwin->drawable.id, + .u.colormap.colormap = *pmid, + .u.colormap.new = FALSE, + .u.colormap.state = ColormapUninstalled + }; xE.u.u.type = ColormapNotify; - xE.u.colormap.window = pwin->drawable.id; - xE.u.colormap.colormap = *pmid; - xE.u.colormap.new = FALSE; - xE.u.colormap.state = ColormapUninstalled; DeliverEvents(pwin, &xE, 1, (WindowPtr) NULL); } @@ -501,7 +502,6 @@ int TellGainedMap(WindowPtr pwin, pointer value) { Colormap *pmid = (Colormap *) value; - xEvent xE; #ifdef PANORAMIX if (!noPanoramiXExtension && pwin->drawable.pScreen->myNum) @@ -509,11 +509,13 @@ TellGainedMap(WindowPtr pwin, pointer value) #endif if (wColormap(pwin) == *pmid) { /* This should be call to DeliverEvent */ + xEvent xE = { + .u.colormap.window = pwin->drawable.id, + .u.colormap.colormap = *pmid, + .u.colormap.new = FALSE, + .u.colormap.state = ColormapInstalled + }; xE.u.u.type = ColormapNotify; - xE.u.colormap.window = pwin->drawable.id; - xE.u.colormap.colormap = *pmid; - xE.u.colormap.new = FALSE; - xE.u.colormap.state = ColormapInstalled; DeliverEvents(pwin, &xE, 1, (WindowPtr) NULL); } @@ -576,7 +578,7 @@ CopyFree(int channel, int client, ColormapPtr pmapSrc, ColormapPtr pmapDst) int nalloc; switch (channel) { - default: /* so compiler can see that everything gets initialized */ + default: /* so compiler can see that everything gets initialized */ case REDMAP: ppix = (pmapSrc->clientPixelsRed)[client]; npix = (pmapSrc->numPixelsRed)[client]; @@ -653,18 +655,18 @@ FreeCell(ColormapPtr pmap, Pixel i, int channel) int *pCount; switch (channel) { - default: /* so compiler can see that everything gets initialized */ + default: /* so compiler can see that everything gets initialized */ case PSEUDOMAP: case REDMAP: - pent = (EntryPtr) & pmap->red[i]; + pent = (EntryPtr) &pmap->red[i]; pCount = &pmap->freeRed; break; case GREENMAP: - pent = (EntryPtr) & pmap->green[i]; + pent = (EntryPtr) &pmap->green[i]; pCount = &pmap->freeGreen; break; case BLUEMAP: - pent = (EntryPtr) & pmap->blue[i]; + pent = (EntryPtr) &pmap->blue[i]; pCount = &pmap->freeBlue; break; } @@ -1398,7 +1400,7 @@ QueryColors(ColormapPtr pmap, int count, Pixel * ppixIn, xrgb * prgbList, errVal = BadValue; } else { - pent = (EntryPtr) & pmap->red[pixel]; + pent = (EntryPtr) &pmap->red[pixel]; if (pent->fShared) { prgb->red = pent->co.shco.red->color; prgb->green = pent->co.shco.green->color; @@ -2146,7 +2148,7 @@ FreeCo(ColormapPtr pmap, int client, int color, int npixIn, Pixel * ppixIn, ppixClient = pmap->clientPixelsBlue[client]; npixClient = pmap->numPixelsBlue[client]; break; - default: /* so compiler can see that everything gets initialized */ + default: /* so compiler can see that everything gets initialized */ case PSEUDOMAP: cmask = ~((Pixel) 0); rgbbad = 0; diff --git a/xserver/dix/devices.c b/xserver/dix/devices.c index 012550443..be236dd70 100644 --- a/xserver/dix/devices.c +++ b/xserver/dix/devices.c @@ -84,6 +84,7 @@ SOFTWARE. #include "enterleave.h" /* for EnterWindow() */ #include "xserver-properties.h" #include "xichangehierarchy.h" /* For XISendDeviceHierarchyEvent */ +#include "syncsrv.h" /** @file * This file handles input device-related stuff. @@ -92,9 +93,10 @@ SOFTWARE. static void RecalculateMasterButtons(DeviceIntPtr slave); static void -DeviceSetTransform(DeviceIntPtr dev, float *transform) +DeviceSetTransform(DeviceIntPtr dev, float *transform_data) { struct pixman_f_transform scale; + struct pixman_f_transform transform; double sx, sy; int x, y; @@ -121,16 +123,21 @@ DeviceSetTransform(DeviceIntPtr dev, float *transform) /* transform */ for (y = 0; y < 3; y++) for (x = 0; x < 3; x++) - dev->transform.m[y][x] = *transform++; + transform.m[y][x] = *transform_data++; - pixman_f_transform_multiply(&dev->transform, &scale, &dev->transform); + pixman_f_transform_multiply(&dev->scale_and_transform, &scale, &transform); /* scale */ pixman_f_transform_init_scale(&scale, 1.0 / sx, 1.0 / sy); scale.m[0][2] = -dev->valuator->axes[0].min_value / sx; scale.m[1][2] = -dev->valuator->axes[1].min_value / sy; - pixman_f_transform_multiply(&dev->transform, &dev->transform, &scale); + pixman_f_transform_multiply(&dev->scale_and_transform, &dev->scale_and_transform, &scale); + + /* remove translation component for relative movements */ + dev->relative_transform = transform; + dev->relative_transform.m[0][2] = 0; + dev->relative_transform.m[1][2] = 0; } /** @@ -144,9 +151,11 @@ DeviceSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop, if (prop->format != 8 || prop->type != XA_INTEGER || prop->size != 1) return BadValue; - /* Don't allow disabling of VCP/VCK */ - if ((dev == inputInfo.pointer ||dev == - inputInfo.keyboard) &&!(*(CARD8 *) prop->data)) + /* Don't allow disabling of VCP/VCK or XTest devices */ + if ((dev == inputInfo.pointer || + dev == inputInfo.keyboard || + IsXTestDevice(dev, NULL)) + &&!(*(CARD8 *) prop->data)) return BadAccess; if (!checkonly) { @@ -177,12 +186,9 @@ DeviceSetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop, /* Pair the keyboard to the pointer device. Keyboard events will follow the * pointer sprite. Only applicable for master devices. - * If the client is set, the request to pair comes from some client. In this - * case, we need to check for access. If the client is NULL, it's from an - * internal automatic pairing, we must always permit this. */ static int -PairDevices(ClientPtr client, DeviceIntPtr ptr, DeviceIntPtr kbd) +PairDevices(DeviceIntPtr ptr, DeviceIntPtr kbd) { if (!ptr) return BadDevice; @@ -248,13 +254,17 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart) if (devid >= MAXDEVICES) return (DeviceIntPtr) NULL; - dev = - _dixAllocateObjectWithPrivates(sizeof(DeviceIntRec) + - sizeof(SpriteInfoRec), - sizeof(DeviceIntRec) + - sizeof(SpriteInfoRec), - offsetof(DeviceIntRec, devPrivates), - PRIVATE_DEVICE); + dev = calloc(1, + sizeof(DeviceIntRec) + + sizeof(SpriteInfoRec)); + if (!dev) + return (DeviceIntPtr) NULL; + + if (!dixAllocatePrivates(&dev->devPrivates, PRIVATE_DEVICE)) { + free(dev); + return NULL; + } + if (!dev) return (DeviceIntPtr) NULL; @@ -279,11 +289,12 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart) dev->coreEvents = TRUE; /* sprite defaults */ - dev->spriteInfo = (SpriteInfoPtr) & dev[1]; + dev->spriteInfo = (SpriteInfoPtr) &dev[1]; /* security creation/labeling check */ if (XaceHook(XACE_DEVICE_ACCESS, client, dev, DixCreateAccess)) { + dixFreePrivates(dev->devPrivates, PRIVATE_DEVICE); free(dev); return NULL; } @@ -303,6 +314,10 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart) /* unity matrix */ memset(transform, 0, sizeof(transform)); transform[0] = transform[4] = transform[8] = 1.0f; + dev->relative_transform.m[0][0] = 1.0; + dev->relative_transform.m[1][1] = 1.0; + dev->relative_transform.m[2][2] = 1.0; + dev->scale_and_transform = dev->relative_transform; XIChangeDeviceProperty(dev, XIGetKnownProperty(XI_PROP_TRANSFORM), XIGetKnownProperty(XATOM_FLOAT), 32, @@ -318,15 +333,14 @@ AddInputDevice(ClientPtr client, DeviceProc deviceProc, Bool autoStart) void SendDevicePresenceEvent(int deviceid, int type) { - DeviceIntRec dummyDev; - devicePresenceNotify ev; + DeviceIntRec dummyDev = { .id = XIAllDevices }; + devicePresenceNotify ev = { + .type = DevicePresenceNotify, + .time = currentTime.milliseconds, + .devchange = type, + .deviceid = deviceid + }; - memset(&dummyDev, 0, sizeof(DeviceIntRec)); - ev.type = DevicePresenceNotify; - ev.time = currentTime.milliseconds; - ev.devchange = type; - ev.deviceid = deviceid; - dummyDev.id = XIAllDevices; SendEventToAllWindows(&dummyDev, DevicePresenceNotifyMask, (xEvent *) &ev, 1); } @@ -364,13 +378,12 @@ EnableDevice(DeviceIntPtr dev, BOOL sendevent) /* mode doesn't matter */ EnterWindow(dev, screenInfo.screens[0]->root, NotifyAncestor); } - else if ((other = NextFreePointerDevice()) == NULL) { - ErrorF("[dix] cannot find pointer to pair with. " - "This is a bug.\n"); - return FALSE; + else { + other = NextFreePointerDevice(); + BUG_RETURN_VAL_MSG(other == NULL, FALSE, + "[dix] cannot find pointer to pair with.\n"); + PairDevices(other, dev); } - else - PairDevices(NULL, other, dev); } else { if (dev->coreEvents) @@ -406,9 +419,13 @@ EnableDevice(DeviceIntPtr dev, BOOL sendevent) RecalculateMasterButtons(dev); + /* initialise an idle timer for this device*/ + dev->idle_counter = SyncInitDeviceIdleTime(dev); + return TRUE; } + /** * Switch a device off through the driver and push it onto the off_devices * list. A device will not send events while disabled. All clients are @@ -427,11 +444,19 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent) BOOL enabled; int flags[MAXDEVICES] = { 0 }; + if (!dev->enabled) + return TRUE; + for (prev = &inputInfo.devices; *prev && (*prev != dev); prev = &(*prev)->next); if (*prev != dev) return FALSE; + TouchEndPhysicallyActiveTouches(dev); + ReleaseButtonsAndKeys(dev); + SyncRemoveDeviceIdleTime(dev->idle_counter); + dev->idle_counter = NULL; + /* float attached devices */ if (IsMaster(dev)) { for (other = inputInfo.devices; other; other = other->next) { @@ -449,18 +474,19 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent) } if (IsMaster(dev) && dev->spriteInfo->sprite) { - for (other = inputInfo.devices; other; other = other->next) { - if (other->spriteInfo->paired == dev) { - ErrorF("[dix] cannot disable device, still paired. " - "This is a bug. \n"); - return FALSE; - } - } + for (other = inputInfo.devices; other; other = other->next) + if (other->spriteInfo->paired == dev && !other->spriteInfo->spriteOwner) + DisableDevice(other, sendevent); } + if (dev->spriteInfo->paired) + dev->spriteInfo->paired = NULL; + (void) (*dev->deviceProc) (dev, DEVICE_OFF); dev->enabled = FALSE; + FreeSprite(dev); + /* now that the device is disabled, we can reset the signal handler's * last.slave */ OsBlockSignals(); @@ -492,6 +518,32 @@ DisableDevice(DeviceIntPtr dev, BOOL sendevent) return TRUE; } +void +DisableAllDevices(void) +{ + DeviceIntPtr dev, tmp; + + /* Disable slave devices first, excluding XTest devices */ + nt_list_for_each_entry_safe(dev, tmp, inputInfo.devices, next) { + if (!IsXTestDevice(dev, NULL) && !IsMaster(dev)) + DisableDevice(dev, FALSE); + } + /* Disable XTest devices */ + nt_list_for_each_entry_safe(dev, tmp, inputInfo.devices, next) { + if (!IsMaster(dev)) + DisableDevice(dev, FALSE); + } + /* master keyboards need to be disabled first */ + nt_list_for_each_entry_safe(dev, tmp, inputInfo.devices, next) { + if (dev->enabled && IsMaster(dev) && IsKeyboardDevice(dev)) + DisableDevice(dev, FALSE); + } + nt_list_for_each_entry_safe(dev, tmp, inputInfo.devices, next) { + if (dev->enabled) + DisableDevice(dev, FALSE); + } +} + /** * Initialise a new device through the driver and tell all clients about the * new device. @@ -905,7 +957,7 @@ CloseDevice(DeviceIntPtr dev) free(dev->name); - classes = (ClassesPtr) & dev->key; + classes = (ClassesPtr) &dev->key; FreeAllDeviceClasses(classes); if (IsMaster(dev)) { @@ -914,12 +966,7 @@ CloseDevice(DeviceIntPtr dev) free(classes); } - if (DevHasCursor(dev) && dev->spriteInfo->sprite) { - if (dev->spriteInfo->sprite->current) - FreeCursor(dev->spriteInfo->sprite->current, None); - free(dev->spriteInfo->sprite->spriteTrace); - free(dev->spriteInfo->sprite); - } + FreeSprite(dev); /* a client may have the device set as client pointer */ for (j = 0; j < currentMaxClients; j++) { @@ -937,7 +984,8 @@ CloseDevice(DeviceIntPtr dev) free(dev->last.touches[j].valuators); free(dev->last.touches); dev->config_info = NULL; - dixFreeObjectWithPrivates(dev, PRIVATE_DEVICE); + dixFreePrivates(dev->devPrivates, PRIVATE_DEVICE); + free(dev); } /** @@ -1007,6 +1055,25 @@ CloseDownDevices(void) OsReleaseSignals(); } +/** + * Signal all devices that we're in the process of aborting. + * This function is called from a signal handler. + */ +void +AbortDevices(void) +{ + DeviceIntPtr dev; + nt_list_for_each_entry(dev, inputInfo.devices, next) { + if (!IsMaster(dev)) + (*dev->deviceProc) (dev, DEVICE_ABORT); + } + + nt_list_for_each_entry(dev, inputInfo.off_devices, next) { + if (!IsMaster(dev)) + (*dev->deviceProc) (dev, DEVICE_ABORT); + } +} + /** * Remove the cursor sprite for all devices. This needs to be done before any * resources are freed or any device is deleted. @@ -1323,13 +1390,10 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, Atom *labels, /* global list of acceleration schemes */ ValuatorAccelerationRec pointerAccelerationScheme[] = { - {PtrAccelNoOp, NULL, NULL, NULL, NULL} - , + {PtrAccelNoOp, NULL, NULL, NULL, NULL}, {PtrAccelPredictable, acceleratePointerPredictable, NULL, - InitPredictableAccelerationScheme, AccelerationDefaultCleanup} - , - {PtrAccelLightweight, acceleratePointerLightweight, NULL, NULL, NULL} - , + InitPredictableAccelerationScheme, AccelerationDefaultCleanup}, + {PtrAccelLightweight, acceleratePointerLightweight, NULL, NULL, NULL}, {-1, NULL, NULL, NULL, NULL} /* terminator */ }; @@ -1366,8 +1430,7 @@ InitPointerAccelerationScheme(DeviceIntPtr dev, int scheme) if (pointerAccelerationScheme[i].AccelInitProc) { if (!pointerAccelerationScheme[i].AccelInitProc(dev, - &pointerAccelerationScheme - [i])) { + &pointerAccelerationScheme[i])) { return FALSE; } } @@ -1640,9 +1703,11 @@ ProcSetModifierMapping(ClientPtr client) bytes_to_int32(sizeof(xSetModifierMappingReq)))) return BadLength; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; + rep = (xSetModifierMappingReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; rc = change_modmap(client, PickKeyboard(client), (KeyCode *) &stuff[1], stuff->numKeyPerModifier); @@ -1670,15 +1735,16 @@ ProcGetModifierMapping(ClientPtr client) generate_modkeymap(client, PickKeyboard(client), &modkeymap, &max_keys_per_mod); - memset(&rep, 0, sizeof(xGetModifierMappingReply)); - rep.type = X_Reply; - rep.numKeyPerModifier = max_keys_per_mod; - rep.sequenceNumber = client->sequence; + rep = (xGetModifierMappingReply) { + .type = X_Reply, + .numKeyPerModifier = max_keys_per_mod, + .sequenceNumber = client->sequence, /* length counts 4 byte quantities - there are 8 modifiers 1 byte big */ - rep.length = max_keys_per_mod << 1; + .length = max_keys_per_mod << 1 + }; WriteReplyToClient(client, sizeof(xGetModifierMappingReply), &rep); - (void) WriteToClient(client, max_keys_per_mod * 8, (char *) modkeymap); + WriteToClient(client, max_keys_per_mod * 8, modkeymap); free(modkeymap); @@ -1759,10 +1825,13 @@ ProcSetPointerMapping(ClientPtr client) if (client->req_len != bytes_to_int32(sizeof(xSetPointerMappingReq) + stuff->nElts)) return BadLength; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.success = MappingSuccess; + + rep = (xSetPointerMappingReply) { + .type = X_Reply, + .success = MappingSuccess, + .sequenceNumber = client->sequence, + .length = 0 + }; map = (BYTE *) &stuff[1]; /* So we're bounded here by the number of core buttons. This check @@ -1831,12 +1900,13 @@ ProcGetKeyboardMapping(ClientPtr client) if (!syms) return BadAlloc; - memset(&rep, 0, sizeof(xGetKeyboardMappingReply)); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.keySymsPerKeyCode = syms->mapWidth; - /* length is a count of 4 byte quantities and KeySyms are 4 bytes */ - rep.length = syms->mapWidth * stuff->count; + rep = (xGetKeyboardMappingReply) { + .type = X_Reply, + .keySymsPerKeyCode = syms->mapWidth, + .sequenceNumber = client->sequence, + /* length is a count of 4 byte quantities and KeySyms are 4 bytes */ + .length = syms->mapWidth * stuff->count + }; WriteReplyToClient(client, sizeof(xGetKeyboardMappingReply), &rep); client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write; WriteSwappedDataToClient(client, @@ -1858,6 +1928,7 @@ ProcGetPointerMapping(ClientPtr client) * the ClientPointer could change. */ DeviceIntPtr ptr = PickPointer(client); ButtonClassPtr butc = ptr->button; + int nElts; int rc; REQUEST_SIZE_MATCH(xReq); @@ -1866,13 +1937,16 @@ ProcGetPointerMapping(ClientPtr client) if (rc != Success) return rc; - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.nElts = (butc) ? butc->numButtons : 0; - rep.length = ((unsigned) rep.nElts + (4 - 1)) / 4; + nElts = (butc) ? butc->numButtons : 0; + rep = (xGetPointerMappingReply) { + .type = X_Reply, + .nElts = nElts, + .sequenceNumber = client->sequence, + .length = ((unsigned) nElts + (4 - 1)) / 4 + }; WriteReplyToClient(client, sizeof(xGetPointerMappingReply), &rep); if (butc) - WriteToClient(client, (int) rep.nElts, (char *) &butc->map[1]); + WriteToClient(client, nElts, &butc->map[1]); return Success; } @@ -2118,15 +2192,17 @@ ProcGetKeyboardControl(ClientPtr client) if (rc != Success) return rc; - rep.type = X_Reply; - rep.length = 5; - rep.sequenceNumber = client->sequence; - rep.globalAutoRepeat = ctrl->autoRepeat; - rep.keyClickPercent = ctrl->click; - rep.bellPercent = ctrl->bell; - rep.bellPitch = ctrl->bell_pitch; - rep.bellDuration = ctrl->bell_duration; - rep.ledMask = ctrl->leds; + rep = (xGetKeyboardControlReply) { + .type = X_Reply, + .globalAutoRepeat = ctrl->autoRepeat, + .sequenceNumber = client->sequence, + .length = 5, + .ledMask = ctrl->leds, + .keyClickPercent = ctrl->click, + .bellPercent = ctrl->bell, + .bellPitch = ctrl->bell_pitch, + .bellDuration = ctrl->bell_duration + }; for (i = 0; i < 32; i++) rep.map[i] = ctrl->autoRepeats[i]; WriteReplyToClient(client, sizeof(xGetKeyboardControlReply), &rep); @@ -2261,12 +2337,14 @@ ProcGetPointerControl(ClientPtr client) if (rc != Success) return rc; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.threshold = ctrl->threshold; - rep.accelNumerator = ctrl->num; - rep.accelDenominator = ctrl->den; + rep = (xGetPointerControlReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .accelNumerator = ctrl->num, + .accelDenominator = ctrl->den, + .threshold = ctrl->threshold + }; WriteReplyToClient(client, sizeof(xGenericReply), &rep); return Success; } @@ -2310,8 +2388,10 @@ ProcGetMotionEvents(ClientPtr client) if (mouse->valuator->motionHintWindow) MaybeStopHint(mouse, client); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; + rep = (xGetMotionEventsReply) { + .type = X_Reply, + .sequenceNumber = client->sequence + }; nEvents = 0; start = ClientTimeToServerTime(stuff->start); stop = ClientTimeToServerTime(stuff->stop); @@ -2359,20 +2439,23 @@ ProcQueryKeymap(ClientPtr client) CARD8 *down = keybd->key->down; REQUEST_SIZE_MATCH(xReq); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 2; + rep = (xQueryKeymapReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 2 + }; rc = XaceHook(XACE_DEVICE_ACCESS, client, keybd, DixReadAccess); - if (rc != Success && rc != BadAccess) + /* If rc is Success, we're allowed to copy out the keymap. + * If it's BadAccess, we leave it empty & lie to the client. + */ + if (rc == Success) { + for (i = 0; i < 32; i++) + rep.map[i] = down[i]; + } + else if (rc != BadAccess) return rc; - for (i = 0; i < 32; i++) - rep.map[i] = down[i]; - - if (rc == BadAccess) - memset(rep.map, 0, 32); - WriteReplyToClient(client, sizeof(xQueryKeymapReply), &rep); return Success; @@ -2406,18 +2489,17 @@ RecalculateMasterButtons(DeviceIntPtr slave) if (master->button && master->button->numButtons != maxbuttons) { int i; - DeviceChangedEvent event; - - memset(&event, 0, sizeof(event)); + DeviceChangedEvent event = { + .header = ET_Internal, + .type = ET_DeviceChanged, + .time = GetTimeInMillis(), + .deviceid = master->id, + .flags = DEVCHANGE_POINTER_EVENT | DEVCHANGE_DEVICE_CHANGE, + .buttons.num_buttons = maxbuttons + }; master->button->numButtons = maxbuttons; - event.header = ET_Internal; - event.type = ET_DeviceChanged; - event.time = GetTimeInMillis(); - event.deviceid = master->id; - event.flags = DEVCHANGE_POINTER_EVENT | DEVCHANGE_DEVICE_CHANGE; - event.buttons.num_buttons = maxbuttons; memcpy(&event.buttons.names, master->button->labels, maxbuttons * sizeof(Atom)); @@ -2630,6 +2712,8 @@ AllocDevicePair(ClientPtr client, const char *name, *ptr = *keybd = NULL; + XkbInitPrivates(); + pointer = AddInputDevice(client, ptr_proc, TRUE); if (!pointer) diff --git a/xserver/dix/dispatch.c b/xserver/dix/dispatch.c index d97180548..8d6173525 100644 --- a/xserver/dix/dispatch.c +++ b/xserver/dix/dispatch.c @@ -223,7 +223,11 @@ UpdateCurrentTimeIf(void) #define SMART_SCHEDULE_DEFAULT_INTERVAL 20 /* ms */ #define SMART_SCHEDULE_MAX_SLICE 200 /* ms */ +#if defined(WIN32) && !defined(__CYGWIN__) +Bool SmartScheduleDisable = TRUE; +#else Bool SmartScheduleDisable = FALSE; +#endif long SmartScheduleSlice = SMART_SCHEDULE_DEFAULT_INTERVAL; long SmartScheduleInterval = SMART_SCHEDULE_DEFAULT_INTERVAL; long SmartScheduleMaxSlice = SMART_SCHEDULE_MAX_SLICE; @@ -466,8 +470,6 @@ Dispatch(void) static int VendorRelease = VENDOR_RELEASE; static char *VendorString = VENDOR_NAME; -static const int padlength[4] = { 0, 3, 2, 1 }; - void SetVendorRelease(int release) { @@ -528,7 +530,7 @@ CreateConnectionBlock(void) memmove(pBuf, VendorString, (int) setup.nbytesVendor); sizesofar += setup.nbytesVendor; pBuf += setup.nbytesVendor; - i = padlength[setup.nbytesVendor & 3]; + i = padding_for_int32(setup.nbytesVendor); sizesofar += i; while (--i >= 0) *pBuf++ = 0; @@ -926,10 +928,9 @@ GetGeometry(ClientPtr client, xGetGeometryReply * rep) int ProcGetGeometry(ClientPtr client) { - xGetGeometryReply rep; + xGetGeometryReply rep = { .type = X_Reply }; int status; - memset(&rep, 0, sizeof(xGetGeometryReply)); if ((status = GetGeometry(client, &rep)) != Success) return status; @@ -951,14 +952,13 @@ ProcQueryTree(ClientPtr client) rc = dixLookupWindow(&pWin, stuff->id, client, DixListAccess); if (rc != Success) return rc; - memset(&reply, 0, sizeof(xQueryTreeReply)); - reply.type = X_Reply; - reply.root = pWin->drawable.pScreen->root->drawable.id; - reply.sequenceNumber = client->sequence; - if (pWin->parent) - reply.parent = pWin->parent->drawable.id; - else - reply.parent = (Window) None; + + reply = (xQueryTreeReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .root = pWin->drawable.pScreen->root->drawable.id, + .parent = (pWin->parent) ? pWin->parent->drawable.id : (Window) None + }; pHead = RealChildHead(pWin); for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) numChildren++; @@ -1003,13 +1003,12 @@ ProcInternAtom(ClientPtr client) tchar = (char *) &stuff[1]; atom = MakeAtom(tchar, stuff->nbytes, !stuff->onlyIfExists); if (atom != BAD_RESOURCE) { - xInternAtomReply reply; - - memset(&reply, 0, sizeof(xInternAtomReply)); - reply.type = X_Reply; - reply.length = 0; - reply.sequenceNumber = client->sequence; - reply.atom = atom; + xInternAtomReply reply = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .atom = atom + }; WriteReplyToClient(client, sizeof(xInternAtomReply), &reply); return Success; } @@ -1021,21 +1020,21 @@ int ProcGetAtomName(ClientPtr client) { const char *str; - xGetAtomNameReply reply; - int len; REQUEST(xResourceReq); REQUEST_SIZE_MATCH(xResourceReq); if ((str = NameForAtom(stuff->id))) { - len = strlen(str); - memset(&reply, 0, sizeof(xGetAtomNameReply)); - reply.type = X_Reply; - reply.length = bytes_to_int32(len); - reply.sequenceNumber = client->sequence; - reply.nameLength = len; + int len = strlen(str); + xGetAtomNameReply reply = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(len), + .nameLength = len + }; + WriteReplyToClient(client, sizeof(xGetAtomNameReply), &reply); - (void) WriteToClient(client, len, str); + WriteToClient(client, len, str); return Success; } else { @@ -1123,10 +1122,12 @@ ProcTranslateCoords(ClientPtr client) rc = dixLookupWindow(&pDst, stuff->dstWid, client, DixGetAttrAccess); if (rc != Success) return rc; - memset(&rep, 0, sizeof(xTranslateCoordsReply)); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; + + rep = (xTranslateCoordsReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; if (!SAME_SCREENS(pWin->drawable, pDst->drawable)) { rep.sameScreen = xFalse; rep.child = None; @@ -1288,17 +1289,19 @@ ProcQueryTextExtents(ClientPtr client) } if (!QueryTextExtents(pFont, length, (unsigned char *) &stuff[1], &info)) return BadAlloc; - reply.type = X_Reply; - reply.length = 0; - reply.sequenceNumber = client->sequence; - reply.drawDirection = info.drawDirection; - reply.fontAscent = info.fontAscent; - reply.fontDescent = info.fontDescent; - reply.overallAscent = info.overallAscent; - reply.overallDescent = info.overallDescent; - reply.overallWidth = info.overallWidth; - reply.overallLeft = info.overallLeft; - reply.overallRight = info.overallRight; + reply = (xQueryTextExtentsReply) { + .type = X_Reply, + .drawDirection = info.drawDirection, + .sequenceNumber = client->sequence, + .length = 0, + .fontAscent = info.fontAscent, + .fontDescent = info.fontDescent, + .overallAscent = info.overallAscent, + .overallDescent = info.overallDescent, + .overallWidth = info.overallWidth, + .overallLeft = info.overallLeft, + .overallRight = info.overallRight + }; WriteReplyToClient(client, sizeof(xQueryTextExtentsReply), &reply); return Success; } @@ -2143,8 +2146,7 @@ DoGetImage(ClientPtr client, int format, Drawable drawable, BitsPerPixel(pDraw->depth), ClientOrder(client)); /* Don't split me, gcc pukes when you do */ - (void) WriteToClient(client, - (int) (nlines * widthBytesLine), pBuf); + WriteToClient(client, (int) (nlines * widthBytesLine), pBuf); } linesDone += nlines; } @@ -2179,9 +2181,8 @@ DoGetImage(ClientPtr client, int format, Drawable drawable, 1, ClientOrder(client)); /* Don't split me, gcc pukes when you do */ - (void) WriteToClient(client, - (int) (nlines * widthBytesLine), - pBuf); + WriteToClient(client, (int) (nlines * widthBytesLine), + pBuf); } linesDone += nlines; } @@ -2453,7 +2454,7 @@ ProcListInstalledColormaps(ClientPtr client) preply->type = X_Reply; preply->sequenceNumber = client->sequence; nummaps = (*pWin->drawable.pScreen->ListInstalledColormaps) - (pWin->drawable.pScreen, (Colormap *) & preply[1]); + (pWin->drawable.pScreen, (Colormap *) &preply[1]); preply->nColormaps = nummaps; preply->length = nummaps; WriteReplyToClient(client, sizeof(xListInstalledColormapsReply), preply); @@ -2468,7 +2469,6 @@ ProcAllocColor(ClientPtr client) { ColormapPtr pmap; int rc; - xAllocColorReply acr; REQUEST(xAllocColorReq); @@ -2476,13 +2476,15 @@ ProcAllocColor(ClientPtr client) rc = dixLookupResourceByType((pointer *) &pmap, stuff->cmap, RT_COLORMAP, client, DixAddAccess); if (rc == Success) { - acr.type = X_Reply; - acr.length = 0; - acr.sequenceNumber = client->sequence; - acr.red = stuff->red; - acr.green = stuff->green; - acr.blue = stuff->blue; - acr.pixel = 0; + xAllocColorReply acr = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .red = stuff->red, + .green = stuff->green, + .blue = stuff->blue, + .pixel = 0 + }; if ((rc = AllocColor(pmap, &acr.red, &acr.green, &acr.blue, &acr.pixel, client->index))) return rc; @@ -2511,12 +2513,11 @@ ProcAllocNamedColor(ClientPtr client) rc = dixLookupResourceByType((pointer *) &pcmp, stuff->cmap, RT_COLORMAP, client, DixAddAccess); if (rc == Success) { - xAllocNamedColorReply ancr; - - ancr.type = X_Reply; - ancr.length = 0; - ancr.sequenceNumber = client->sequence; - + xAllocNamedColorReply ancr = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; if (OsLookupColor (pcmp->pScreen->myNum, (char *) &stuff[1], stuff->nbytes, &ancr.exactRed, &ancr.exactGreen, &ancr.exactBlue)) { @@ -2557,7 +2558,6 @@ ProcAllocColorCells(ClientPtr client) rc = dixLookupResourceByType((pointer *) &pcmp, stuff->cmap, RT_COLORMAP, client, DixAddAccess); if (rc == Success) { - xAllocColorCellsReply accr; int npixels, nmasks; long length; Pixel *ppixels, *pmasks; @@ -2587,11 +2587,13 @@ ProcAllocColorCells(ClientPtr client) if (noPanoramiXExtension || !pcmp->pScreen->myNum) #endif { - accr.type = X_Reply; - accr.length = bytes_to_int32(length); - accr.sequenceNumber = client->sequence; - accr.nPixels = npixels; - accr.nMasks = nmasks; + xAllocColorCellsReply accr = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(length), + .nPixels = npixels, + .nMasks = nmasks + }; WriteReplyToClient(client, sizeof(xAllocColorCellsReply), &accr); client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, length, ppixels); @@ -2631,9 +2633,11 @@ ProcAllocColorPlanes(ClientPtr client) client->errorValue = stuff->contiguous; return BadValue; } - acpr.type = X_Reply; - acpr.sequenceNumber = client->sequence; - acpr.nPixels = npixels; + acpr = (xAllocColorPlanesReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .nPixels = npixels + }; length = (long) npixels *sizeof(Pixel); ppixels = malloc(length); @@ -2771,11 +2775,12 @@ ProcQueryColors(ClientPtr client) free(prgbs); return rc; } - memset(&qcr, 0, sizeof(xQueryColorsReply)); - qcr.type = X_Reply; - qcr.length = bytes_to_int32(count * sizeof(xrgb)); - qcr.sequenceNumber = client->sequence; - qcr.nColors = count; + qcr = (xQueryColorsReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(count * sizeof(xrgb)), + .nColors = count + }; WriteReplyToClient(client, sizeof(xQueryColorsReply), &qcr); if (count) { client->pSwapReplyFunc = (ReplySwapPtr) SQColorsExtend; @@ -2803,17 +2808,22 @@ ProcLookupColor(ClientPtr client) rc = dixLookupResourceByType((pointer *) &pcmp, stuff->cmap, RT_COLORMAP, client, DixReadAccess); if (rc == Success) { - xLookupColorReply lcr; + CARD16 exactRed, exactGreen, exactBlue; if (OsLookupColor (pcmp->pScreen->myNum, (char *) &stuff[1], stuff->nbytes, - &lcr.exactRed, &lcr.exactGreen, &lcr.exactBlue)) { - lcr.type = X_Reply; - lcr.length = 0; - lcr.sequenceNumber = client->sequence; - lcr.screenRed = lcr.exactRed; - lcr.screenGreen = lcr.exactGreen; - lcr.screenBlue = lcr.exactBlue; + &exactRed, &exactGreen, &exactBlue)) { + xLookupColorReply lcr = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .exactRed = exactRed, + .exactGreen = exactGreen, + .exactBlue = exactBlue, + .screenRed = exactRed, + .screenGreen = exactGreen, + .screenBlue = exactBlue + }; (*pcmp->pScreen->ResolveColor) (&lcr.screenRed, &lcr.screenGreen, &lcr.screenBlue, pcmp->pVisual); @@ -2993,12 +3003,13 @@ ProcQueryBestSize(ClientPtr client) return rc; (*pScreen->QueryBestSize) (stuff->class, &stuff->width, &stuff->height, pScreen); - memset(&reply, 0, sizeof(xQueryBestSizeReply)); - reply.type = X_Reply; - reply.length = 0; - reply.sequenceNumber = client->sequence; - reply.width = stuff->width; - reply.height = stuff->height; + reply = (xQueryBestSizeReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .width = stuff->width, + .height = stuff->height + }; WriteReplyToClient(client, sizeof(xQueryBestSizeReply), &reply); return Success; } @@ -3078,13 +3089,15 @@ ProcGetScreenSaver(ClientPtr client) return rc; } - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.timeout = ScreenSaverTime / MILLI_PER_SECOND; - rep.interval = ScreenSaverInterval / MILLI_PER_SECOND; - rep.preferBlanking = ScreenSaverBlanking; - rep.allowExposures = ScreenSaverAllowExposures; + rep = (xGetScreenSaverReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .timeout = ScreenSaverTime / MILLI_PER_SECOND, + .interval = ScreenSaverInterval / MILLI_PER_SECOND, + .preferBlanking = ScreenSaverBlanking, + .allowExposures = ScreenSaverAllowExposures + }; WriteReplyToClient(client, sizeof(xGetScreenSaverReply), &rep); return Success; } @@ -3111,6 +3124,7 @@ ProcListHosts(ClientPtr client) { xListHostsReply reply; int len, nHosts, result; + BOOL enabled; pointer pdata; /* REQUEST(xListHostsReq); */ @@ -3122,13 +3136,17 @@ ProcListHosts(ClientPtr client) if (result != Success) return result; - result = GetHosts(&pdata, &nHosts, &len, &reply.enabled); + result = GetHosts(&pdata, &nHosts, &len, &enabled); if (result != Success) return result; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.nHosts = nHosts; - reply.length = bytes_to_int32(len); + + reply = (xListHostsReply) { + .type = X_Reply, + .enabled = enabled, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(len), + .nHosts = nHosts + }; WriteReplyToClient(client, sizeof(xListHostsReply), &reply); if (nHosts) { client->pSwapReplyFunc = (ReplySwapPtr) SLHostsExtend; @@ -3243,15 +3261,16 @@ ProcGetFontPath(ClientPtr client) if (rc != Success) return rc; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.length = bytes_to_int32(stringLens + numpaths); - reply.nPaths = numpaths; + reply = (xGetFontPathReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(stringLens + numpaths), + .nPaths = numpaths + }; WriteReplyToClient(client, sizeof(xGetFontPathReply), &reply); if (stringLens || numpaths) - (void) WriteToClient(client, stringLens + numpaths, - (char *) bufferStart); + WriteToClient(client, stringLens + numpaths, bufferStart); return Success; } @@ -3484,14 +3503,16 @@ ProcInitialConnection(ClientPtr client) REQUEST(xReq); xConnClientPrefix *prefix; int whichbyte = 1; + char order; - prefix = (xConnClientPrefix *) ((char *) stuff + sz_xReq); - if ((prefix->byteOrder != 'l') && (prefix->byteOrder != 'B')) - return client->noClientException = -1; - if (((*(char *) &whichbyte) && (prefix->byteOrder == 'B')) || - (!(*(char *) &whichbyte) && (prefix->byteOrder == 'l'))) { - client->swapped = TRUE; - SwapConnClientPrefix(prefix); + prefix = (xConnClientPrefix *) ((char *)stuff + sz_xReq); + order = prefix->byteOrder; + if (order != 'l' && order != 'B' && order != 'r' && order != 'R') + return client->noClientException = -1; + if (((*(char *) &whichbyte) && (order == 'B' || order == 'R')) || + (!(*(char *) &whichbyte) && (order == 'l' || order == 'r'))) { + client->swapped = TRUE; + SwapConnClientPrefix(prefix); } stuff->reqType = 2; stuff->length += bytes_to_int32(prefix->nbytesAuthProto) + @@ -3499,6 +3520,9 @@ ProcInitialConnection(ClientPtr client) if (client->swapped) { swaps(&stuff->length); } + if (order == 'r' || order == 'R') { + client->local = FALSE; + } ResetCurrentRequest(client); return Success; } @@ -3523,8 +3547,8 @@ SendConnSetup(ClientPtr client, const char *reason) if (client->swapped) WriteSConnSetupPrefix(client, &csp); else - (void) WriteToClient(client, sz_xConnSetupPrefix, (char *) &csp); - (void) WriteToClient(client, (int) csp.lengthReason, reason); + WriteToClient(client, sz_xConnSetupPrefix, &csp); + WriteToClient(client, (int) csp.lengthReason, reason); return client->noClientException = -1; } @@ -3577,10 +3601,9 @@ SendConnSetup(ClientPtr client, const char *reason) lConnectionInfo); } else { - (void) WriteToClient(client, sizeof(xConnSetupPrefix), - (char *) lconnSetupPrefix); - (void) WriteToClient(client, (int) (lconnSetupPrefix->length << 2), - lConnectionInfo); + WriteToClient(client, sizeof(xConnSetupPrefix), lconnSetupPrefix); + WriteToClient(client, (int) (lconnSetupPrefix->length << 2), + lConnectionInfo); } client->clientState = ClientStateRunning; if (ClientStateCallback) { @@ -3623,14 +3646,13 @@ void SendErrorToClient(ClientPtr client, unsigned majorCode, unsigned minorCode, XID resId, int errorCode) { - xError rep; - - memset(&rep, 0, sizeof(xError)); - rep.type = X_Error; - rep.errorCode = errorCode; - rep.majorCode = majorCode; - rep.minorCode = minorCode; - rep.resourceID = resId; + xError rep = { + .type = X_Error, + .errorCode = errorCode, + .resourceID = resId, + .minorCode = minorCode, + .majorCode = majorCode + }; WriteEventsToClient(client, 1, (xEvent *) &rep); } @@ -3724,35 +3746,29 @@ with its screen number, a pointer to its ScreenRec, argc, and argv. */ -int -AddScreen(Bool (*pfnInit) (int /*index */ , - ScreenPtr /*pScreen */ , - int /*argc */ , - char ** /*argv */ - ), int argc, char **argv) +static int init_screen(ScreenPtr pScreen, int i, Bool gpu) { - - int i; int scanlinepad, format, depth, bitsPerPixel, j, k; - ScreenPtr pScreen; - i = screenInfo.numScreens; - if (i == MAXSCREENS) - return -1; - - pScreen = (ScreenPtr) calloc(1, sizeof(ScreenRec)); - if (!pScreen) - return -1; + dixInitScreenSpecificPrivates(pScreen); if (!dixAllocatePrivates(&pScreen->devPrivates, PRIVATE_SCREEN)) { - free(pScreen); return -1; } pScreen->myNum = i; + if (gpu) { + pScreen->myNum += GPU_SCREEN_OFFSET; + pScreen->isGPU = TRUE; + } pScreen->totalPixmapSize = 0; /* computed in CreateScratchPixmapForScreen */ pScreen->ClipNotify = 0; /* for R4 ddx compatibility */ pScreen->CreateScreenResources = 0; + xorg_list_init(&pScreen->pixmap_dirty_list); + xorg_list_init(&pScreen->unattached_list); + xorg_list_init(&pScreen->output_slave_list); + xorg_list_init(&pScreen->offload_slave_list); + /* * This loop gets run once for every Screen that gets added, * but thats ok. If the ddx layer initializes the formats @@ -3783,7 +3799,33 @@ AddScreen(Bool (*pfnInit) (int /*index */ , PixmapWidthPaddingInfo[depth].notPower2 = 0; } } + return 0; +} +int +AddScreen(Bool (*pfnInit) (ScreenPtr /*pScreen */ , + int /*argc */ , + char ** /*argv */ + ), int argc, char **argv) +{ + + int i; + ScreenPtr pScreen; + Bool ret; + + i = screenInfo.numScreens; + if (i == MAXSCREENS) + return -1; + + pScreen = (ScreenPtr) calloc(1, sizeof(ScreenRec)); + if (!pScreen) + return -1; + + ret = init_screen(pScreen, i, FALSE); + if (ret != 0) { + free(pScreen); + return ret; + } /* This is where screen specific stuff gets initialized. Load the screen structure, call the hardware, whatever. This is also where the default colormap should be allocated and @@ -3794,7 +3836,8 @@ AddScreen(Bool (*pfnInit) (int /*index */ , */ screenInfo.screens[i] = pScreen; screenInfo.numScreens++; - if (!(*pfnInit) (i, pScreen, argc, argv)) { + if (!(*pfnInit) (pScreen, argc, argv)) { + dixFreeScreenSpecificPrivates(pScreen); dixFreePrivates(pScreen->devPrivates, PRIVATE_SCREEN); free(pScreen); screenInfo.numScreens--; @@ -3808,3 +3851,124 @@ AddScreen(Bool (*pfnInit) (int /*index */ , return i; } + +int +AddGPUScreen(Bool (*pfnInit) (ScreenPtr /*pScreen */ , + int /*argc */ , + char ** /*argv */ + ), + int argc, char **argv) +{ + int i; + ScreenPtr pScreen; + Bool ret; + + i = screenInfo.numGPUScreens; + if (i == MAXGPUSCREENS) + return -1; + + pScreen = (ScreenPtr) calloc(1, sizeof(ScreenRec)); + if (!pScreen) + return -1; + + ret = init_screen(pScreen, i, TRUE); + if (ret != 0) { + free(pScreen); + return ret; + } + + /* This is where screen specific stuff gets initialized. Load the + screen structure, call the hardware, whatever. + This is also where the default colormap should be allocated and + also pixel values for blackPixel, whitePixel, and the cursor + Note that InitScreen is NOT allowed to modify argc, argv, or + any of the strings pointed to by argv. They may be passed to + multiple screens. + */ + screenInfo.gpuscreens[i] = pScreen; + screenInfo.numGPUScreens++; + if (!(*pfnInit) (pScreen, argc, argv)) { + dixFreePrivates(pScreen->devPrivates, PRIVATE_SCREEN); + free(pScreen); + screenInfo.numGPUScreens--; + return -1; + } + + update_desktop_dimensions(); + + return i; +} + +void +RemoveGPUScreen(ScreenPtr pScreen) +{ + int idx, j; + if (!pScreen->isGPU) + return; + + idx = pScreen->myNum - GPU_SCREEN_OFFSET; + for (j = idx; j < screenInfo.numGPUScreens - 1; j++) { + screenInfo.gpuscreens[j] = screenInfo.gpuscreens[j + 1]; + screenInfo.gpuscreens[j]->myNum = j + GPU_SCREEN_OFFSET; + } + screenInfo.numGPUScreens--; + + /* this gets freed later in the resource list, but without + * the screen existing it causes crashes - so remove it here */ + if (pScreen->defColormap) + FreeResource(pScreen->defColormap, RT_COLORMAP); + free(pScreen); + +} + +void +AttachUnboundGPU(ScreenPtr pScreen, ScreenPtr new) +{ + assert(new->isGPU); + assert(!new->current_master); + xorg_list_add(&new->unattached_head, &pScreen->unattached_list); + new->current_master = pScreen; +} + +void +DetachUnboundGPU(ScreenPtr slave) +{ + assert(slave->isGPU); + xorg_list_del(&slave->unattached_head); + slave->current_master = NULL; +} + +void +AttachOutputGPU(ScreenPtr pScreen, ScreenPtr new) +{ + assert(new->isGPU); + assert(!new->current_master); + xorg_list_add(&new->output_head, &pScreen->output_slave_list); + new->current_master = pScreen; +} + +void +DetachOutputGPU(ScreenPtr slave) +{ + assert(slave->isGPU); + xorg_list_del(&slave->output_head); + slave->current_master = NULL; +} + +void +AttachOffloadGPU(ScreenPtr pScreen, ScreenPtr new) +{ + assert(new->isGPU); + assert(!new->current_master); + xorg_list_add(&new->offload_head, &pScreen->offload_slave_list); + new->current_master = pScreen; +} + +void +DetachOffloadGPU(ScreenPtr slave) +{ + assert(slave->isGPU); + xorg_list_del(&slave->offload_head); + slave->current_master = NULL; +} + diff --git a/xserver/dix/dixfonts.c b/xserver/dix/dixfonts.c index 19fd31e3e..feb765d1c 100644 --- a/xserver/dix/dixfonts.c +++ b/xserver/dix/dixfonts.c @@ -115,6 +115,15 @@ LoadGlyphs(ClientPtr client, FontPtr pfont, unsigned nchars, int item_size, return Successful; } +void +dixGetGlyphs(FontPtr font, unsigned long count, unsigned char *chars, + FontEncoding fontEncoding, + unsigned long *glyphcount, /* RETURN */ + CharInfoPtr *glyphs) /* RETURN */ +{ + (*font->get_glyphs) (font, count, chars, fontEncoding, glyphcount, glyphs); +} + /* * adding RT_FONT prevents conflict with default cursor font */ @@ -744,11 +753,12 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) for (i = 0; i < nnames; i++) stringLens += (names->length[i] <= 255) ? names->length[i] : 0; - memset(&reply, 0, sizeof(xListFontsReply)); - reply.type = X_Reply; - reply.length = bytes_to_int32(stringLens + nnames); - reply.nFonts = nnames; - reply.sequenceNumber = client->sequence; + reply = (xListFontsReply) { + .type = X_Reply, + .length = bytes_to_int32(stringLens + nnames), + .nFonts = nnames, + .sequenceNumber = client->sequence + }; bufptr = bufferStart = malloc(reply.length << 2); @@ -773,7 +783,7 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c) reply.length = bytes_to_int32(stringLens + nnames); client->pSwapReplyFunc = ReplySwapVector[X_ListFonts]; WriteSwappedDataToClient(client, sizeof(xListFontsReply), &reply); - (void) WriteToClient(client, stringLens + nnames, bufferStart); + WriteToClient(client, stringLens + nnames, bufferStart); free(bufferStart); bail: @@ -1011,7 +1021,7 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) pFP++; } WriteSwappedDataToClient(client, length, reply); - (void) WriteToClient(client, namelen, name); + WriteToClient(client, namelen, name); if (pFontInfo == &fontInfo) { free(fontInfo.props); free(fontInfo.isStringProp); @@ -1021,11 +1031,12 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c) } finish: length = sizeof(xListFontsWithInfoReply); - memset((char *) &finalReply, 0, sizeof(xListFontsWithInfoReply)); - finalReply.type = X_Reply; - finalReply.sequenceNumber = client->sequence; - finalReply.length = bytes_to_int32(sizeof(xListFontsWithInfoReply) - - sizeof(xGenericReply)); + finalReply = (xListFontsWithInfoReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(sizeof(xListFontsWithInfoReply) + - sizeof(xGenericReply)) + }; WriteSwappedDataToClient(client, length, &finalReply); bail: ClientWakeup(client); @@ -1812,12 +1823,14 @@ InitFonts(void) register_fpe_functions(); } +_X_EXPORT int GetDefaultPointSize(void) { return 120; } +_X_EXPORT FontResolutionPtr GetClientResolutions(int *num) { @@ -1850,6 +1863,7 @@ GetClientResolutions(int *num) * should be called (only once!) by each type of fpe when initialized */ +_X_EXPORT int RegisterFPEFunctions(NameCheckFunc name_func, InitFpeFunc init_func, @@ -1921,24 +1935,28 @@ find_old_font(XID id) return (FontPtr) pFont; } +_X_EXPORT Font GetNewFontClientID(void) { return FakeClientID(0); } +_X_EXPORT int StoreFontClientFont(FontPtr pfont, Font id) { return AddResource(id, RT_NONE, (pointer) pfont); } +_X_EXPORT void DeleteFontClientID(Font id) { FreeResource(id, RT_NONE); } +_X_EXPORT int client_auth_generation(ClientPtr client) { @@ -1948,6 +1966,7 @@ client_auth_generation(ClientPtr client) static int fs_handlers_installed = 0; static unsigned int last_server_gen; +_X_EXPORT int init_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler) { @@ -1966,6 +1985,7 @@ init_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler) return Successful; } +_X_EXPORT void remove_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler, Bool all) diff --git a/xserver/dix/dixutils.c b/xserver/dix/dixutils.c index 9eb54893a..3f24629b4 100644 --- a/xserver/dix/dixutils.c +++ b/xserver/dix/dixutils.c @@ -384,9 +384,11 @@ BlockHandler(pointer pTimeout, pointer pReadmask) ++inHandler; for (i = 0; i < screenInfo.numScreens; i++) - (*screenInfo.screens[i]->BlockHandler) (i, - screenInfo.screens[i]-> - blockData, pTimeout, pReadmask); + (*screenInfo.screens[i]->BlockHandler) (screenInfo.screens[i], + pTimeout, pReadmask); + for (i = 0; i < screenInfo.numGPUScreens; i++) + (*screenInfo.gpuscreens[i]->BlockHandler) (screenInfo.gpuscreens[i], + pTimeout, pReadmask); for (i = 0; i < numHandlers; i++) if (!handlers[i].deleted) (*handlers[i].BlockHandler) (handlers[i].blockData, @@ -421,9 +423,11 @@ WakeupHandler(int result, pointer pReadmask) (*handlers[i].WakeupHandler) (handlers[i].blockData, result, pReadmask); for (i = 0; i < screenInfo.numScreens; i++) - (*screenInfo.screens[i]->WakeupHandler) (i, - screenInfo.screens[i]-> - wakeupData, result, pReadmask); + (*screenInfo.screens[i]->WakeupHandler) (screenInfo.screens[i], + result, pReadmask); + for (i = 0; i < screenInfo.numGPUScreens; i++) + (*screenInfo.gpuscreens[i]->WakeupHandler) (screenInfo.gpuscreens[i], + result, pReadmask); if (handlerDeleted) { for (i = 0; i < numHandlers;) if (handlers[i].deleted) { diff --git a/xserver/dix/enterleave.c b/xserver/dix/enterleave.c index 725080a4c..54f4b8554 100644 --- a/xserver/dix/enterleave.c +++ b/xserver/dix/enterleave.c @@ -30,11 +30,16 @@ #include #include +#include +#include #include "inputstr.h" #include "windowstr.h" #include "scrnintstr.h" #include "exglobals.h" #include "enterleave.h" +#include "eventconvert.h" +#include "xkbsrv.h" +#include "inpututils.h" /** * @file @@ -602,6 +607,243 @@ DoEnterLeaveEvents(DeviceIntPtr pDev, DeviceEnterLeaveEvents(pDev, sourceid, fromWin, toWin, mode); } +static void +FixDeviceValuator(DeviceIntPtr dev, deviceValuator * ev, ValuatorClassPtr v, + int first) +{ + int nval = v->numAxes - first; + + ev->type = DeviceValuator; + ev->deviceid = dev->id; + ev->num_valuators = nval < 3 ? nval : 3; + ev->first_valuator = first; + switch (ev->num_valuators) { + case 3: + ev->valuator2 = v->axisVal[first + 2]; + case 2: + ev->valuator1 = v->axisVal[first + 1]; + case 1: + ev->valuator0 = v->axisVal[first]; + break; + } + first += ev->num_valuators; +} + +static void +FixDeviceStateNotify(DeviceIntPtr dev, deviceStateNotify * ev, KeyClassPtr k, + ButtonClassPtr b, ValuatorClassPtr v, int first) +{ + ev->type = DeviceStateNotify; + ev->deviceid = dev->id; + ev->time = currentTime.milliseconds; + ev->classes_reported = 0; + ev->num_keys = 0; + ev->num_buttons = 0; + ev->num_valuators = 0; + + if (b) { + ev->classes_reported |= (1 << ButtonClass); + ev->num_buttons = b->numButtons; + memcpy((char *) ev->buttons, (char *) b->down, 4); + } + else if (k) { + ev->classes_reported |= (1 << KeyClass); + ev->num_keys = k->xkbInfo->desc->max_key_code - + k->xkbInfo->desc->min_key_code; + memmove((char *) &ev->keys[0], (char *) k->down, 4); + } + if (v) { + int nval = v->numAxes - first; + + ev->classes_reported |= (1 << ValuatorClass); + ev->classes_reported |= valuator_get_mode(dev, 0) << ModeBitsShift; + ev->num_valuators = nval < 3 ? nval : 3; + switch (ev->num_valuators) { + case 3: + ev->valuator2 = v->axisVal[first + 2]; + case 2: + ev->valuator1 = v->axisVal[first + 1]; + case 1: + ev->valuator0 = v->axisVal[first]; + break; + } + } +} + + +static void +DeliverStateNotifyEvent(DeviceIntPtr dev, WindowPtr win) +{ + int evcount = 1; + deviceStateNotify *ev, *sev; + deviceKeyStateNotify *kev; + deviceButtonStateNotify *bev; + + KeyClassPtr k; + ButtonClassPtr b; + ValuatorClassPtr v; + int nval = 0, nkeys = 0, nbuttons = 0, first = 0; + + if (!(wOtherInputMasks(win)) || + !(wOtherInputMasks(win)->inputEvents[dev->id] & DeviceStateNotifyMask)) + return; + + if ((b = dev->button) != NULL) { + nbuttons = b->numButtons; + if (nbuttons > 32) + evcount++; + } + if ((k = dev->key) != NULL) { + nkeys = k->xkbInfo->desc->max_key_code - k->xkbInfo->desc->min_key_code; + if (nkeys > 32) + evcount++; + if (nbuttons > 0) { + evcount++; + } + } + if ((v = dev->valuator) != NULL) { + nval = v->numAxes; + + if (nval > 3) + evcount++; + if (nval > 6) { + if (!(k && b)) + evcount++; + if (nval > 9) + evcount += ((nval - 7) / 3); + } + } + + sev = ev = (deviceStateNotify *) malloc(evcount * sizeof(xEvent)); + FixDeviceStateNotify(dev, ev, NULL, NULL, NULL, first); + + if (b != NULL) { + FixDeviceStateNotify(dev, ev++, NULL, b, v, first); + first += 3; + nval -= 3; + if (nbuttons > 32) { + (ev - 1)->deviceid |= MORE_EVENTS; + bev = (deviceButtonStateNotify *) ev++; + bev->type = DeviceButtonStateNotify; + bev->deviceid = dev->id; + memcpy((char *) &bev->buttons[4], (char *) &b->down[4], + DOWN_LENGTH - 4); + } + if (nval > 0) { + (ev - 1)->deviceid |= MORE_EVENTS; + FixDeviceValuator(dev, (deviceValuator *) ev++, v, first); + first += 3; + nval -= 3; + } + } + + if (k != NULL) { + FixDeviceStateNotify(dev, ev++, k, NULL, v, first); + first += 3; + nval -= 3; + if (nkeys > 32) { + (ev - 1)->deviceid |= MORE_EVENTS; + kev = (deviceKeyStateNotify *) ev++; + kev->type = DeviceKeyStateNotify; + kev->deviceid = dev->id; + memmove((char *) &kev->keys[0], (char *) &k->down[4], 28); + } + if (nval > 0) { + (ev - 1)->deviceid |= MORE_EVENTS; + FixDeviceValuator(dev, (deviceValuator *) ev++, v, first); + first += 3; + nval -= 3; + } + } + + while (nval > 0) { + FixDeviceStateNotify(dev, ev++, NULL, NULL, v, first); + first += 3; + nval -= 3; + if (nval > 0) { + (ev - 1)->deviceid |= MORE_EVENTS; + FixDeviceValuator(dev, (deviceValuator *) ev++, v, first); + first += 3; + nval -= 3; + } + } + + DeliverEventsToWindow(dev, win, (xEvent *) sev, evcount, + DeviceStateNotifyMask, NullGrab); + free(sev); +} + +void +DeviceFocusEvent(DeviceIntPtr dev, int type, int mode, int detail, + WindowPtr pWin) +{ + deviceFocus event; + xXIFocusInEvent *xi2event; + DeviceIntPtr mouse; + int btlen, len, i; + + mouse = IsFloating(dev) ? dev : GetMaster(dev, MASTER_POINTER); + + /* XI 2 event */ + btlen = (mouse->button) ? bits_to_bytes(mouse->button->numButtons) : 0; + btlen = bytes_to_int32(btlen); + len = sizeof(xXIFocusInEvent) + btlen * 4; + + xi2event = calloc(1, len); + xi2event->type = GenericEvent; + xi2event->extension = IReqCode; + xi2event->evtype = type; + xi2event->length = bytes_to_int32(len - sizeof(xEvent)); + xi2event->buttons_len = btlen; + xi2event->detail = detail; + xi2event->time = currentTime.milliseconds; + xi2event->deviceid = dev->id; + xi2event->sourceid = dev->id; /* a device doesn't change focus by itself */ + xi2event->mode = mode; + xi2event->root_x = double_to_fp1616(mouse->spriteInfo->sprite->hot.x); + xi2event->root_y = double_to_fp1616(mouse->spriteInfo->sprite->hot.y); + + for (i = 0; mouse && mouse->button && i < mouse->button->numButtons; i++) + if (BitIsOn(mouse->button->down, i)) + SetBit(&xi2event[1], mouse->button->map[i]); + + if (dev->key) { + xi2event->mods.base_mods = dev->key->xkbInfo->state.base_mods; + xi2event->mods.latched_mods = dev->key->xkbInfo->state.latched_mods; + xi2event->mods.locked_mods = dev->key->xkbInfo->state.locked_mods; + xi2event->mods.effective_mods = dev->key->xkbInfo->state.mods; + + xi2event->group.base_group = dev->key->xkbInfo->state.base_group; + xi2event->group.latched_group = dev->key->xkbInfo->state.latched_group; + xi2event->group.locked_group = dev->key->xkbInfo->state.locked_group; + xi2event->group.effective_group = dev->key->xkbInfo->state.group; + } + + FixUpEventFromWindow(dev->spriteInfo->sprite, (xEvent *) xi2event, pWin, + None, FALSE); + + DeliverEventsToWindow(dev, pWin, (xEvent *) xi2event, 1, + GetEventFilter(dev, (xEvent *) xi2event), NullGrab); + + free(xi2event); + + /* XI 1.x event */ + event = (deviceFocus) { + .deviceid = dev->id, + .mode = mode, + .type = (type == XI_FocusIn) ? DeviceFocusIn : DeviceFocusOut, + .detail = detail, + .window = pWin->drawable.id, + .time = currentTime.milliseconds + }; + + DeliverEventsToWindow(dev, pWin, (xEvent *) &event, 1, + DeviceFocusChangeMask, NullGrab); + + if (event.type == DeviceFocusIn) + DeliverStateNotifyEvent(dev, pWin); +} + /** * Send focus out events to all windows between 'child' and 'ancestor'. * Events are sent running up the hierarchy. @@ -1007,7 +1249,8 @@ HasOtherPointer(WindowPtr win, DeviceIntPtr exclude) * Assumption: Neither A nor B are valid windows. */ static void -CoreFocusPointerRootNoneSwitch(DeviceIntPtr dev, WindowPtr A, /* PointerRootWin or NoneWin */ +CoreFocusPointerRootNoneSwitch(DeviceIntPtr dev, + WindowPtr A, /* PointerRootWin or NoneWin */ WindowPtr B, /* NoneWin or PointerRootWin */ int mode) { @@ -1051,7 +1294,8 @@ CoreFocusPointerRootNoneSwitch(DeviceIntPtr dev, WindowPtr A, /* PointerRootWi * Assumption: A is a valid window and not PointerRoot or None. */ static void -CoreFocusToPointerRootOrNone(DeviceIntPtr dev, WindowPtr A, WindowPtr B, /* PointerRootWin or NoneWin */ +CoreFocusToPointerRootOrNone(DeviceIntPtr dev, WindowPtr A, + WindowPtr B, /* PointerRootWin or NoneWin */ int mode) { WindowPtr root; @@ -1097,7 +1341,8 @@ CoreFocusToPointerRootOrNone(DeviceIntPtr dev, WindowPtr A, WindowPtr B, * Assumption: B is a valid window and not PointerRoot or None. */ static void -CoreFocusFromPointerRootOrNone(DeviceIntPtr dev, WindowPtr A, /* PointerRootWin or NoneWin */ +CoreFocusFromPointerRootOrNone(DeviceIntPtr dev, + WindowPtr A, /* PointerRootWin or NoneWin */ WindowPtr B, int mode) { WindowPtr root; diff --git a/xserver/dix/enterleave.h b/xserver/dix/enterleave.h index c1729f8da..a59d05799 100644 --- a/xserver/dix/enterleave.h +++ b/xserver/dix/enterleave.h @@ -31,13 +31,12 @@ #ifndef ENTERLEAVE_H #define ENTERLEAVE_H +#include /* DoFocusEvents() */ + extern void DoEnterLeaveEvents(DeviceIntPtr pDev, int sourceid, WindowPtr fromWin, WindowPtr toWin, int mode); -extern void DoFocusEvents(DeviceIntPtr pDev, - WindowPtr fromWin, WindowPtr toWin, int mode); - extern void EnterLeaveEvent(DeviceIntPtr mouse, int type, int mode, int detail, WindowPtr pWin, Window child); @@ -53,6 +52,11 @@ extern void DeviceEnterLeaveEvent(DeviceIntPtr mouse, int type, int mode, int detail, WindowPtr pWin, Window child); +extern void DeviceFocusEvent(DeviceIntPtr dev, + int type, + int mode, + int detail , + WindowPtr pWin); extern void EnterWindow(DeviceIntPtr dev, WindowPtr win, int mode); @@ -61,9 +65,6 @@ extern void LeaveWindow(DeviceIntPtr dev); extern void CoreFocusEvent(DeviceIntPtr kbd, int type, int mode, int detail, WindowPtr pWin); -extern void DeviceFocusEvent(DeviceIntPtr kbd, - int type, int mode, int detail, WindowPtr pWin); - extern void SetFocusIn(DeviceIntPtr kbd, WindowPtr win); extern void SetFocusOut(DeviceIntPtr dev); diff --git a/xserver/dix/eventconvert.c b/xserver/dix/eventconvert.c index 41a3174a6..2c411cf40 100644 --- a/xserver/dix/eventconvert.c +++ b/xserver/dix/eventconvert.c @@ -57,6 +57,7 @@ static int eventToKeyButtonPointer(DeviceEvent *ev, xEvent **xi, int *count); static int eventToDeviceChanged(DeviceChangedEvent *ev, xEvent **dcce); static int eventToDeviceEvent(DeviceEvent *ev, xEvent **xi); static int eventToRawEvent(RawDeviceEvent *ev, xEvent **xi); +static int eventToBarrierEvent(BarrierEvent *ev, xEvent **xi); static int eventToTouchOwnershipEvent(TouchOwnershipEvent *ev, xEvent **xi); /* Do not use, read comments below */ @@ -160,6 +161,8 @@ EventToCore(InternalEvent *event, xEvent **core_out, int *count_out) case ET_TouchUpdate: case ET_TouchEnd: case ET_TouchOwnership: + case ET_BarrierHit: + case ET_BarrierLeave: ret = BadMatch; break; default: @@ -216,6 +219,8 @@ EventToXI(InternalEvent *ev, xEvent **xi, int *count) case ET_TouchUpdate: case ET_TouchEnd: case ET_TouchOwnership: + case ET_BarrierHit: + case ET_BarrierLeave: *count = 0; *xi = NULL; return BadMatch; @@ -277,6 +282,9 @@ EventToXI2(InternalEvent *ev, xEvent **xi) case ET_RawTouchUpdate: case ET_RawTouchEnd: return eventToRawEvent(&ev->raw_event, xi); + case ET_BarrierHit: + case ET_BarrierLeave: + return eventToBarrierEvent(&ev->barrier_event, xi); default: break; } @@ -451,7 +459,7 @@ appendKeyInfo(DeviceChangedEvent *dce, xXIKeyInfo * info) info->length = sizeof(xXIKeyInfo) / 4 + info->num_keycodes; info->sourceid = dce->sourceid; - kc = (uint32_t *) & info[1]; + kc = (uint32_t *) &info[1]; for (i = 0; i < info->num_keycodes; i++) *kc++ = i + dce->keys.min_keycode; @@ -673,8 +681,8 @@ eventToDeviceEvent(DeviceEvent *ev, xEvent **xi) xde->valuators_len = vallen; xde->deviceid = ev->deviceid; xde->sourceid = ev->sourceid; - xde->root_x = FP1616(ev->root_x, ev->root_x_frac); - xde->root_y = FP1616(ev->root_y, ev->root_y_frac); + xde->root_x = double_to_fp1616(ev->root_x + ev->root_x_frac); + xde->root_y = double_to_fp1616(ev->root_y + ev->root_y_frac); if (ev->type == ET_TouchUpdate) xde->flags |= (ev->flags & TOUCH_PENDING_END) ? XITouchPendingEnd : 0; @@ -782,6 +790,35 @@ eventToRawEvent(RawDeviceEvent *ev, xEvent **xi) return Success; } +static int +eventToBarrierEvent(BarrierEvent *ev, xEvent **xi) +{ + xXIBarrierEvent *barrier; + int len = sizeof(xXIBarrierEvent); + + *xi = calloc(1, len); + barrier = (xXIBarrierEvent*) *xi; + barrier->type = GenericEvent; + barrier->extension = IReqCode; + barrier->evtype = GetXI2Type(ev->type); + barrier->length = bytes_to_int32(len - sizeof(xEvent)); + barrier->deviceid = ev->deviceid; + barrier->sourceid = ev->sourceid; + barrier->time = ev->time; + barrier->event = ev->window; + barrier->root = ev->root; + barrier->dx = double_to_fp3232(ev->dx); + barrier->dy = double_to_fp3232(ev->dy); + barrier->dtime = ev->dt; + barrier->flags = ev->flags; + barrier->eventid = ev->event_id; + barrier->barrier = ev->barrierid; + barrier->root_x = double_to_fp1616(ev->root_x); + barrier->root_y = double_to_fp1616(ev->root_y); + + return Success; +} + /** * Return the corresponding core type for the given event or 0 if no core * equivalent exists. @@ -929,6 +966,12 @@ GetXI2Type(enum EventType type) case ET_TouchOwnership: xi2type = XI_TouchOwnership; break; + case ET_BarrierHit: + xi2type = XI_BarrierHit; + break; + case ET_BarrierLeave: + xi2type = XI_BarrierLeave; + break; default: break; } diff --git a/xserver/dix/events.c b/xserver/dix/events.c index 86336fef6..2682ecd46 100644 --- a/xserver/dix/events.c +++ b/xserver/dix/events.c @@ -219,6 +219,9 @@ static void CheckVirtualMotion(DeviceIntPtr pDev, QdEventPtr qe, static void CheckPhysLimits(DeviceIntPtr pDev, CursorPtr cursor, Bool generateEvents, Bool confineToScreen, ScreenPtr pScreen); +static Bool IsWrongPointerBarrierClient(ClientPtr client, + DeviceIntPtr dev, + xEvent *event); /** Key repeat hack. Do not use but in TryClientEvents */ extern BOOL EventIsKeyRepeat(xEvent *event); @@ -349,8 +352,6 @@ IsFloating(DeviceIntPtr dev) */ extern int lastEvent; -extern int DeviceMotionNotify; - #define CantBeFiltered NoEventMask /** * Event masks for each event type. @@ -700,9 +701,10 @@ ConfineToShape(DeviceIntPtr pDev, RegionPtr shape, int *px, int *py) } static void -CheckPhysLimits(DeviceIntPtr pDev, CursorPtr cursor, Bool generateEvents, Bool confineToScreen, /* unused if PanoramiX on */ - ScreenPtr pScreen) -{ /* unused if PanoramiX on */ +CheckPhysLimits(DeviceIntPtr pDev, CursorPtr cursor, Bool generateEvents, + Bool confineToScreen, /* unused if PanoramiX on */ + ScreenPtr pScreen) /* unused if PanoramiX on */ +{ HotSpot new; SpritePtr pSprite = pDev->spriteInfo->sprite; @@ -1055,19 +1057,20 @@ MonthChangedOrBadTime(InternalEvent *ev) } static void -NoticeTime(InternalEvent *ev) +NoticeTime(InternalEvent *ev, DeviceIntPtr dev) { if (ev->any.time < currentTime.milliseconds) MonthChangedOrBadTime(ev); currentTime.milliseconds = ev->any.time; - lastDeviceEventTime = currentTime; + lastDeviceEventTime[XIAllDevices] = currentTime; + lastDeviceEventTime[dev->id] = currentTime; } void -NoticeEventTime(InternalEvent *ev) +NoticeEventTime(InternalEvent *ev, DeviceIntPtr dev) { if (!syncEvents.playingEvents) - NoticeTime(ev); + NoticeTime(ev, dev); } /************************************************************************** @@ -1091,7 +1094,7 @@ EnqueueEvent(InternalEvent *ev, DeviceIntPtr device) if (!xorg_list_is_empty(&syncEvents.pending)) tail = xorg_list_last_entry(&syncEvents.pending, QdEventRec, next); - NoticeTime((InternalEvent *) event); + NoticeTime((InternalEvent *)event, device); /* Fix for key repeating bug. */ if (device->key != NULL && device->key->xkbInfo != NULL && @@ -1435,6 +1438,7 @@ UpdateTouchesForGrab(DeviceIntPtr mouse) ti->listeners[0].type = LISTENER_POINTER_GRAB; else ti->listeners[0].type = LISTENER_GRAB; + ti->listeners[0].grab = grab; } } } @@ -1503,11 +1507,27 @@ DeactivatePointerGrab(DeviceIntPtr mouse) { GrabPtr grab = mouse->deviceGrab.grab; DeviceIntPtr dev; + Bool wasPassive = mouse->deviceGrab.fromPassiveGrab; Bool wasImplicit = (mouse->deviceGrab.fromPassiveGrab && mouse->deviceGrab.implicitGrab); XID grab_resource = grab->resource; int i; + /* If an explicit grab was deactivated, we must remove it from the head of + * all the touches' listener lists. */ + for (i = 0; !wasPassive && mouse->touch && i < mouse->touch->num_touches; i++) { + TouchPointInfoPtr ti = mouse->touch->touches + i; + if (ti->active && TouchResourceIsOwner(ti, grab_resource)) { + /* Rejecting will generate a TouchEnd, but we must not + emulate a ButtonRelease here. So pretend the listener + already has the end event */ + if (grab->grabtype == CORE || grab->grabtype == XI || + !xi2mask_isset(mouse->deviceGrab.grab->xi2mask, mouse, XI_TouchBegin)) + ti->listeners[0].state = LISTENER_HAS_END; + TouchListenerAcceptReject(mouse, ti, 0, XIRejectTouch); + } + } + TouchRemovePointerGrab(mouse); mouse->valuator->motionHintWindow = NullWindow; @@ -1531,15 +1551,6 @@ DeactivatePointerGrab(DeviceIntPtr mouse) ReattachToOldMaster(mouse); ComputeFreezes(); - - /* If an explicit grab was deactivated, we must remove it from the head of - * all the touches' listener lists. */ - for (i = 0; mouse->touch && i < mouse->touch->num_touches; i++) { - TouchPointInfoPtr ti = mouse->touch->touches + i; - - if (ti->active && TouchResourceIsOwner(ti, grab_resource)) - TouchListenerAcceptReject(mouse, ti, 0, XIRejectTouch); - } } /** @@ -1555,11 +1566,13 @@ ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time, WindowPtr oldWin; /* slave devices need to float for the duration of the grab. */ - if (grab->grabtype == XI2 && + if (grab->grabtype == XI2 && keybd->enabled && !(passive & ImplicitGrabMask) && !IsMaster(keybd)) DetachFromMaster(keybd); - if (grabinfo->grab) + if (!keybd->enabled) + oldWin = NULL; + else if (grabinfo->grab) oldWin = grabinfo->grab->window; else if (keybd->focus) oldWin = keybd->focus->win; @@ -1569,7 +1582,8 @@ ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time, oldWin = keybd->focus->win; if (keybd->valuator) keybd->valuator->motionHintWindow = NullWindow; - DoFocusEvents(keybd, oldWin, grab->window, NotifyGrab); + if (oldWin) + DoFocusEvents(keybd, oldWin, grab->window, NotifyGrab); if (syncEvents.playingEvents) grabinfo->grabTime = syncEvents.time; else @@ -1590,13 +1604,10 @@ DeactivateKeyboardGrab(DeviceIntPtr keybd) { GrabPtr grab = keybd->deviceGrab.grab; DeviceIntPtr dev; - WindowPtr focusWin = keybd->focus ? keybd->focus->win - : keybd->spriteInfo->sprite->win; + WindowPtr focusWin; Bool wasImplicit = (keybd->deviceGrab.fromPassiveGrab && keybd->deviceGrab.implicitGrab); - if (focusWin == FollowKeyboardWin) - focusWin = inputInfo.keyboard->focus->win; if (keybd->valuator) keybd->valuator->motionHintWindow = NullWindow; keybd->deviceGrab.grab = NullGrab; @@ -1607,6 +1618,17 @@ DeactivateKeyboardGrab(DeviceIntPtr keybd) if (dev->deviceGrab.sync.other == grab) dev->deviceGrab.sync.other = NullGrab; } + + if (keybd->focus) + focusWin = keybd->focus->win; + else if (keybd->spriteInfo->sprite) + focusWin = keybd->spriteInfo->sprite->win; + else + focusWin = NullWindow; + + if (focusWin == FollowKeyboardWin) + focusWin = inputInfo.keyboard->focus->win; + DoFocusEvents(keybd, grab->window, focusWin, NotifyUngrab); if (!wasImplicit && grab->grabtype == XI2) @@ -2016,19 +2038,19 @@ DeliverToWindowOwner(DeviceIntPtr dev, WindowPtr win, */ static Bool GetClientsForDelivery(DeviceIntPtr dev, WindowPtr win, - xEvent *events, Mask filter, InputClients ** clients) + xEvent *events, Mask filter, InputClients ** iclients) { int rc = 0; if (core_get_type(events) != 0) - *clients = (InputClients *) wOtherClients(win); + *iclients = (InputClients *) wOtherClients(win); else if (xi2_get_type(events) != 0) { OtherInputMasks *inputMasks = wOtherInputMasks(win); /* Has any client selected for the event? */ if (!WindowXI2MaskIsset(dev, win, events)) goto out; - *clients = inputMasks->inputClients; + *iclients = inputMasks->inputClients; } else { OtherInputMasks *inputMasks = wOtherInputMasks(win); @@ -2037,7 +2059,7 @@ GetClientsForDelivery(DeviceIntPtr dev, WindowPtr win, if (!inputMasks || !(inputMasks->inputEvents[dev->id] & filter)) goto out; - *clients = inputMasks->inputClients; + *iclients = inputMasks->inputClients; } rc = 1; @@ -2065,6 +2087,9 @@ DeliverEventToInputClients(DeviceIntPtr dev, InputClients * inputclients, if (IsInterferingGrab(client, dev, events)) continue; + if (IsWrongPointerBarrierClient(client, dev, events)) + continue; + mask = GetEventMask(dev, events, inputclients); if (XaceHook(XACE_RECEIVE_ACCESS, client, win, events, count)) @@ -2099,12 +2124,12 @@ DeliverEventToWindowMask(DeviceIntPtr dev, WindowPtr win, xEvent *events, int count, Mask filter, GrabPtr grab, ClientPtr *client_return, Mask *mask_return) { - InputClients *clients; + InputClients *iclients; - if (!GetClientsForDelivery(dev, win, events, filter, &clients)) + if (!GetClientsForDelivery(dev, win, events, filter, &iclients)) return EVENT_SKIP; - return DeliverEventToInputClients(dev, clients, win, events, count, filter, + return DeliverEventToInputClients(dev, iclients, win, events, count, filter, grab, client_return, mask_return); } @@ -2213,7 +2238,7 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent * @return TRUE if the event should be discarded, FALSE otherwise. */ static BOOL -FilterRawEvents(const ClientPtr client, const GrabPtr grab) +FilterRawEvents(const ClientPtr client, const GrabPtr grab, WindowPtr root) { XIClientPtr client_xi_version; int cmp; @@ -2229,7 +2254,10 @@ FilterRawEvents(const ClientPtr client, const GrabPtr grab) client_xi_version->minor_version, 2, 0); /* XI 2.0: if device is grabbed, skip XI 2.1: if device is grabbed by us, skip, we've already delivered */ - return (cmp == 0) ? TRUE : SameClient(grab, client); + if (cmp == 0) + return TRUE; + + return (grab->window != root) ? FALSE : SameClient(grab, client); } /** @@ -2282,7 +2310,7 @@ DeliverRawEvent(RawDeviceEvent *ev, DeviceIntPtr device) */ ic.next = NULL; - if (!FilterRawEvents(rClient(&ic), grab)) + if (!FilterRawEvents(rClient(&ic), grab, root)) DeliverEventToInputClients(device, &ic, root, xi, 1, filter, NULL, &c, &m); } @@ -2419,6 +2447,8 @@ FixUpEventFromWindow(SpritePtr pSprite, case XI_DeviceChanged: case XI_HierarchyChanged: case XI_PropertyEvent: + case XI_BarrierHit: + case XI_BarrierLeave: return; default: break; @@ -2433,8 +2463,8 @@ FixUpEventFromWindow(SpritePtr pSprite, } if (pSprite->hot.pScreen == pWin->drawable.pScreen) { - event->event_x = event->root_x - FP1616(pWin->drawable.x, 0); - event->event_y = event->root_y - FP1616(pWin->drawable.y, 0); + event->event_x = event->root_x - double_to_fp1616(pWin->drawable.x); + event->event_y = event->root_y - double_to_fp1616(pWin->drawable.y); event->child = child; } else { @@ -2834,14 +2864,15 @@ ActivateFocusInGrab(DeviceIntPtr dev, WindowPtr old, WindowPtr win) if (win == NoneWin || win == PointerRootWin) return FALSE; - memset(&event, 0, sizeof(DeviceEvent)); - event.header = ET_Internal; - event.type = ET_FocusIn; - event.length = sizeof(DeviceEvent); - event.time = GetTimeInMillis(); - event.deviceid = dev->id; - event.sourceid = dev->id; - event.detail.button = 0; + event = (DeviceEvent) { + .header = ET_Internal, + .type = ET_FocusIn, + .length = sizeof(DeviceEvent), + .time = GetTimeInMillis(), + .deviceid = dev->id, + .sourceid = dev->id, + .detail.button = 0 + }; rc = (CheckPassiveGrabsOnWindow(win, dev, (InternalEvent *) &event, FALSE, TRUE) != NULL); if (rc) @@ -2871,14 +2902,15 @@ ActivateEnterGrab(DeviceIntPtr dev, WindowPtr old, WindowPtr win) (*dev->deviceGrab.DeactivateGrab) (dev); } - memset(&event, 0, sizeof(DeviceEvent)); - event.header = ET_Internal; - event.type = ET_Enter; - event.length = sizeof(DeviceEvent); - event.time = GetTimeInMillis(); - event.deviceid = dev->id; - event.sourceid = dev->id; - event.detail.button = 0; + event = (DeviceEvent) { + .header = ET_Internal, + .type = ET_Enter, + .length = sizeof(DeviceEvent), + .time = GetTimeInMillis(), + .deviceid = dev->id, + .sourceid = dev->id, + .detail.button = 0 + }; rc = (CheckPassiveGrabsOnWindow(win, dev, (InternalEvent *) &event, FALSE, TRUE) != NULL); if (rc) @@ -3193,6 +3225,18 @@ InitializeSprite(DeviceIntPtr pDev, WindowPtr pWin) #endif } +void FreeSprite(DeviceIntPtr dev) +{ + if (DevHasCursor(dev) && dev->spriteInfo->sprite) { + if (dev->spriteInfo->sprite->current) + FreeCursor(dev->spriteInfo->sprite->current, None); + free(dev->spriteInfo->sprite->spriteTrace); + free(dev->spriteInfo->sprite); + } + dev->spriteInfo->sprite = NULL; +} + + /** * Update the mouse sprite info when the server switches from a pScreen to another. * Otherwise, the pScreen of the mouse sprite is never updated when we switch @@ -4314,7 +4358,6 @@ OtherClientGone(pointer value, XID id) prev = other; } FatalError("client not on event list"); - /*NOTREACHED*/ return -1; /* make compiler happy */ } int @@ -4337,12 +4380,10 @@ EventSelectForWindow(WindowPtr pWin, ClientPtr client, Mask mask) return rc; } check = (mask & AtMostOneClient); - if (check & (pWin->eventMask | wOtherEventMasks(pWin))) { /* It is illegal for two different - clients to select on any of the - events for AtMostOneClient. However, - it is OK, for some client to - continue selecting on one of those - events. */ + if (check & (pWin->eventMask | wOtherEventMasks(pWin))) { + /* It is illegal for two different clients to select on any of the + events for AtMostOneClient. However, it is OK, for some client to + continue selecting on one of those events. */ if ((wClient(pWin) != client) && (check & pWin->eventMask)) return BadAccess; for (others = wOtherClients(pWin); others; others = others->next) { @@ -4395,7 +4436,7 @@ int EventSuppressForWindow(WindowPtr pWin, ClientPtr client, Mask mask, Bool *checkOptional) { - int i, free; + int i, freed; if (mask & ~PropagateMask) { client->errorValue = mask; @@ -4406,14 +4447,14 @@ EventSuppressForWindow(WindowPtr pWin, ClientPtr client, if (!mask) i = 0; else { - for (i = DNPMCOUNT, free = 0; --i > 0;) { + for (i = DNPMCOUNT, freed = 0; --i > 0;) { if (!DontPropagateRefCnts[i]) - free = i; + freed = i; else if (mask == DontPropagateMasks[i]) break; } - if (!i && free) { - i = free; + if (!i && freed) { + i = freed; DontPropagateMasks[i] = mask; } } @@ -4448,7 +4489,10 @@ CoreEnterLeaveEvent(DeviceIntPtr mouse, int type, int mode, int detail, WindowPtr pWin, Window child) { - xEvent event; + xEvent event = { + .u.u.type = type, + .u.u.detail = detail + }; WindowPtr focus; DeviceIntPtr keybd; GrabPtr grab = mouse->deviceGrab.grab; @@ -4468,9 +4512,6 @@ CoreEnterLeaveEvent(DeviceIntPtr mouse, mask = pWin->eventMask | wOtherEventMasks(pWin); } - memset(&event, 0, sizeof(xEvent)); - event.u.u.type = type; - event.u.u.detail = detail; event.u.enterLeave.time = currentTime.milliseconds; event.u.enterLeave.rootX = mouse->spriteInfo->sprite->hot.x; event.u.enterLeave.rootY = mouse->spriteInfo->sprite->hot.y; @@ -4501,15 +4542,16 @@ CoreEnterLeaveEvent(DeviceIntPtr mouse, } if ((type == EnterNotify) && (mask & KeymapStateMask)) { - xKeymapEvent ke; + xKeymapEvent ke = { + .type = KeymapNotify + }; ClientPtr client = grab ? rClient(grab) : wClient(pWin); + int rc; - if (XaceHook(XACE_DEVICE_ACCESS, client, keybd, DixReadAccess)) - memset((char *) &ke.map[0], 0, 31); - else - memmove((char *) &ke.map[0], (char *) &keybd->key->down[1], 31); + rc = XaceHook(XACE_DEVICE_ACCESS, client, keybd, DixReadAccess); + if (rc == Success) + memcpy((char *) &ke.map[0], (char *) &keybd->key->down[1], 31); - ke.type = KeymapNotify; if (grab) TryClientEvents(rClient(grab), keybd, (xEvent *) &ke, 1, mask, KeymapStateMask, grab); @@ -4527,6 +4569,7 @@ DeviceEnterLeaveEvent(DeviceIntPtr mouse, { GrabPtr grab = mouse->deviceGrab.grab; xXIEnterEvent *event; + WindowPtr focus; int filter; int btlen, len, i; DeviceIntPtr kbd; @@ -4550,8 +4593,8 @@ DeviceEnterLeaveEvent(DeviceIntPtr mouse, event->deviceid = mouse->id; event->sourceid = sourceid; event->mode = mode; - event->root_x = FP1616(mouse->spriteInfo->sprite->hot.x, 0); - event->root_y = FP1616(mouse->spriteInfo->sprite->hot.y, 0); + event->root_x = double_to_fp1616(mouse->spriteInfo->sprite->hot.x); + event->root_y = double_to_fp1616(mouse->spriteInfo->sprite->hot.y); for (i = 0; mouse && mouse->button && i < mouse->button->numButtons; i++) if (BitIsOn(mouse->button->down, i)) @@ -4568,6 +4611,11 @@ DeviceEnterLeaveEvent(DeviceIntPtr mouse, event->group.locked_group = kbd->key->xkbInfo->state.locked_group; } + focus = (kbd) ? kbd->focus->win : None; + if ((focus != NoneWin) && + ((pWin == focus) || (focus == PointerRootWin) || IsParent(focus, pWin))) + event->focus = TRUE; + FixUpEventFromWindow(mouse->spriteInfo->sprite, (xEvent *) event, pWin, None, FALSE); @@ -4594,27 +4642,27 @@ DeviceEnterLeaveEvent(DeviceIntPtr mouse, void CoreFocusEvent(DeviceIntPtr dev, int type, int mode, int detail, WindowPtr pWin) { - xEvent event; - - memset(&event, 0, sizeof(xEvent)); + xEvent event = { + .u.u.type = type, + .u.u.detail = detail + }; event.u.focus.mode = mode; - event.u.u.type = type; - event.u.u.detail = detail; event.u.focus.window = pWin->drawable.id; DeliverEventsToWindow(dev, pWin, &event, 1, GetEventFilter(dev, &event), NullGrab); if ((type == FocusIn) && ((pWin->eventMask | wOtherEventMasks(pWin)) & KeymapStateMask)) { - xKeymapEvent ke; + xKeymapEvent ke = { + .type = KeymapNotify + }; ClientPtr client = wClient(pWin); + int rc; - if (XaceHook(XACE_DEVICE_ACCESS, client, dev, DixReadAccess)) - memset((char *) &ke.map[0], 0, 31); - else - memmove((char *) &ke.map[0], (char *) &dev->key->down[1], 31); + rc = XaceHook(XACE_DEVICE_ACCESS, client, dev, DixReadAccess); + if (rc == Success) + memcpy((char *) &ke.map[0], (char *) &dev->key->down[1], 31); - ke.type = KeymapNotify; DeliverEventsToWindow(dev, pWin, (xEvent *) &ke, 1, KeymapStateMask, NullGrab); } @@ -4756,17 +4804,20 @@ ProcGetInputFocus(ClientPtr client) if (rc != Success) return rc; - memset(&rep, 0, sizeof(xGetInputFocusReply)); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; + rep = (xGetInputFocusReply) { + .type = X_Reply, + .length = 0, + .sequenceNumber = client->sequence, + .revertTo = focus->revert + }; + if (focus->win == NoneWin) rep.focus = None; else if (focus->win == PointerRootWin) rep.focus = PointerRoot; else rep.focus = focus->win->drawable.id; - rep.revertTo = focus->revert; + WriteReplyToClient(client, sizeof(xGetInputFocusReply), &rep); return Success; } @@ -4786,6 +4837,7 @@ ProcGrabPointer(ClientPtr client) GrabMask mask; WindowPtr confineTo; CursorPtr oldCursor; + BYTE status; REQUEST(xGrabPointerReq); int rc; @@ -4807,7 +4859,6 @@ ProcGrabPointer(ClientPtr client) return rc; } - memset(&rep, 0, sizeof(xGrabPointerReply)); oldCursor = NullCursor; grab = device->deviceGrab.grab; @@ -4822,16 +4873,19 @@ ProcGrabPointer(ClientPtr client) rc = GrabDevice(client, device, stuff->pointerMode, stuff->keyboardMode, stuff->grabWindow, stuff->ownerEvents, stuff->time, - &mask, CORE, stuff->cursor, stuff->confineTo, &rep.status); + &mask, CORE, stuff->cursor, stuff->confineTo, &status); if (rc != Success) return rc; - if (oldCursor && rep.status == GrabSuccess) + if (oldCursor && status == GrabSuccess) FreeCursor(oldCursor, (Cursor) 0); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; + rep = (xGrabPointerReply) { + .type = X_Reply, + .status = status, + .sequenceNumber = client->sequence, + .length = 0 + }; WriteReplyToClient(client, sizeof(xGrabPointerReply), &rep); return Success; } @@ -4998,7 +5052,7 @@ GrabDevice(ClientPtr client, DeviceIntPtr dev, grab = grabInfo->grab; if (grab && grab->grabtype != grabtype) *status = AlreadyGrabbed; - if (grab && !SameClient(grab, client)) + else if (grab && !SameClient(grab, client)) *status = AlreadyGrabbed; else if ((!pWin->realized) || (confineTo && @@ -5048,6 +5102,7 @@ int ProcGrabKeyboard(ClientPtr client) { xGrabKeyboardReply rep; + BYTE status; REQUEST(xGrabKeyboardReq); int result; @@ -5056,19 +5111,22 @@ ProcGrabKeyboard(ClientPtr client) REQUEST_SIZE_MATCH(xGrabKeyboardReq); - memset(&rep, 0, sizeof(xGrabKeyboardReply)); mask.core = KeyPressMask | KeyReleaseMask; result = GrabDevice(client, keyboard, stuff->pointerMode, stuff->keyboardMode, stuff->grabWindow, stuff->ownerEvents, stuff->time, &mask, CORE, None, - None, &rep.status); + None, &status); if (result != Success) return result; - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; + + rep = (xGrabKeyboardReply) { + .type = X_Reply, + .status = status, + .sequenceNumber = client->sequence, + .length = 0 + }; WriteReplyToClient(client, sizeof(xGrabKeyboardReply), &rep); return Success; } @@ -5131,15 +5189,16 @@ ProcQueryPointer(ClientPtr client) pSprite = mouse->spriteInfo->sprite; if (mouse->valuator->motionHintWindow) MaybeStopHint(mouse, client); - memset(&rep, 0, sizeof(xQueryPointerReply)); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.mask = event_get_corestate(mouse, keyboard); - rep.length = 0; - rep.root = (GetCurrentRootWindow(mouse))->drawable.id; - rep.rootX = pSprite->hot.x; - rep.rootY = pSprite->hot.y; - rep.child = None; + rep = (xQueryPointerReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .mask = event_get_corestate(mouse, keyboard), + .root = (GetCurrentRootWindow(mouse))->drawable.id, + .rootX = pSprite->hot.x, + .rootY = pSprite->hot.y, + .child = None + }; if (pSprite->hot.pScreen == pWin->drawable.pScreen) { rep.sameScreen = xTrue; rep.winX = pSprite->hot.x - pWin->drawable.x; @@ -5199,6 +5258,7 @@ InitEvents(void) for (i = 0; i < MAXDEVICES; i++) { memcpy(&event_filters[i], default_filter, sizeof(default_filter)); + lastDeviceEventTime[i] = currentTime; } syncEvents.replayDev = (DeviceIntPtr) NULL; @@ -5212,7 +5272,6 @@ InitEvents(void) syncEvents.time.milliseconds = 0; /* hardly matters */ currentTime.months = 0; currentTime.milliseconds = GetTimeInMillis(); - lastDeviceEventTime = currentTime; for (i = 0; i < DNPMCOUNT; i++) { DontPropagateMasks[i] = 0; DontPropagateRefCnts[i] = 0; @@ -5407,12 +5466,13 @@ ProcGrabKey(ClientPtr client) REQUEST_SIZE_MATCH(xGrabKeyReq); - memset(¶m, 0, sizeof(param)); - param.grabtype = CORE; - param.ownerEvents = stuff->ownerEvents; - param.this_device_mode = stuff->keyboardMode; - param.other_devices_mode = stuff->pointerMode; - param.modifiers = stuff->modifiers; + param = (GrabParameters) { + .grabtype = CORE, + .ownerEvents = stuff->ownerEvents, + .this_device_mode = stuff->keyboardMode, + .other_devices_mode = stuff->pointerMode, + .modifiers = stuff->modifiers + }; rc = CheckGrabValues(client, ¶m); if (rc != Success) @@ -5513,12 +5573,13 @@ ProcGrabButton(ClientPtr client) if (rc != Success) return rc; - memset(¶m, 0, sizeof(param)); - param.grabtype = CORE; - param.ownerEvents = stuff->ownerEvents; - param.this_device_mode = stuff->keyboardMode; - param.other_devices_mode = stuff->pointerMode; - param.modifiers = stuff->modifiers; + param = (GrabParameters) { + .grabtype = CORE, + .ownerEvents = stuff->ownerEvents, + .this_device_mode = stuff->keyboardMode, + .other_devices_mode = stuff->pointerMode, + .modifiers = stuff->modifiers + }; mask.core = stuff->eventMask; @@ -5622,8 +5683,8 @@ DeleteWindowFromAnyEvents(WindowPtr pWin, Bool freeResources) if (IsKeyboardDevice(keybd)) { focus = keybd->focus; - /* If the focus window is a root window (ie. has no parent) then don't - delete the focus from it. */ + /* If the focus window is a root window (ie. has no parent) + then don't delete the focus from it. */ if ((pWin == focus->win) && (pWin->parent != NullWindow)) { int focusEventMode = NotifyNormal; @@ -5645,12 +5706,12 @@ DeleteWindowFromAnyEvents(WindowPtr pWin, Bool freeResources) parent = parent->parent; focus->traceGood--; } while (!parent->realized - /* This would be a good protocol change -- windows being reparented - during SaveSet processing would cause the focus to revert to the - nearest enclosing window which will survive the death of the exiting - client, instead of ending up reverting to a dying window and thence - to None - */ + /* This would be a good protocol change -- windows being + reparented during SaveSet processing would cause the + focus to revert to the nearest enclosing window which + will survive the death of the exiting client, instead + of ending up reverting to a dying window and thence + to None */ #ifdef NOTDEF || wClient(parent)->clientGone #endif @@ -5890,14 +5951,14 @@ WriteEventsToClient(ClientPtr pClient, int count, xEvent *events) (*EventSwapVector[eventFrom->u.u.type & 0177]) (eventFrom, eventTo); - WriteToClient(pClient, eventlength, (char *) eventTo); + WriteToClient(pClient, eventlength, eventTo); } } else { /* only one GenericEvent, remember? that means either count is 1 and * eventlength is arbitrary or eventlength is 32 and count doesn't * matter. And we're all set. Woohoo. */ - WriteToClient(pClient, count * eventlength, (char *) events); + WriteToClient(pClient, count * eventlength, events); } } @@ -6028,3 +6089,19 @@ IsInterferingGrab(ClientPtr client, DeviceIntPtr dev, xEvent *event) return FALSE; } + +/* PointerBarrier events are only delivered to the client that created that + * barrier */ +static Bool +IsWrongPointerBarrierClient(ClientPtr client, DeviceIntPtr dev, xEvent *event) +{ + xXIBarrierEvent *ev = (xXIBarrierEvent*)event; + + if (ev->type != GenericEvent || ev->extension != IReqCode) + return FALSE; + + if (ev->evtype != XI_BarrierHit && ev->evtype != XI_BarrierLeave) + return FALSE; + + return client->index != CLIENT_ID(ev->barrier); +} diff --git a/xserver/dix/extension.c b/xserver/dix/extension.c index b46b36874..24e9cb43a 100644 --- a/xserver/dix/extension.c +++ b/xserver/dix/extension.c @@ -254,11 +254,12 @@ ProcQueryExtension(ClientPtr client) REQUEST_FIXED_SIZE(xQueryExtensionReq, stuff->nbytes); - memset(&reply, 0, sizeof(xQueryExtensionReply)); - reply.type = X_Reply; - reply.length = 0; - reply.major_opcode = 0; - reply.sequenceNumber = client->sequence; + reply = (xQueryExtensionReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .major_opcode = 0 + }; if (!NumExtensions) reply.present = xFalse; @@ -286,11 +287,12 @@ ProcListExtensions(ClientPtr client) REQUEST_SIZE_MATCH(xReq); - memset(&reply, 0, sizeof(xListExtensionsReply)); - reply.type = X_Reply; - reply.nExtensions = 0; - reply.length = 0; - reply.sequenceNumber = client->sequence; + reply = (xListExtensionsReply) { + .type = X_Reply, + .nExtensions = 0, + .sequenceNumber = client->sequence, + .length = 0 + }; buffer = NULL; if (NumExtensions) { diff --git a/xserver/dix/gc.c b/xserver/dix/gc.c index 7be050221..f46e0ddc4 100644 --- a/xserver/dix/gc.c +++ b/xserver/dix/gc.c @@ -419,11 +419,11 @@ static const struct { RESTYPE type; Mask access_mode; } xidfields[] = { - { - GCTile, RT_PIXMAP, DixReadAccess}, { - GCStipple, RT_PIXMAP, DixReadAccess}, { - GCFont, RT_FONT, DixUseAccess}, { -GCClipMask, RT_PIXMAP, DixReadAccess},}; + {GCTile, RT_PIXMAP, DixReadAccess}, + {GCStipple, RT_PIXMAP, DixReadAccess}, + {GCFont, RT_FONT, DixUseAccess}, + {GCClipMask, RT_PIXMAP, DixReadAccess}, +}; int ChangeGCXIDs(ClientPtr client, GC * pGC, BITS32 mask, CARD32 *pC32) @@ -458,6 +458,60 @@ ChangeGCXIDs(ClientPtr client, GC * pGC, BITS32 mask, CARD32 *pC32) return ChangeGC(client, pGC, mask, vals); } +static GCPtr +NewGCObject(ScreenPtr pScreen, int depth) +{ + GCPtr pGC; + + pGC = dixAllocateScreenObjectWithPrivates(pScreen, GC, PRIVATE_GC); + if (!pGC) { + return (GCPtr) NULL; + } + + pGC->pScreen = pScreen; + pGC->depth = depth; + pGC->alu = GXcopy; /* dst <- src */ + pGC->planemask = ~0; + pGC->serialNumber = 0; + pGC->funcs = 0; + pGC->fgPixel = 0; + pGC->bgPixel = 1; + pGC->lineWidth = 0; + pGC->lineStyle = LineSolid; + pGC->capStyle = CapButt; + pGC->joinStyle = JoinMiter; + pGC->fillStyle = FillSolid; + pGC->fillRule = EvenOddRule; + pGC->arcMode = ArcPieSlice; + pGC->tile.pixel = 0; + pGC->tile.pixmap = NullPixmap; + + pGC->tileIsPixel = TRUE; + pGC->patOrg.x = 0; + pGC->patOrg.y = 0; + pGC->subWindowMode = ClipByChildren; + pGC->graphicsExposures = TRUE; + pGC->clipOrg.x = 0; + pGC->clipOrg.y = 0; + pGC->clientClipType = CT_NONE; + pGC->clientClip = (pointer) NULL; + pGC->numInDashList = 2; + pGC->dash = DefaultDash; + pGC->dashOffset = 0; + + /* use the default font and stipple */ + pGC->font = defaultFont; + if (pGC->font) /* necessary, because open of default font could fail */ + pGC->font->refcnt++; + pGC->stipple = pGC->pScreen->PixmapPerDepth[0]; + if (pGC->stipple) + pGC->stipple->refcnt++; + + /* this is not a scratch GC */ + pGC->scratch_inuse = FALSE; + return pGC; +} + /* CreateGC(pDrawable, mask, pval, pStatus) creates a default GC for the given drawable, using mask to fill in any non-default values. @@ -473,29 +527,13 @@ CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus, { GCPtr pGC; - pGC = dixAllocateObjectWithPrivates(GC, PRIVATE_GC); + pGC = NewGCObject(pDrawable->pScreen, pDrawable->depth); if (!pGC) { *pStatus = BadAlloc; return (GCPtr) NULL; } - pGC->pScreen = pDrawable->pScreen; - pGC->depth = pDrawable->depth; - pGC->alu = GXcopy; /* dst <- src */ - pGC->planemask = ~0; pGC->serialNumber = GC_CHANGE_SERIAL_BIT; - pGC->funcs = 0; - pGC->fgPixel = 0; - pGC->bgPixel = 1; - pGC->lineWidth = 0; - pGC->lineStyle = LineSolid; - pGC->capStyle = CapButt; - pGC->joinStyle = JoinMiter; - pGC->fillStyle = FillSolid; - pGC->fillRule = EvenOddRule; - pGC->arcMode = ArcPieSlice; - pGC->tile.pixel = 0; - pGC->tile.pixmap = NullPixmap; if (mask & GCForeground) { /* * magic special case -- ChangeGC checks for this condition @@ -507,27 +545,6 @@ CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus, pGC->tileIsPixel = TRUE; } - pGC->patOrg.x = 0; - pGC->patOrg.y = 0; - pGC->subWindowMode = ClipByChildren; - pGC->graphicsExposures = TRUE; - pGC->clipOrg.x = 0; - pGC->clipOrg.y = 0; - pGC->clientClipType = CT_NONE; - pGC->clientClip = (pointer) NULL; - pGC->numInDashList = 2; - pGC->dash = DefaultDash; - pGC->dashOffset = 0; - - /* use the default font and stipple */ - pGC->font = defaultFont; - defaultFont->refcnt++; - pGC->stipple = pGC->pScreen->PixmapPerDepth[0]; - pGC->stipple->refcnt++; - - /* this is not a scratch GC */ - pGC->scratch_inuse = FALSE; - /* security creation/labeling check */ *pStatus = XaceHook(XACE_RESOURCE_ACCESS, client, gcid, RT_GC, pGC, RT_NONE, NULL, DixCreateAccess | DixSetAttrAccess); @@ -784,45 +801,10 @@ CreateScratchGC(ScreenPtr pScreen, unsigned depth) { GCPtr pGC; - pGC = dixAllocateObjectWithPrivates(GC, PRIVATE_GC); + pGC = NewGCObject(pScreen, depth); if (!pGC) return (GCPtr) NULL; - pGC->pScreen = pScreen; - pGC->depth = depth; - pGC->alu = GXcopy; /* dst <- src */ - pGC->planemask = ~0; - pGC->serialNumber = 0; - pGC->fgPixel = 0; - pGC->bgPixel = 1; - pGC->lineWidth = 0; - pGC->lineStyle = LineSolid; - pGC->capStyle = CapButt; - pGC->joinStyle = JoinMiter; - pGC->fillStyle = FillSolid; - pGC->fillRule = EvenOddRule; - pGC->arcMode = ArcPieSlice; - pGC->font = defaultFont; - if (pGC->font) /* necessary, because open of default font could fail */ - pGC->font->refcnt++; - pGC->tileIsPixel = TRUE; - pGC->tile.pixel = 0; - pGC->tile.pixmap = NullPixmap; - pGC->stipple = NullPixmap; - pGC->patOrg.x = 0; - pGC->patOrg.y = 0; - pGC->subWindowMode = ClipByChildren; - pGC->graphicsExposures = TRUE; - pGC->clipOrg.x = 0; - pGC->clipOrg.y = 0; - pGC->clientClipType = CT_NONE; - pGC->dashOffset = 0; - pGC->numInDashList = 2; - pGC->dash = DefaultDash; - - /* scratch GCs in the GCperDepth pool start off unused */ - pGC->scratch_inuse = FALSE; - pGC->stateChanges = GCAllBits; if (!(*pScreen->CreateGC) (pGC)) { FreeGC(pGC, (XID) 0); diff --git a/xserver/dix/getevents.c b/xserver/dix/getevents.c index b78d5cec0..a4f192cf0 100644 --- a/xserver/dix/getevents.c +++ b/xserver/dix/getevents.c @@ -69,6 +69,12 @@ #include "extnsionst.h" #include "listdev.h" /* for sizing up DeviceClassesChangedEvent */ +#if XSERVER_DTRACE +#include +typedef const char *string; +#include +#endif + /* Number of motion history events to store. */ #define MOTION_HISTORY_SIZE 256 @@ -157,17 +163,6 @@ key_autorepeats(DeviceIntPtr pDev, int key_code) (1 << (key_code & 7))); } -static void -init_event(DeviceIntPtr dev, DeviceEvent *event, Time ms) -{ - memset(event, 0, sizeof(DeviceEvent)); - event->header = ET_Internal; - event->length = sizeof(DeviceEvent); - event->time = ms; - event->deviceid = dev->id; - event->sourceid = dev->id; -} - static void init_touch_ownership(DeviceIntPtr dev, TouchOwnershipEvent *event, Time ms) { @@ -781,11 +776,33 @@ add_to_scroll_valuator(DeviceIntPtr dev, ValuatorMask *mask, int valuator, doubl * @param[in,out] mask Valuator data for this event, modified in-place. */ static void -moveRelative(DeviceIntPtr dev, ValuatorMask *mask) +moveRelative(DeviceIntPtr dev, int flags, ValuatorMask *mask) { int i; Bool clip_xy = IsMaster(dev) || !IsFloating(dev); + /* for abs devices in relative mode, we've just scaled wrong, since we + mapped the device's shape into the screen shape. Undo this. */ + if ((flags & POINTER_ABSOLUTE) == 0 && dev->valuator && + dev->valuator->axes[0].min_value < dev->valuator->axes[0].max_value) { + + double ratio = 1.0 * screenInfo.width/screenInfo.height; + + if (ratio > 1.0) { + double y; + if (valuator_mask_fetch_double(mask, 1, &y)) { + y *= ratio; + valuator_mask_set_double(mask, 1, y); + } + } else { + double x; + if (valuator_mask_fetch_double(mask, 0, &x)) { + x *= ratio; + valuator_mask_set_double(mask, 0, x); + } + } + } + /* calc other axes, clip, drop back into valuators */ for (i = 0; i < valuator_mask_size(mask); i++) { double val = dev->last.valuators[i]; @@ -825,27 +842,33 @@ accelPointer(DeviceIntPtr dev, ValuatorMask *valuators, CARD32 ms) * device's coordinate range. * * @param dev The device to scale for. - * @param[in, out] mask The mask in desktop coordinates, modified in place + * @param[in, out] mask The mask in desktop/screen coordinates, modified in place * to contain device coordinate range. + * @param flags If POINTER_SCREEN is set, mask is in per-screen coordinates. + * Otherwise, mask is in desktop coords. */ static void -scale_from_screen(DeviceIntPtr dev, ValuatorMask *mask) +scale_from_screen(DeviceIntPtr dev, ValuatorMask *mask, int flags) { double scaled; ScreenPtr scr = miPointerGetScreen(dev); if (valuator_mask_isset(mask, 0)) { - scaled = valuator_mask_get_double(mask, 0) + scr->x; + scaled = valuator_mask_get_double(mask, 0); + if (flags & POINTER_SCREEN) + scaled += scr->x; scaled = rescaleValuatorAxis(scaled, NULL, dev->valuator->axes + 0, - 0, scr->width); + screenInfo.x, screenInfo.width); valuator_mask_set_double(mask, 0, scaled); } if (valuator_mask_isset(mask, 1)) { - scaled = valuator_mask_get_double(mask, 1) + scr->y; + scaled = valuator_mask_get_double(mask, 1); + if (flags & POINTER_SCREEN) + scaled += scr->y; scaled = rescaleValuatorAxis(scaled, NULL, dev->valuator->axes + 1, - 0, scr->height); + screenInfo.y, screenInfo.height); valuator_mask_set_double(mask, 1, scaled); } } @@ -890,9 +913,9 @@ scale_to_desktop(DeviceIntPtr dev, ValuatorMask *mask, /* scale x&y to desktop coordinates */ *screenx = rescaleValuatorAxis(x, dev->valuator->axes + 0, NULL, - screenInfo.x, screenInfo.width); + screenInfo.x, screenInfo.width - 1); *screeny = rescaleValuatorAxis(y, dev->valuator->axes + 1, NULL, - screenInfo.y, screenInfo.height); + screenInfo.y, screenInfo.height - 1); *devx = x; *devy = y; @@ -921,10 +944,13 @@ scale_to_desktop(DeviceIntPtr dev, ValuatorMask *mask, * @param[in,out] devy y desktop-wide coordinate in device coordinate system * @param[in,out] screenx x coordinate in desktop coordinate system * @param[in,out] screeny y coordinate in desktop coordinate system + * @param[out] nevents Number of barrier events added to events + * @param[in,out] events List of events barrier events are added to */ static ScreenPtr positionSprite(DeviceIntPtr dev, int mode, ValuatorMask *mask, - double *devx, double *devy, double *screenx, double *screeny) + double *devx, double *devy, double *screenx, double *screeny, + int *nevents, InternalEvent* events) { ScreenPtr scr = miPointerGetScreen(dev); double tmpx, tmpy; @@ -938,7 +964,7 @@ positionSprite(DeviceIntPtr dev, int mode, ValuatorMask *mask, /* miPointerSetPosition takes care of crossing screens for us, as well as * clipping to the current screen. Coordinates returned are in desktop * coord system */ - scr = miPointerSetPosition(dev, mode, screenx, screeny); + scr = miPointerSetPosition(dev, mode, screenx, screeny, nevents, events); /* If we were constrained, rescale x/y from the screen coordinates so * the device valuators reflect the correct position. For screen @@ -1054,6 +1080,15 @@ GetKeyboardEvents(InternalEvent *events, DeviceIntPtr pDev, int type, RawDeviceEvent *raw; ValuatorMask mask; +#if XSERVER_DTRACE + if (XSERVER_INPUT_EVENT_ENABLED()) { + XSERVER_INPUT_EVENT(pDev->id, type, key_code, 0, + mask_in ? mask_in->last_bit + 1 : 0, + mask_in ? mask_in->mask : NULL, + mask_in ? mask_in->valuators : NULL); + } +#endif + /* refuse events from disabled devices */ if (!pDev->enabled) return 0; @@ -1167,6 +1202,27 @@ transform(struct pixman_f_transform *m, double *x, double *y) *y = p.v[1]; } +static void +transformRelative(DeviceIntPtr dev, ValuatorMask *mask) +{ + double x = 0, y = 0; + + valuator_mask_fetch_double(mask, 0, &x); + valuator_mask_fetch_double(mask, 1, &y); + + transform(&dev->relative_transform, &x, &y); + + if (x) + valuator_mask_set_double(mask, 0, x); + else + valuator_mask_unset(mask, 0); + + if (y) + valuator_mask_set_double(mask, 1, y); + else + valuator_mask_unset(mask, 1); +} + /** * Apply the device's transformation matrix to the valuator mask and replace * the scaled values in mask. This transformation only applies to valuators @@ -1194,7 +1250,7 @@ transformAbsolute(DeviceIntPtr dev, ValuatorMask *mask) ox = dev->last.valuators[0]; oy = dev->last.valuators[1]; - pixman_f_transform_invert(&invert, &dev->transform); + pixman_f_transform_invert(&invert, &dev->scale_and_transform); transform(&invert, &ox, &oy); x = ox; @@ -1207,7 +1263,7 @@ transformAbsolute(DeviceIntPtr dev, ValuatorMask *mask) if (valuator_mask_isset(mask, 1)) oy = y = valuator_mask_get_double(mask, 1); - transform(&dev->transform, &x, &y); + transform(&dev->scale_and_transform, &x, &y); if (valuator_mask_isset(mask, 0) || ox != x) valuator_mask_set_double(mask, 0, x); @@ -1312,8 +1368,10 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type, RawDeviceEvent *raw; double screenx = 0.0, screeny = 0.0; /* desktop coordinate system */ double devx = 0.0, devy = 0.0; /* desktop-wide in device coords */ + int sx, sy; /* for POINTER_SCREEN */ ValuatorMask mask; ScreenPtr scr; + int num_barrier_events = 0; switch (type) { case MotionNotify: @@ -1354,8 +1412,11 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type, /* valuators are in driver-native format (rel or abs) */ if (flags & POINTER_ABSOLUTE) { - if (flags & POINTER_SCREEN) /* valuators are in screen coords */ - scale_from_screen(pDev, &mask); + if (flags & (POINTER_SCREEN | POINTER_DESKTOP)) { /* valuators are in screen/desktop coords */ + sx = valuator_mask_get(&mask, 0); + sy = valuator_mask_get(&mask, 1); + scale_from_screen(pDev, &mask, flags); + } transformAbsolute(pDev, &mask); clipAbsolute(pDev, &mask); @@ -1363,18 +1424,36 @@ fill_pointer_events(InternalEvent *events, DeviceIntPtr pDev, int type, set_raw_valuators(raw, &mask, raw->valuators.data); } else { + transformRelative(pDev, &mask); + if (flags & POINTER_ACCELERATE) accelPointer(pDev, &mask, ms); if ((flags & POINTER_NORAW) == 0) set_raw_valuators(raw, &mask, raw->valuators.data); - moveRelative(pDev, &mask); + moveRelative(pDev, flags, &mask); } /* valuators are in device coordinate system in absolute coordinates */ scale_to_desktop(pDev, &mask, &devx, &devy, &screenx, &screeny); + + /* #53037 XWarpPointer's scaling back and forth between screen and + device may leave us with rounding errors. End result is that the + pointer doesn't end up on the pixel it should. + Avoid this by forcing screenx/screeny back to what the input + coordinates were. + */ + if (flags & POINTER_SCREEN) { + scr = miPointerGetScreen(pDev); + screenx = sx + scr->x; + screeny = sy + scr->y; + } + scr = positionSprite(pDev, (flags & POINTER_ABSOLUTE) ? Absolute : Relative, - &mask, &devx, &devy, &screenx, &screeny); + &mask, &devx, &devy, &screenx, &screeny, + &num_barrier_events, events); + num_events += num_barrier_events; + events += num_barrier_events; /* screenx, screeny are in desktop coordinates, mask is in device coordinates per-screen (the event data) @@ -1549,6 +1628,15 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type, int i; int realtype = type; +#if XSERVER_DTRACE + if (XSERVER_INPUT_EVENT_ENABLED()) { + XSERVER_INPUT_EVENT(pDev->id, type, buttons, flags, + mask_in ? mask_in->last_bit + 1 : 0, + mask_in ? mask_in->mask : NULL, + mask_in ? mask_in->valuators : NULL); + } +#endif + /* refuse events from disabled devices */ if (!pDev->enabled) return 0; @@ -1601,6 +1689,8 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type, if (adj != 0.0 && axis != -1) { adj *= pDev->valuator->axes[axis].scroll.increment; + if (!valuator_mask_isset(&mask, axis)) + valuator_mask_set(&mask, axis, 0); add_to_scroll_valuator(pDev, &mask, axis, adj); type = MotionNotify; buttons = 0; @@ -1676,6 +1766,15 @@ GetProximityEvents(InternalEvent *events, DeviceIntPtr pDev, int type, DeviceEvent *event; ValuatorMask mask; +#if XSERVER_DTRACE + if (XSERVER_INPUT_EVENT_ENABLED()) { + XSERVER_INPUT_EVENT(pDev->id, type, 0, 0, + mask_in ? mask_in->last_bit + 1 : 0, + mask_in ? mask_in->mask : NULL, + mask_in ? mask_in->valuators : NULL); + } +#endif + /* refuse events from disabled devices */ if (!pDev->enabled) return 0; @@ -1792,53 +1891,34 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid, int i; int num_events = 0; RawDeviceEvent *raw; - union touch { - TouchPointInfoPtr dix_ti; - DDXTouchPointInfoPtr ti; - } touchpoint; + DDXTouchPointInfoPtr ti; int need_rawevent = TRUE; Bool emulate_pointer = FALSE; int client_id = 0; +#if XSERVER_DTRACE + if (XSERVER_INPUT_EVENT_ENABLED()) { + XSERVER_INPUT_EVENT(dev->id, type, ddx_touchid, flags, + mask_in ? mask_in->last_bit + 1 : 0, + mask_in ? mask_in->mask : NULL, + mask_in ? mask_in->valuators : NULL); + } +#endif + if (!dev->enabled || !t || !v) return 0; /* Find and/or create the DDX touch info */ - if (flags & TOUCH_CLIENT_ID) { /* A DIX-submitted TouchEnd */ - touchpoint.dix_ti = TouchFindByClientID(dev, ddx_touchid); - BUG_WARN(!touchpoint.dix_ti); - - if (!touchpoint.dix_ti) - return 0; - - if (!mask_in || - !valuator_mask_isset(mask_in, 0) || - !valuator_mask_isset(mask_in, 1)) { - ErrorF - ("[dix] dix-submitted events must have x/y valuator information.\n"); - return 0; - } - - need_rawevent = FALSE; - client_id = touchpoint.dix_ti->client_id; + ti = TouchFindByDDXID(dev, ddx_touchid, (type == XI_TouchBegin)); + if (!ti) { + ErrorFSigSafe("[dix] %s: unable to %s touch point %u\n", dev->name, + type == XI_TouchBegin ? "begin" : "find", ddx_touchid); + return 0; } - else { /* a DDX-submitted touch */ + client_id = ti->client_id; - touchpoint.ti = - TouchFindByDDXID(dev, ddx_touchid, (type == XI_TouchBegin)); - if (!touchpoint.ti) { - ErrorF("[dix] %s: unable to %s touch point %x\n", dev->name, - type == XI_TouchBegin ? "begin" : "find", ddx_touchid); - return 0; - } - client_id = touchpoint.ti->client_id; - } - - if (!(flags & TOUCH_CLIENT_ID)) - emulate_pointer = touchpoint.ti->emulate_pointer; - else - emulate_pointer = ! !(flags & TOUCH_POINTER_EMULATED); + emulate_pointer = ti->emulate_pointer; if (!IsMaster(dev)) events = @@ -1857,12 +1937,7 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid, event = &events->device_event; num_events++; - init_event(dev, event, ms); - /* if submitted for master device, get the sourceid from there */ - if (flags & TOUCH_CLIENT_ID) { - event->sourceid = touchpoint.dix_ti->sourceid; - /* TOUCH_CLIENT_ID implies norawevent */ - } + init_device_event(event, dev, ms); switch (type) { case XI_TouchBegin: @@ -1871,54 +1946,46 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid, if (!mask_in || !valuator_mask_isset(mask_in, 0) || !valuator_mask_isset(mask_in, 1)) { - ErrorF("%s: Attempted to start touch without x/y (driver bug)\n", - dev->name); + ErrorFSigSafe("%s: Attempted to start touch without x/y " + "(driver bug)\n", dev->name); return 0; } break; case XI_TouchUpdate: event->type = ET_TouchUpdate; if (!mask_in || valuator_mask_num_valuators(mask_in) <= 0) { - ErrorF("%s: TouchUpdate with no valuators? Driver bug\n", - dev->name); + ErrorFSigSafe("%s: TouchUpdate with no valuators? Driver bug\n", + dev->name); } break; case XI_TouchEnd: event->type = ET_TouchEnd; /* We can end the DDX touch here, since we don't use the active * field below */ - if (!(flags & TOUCH_CLIENT_ID)) - TouchEndDDXTouch(dev, touchpoint.ti); + TouchEndDDXTouch(dev, ti); break; default: return 0; } - if (t->mode == XIDirectTouch && !(flags & TOUCH_CLIENT_ID)) { - if (!valuator_mask_isset(&mask, 0)) - valuator_mask_set_double(&mask, 0, - valuator_mask_get_double(touchpoint.ti-> - valuators, 0)); - if (!valuator_mask_isset(&mask, 1)) - valuator_mask_set_double(&mask, 1, - valuator_mask_get_double(touchpoint.ti-> - valuators, 1)); - } /* Get our screen event co-ordinates (root_x/root_y/event_x/event_y): * these come from the touchpoint in Absolute mode, or the sprite in * Relative. */ if (t->mode == XIDirectTouch) { - transformAbsolute(dev, &mask); + for (i = 0; i < max(valuator_mask_size(&mask), 2); i++) { + double val; - if (!(flags & TOUCH_CLIENT_ID)) { - for (i = 0; i < valuator_mask_size(&mask); i++) { - double val; - - if (valuator_mask_fetch_double(&mask, i, &val)) - valuator_mask_set_double(touchpoint.ti->valuators, i, val); - } + if (valuator_mask_fetch_double(&mask, i, &val)) + valuator_mask_set_double(ti->valuators, i, val); + /* If the device doesn't post new X and Y axis values, + * use the last values posted. + */ + else if (i < 2 && + valuator_mask_fetch_double(ti->valuators, i, &val)) + valuator_mask_set_double(&mask, i, val); } + transformAbsolute(dev, &mask); clipAbsolute(dev, &mask); } else { @@ -1936,7 +2003,7 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid, scr = scale_to_desktop(dev, &mask, &devx, &devy, &screenx, &screeny); if (emulate_pointer) scr = positionSprite(dev, Absolute, &mask, - &devx, &devy, &screenx, &screeny); + &devx, &devy, &screenx, &screeny, NULL, NULL); /* see fill_pointer_events for coordinate systems */ if (emulate_pointer) @@ -1947,6 +2014,14 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid, if (emulate_pointer) storeLastValuators(dev, &mask, 0, 1, devx, devy); + /* Update the MD's co-ordinates, which are always in desktop space. */ + if (emulate_pointer && !IsMaster(dev) && !IsFloating(dev)) { + DeviceIntPtr master = GetMaster(dev, MASTER_POINTER); + + master->last.valuators[0] = screenx; + master->last.valuators[1] = screeny; + } + event->root = scr->root->drawable.id; event_set_root_coordinates(event, screenx, screeny); @@ -1967,6 +2042,37 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid, return num_events; } +void +GetDixTouchEnd(InternalEvent *ievent, DeviceIntPtr dev, TouchPointInfoPtr ti, + uint32_t flags) +{ + ScreenPtr scr = dev->spriteInfo->sprite->hotPhys.pScreen; + DeviceEvent *event = &ievent->device_event; + CARD32 ms = GetTimeInMillis(); + + BUG_WARN(!dev->enabled); + + init_device_event(event, dev, ms); + + event->sourceid = ti->sourceid; + event->type = ET_TouchEnd; + + event->root = scr->root->drawable.id; + + /* Get screen event coordinates from the sprite. Is this really the best + * we can do? */ + event_set_root_coordinates(event, + dev->last.valuators[0], + dev->last.valuators[1]); + event->touchid = ti->client_id; + event->flags = flags; + + if (flags & TOUCH_POINTER_EMULATED) { + event->flags |= TOUCH_POINTER_EMULATED; + event->detail.button = 1; + } +} + /** * Synthesize a single motion event for the core pointer. * diff --git a/xserver/dix/globals.c b/xserver/dix/globals.c index db38ffd0a..ee7379226 100644 --- a/xserver/dix/globals.c +++ b/xserver/dix/globals.c @@ -126,12 +126,13 @@ Bool party_like_its_1989 = TRUE; Bool whiteRoot = FALSE; TimeStamp currentTime; -TimeStamp lastDeviceEventTime; +TimeStamp lastDeviceEventTime[MAXDEVICES]; int defaultColorVisualClass = -1; int monitorResolution = 0; char *display; +int displayfd; char *ConnectionInfo; CARD32 TimeOutValue = DEFAULT_TIMEOUT * MILLI_PER_SECOND; diff --git a/xserver/dix/grabs.c b/xserver/dix/grabs.c index 2f05f5733..3b02352df 100644 --- a/xserver/dix/grabs.c +++ b/xserver/dix/grabs.c @@ -179,7 +179,7 @@ UngrabAllDevices(Bool kill_client) continue; PrintDeviceGrabInfo(dev); client = clients[CLIENT_ID(dev->deviceGrab.grab->resource)]; - if (!client || client->clientGone) + if (!kill_client || !client || client->clientGone) dev->deviceGrab.DeactivateGrab(dev); if (kill_client) CloseDownClient(client); @@ -205,7 +205,10 @@ AllocGrab(void) } GrabPtr -CreateGrab(int client, DeviceIntPtr device, DeviceIntPtr modDevice, WindowPtr window, enum InputLevel grabtype, GrabMask *mask, GrabParameters *param, int type, KeyCode keybut, /* key or button */ +CreateGrab(int client, DeviceIntPtr device, DeviceIntPtr modDevice, + WindowPtr window, enum InputLevel grabtype, GrabMask *mask, + GrabParameters *param, int type, + KeyCode keybut, /* key or button */ WindowPtr confineTo, CursorPtr cursor) { GrabPtr grab; @@ -216,7 +219,10 @@ CreateGrab(int client, DeviceIntPtr device, DeviceIntPtr modDevice, WindowPtr wi grab->resource = FakeClientID(client); grab->device = device; grab->window = window; - grab->eventMask = mask->core; /* same for XI */ + if (grabtype == CORE || grabtype == XI) + grab->eventMask = mask->core; /* same for XI */ + else + grab->eventMask = 0; grab->deviceMask = 0; grab->ownerEvents = param->ownerEvents; grab->keyboardMode = param->this_device_mode; diff --git a/xserver/dix/inpututils.c b/xserver/dix/inpututils.c index 223d547c5..9e38e1742 100644 --- a/xserver/dix/inpututils.c +++ b/xserver/dix/inpututils.c @@ -71,14 +71,13 @@ static void do_butmap_change(DeviceIntPtr dev, CARD8 *map, int len, ClientPtr client) { int i; - xEvent core_mn; + xEvent core_mn = { .u.u.type = MappingNotify }; deviceMappingNotify xi_mn; /* The map in ButtonClassRec refers to button numbers, whereas the * protocol is zero-indexed. Sigh. */ memcpy(&(dev->button->map[1]), map, len); - core_mn.u.u.type = MappingNotify; core_mn.u.mappingNotify.request = MappingPointer; /* 0 is the server client. */ @@ -93,10 +92,12 @@ do_butmap_change(DeviceIntPtr dev, CARD8 *map, int len, ClientPtr client) WriteEventsToClient(clients[i], 1, &core_mn); } - xi_mn.type = DeviceMappingNotify; - xi_mn.request = MappingPointer; - xi_mn.deviceid = dev->id; - xi_mn.time = GetTimeInMillis(); + xi_mn = (deviceMappingNotify) { + .type = DeviceMappingNotify, + .request = MappingPointer, + .deviceid = dev->id, + .time = GetTimeInMillis() + }; SendEventToAllWindows(dev, DeviceMappingNotifyMask, (xEvent *) &xi_mn, 1); } @@ -909,11 +910,7 @@ input_option_set_value(InputOption *opt, const char *value) double fp1616_to_double(FP1616 in) { - double ret; - - ret = (double) (in >> 16); - ret += (double) (in & 0xffff) * (1.0 / (1UL << 16)); /* Optimized: ldexp((double)(in & 0xffff), -16); */ - return ret; + return pixman_fixed_to_double(in); } double @@ -929,20 +926,7 @@ fp3232_to_double(FP3232 in) FP1616 double_to_fp1616(double in) { - FP1616 ret; - int32_t integral; - double tmp; - uint32_t frac_d; - - tmp = floor(in); - integral = (int32_t) tmp; - - tmp = (in - integral) * (1UL << 16); /* Optimized: ldexp(in - integral, 16) */ - frac_d = (uint16_t) tmp; - - ret = integral << 16; - ret |= frac_d & 0xffff; - return ret; + return pixman_double_to_fixed(in); } FP3232 @@ -1031,6 +1015,21 @@ xi2mask_free(XI2Mask **mask) *mask = NULL; } +/** + * Test if the bit for event type is set for this device only. + * + * @return TRUE if the bit is set, FALSE otherwise + */ +Bool +xi2mask_isset_for_device(XI2Mask *mask, const DeviceIntPtr dev, int event_type) +{ + BUG_WARN(dev->id < 0); + BUG_WARN(dev->id >= mask->nmasks); + BUG_WARN(bits_to_bytes(event_type + 1) > mask->mask_size); + + return BitIsOn(mask->masks[dev->id], event_type); +} + /** * Test if the bit for event type is set for this device, or the * XIAllDevices/XIAllMasterDevices (if applicable) is set. @@ -1042,15 +1041,12 @@ xi2mask_isset(XI2Mask *mask, const DeviceIntPtr dev, int event_type) { int set = 0; - BUG_WARN(dev->id < 0); - BUG_WARN(dev->id >= mask->nmasks); - BUG_WARN(bits_to_bytes(event_type + 1) > mask->mask_size); - - set = ! !BitIsOn(mask->masks[XIAllDevices], event_type); - if (!set) - set = ! !BitIsOn(mask->masks[dev->id], event_type); - if (!set && IsMaster(dev)) - set = ! !BitIsOn(mask->masks[XIAllMasterDevices], event_type); + if (xi2mask_isset_for_device(mask, inputInfo.all_devices, event_type)) + set = 1; + else if (xi2mask_isset_for_device(mask, dev, event_type)) + set = 1; + else if (IsMaster(dev) && xi2mask_isset_for_device(mask, inputInfo.all_master_devices, event_type)) + set = 1; return set; } diff --git a/xserver/dix/main.c b/xserver/dix/main.c index 70dcc946e..fb935c969 100644 --- a/xserver/dix/main.c +++ b/xserver/dix/main.c @@ -104,6 +104,7 @@ Equipment Corporation. #include "privates.h" #include "registry.h" #include "client.h" +#include "exevents.h" #ifdef PANORAMIX #include "panoramiXsrv.h" #else @@ -206,10 +207,16 @@ main(int argc, char *argv[], char *envp[]) FatalError("no screens found"); InitExtensions(argc, argv); + for (i = 0; i < screenInfo.numGPUScreens; i++) { + ScreenPtr pScreen = screenInfo.gpuscreens[i]; + if (!CreateScratchPixmapsForScreen(pScreen)) + FatalError("failed to create scratch pixmaps"); + } + for (i = 0; i < screenInfo.numScreens; i++) { ScreenPtr pScreen = screenInfo.screens[i]; - if (!CreateScratchPixmapsForScreen(i)) + if (!CreateScratchPixmapsForScreen(pScreen)) FatalError("failed to create scratch pixmaps"); if (pScreen->CreateScreenResources && !(*pScreen->CreateScreenResources) (pScreen)) @@ -295,6 +302,7 @@ main(int argc, char *argv[], char *envp[]) #endif UndisplayDevices(); + DisableAllDevices(); /* Now free up whatever must be freed */ if (screenIsSaved == SCREEN_SAVER_ON) @@ -318,14 +326,26 @@ main(int argc, char *argv[], char *envp[]) for (i = 0; i < screenInfo.numScreens; i++) screenInfo.screens[i]->root = NullWindow; + CloseDownDevices(); + CloseDownEvents(); + for (i = screenInfo.numGPUScreens - 1; i >= 0; i--) { + ScreenPtr pScreen = screenInfo.gpuscreens[i]; + FreeScratchPixmapsForScreen(pScreen); + (*pScreen->CloseScreen) (pScreen); + dixFreePrivates(pScreen->devPrivates, PRIVATE_SCREEN); + free(pScreen); + screenInfo.numGPUScreens = i; + } + for (i = screenInfo.numScreens - 1; i >= 0; i--) { - FreeScratchPixmapsForScreen(i); + FreeScratchPixmapsForScreen(screenInfo.screens[i]); FreeGCperDepth(i); FreeDefaultStipple(i); - (*screenInfo.screens[i]->CloseScreen) (i, screenInfo.screens[i]); + dixFreeScreenSpecificPrivates(screenInfo.screens[i]); + (*screenInfo.screens[i]->CloseScreen) (screenInfo.screens[i]); dixFreePrivates(screenInfo.screens[i]->devPrivates, PRIVATE_SCREEN); free(screenInfo.screens[i]); screenInfo.numScreens = i; diff --git a/xserver/dix/pixmap.c b/xserver/dix/pixmap.c index 47b220b58..241881262 100644 --- a/xserver/dix/pixmap.c +++ b/xserver/dix/pixmap.c @@ -84,23 +84,23 @@ FreeScratchPixmapHeader(PixmapPtr pPixmap) } Bool -CreateScratchPixmapsForScreen(int scrnum) +CreateScratchPixmapsForScreen(ScreenPtr pScreen) { unsigned int pixmap_size; - pixmap_size = sizeof(PixmapRec) + dixPrivatesSize(PRIVATE_PIXMAP); - screenInfo.screens[scrnum]->totalPixmapSize = + pixmap_size = sizeof(PixmapRec) + dixScreenSpecificPrivatesSize(pScreen, PRIVATE_PIXMAP); + pScreen->totalPixmapSize = BitmapBytePad(pixmap_size * 8); /* let it be created on first use */ - screenInfo.screens[scrnum]->pScratchPixmap = NULL; + pScreen->pScratchPixmap = NULL; return TRUE; } void -FreeScratchPixmapsForScreen(int scrnum) +FreeScratchPixmapsForScreen(ScreenPtr pScreen) { - FreeScratchPixmapHeader(screenInfo.screens[scrnum]->pScratchPixmap); + FreeScratchPixmapHeader(pScreen->pScratchPixmap); } /* callable by ddx */ @@ -118,7 +118,7 @@ AllocatePixmap(ScreenPtr pScreen, int pixDataSize) if (!pPixmap) return NullPixmap; - dixInitPrivates(pPixmap, pPixmap + 1, PRIVATE_PIXMAP); + dixInitScreenPrivates(pScreen, pPixmap, pPixmap + 1, PRIVATE_PIXMAP); return pPixmap; } @@ -129,3 +129,142 @@ FreePixmap(PixmapPtr pPixmap) dixFiniPrivates(pPixmap, PRIVATE_PIXMAP); free(pPixmap); } + +PixmapPtr PixmapShareToSlave(PixmapPtr pixmap, ScreenPtr slave) +{ + PixmapPtr spix; + int ret; + void *handle; + ScreenPtr master = pixmap->drawable.pScreen; + int depth = pixmap->drawable.depth; + + ret = master->SharePixmapBacking(pixmap, slave, &handle); + if (ret == FALSE) + return NULL; + + spix = slave->CreatePixmap(slave, 0, 0, depth, + CREATE_PIXMAP_USAGE_SHARED); + slave->ModifyPixmapHeader(spix, pixmap->drawable.width, + pixmap->drawable.height, depth, 0, + pixmap->devKind, NULL); + + /* have the slave pixmap take a reference on the master pixmap + later we destroy them both at the same time */ + pixmap->refcnt++; + + spix->master_pixmap = pixmap; + + ret = slave->SetSharedPixmapBacking(spix, handle); + if (ret == FALSE) { + slave->DestroyPixmap(spix); + return NULL; + } + + return spix; +} + +Bool +PixmapStartDirtyTracking(PixmapPtr src, + PixmapPtr slave_dst, + int x, int y) +{ + ScreenPtr screen = src->drawable.pScreen; + PixmapDirtyUpdatePtr dirty_update; + + dirty_update = calloc(1, sizeof(PixmapDirtyUpdateRec)); + if (!dirty_update) + return FALSE; + + dirty_update->src = src; + dirty_update->slave_dst = slave_dst; + dirty_update->x = x; + dirty_update->y = y; + + dirty_update->damage = DamageCreate(NULL, NULL, + DamageReportNone, + TRUE, src->drawable.pScreen, + src->drawable.pScreen); + if (!dirty_update->damage) { + free(dirty_update); + return FALSE; + } + + DamageRegister(&src->drawable, dirty_update->damage); + xorg_list_add(&dirty_update->ent, &screen->pixmap_dirty_list); + return TRUE; +} + +Bool +PixmapStopDirtyTracking(PixmapPtr src, PixmapPtr slave_dst) +{ + ScreenPtr screen = src->drawable.pScreen; + PixmapDirtyUpdatePtr ent, safe; + + xorg_list_for_each_entry_safe(ent, safe, &screen->pixmap_dirty_list, ent) { + if (ent->src == src && ent->slave_dst == slave_dst) { + DamageUnregister(&src->drawable, ent->damage); + DamageDestroy(ent->damage); + xorg_list_del(&ent->ent); + free(ent); + } + } + return TRUE; +} + +/* + * this function can possibly be improved and optimised, by clipping + * instead of iterating + */ +Bool PixmapSyncDirtyHelper(PixmapDirtyUpdatePtr dirty, RegionPtr dirty_region) +{ + ScreenPtr pScreen = dirty->src->drawable.pScreen; + int n; + BoxPtr b; + RegionPtr region = DamageRegion(dirty->damage); + GCPtr pGC; + PixmapPtr dst; + SourceValidateProcPtr SourceValidate; + + /* + * SourceValidate is used by the software cursor code + * to pull the cursor off of the screen when reading + * bits from the frame buffer. Bypassing this function + * leaves the software cursor in place + */ + SourceValidate = pScreen->SourceValidate; + pScreen->SourceValidate = NULL; + + RegionTranslate(dirty_region, dirty->x, dirty->y); + RegionIntersect(dirty_region, dirty_region, region); + + if (RegionNil(dirty_region)) { + RegionUninit(dirty_region); + return FALSE; + } + + dst = dirty->slave_dst->master_pixmap; + + RegionTranslate(dirty_region, -dirty->x, -dirty->y); + n = RegionNumRects(dirty_region); + b = RegionRects(dirty_region); + + pGC = GetScratchGC(dirty->src->drawable.depth, pScreen); + ValidateGC(&dst->drawable, pGC); + + while (n--) { + BoxRec dst_box; + int w, h; + + dst_box = *b; + w = dst_box.x2 - dst_box.x1; + h = dst_box.y2 - dst_box.y1; + + pGC->ops->CopyArea(&dirty->src->drawable, &dst->drawable, pGC, + dirty->x + dst_box.x1, dirty->y + dst_box.y1, w, h, dst_box.x1, dst_box.y1); + b++; + } + FreeScratchGC(pGC); + + pScreen->SourceValidate = SourceValidate; + return TRUE; +} diff --git a/xserver/dix/privates.c b/xserver/dix/privates.c index 15fbf7590..55b9345a7 100644 --- a/xserver/dix/privates.c +++ b/xserver/dix/privates.c @@ -62,13 +62,9 @@ from The Open Group. #include "inputstr.h" #include "scrnintstr.h" #include "extnsionst.h" +#include "inputstr.h" -static struct { - DevPrivateKey key; - unsigned offset; - int created; - int allocated; -} keys[PRIVATE_LAST]; +static DevPrivateSetRec global_keys[PRIVATE_LAST]; static const Bool xselinux_private[PRIVATE_LAST] = { [PRIVATE_SCREEN] = TRUE, @@ -86,8 +82,57 @@ static const Bool xselinux_private[PRIVATE_LAST] = { [PRIVATE_GLYPHSET] = TRUE, }; +static const char *key_names[PRIVATE_LAST] = { + /* XSELinux uses the same private keys for numerous objects */ + [PRIVATE_XSELINUX] = "XSELINUX", + + /* Otherwise, you get a private in just the requested structure + */ + /* These can have objects created before all of the keys are registered */ + [PRIVATE_SCREEN] = "SCREEN", + [PRIVATE_EXTENSION] = "EXTENSION", + [PRIVATE_COLORMAP] = "COLORMAP", + [PRIVATE_DEVICE] = "DEVICE", + + /* These cannot have any objects before all relevant keys are registered */ + [PRIVATE_CLIENT] = "CLIENT", + [PRIVATE_PROPERTY] = "PROPERTY", + [PRIVATE_SELECTION] = "SELECTION", + [PRIVATE_WINDOW] = "WINDOW", + [PRIVATE_PIXMAP] = "PIXMAP", + [PRIVATE_GC] = "GC", + [PRIVATE_CURSOR] = "CURSOR", + [PRIVATE_CURSOR_BITS] = "CURSOR_BITS", + + /* extension privates */ + [PRIVATE_DBE_WINDOW] = "DBE_WINDOW", + [PRIVATE_DAMAGE] = "DAMAGE", + [PRIVATE_GLYPH] = "GLYPH", + [PRIVATE_GLYPHSET] = "GLYPHSET", + [PRIVATE_PICTURE] = "PICTURE", + [PRIVATE_SYNC_FENCE] = "SYNC_FENCE", +}; + +static const Bool screen_specific_private[PRIVATE_LAST] = { + [PRIVATE_SCREEN] = FALSE, + [PRIVATE_CLIENT] = FALSE, + [PRIVATE_WINDOW] = TRUE, + [PRIVATE_PIXMAP] = TRUE, + [PRIVATE_GC] = TRUE, + [PRIVATE_CURSOR] = FALSE, + [PRIVATE_COLORMAP] = FALSE, + [PRIVATE_DEVICE] = FALSE, + [PRIVATE_EXTENSION] = FALSE, + [PRIVATE_SELECTION] = FALSE, + [PRIVATE_PROPERTY] = FALSE, + [PRIVATE_PICTURE] = TRUE, + [PRIVATE_GLYPHSET] = FALSE, +}; + typedef Bool (*FixupFunc) (PrivatePtr *privates, int offset, unsigned bytes); +typedef enum { FixupMove, FixupRealloc } FixupType; + static Bool dixReallocPrivates(PrivatePtr *privates, int old_offset, unsigned bytes) { @@ -109,15 +154,77 @@ dixMovePrivates(PrivatePtr *privates, int new_offset, unsigned bytes) return TRUE; } +static Bool +fixupOneScreen(ScreenPtr pScreen, FixupFunc fixup, unsigned bytes) +{ + intptr_t dist; + char *old; + char *new; + DevPrivateKey *keyp, key; + DevPrivateType type; + int size; + + old = (char *) pScreen->devPrivates; + size = global_keys[PRIVATE_SCREEN].offset; + if (!fixup (&pScreen->devPrivates, size, bytes)) + return FALSE; + + /* Screen privates can contain screen-specific private keys + * for other types. When they move, the linked list we use to + * track them gets scrambled. Fix that by computing the change + * in the location of each private adjusting our linked list + * pointers to match + */ + + new = (char *) pScreen->devPrivates; + + /* Moving means everyone shifts up in the privates by 'bytes' amount, + * realloc means the base pointer moves + */ + if (fixup == dixMovePrivates) + new += bytes; + + dist = new - old; + + if (dist) { + for (type = PRIVATE_XSELINUX; type < PRIVATE_LAST; type++) + + /* Walk the privates list, being careful as the + * pointers are scrambled before we patch them. + */ + for (keyp = &pScreen->screenSpecificPrivates[type].key; + (key = *keyp) != NULL; + keyp = &key->next) + { + + /* Only mangle things if the private structure + * is contained within the allocation. Privates + * stored elsewhere will be left alone + */ + if (old <= (char *) key && (char *) key < old + size) + { + /* Compute new location of key */ + key = (DevPrivateKey) ((char *) key + dist); + + /* Patch the list */ + *keyp = key; + } + } + } + return TRUE; +} + static Bool fixupScreens(FixupFunc fixup, unsigned bytes) { int s; for (s = 0; s < screenInfo.numScreens; s++) - if (!fixup - (&screenInfo.screens[s]->devPrivates, keys[PRIVATE_SCREEN].offset, - bytes)) + if (!fixupOneScreen (screenInfo.screens[s], fixup, bytes)) + return FALSE; + + for (s = 0; s < screenInfo.numGPUScreens; s++) + if (!fixupOneScreen (screenInfo.gpuscreens[s], fixup, bytes)) return FALSE; return TRUE; } @@ -126,7 +233,7 @@ static Bool fixupServerClient(FixupFunc fixup, unsigned bytes) { if (serverClient) - return fixup(&serverClient->devPrivates, keys[PRIVATE_CLIENT].offset, + return fixup(&serverClient->devPrivates, global_keys[PRIVATE_CLIENT].offset, bytes); return TRUE; } @@ -140,7 +247,7 @@ fixupExtensions(FixupFunc fixup, unsigned bytes) for (major = EXTENSION_BASE; (extension = GetExtensionEntry(major)); major++) if (!fixup - (&extension->devPrivates, keys[PRIVATE_EXTENSION].offset, bytes)) + (&extension->devPrivates, global_keys[PRIVATE_EXTENSION].offset, bytes)) return FALSE; return TRUE; } @@ -157,17 +264,65 @@ fixupDefaultColormaps(FixupFunc fixup, unsigned bytes) screenInfo.screens[s]->defColormap, RT_COLORMAP, serverClient, DixCreateAccess); if (cmap && - !fixup(&cmap->devPrivates, keys[PRIVATE_COLORMAP].offset, bytes)) + !fixup(&cmap->devPrivates, screenInfo.screens[s]->screenSpecificPrivates[PRIVATE_COLORMAP].offset, bytes)) return FALSE; } return TRUE; } +static Bool +fixupDeviceList(DeviceIntPtr device, FixupFunc fixup, unsigned bytes) +{ + while (device) { + if (!fixup(&device->devPrivates, global_keys[PRIVATE_DEVICE].offset, bytes)) + return FALSE; + device = device->next; + } + return TRUE; +} + +static Bool +fixupDevices(FixupFunc fixup, unsigned bytes) +{ + return (fixupDeviceList(inputInfo.devices, fixup, bytes) && + fixupDeviceList(inputInfo.off_devices, fixup, bytes)); +} + static Bool (*const allocated_early[PRIVATE_LAST]) (FixupFunc, unsigned) = { -[PRIVATE_SCREEN] = fixupScreens, - [PRIVATE_CLIENT] = fixupServerClient, - [PRIVATE_EXTENSION] = fixupExtensions, - [PRIVATE_COLORMAP] = fixupDefaultColormaps,}; + [PRIVATE_SCREEN] = fixupScreens, + [PRIVATE_CLIENT] = fixupServerClient, + [PRIVATE_EXTENSION] = fixupExtensions, + [PRIVATE_COLORMAP] = fixupDefaultColormaps, + [PRIVATE_DEVICE] = fixupDevices, +}; + +static void +grow_private_set(DevPrivateSetPtr set, unsigned bytes) +{ + DevPrivateKey k; + + for (k = set->key; k; k = k->next) + k->offset += bytes; + set->offset += bytes; +} + +static void +grow_screen_specific_set(DevPrivateType type, unsigned bytes) +{ + int s; + + /* Update offsets for all screen-specific keys */ + for (s = 0; s < screenInfo.numScreens; s++) { + ScreenPtr pScreen = screenInfo.screens[s]; + + grow_private_set(&pScreen->screenSpecificPrivates[type], bytes); + } + for (s = 0; s < screenInfo.numGPUScreens; s++) { + ScreenPtr pScreen = screenInfo.gpuscreens[s]; + + grow_private_set(&pScreen->screenSpecificPrivates[type], bytes); + } +} /* * Register a private key. This takes the type of object the key will @@ -199,14 +354,13 @@ dixRegisterPrivateKey(DevPrivateKey key, DevPrivateType type, unsigned size) /* Update offsets for all affected keys */ if (type == PRIVATE_XSELINUX) { - DevPrivateKey k; /* Resize if we can, or make sure nothing's allocated if we can't */ for (t = PRIVATE_XSELINUX; t < PRIVATE_LAST; t++) if (xselinux_private[t]) { if (!allocated_early[t]) - assert(!keys[t].created); + assert(!global_keys[t].created); else if (!allocated_early[t] (dixReallocPrivates, bytes)) return FALSE; } @@ -216,12 +370,12 @@ dixRegisterPrivateKey(DevPrivateKey key, DevPrivateType type, unsigned size) */ for (t = PRIVATE_XSELINUX; t < PRIVATE_LAST; t++) { if (xselinux_private[t]) { - for (k = keys[t].key; k; k = k->next) - k->offset += bytes; - keys[t].offset += bytes; + grow_private_set(&global_keys[t], bytes); + grow_screen_specific_set(t, bytes); if (allocated_early[t]) allocated_early[t] (dixMovePrivates, bytes); } + } offset = 0; @@ -229,11 +383,12 @@ dixRegisterPrivateKey(DevPrivateKey key, DevPrivateType type, unsigned size) else { /* Resize if we can, or make sure nothing's allocated if we can't */ if (!allocated_early[type]) - assert(!keys[type].created); + assert(!global_keys[type].created); else if (!allocated_early[type] (dixReallocPrivates, bytes)) return FALSE; - offset = keys[type].offset; - keys[type].offset += bytes; + offset = global_keys[type].offset; + global_keys[type].offset += bytes; + grow_screen_specific_set(type, bytes); } /* Setup this key */ @@ -242,8 +397,8 @@ dixRegisterPrivateKey(DevPrivateKey key, DevPrivateType type, unsigned size) key->initialized = TRUE; key->type = type; key->allocated = FALSE; - key->next = keys[type].key; - keys[type].key = key; + key->next = global_keys[type].key; + global_keys[type].key = key; return TRUE; } @@ -286,13 +441,15 @@ _dixGetScreenPrivateKey(const DevScreenPrivateKey key, ScreenPtr pScreen) void _dixInitPrivates(PrivatePtr *privates, void *addr, DevPrivateType type) { - keys[type].created++; + assert (!screen_specific_private[type]); + + global_keys[type].created++; if (xselinux_private[type]) - keys[PRIVATE_XSELINUX].created++; - if (keys[type].offset == 0) + global_keys[PRIVATE_XSELINUX].created++; + if (global_keys[type].offset == 0) addr = 0; *privates = addr; - memset(addr, '\0', keys[type].offset); + memset(addr, '\0', global_keys[type].offset); } /* @@ -301,9 +458,9 @@ _dixInitPrivates(PrivatePtr *privates, void *addr, DevPrivateType type) void _dixFiniPrivates(PrivatePtr privates, DevPrivateType type) { - keys[type].created--; + global_keys[type].created--; if (xselinux_private[type]) - keys[PRIVATE_XSELINUX].created--; + global_keys[PRIVATE_XSELINUX].created--; } /* @@ -322,10 +479,11 @@ _dixAllocateObjectWithPrivates(unsigned baseSize, unsigned clear, PrivatePtr *devPrivates; assert(type > PRIVATE_SCREEN && type < PRIVATE_LAST); + assert(!screen_specific_private[type]); /* round up so that void * is aligned */ baseSize = (baseSize + sizeof(void *) - 1) & ~(sizeof(void *) - 1); - totalSize = baseSize + keys[type].offset; + totalSize = baseSize + global_keys[type].offset; object = malloc(totalSize); if (!object) return NULL; @@ -350,8 +508,9 @@ dixAllocatePrivates(PrivatePtr *privates, DevPrivateType type) PrivatePtr p; assert(type > PRIVATE_XSELINUX && type < PRIVATE_LAST); + assert(!screen_specific_private[type]); - size = keys[type].offset; + size = global_keys[type].offset; if (!size) { p = NULL; } @@ -361,7 +520,7 @@ dixAllocatePrivates(PrivatePtr *privates, DevPrivateType type) } _dixInitPrivates(privates, p, type); - ++keys[type].allocated; + ++global_keys[type].allocated; return TRUE; } @@ -387,7 +546,7 @@ void dixFreePrivates(PrivatePtr privates, DevPrivateType type) { _dixFiniPrivates(privates, type); - --keys[type].allocated; + --global_keys[type].allocated; free(privates); } @@ -398,8 +557,9 @@ extern _X_EXPORT int dixPrivatesSize(DevPrivateType type) { assert(type >= PRIVATE_SCREEN && type < PRIVATE_LAST); + assert (!screen_specific_private[type]); - return keys[type].offset; + return global_keys[type].offset; } /* Table of devPrivates offsets */ @@ -434,36 +594,136 @@ dixLookupPrivateOffset(RESTYPE type) return -1; } -static const char *key_names[PRIVATE_LAST] = { - /* XSELinux uses the same private keys for numerous objects */ - [PRIVATE_XSELINUX] = "XSELINUX", +/* + * Screen-specific privates + */ - /* Otherwise, you get a private in just the requested structure - */ - /* These can have objects created before all of the keys are registered */ - [PRIVATE_SCREEN] = "SCREEN", - [PRIVATE_EXTENSION] = "EXTENSION", - [PRIVATE_COLORMAP] = "COLORMAP", +extern _X_EXPORT Bool +dixRegisterScreenSpecificPrivateKey(ScreenPtr pScreen, DevPrivateKey key, + DevPrivateType type, unsigned size) +{ + int offset; + unsigned bytes; - /* These cannot have any objects before all relevant keys are registered */ - [PRIVATE_DEVICE] = "DEVICE", - [PRIVATE_CLIENT] = "CLIENT", - [PRIVATE_PROPERTY] = "PROPERTY", - [PRIVATE_SELECTION] = "SELECTION", - [PRIVATE_WINDOW] = "WINDOW", - [PRIVATE_PIXMAP] = "PIXMAP", - [PRIVATE_GC] = "GC", - [PRIVATE_CURSOR] = "CURSOR", - [PRIVATE_CURSOR_BITS] = "CURSOR_BITS", + if (!screen_specific_private[type]) + FatalError("Attempt to allocate screen-specific private storage for type %s\n", + key_names[type]); - /* extension privates */ - [PRIVATE_DBE_WINDOW] = "DBE_WINDOW", - [PRIVATE_DAMAGE] = "DAMAGE", - [PRIVATE_GLYPH] = "GLYPH", - [PRIVATE_GLYPHSET] = "GLYPHSET", - [PRIVATE_PICTURE] = "PICTURE", - [PRIVATE_SYNC_FENCE] = "SYNC_FENCE", -}; + if (key->initialized) { + assert(size == key->size); + return TRUE; + } + + /* Compute required space */ + bytes = size; + if (size == 0) + bytes = sizeof(void *); + + /* align to void * size */ + bytes = (bytes + sizeof(void *) - 1) & ~(sizeof(void *) - 1); + + assert (!allocated_early[type]); + assert (!pScreen->screenSpecificPrivates[type].created); + offset = pScreen->screenSpecificPrivates[type].offset; + pScreen->screenSpecificPrivates[type].offset += bytes; + + /* Setup this key */ + key->offset = offset; + key->size = size; + key->initialized = TRUE; + key->type = type; + key->allocated = FALSE; + key->next = pScreen->screenSpecificPrivates[type].key; + pScreen->screenSpecificPrivates[type].key = key; + + return TRUE; +} + +/* Clean up screen-specific privates before CloseScreen */ +void +dixFreeScreenSpecificPrivates(ScreenPtr pScreen) +{ +} + +/* Initialize screen-specific privates in AddScreen */ +void +dixInitScreenSpecificPrivates(ScreenPtr pScreen) +{ + DevPrivateType t; + + for (t = PRIVATE_XSELINUX; t < PRIVATE_LAST; t++) + pScreen->screenSpecificPrivates[t].offset = global_keys[t].offset; +} + +/* Initialize screen-specific privates in AddScreen */ +void +_dixInitScreenPrivates(ScreenPtr pScreen, PrivatePtr *privates, void *addr, DevPrivateType type) +{ + int privates_size; + assert (screen_specific_private[type]); + + if (pScreen) { + privates_size = pScreen->screenSpecificPrivates[type].offset; + pScreen->screenSpecificPrivates[type].created++; + } + else + privates_size = global_keys[type].offset; + + global_keys[type].created++; + if (xselinux_private[type]) + global_keys[PRIVATE_XSELINUX].created++; + if (privates_size == 0) + addr = 0; + *privates = addr; + memset(addr, '\0', privates_size); +} + +void * +_dixAllocateScreenObjectWithPrivates(ScreenPtr pScreen, + unsigned baseSize, + unsigned clear, + unsigned offset, + DevPrivateType type) +{ + unsigned totalSize; + void *object; + PrivatePtr privates; + PrivatePtr *devPrivates; + int privates_size; + + assert(type > PRIVATE_SCREEN && type < PRIVATE_LAST); + assert (screen_specific_private[type]); + + if (pScreen) + privates_size = pScreen->screenSpecificPrivates[type].offset; + else + privates_size = global_keys[type].offset; + /* round up so that void * is aligned */ + baseSize = (baseSize + sizeof(void *) - 1) & ~(sizeof(void *) - 1); + totalSize = baseSize + privates_size; + object = malloc(totalSize); + if (!object) + return NULL; + + memset(object, '\0', clear); + privates = (PrivatePtr) (((char *) object) + baseSize); + devPrivates = (PrivatePtr *) ((char *) object + offset); + + _dixInitScreenPrivates(pScreen, devPrivates, privates, type); + + return object; +} + +int +dixScreenSpecificPrivatesSize(ScreenPtr pScreen, DevPrivateType type) +{ + assert(type >= PRIVATE_SCREEN && type < PRIVATE_LAST); + + if (screen_specific_private[type]) + return pScreen->screenSpecificPrivates[type].offset; + else + return global_keys[type].offset; +} void dixPrivateUsage(void) @@ -474,14 +734,14 @@ dixPrivateUsage(void) DevPrivateType t; for (t = PRIVATE_XSELINUX + 1; t < PRIVATE_LAST; t++) { - if (keys[t].offset) { + if (global_keys[t].offset) { ErrorF ("%s: %d objects of %d bytes = %d total bytes %d private allocs\n", - key_names[t], keys[t].created, keys[t].offset, - keys[t].created * keys[t].offset, keys[t].allocated); - bytes += keys[t].created * keys[t].offset; - objects += keys[t].created; - alloc += keys[t].allocated; + key_names[t], global_keys[t].created, global_keys[t].offset, + global_keys[t].created * global_keys[t].offset, global_keys[t].allocated); + bytes += global_keys[t].created * global_keys[t].offset; + objects += global_keys[t].created; + alloc += global_keys[t].allocated; } } ErrorF("TOTAL: %d objects, %d bytes, %d allocs\n", objects, bytes, alloc); @@ -495,7 +755,7 @@ dixResetPrivates(void) for (t = PRIVATE_XSELINUX; t < PRIVATE_LAST; t++) { DevPrivateKey key, next; - for (key = keys[t].key; key; key = next) { + for (key = global_keys[t].key; key; key = next) { next = key->next; key->offset = 0; key->initialized = FALSE; @@ -504,14 +764,14 @@ dixResetPrivates(void) if (key->allocated) free(key); } - if (keys[t].created) { + if (global_keys[t].created) { ErrorF("%d %ss still allocated at reset\n", - keys[t].created, key_names[t]); + global_keys[t].created, key_names[t]); dixPrivateUsage(); } - keys[t].key = NULL; - keys[t].offset = 0; - keys[t].created = 0; - keys[t].allocated = 0; + global_keys[t].key = NULL; + global_keys[t].offset = 0; + global_keys[t].created = 0; + global_keys[t].allocated = 0; } } diff --git a/xserver/dix/property.c b/xserver/dix/property.c index b1b83124f..dec409024 100644 --- a/xserver/dix/property.c +++ b/xserver/dix/property.c @@ -108,14 +108,13 @@ dixLookupProperty(PropertyPtr *result, WindowPtr pWin, Atom propertyName, static void deliverPropertyNotifyEvent(WindowPtr pWin, int state, Atom atom) { - xEvent event; - - memset(&event, 0, sizeof(xEvent)); + xEvent event = { + .u.property.window = pWin->drawable.id, + .u.property.state = state, + .u.property.atom = atom, + .u.property.time = currentTime.milliseconds + }; event.u.u.type = PropertyNotify; - event.u.property.window = pWin->drawable.id; - event.u.property.state = state; - event.u.property.atom = atom; - event.u.property.time = currentTime.milliseconds; DeliverEvents(pWin, &event, 1, (WindowPtr) NULL); } @@ -413,15 +412,18 @@ DeleteAllWindowProperties(WindowPtr pWin) } static int -NullPropertyReply(ClientPtr client, - ATOM propertyType, int format, xGetPropertyReply * reply) +NullPropertyReply(ClientPtr client, ATOM propertyType, int format) { - reply->nItems = 0; - reply->length = 0; - reply->bytesAfter = 0; - reply->propertyType = propertyType; - reply->format = format; - WriteReplyToClient(client, sizeof(xGenericReply), reply); + xGetPropertyReply reply = { + .type = X_Reply, + .format = format, + .sequenceNumber = client->sequence, + .length = 0, + .propertyType = propertyType, + .bytesAfter = 0, + .nItems = 0 + }; + WriteReplyToClient(client, sizeof(xGenericReply), &reply); return Success; } @@ -470,13 +472,9 @@ ProcGetProperty(ClientPtr client) return BadAtom; } - memset(&reply, 0, sizeof(xGetPropertyReply)); - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - rc = dixLookupProperty(&pProp, pWin, stuff->property, client, prop_mode); if (rc == BadMatch) - return NullPropertyReply(client, None, 0, &reply); + return NullPropertyReply(client, None, 0); else if (rc != Success) return rc; @@ -485,11 +483,15 @@ ProcGetProperty(ClientPtr client) if (((stuff->type != pProp->type) && (stuff->type != AnyPropertyType)) ) { - reply.bytesAfter = pProp->size; - reply.format = pProp->format; - reply.length = 0; - reply.nItems = 0; - reply.propertyType = pProp->type; + reply = (xGetPropertyReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .bytesAfter = pProp->size, + .format = pProp->format, + .length = 0, + .nItems = 0, + .propertyType = pProp->type + }; WriteReplyToClient(client, sizeof(xGenericReply), &reply); return Success; } @@ -510,11 +512,15 @@ ProcGetProperty(ClientPtr client) len = min(n - ind, 4 * stuff->longLength); - reply.bytesAfter = n - (ind + len); - reply.format = pProp->format; - reply.length = bytes_to_int32(len); - reply.nItems = len / (pProp->format / 8); - reply.propertyType = pProp->type; + reply = (xGetPropertyReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .bytesAfter = n - (ind + len), + .format = pProp->format, + .length = bytes_to_int32(len), + .nItems = len / (pProp->format / 8), + .propertyType = pProp->type + }; if (stuff->delete && (reply.bytesAfter == 0)) deliverPropertyNotifyEvent(pWin, PropertyDelete, pProp->propertyName); @@ -589,10 +595,12 @@ ProcListProperties(ClientPtr client) } } - xlpr.type = X_Reply; - xlpr.nProperties = numProps; - xlpr.length = bytes_to_int32(numProps * sizeof(Atom)); - xlpr.sequenceNumber = client->sequence; + xlpr = (xListPropertiesReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(numProps * sizeof(Atom)), + .nProperties = numProps + }; WriteReplyToClient(client, sizeof(xGenericReply), &xlpr); if (numProps) { client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; diff --git a/xserver/dix/ptrveloc.c b/xserver/dix/ptrveloc.c index acbb479c1..d6fef9cf3 100644 --- a/xserver/dix/ptrveloc.c +++ b/xserver/dix/ptrveloc.c @@ -61,10 +61,7 @@ ****************************************************************************/ /* fwds */ -int - SetAccelerationProfile(DeviceVelocityPtr vel, int profile_num); static double - SimpleSmoothProfile(DeviceIntPtr dev, DeviceVelocityPtr vel, double velocity, double threshold, double acc); static PointerAccelerationProfileFunc @@ -80,7 +77,7 @@ DeletePredictableAccelerationProperties(DeviceIntPtr, /*#define PTRACCEL_DEBUGGING*/ #ifdef PTRACCEL_DEBUGGING -#define DebugAccelF ErrorF +#define DebugAccelF(...) ErrorFSigSafe("dix/ptraccel: " __VA_ARGS__) #else #define DebugAccelF(...) /* */ #endif @@ -424,7 +421,7 @@ void InitTrackers(DeviceVelocityPtr vel, int ntracker) { if (ntracker < 1) { - ErrorF("(dix ptracc) invalid number of trackers\n"); + ErrorF("invalid number of trackers\n"); return; } free(vel->tracker); @@ -569,7 +566,7 @@ FeedTrackers(DeviceVelocityPtr vel, double dx, double dy, int cur_t) vel->tracker[n].dy = 0.0; vel->tracker[n].time = cur_t; vel->tracker[n].dir = GetDirection(dx, dy); - DebugAccelF("(dix prtacc) motion [dx: %i dy: %i dir:%i diff: %i]\n", + DebugAccelF("motion [dx: %f dy: %f dir:%d diff: %d]\n", dx, dy, vel->tracker[n].dir, cur_t - vel->tracker[vel->cur_tracker].time); vel->cur_tracker = n; @@ -617,7 +614,8 @@ QueryTrackers(DeviceVelocityPtr vel, int cur_t) /* bail out if data is too old and protect from overrun */ if (age_ms >= vel->reset_time || age_ms < 0) { - DebugAccelF("(dix prtacc) query: tracker too old\n"); + DebugAccelF("query: tracker too old (reset after %d, age is %d)\n", + vel->reset_time, age_ms); break; } @@ -629,7 +627,7 @@ QueryTrackers(DeviceVelocityPtr vel, int cur_t) */ dir &= tracker->dir; if (dir == 0) { /* we've changed octant of movement (e.g. NE → NW) */ - DebugAccelF("(dix prtacc) query: no longer linear\n"); + DebugAccelF("query: no longer linear\n"); /* instead of breaking it we might also inspect the partition after, * but actual improvement with this is probably rare. */ break; @@ -650,7 +648,7 @@ QueryTrackers(DeviceVelocityPtr vel, int cur_t) velocity_diff / (initial_velocity + tracker_velocity) >= vel->max_rel_diff) { /* we're not in range, quit - it won't get better. */ - DebugAccelF("(dix prtacc) query: tracker too different:" + DebugAccelF("query: tracker too different:" " old %2.2f initial %2.2f diff: %2.2f\n", tracker_velocity, initial_velocity, velocity_diff); break; @@ -663,14 +661,14 @@ QueryTrackers(DeviceVelocityPtr vel, int cur_t) } } if (offset == vel->num_tracker) { - DebugAccelF("(dix prtacc) query: last tracker in effect\n"); + DebugAccelF("query: last tracker in effect\n"); used_offset = vel->num_tracker - 1; } if (used_offset >= 0) { #ifdef PTRACCEL_DEBUGGING MotionTracker *tracker = TRACKER(vel, used_offset); - DebugAccelF("(dix prtacc) result: offset %i [dx: %i dy: %i diff: %i]\n", + DebugAccelF("result: offset %i [dx: %f dy: %f diff: %i]\n", used_offset, tracker->dx, tracker->dy, cur_t - tracker->time); #endif @@ -696,6 +694,8 @@ ProcessVelocityData2D(DeviceVelocityPtr vel, double dx, double dy, int time) velocity = QueryTrackers(vel, time); + DebugAccelF("velocity is %f\n", velocity); + vel->velocity = velocity; return velocity == 0; } @@ -741,7 +741,7 @@ ApplyConstantDeceleration(DeviceVelocityPtr vel, double *fdx, double *fdy) } /* - * compute the acceleration for given velocity and enforce min_acceleartion + * compute the acceleration for given velocity and enforce min_acceleration */ double BasicComputeAcceleration(DeviceIntPtr dev, @@ -771,7 +771,7 @@ ComputeAcceleration(DeviceIntPtr dev, double result; if (vel->velocity <= 0) { - DebugAccelF("(dix ptracc) profile skipped\n"); + DebugAccelF("profile skipped\n"); /* * If we have no idea about device velocity, don't pretend it. */ @@ -791,17 +791,18 @@ ComputeAcceleration(DeviceIntPtr dev, result += 4.0f * BasicComputeAcceleration(dev, vel, (vel->last_velocity + - vel->velocity) / 2, threshold, + vel->velocity) / 2, + threshold, acc); result /= 6.0f; - DebugAccelF("(dix ptracc) profile average [%.2f ... %.2f] is %.3f\n", + DebugAccelF("profile average [%.2f ... %.2f] is %.3f\n", vel->velocity, vel->last_velocity, result); } else { result = BasicComputeAcceleration(dev, vel, vel->velocity, threshold, acc); - DebugAccelF("(dix ptracc) profile sample [%.2f] is %.3f\n", - vel->velocity, res); + DebugAccelF("profile sample [%.2f] is %.3f\n", + vel->velocity, result); } return result; @@ -1052,11 +1053,8 @@ SetDeviceSpecificAccelerationProfile(DeviceVelocityPtr vel, DeviceVelocityPtr GetDevicePredictableAccelData(DeviceIntPtr dev) { - /*sanity check */ - if (!dev) { - ErrorF("[dix] accel: DeviceIntPtr was NULL"); - return NULL; - } + BUG_RETURN_VAL(!dev, NULL); + if (dev->valuator && dev->valuator->accelScheme.AccelSchemeProc == acceleratePointerPredictable && @@ -1115,6 +1113,7 @@ acceleratePointerPredictable(DeviceIntPtr dev, ValuatorMask *val, CARD32 evtime) (double) dev->ptrfeed->ctrl.num / (double) dev->ptrfeed->ctrl.den); + DebugAccelF("mult is %f\n", mult); if (mult != 1.0f || velocitydata->const_acceleration != 1.0f) { if (mult > 1.0f && soften) ApplySoftening(velocitydata, &dx, &dy); @@ -1124,8 +1123,7 @@ acceleratePointerPredictable(DeviceIntPtr dev, ValuatorMask *val, CARD32 evtime) valuator_mask_set_double(val, 0, mult * dx); if (dy != 0.0) valuator_mask_set_double(val, 1, mult * dy); - DebugAccelF("pos (%i | %i) delta x:%.3f y:%.3f\n", mult * dx, - mult * dy); + DebugAccelF("delta x:%.3f y:%.3f\n", mult * dx, mult * dy); } } } diff --git a/xserver/dix/registry.c b/xserver/dix/registry.c index e9c19b092..5bad0fdd4 100644 --- a/xserver/dix/registry.c +++ b/xserver/dix/registry.c @@ -286,7 +286,7 @@ LookupResourceName(RESTYPE resource) void dixResetRegistry(void) { - ExtensionEntry extEntry; + ExtensionEntry extEntry = { .name = CORE }; /* Free all memory */ while (nmajor--) { @@ -336,8 +336,6 @@ dixResetRegistry(void) RegisterResourceName(RT_PASSIVEGRAB, "PASSIVE GRAB"); /* Add the core protocol */ - memset(&extEntry, 0, sizeof(extEntry)); - extEntry.name = CORE; RegisterExtensionNames(&extEntry); } diff --git a/xserver/dix/resource.c b/xserver/dix/resource.c index 89d077642..2aafa343c 100644 --- a/xserver/dix/resource.c +++ b/xserver/dix/resource.c @@ -141,6 +141,7 @@ Equipment Corporation. #include "xace.h" #include #include "registry.h" +#include "gcstruct.h" #ifdef XSERVER_DTRACE #include @@ -182,50 +183,313 @@ RESTYPE TypeMask; struct ResourceType { DeleteType deleteFunc; + SizeType sizeFunc; + FindTypeSubResources findSubResFunc; int errorValue; }; +/** + * Used by all resources that don't specify a function to calculate + * resource size. Currently this is used for all resources with + * insignificant memory usage. + * + * @see GetResourceTypeSizeFunc, SetResourceTypeSizeFunc + * + * @param[in] value Pointer to resource object. + * + * @param[in] id Resource ID for the object. + * + * @param[out] size Fill all fields to zero to indicate that size of + * resource can't be determined. + */ +static void +GetDefaultBytes(pointer value, XID id, ResourceSizePtr size) +{ + size->resourceSize = 0; + size->pixmapRefSize = 0; + size->refCnt = 1; +} + +/** + * Used by all resources that don't specify a function to iterate + * through subresources. Currently this is used for all resources with + * insignificant memory usage. + * + * @see FindSubResources, SetResourceTypeFindSubResFunc + * + * @param[in] value Pointer to resource object. + * + * @param[in] func Function to call for each subresource. + + * @param[out] cdata Pointer to opaque data. + */ +static void +DefaultFindSubRes(pointer value, FindAllRes func, pointer cdata) +{ + /* do nothing */ +} + +/** + * Calculate drawable size in bytes. Reference counting is not taken + * into account. + * + * @param[in] drawable Pointer to a drawable. + * + * @return Estimate of total memory usage for the drawable. + */ +static unsigned long +GetDrawableBytes(DrawablePtr drawable) +{ + int bytes = 0; + + if (drawable) + { + int bytesPerPixel = drawable->bitsPerPixel >> 3; + int numberOfPixels = drawable->width * drawable->height; + bytes = numberOfPixels * bytesPerPixel; + } + + return bytes; +} + +/** + * Calculate pixmap size in bytes. Reference counting is taken into + * account. Any extra data attached by extensions and drivers is not + * taken into account. The purpose of this function is to estimate + * memory usage that can be attributed to single reference of the + * pixmap. + * + * @param[in] value Pointer to a pixmap. + * + * @param[in] id Resource ID of pixmap. If the pixmap hasn't been + * added as resource, just pass value->drawable.id. + * + * @param[out] size Estimate of memory usage attributed to a single + * pixmap reference. + */ +static void +GetPixmapBytes(pointer value, XID id, ResourceSizePtr size) +{ + PixmapPtr pixmap = value; + + size->resourceSize = 0; + size->pixmapRefSize = 0; + size->refCnt = pixmap->refcnt; + + if (pixmap && pixmap->refcnt) + { + DrawablePtr drawable = &pixmap->drawable; + size->resourceSize = GetDrawableBytes(drawable); + size->pixmapRefSize = size->resourceSize / pixmap->refcnt; + } +} + +/** + * Calculate window size in bytes. The purpose of this function is to + * estimate memory usage that can be attributed to all pixmap + * references of the window. + * + * @param[in] value Pointer to a window. + * + * @param[in] id Resource ID of window. + * + * @param[out] size Estimate of memory usage attributed to a all + * pixmap references of a window. + */ +static void +GetWindowBytes(pointer value, XID id, ResourceSizePtr size) +{ + SizeType pixmapSizeFunc = GetResourceTypeSizeFunc(RT_PIXMAP); + ResourceSizeRec pixmapSize = { 0, 0, 0 }; + WindowPtr window = value; + + /* Currently only pixmap bytes are reported to clients. */ + size->resourceSize = 0; + + /* Calculate pixmap reference sizes. */ + size->pixmapRefSize = 0; + + size->refCnt = 1; + + if (window->backgroundState == BackgroundPixmap) + { + PixmapPtr pixmap = window->background.pixmap; + pixmapSizeFunc(pixmap, pixmap->drawable.id, &pixmapSize); + size->pixmapRefSize += pixmapSize.pixmapRefSize; + } + if (window->border.pixmap && !window->borderIsPixel) + { + PixmapPtr pixmap = window->border.pixmap; + pixmapSizeFunc(pixmap, pixmap->drawable.id, &pixmapSize); + size->pixmapRefSize += pixmapSize.pixmapRefSize; + } +} + +/** + * Iterate through subresources of a window. The purpose of this + * function is to gather accurate information on what resources + * a resource uses. + * + * @note Currently only sub-pixmaps are iterated + * + * @param[in] value Pointer to a window + * + * @param[in] func Function to call with each subresource + * + * @param[out] cdata Pointer to opaque data + */ +static void +FindWindowSubRes(pointer value, FindAllRes func, pointer cdata) +{ + WindowPtr window = value; + + /* Currently only pixmap subresources are reported to clients. */ + + if (window->backgroundState == BackgroundPixmap) + { + PixmapPtr pixmap = window->background.pixmap; + func(window->background.pixmap, pixmap->drawable.id, RT_PIXMAP, cdata); + } + if (window->border.pixmap && !window->borderIsPixel) + { + PixmapPtr pixmap = window->border.pixmap; + func(window->background.pixmap, pixmap->drawable.id, RT_PIXMAP, cdata); + } +} + +/** + * Calculate graphics context size in bytes. The purpose of this + * function is to estimate memory usage that can be attributed to all + * pixmap references of the graphics context. + * + * @param[in] value Pointer to a graphics context. + * + * @param[in] id Resource ID of graphics context. + * + * @param[out] size Estimate of memory usage attributed to a all + * pixmap references of a graphics context. + */ +static void +GetGcBytes(pointer value, XID id, ResourceSizePtr size) +{ + SizeType pixmapSizeFunc = GetResourceTypeSizeFunc(RT_PIXMAP); + ResourceSizeRec pixmapSize = { 0, 0, 0 }; + GCPtr gc = value; + + /* Currently only pixmap bytes are reported to clients. */ + size->resourceSize = 0; + + /* Calculate pixmap reference sizes. */ + size->pixmapRefSize = 0; + + size->refCnt = 1; + if (gc->stipple) + { + PixmapPtr pixmap = gc->stipple; + pixmapSizeFunc(pixmap, pixmap->drawable.id, &pixmapSize); + size->pixmapRefSize += pixmapSize.pixmapRefSize; + } + if (gc->tile.pixmap && !gc->tileIsPixel) + { + PixmapPtr pixmap = gc->tile.pixmap; + pixmapSizeFunc(pixmap, pixmap->drawable.id, &pixmapSize); + size->pixmapRefSize += pixmapSize.pixmapRefSize; + } +} + +/** + * Iterate through subresources of a graphics context. The purpose of + * this function is to gather accurate information on what resources a + * resource uses. + * + * @note Currently only sub-pixmaps are iterated + * + * @param[in] value Pointer to a window + * + * @param[in] func Function to call with each subresource + * + * @param[out] cdata Pointer to opaque data + */ +static void +FindGCSubRes(pointer value, FindAllRes func, pointer cdata) +{ + GCPtr gc = value; + + /* Currently only pixmap subresources are reported to clients. */ + + if (gc->stipple) + { + PixmapPtr pixmap = gc->stipple; + func(pixmap, pixmap->drawable.id, RT_PIXMAP, cdata); + } + if (gc->tile.pixmap && !gc->tileIsPixel) + { + PixmapPtr pixmap = gc->tile.pixmap; + func(pixmap, pixmap->drawable.id, RT_PIXMAP, cdata); + } +} + static struct ResourceType *resourceTypes; static const struct ResourceType predefTypes[] = { [RT_NONE & (RC_LASTPREDEF - 1)] = { .deleteFunc = (DeleteType) NoopDDA, + .sizeFunc = GetDefaultBytes, + .findSubResFunc = DefaultFindSubRes, .errorValue = BadValue, }, [RT_WINDOW & (RC_LASTPREDEF - 1)] = { .deleteFunc = DeleteWindow, + .sizeFunc = GetWindowBytes, + .findSubResFunc = FindWindowSubRes, .errorValue = BadWindow, }, [RT_PIXMAP & (RC_LASTPREDEF - 1)] = { .deleteFunc = dixDestroyPixmap, + .sizeFunc = GetPixmapBytes, + .findSubResFunc = DefaultFindSubRes, .errorValue = BadPixmap, }, [RT_GC & (RC_LASTPREDEF - 1)] = { .deleteFunc = FreeGC, + .sizeFunc = GetGcBytes, + .findSubResFunc = FindGCSubRes, .errorValue = BadGC, }, [RT_FONT & (RC_LASTPREDEF - 1)] = { .deleteFunc = CloseFont, + .sizeFunc = GetDefaultBytes, + .findSubResFunc = DefaultFindSubRes, .errorValue = BadFont, }, [RT_CURSOR & (RC_LASTPREDEF - 1)] = { .deleteFunc = FreeCursor, + .sizeFunc = GetDefaultBytes, + .findSubResFunc = DefaultFindSubRes, .errorValue = BadCursor, }, [RT_COLORMAP & (RC_LASTPREDEF - 1)] = { .deleteFunc = FreeColormap, + .sizeFunc = GetDefaultBytes, + .findSubResFunc = DefaultFindSubRes, .errorValue = BadColor, }, [RT_CMAPENTRY & (RC_LASTPREDEF - 1)] = { .deleteFunc = FreeClientPixels, + .sizeFunc = GetDefaultBytes, + .findSubResFunc = DefaultFindSubRes, .errorValue = BadColor, }, [RT_OTHERCLIENT & (RC_LASTPREDEF - 1)] = { .deleteFunc = OtherClientGone, + .sizeFunc = GetDefaultBytes, + .findSubResFunc = DefaultFindSubRes, .errorValue = BadValue, }, [RT_PASSIVEGRAB & (RC_LASTPREDEF - 1)] = { .deleteFunc = DeletePassiveGrab, + .sizeFunc = GetDefaultBytes, + .findSubResFunc = DefaultFindSubRes, .errorValue = BadValue, }, }; @@ -256,6 +520,8 @@ CreateNewResourceType(DeleteType deleteFunc, const char *name) lastResourceType = next; resourceTypes = types; resourceTypes[next].deleteFunc = deleteFunc; + resourceTypes[next].sizeFunc = GetDefaultBytes; + resourceTypes[next].findSubResFunc = DefaultFindSubRes; resourceTypes[next].errorValue = BadValue; /* Called even if name is NULL, to remove any previous entry */ @@ -264,6 +530,57 @@ CreateNewResourceType(DeleteType deleteFunc, const char *name) return next; } +/** + * Get the function used to calculate resource size. Extensions and + * drivers need to be able to determine the current size calculation + * function if they want to wrap or override it. + * + * @param[in] type Resource type used in size calculations. + * + * @return Function to calculate the size of a single + * resource. + */ +SizeType +GetResourceTypeSizeFunc(RESTYPE type) +{ + return resourceTypes[type & TypeMask].sizeFunc; +} + +/** + * Override the default function that calculates resource size. For + * example, video driver knows better how to calculate pixmap memory + * usage and can therefore wrap or override size calculation for + * RT_PIXMAP. + * + * @param[in] type Resource type used in size calculations. + * + * @param[in] sizeFunc Function to calculate the size of a single + * resource. + */ +void +SetResourceTypeSizeFunc(RESTYPE type, SizeType sizeFunc) +{ + resourceTypes[type & TypeMask].sizeFunc = sizeFunc; +} + +/** + * Provide a function for iterating the subresources of a resource. + * This allows for example more accurate accounting of the (memory) + * resources consumed by a resource. + * + * @see FindSubResources + * + * @param[in] type Resource type used in size calculations. + * + * @param[in] sizeFunc Function to calculate the size of a single + * resource. + */ +void +SetResourceTypeFindSubResFunc(RESTYPE type, FindTypeSubResources findFunc) +{ + resourceTypes[type & TypeMask].findSubResFunc = findFunc; +} + void SetResourceTypeErrorValue(RESTYPE type, int errorValue) { @@ -326,25 +643,32 @@ InitClientResources(ClientPtr client) return TRUE; } -static int -Hash(int client, XID id) +int +HashResourceID(XID id, int numBits) { id &= RESOURCE_ID_MASK; - switch (clientTable[client].hashsize) { - case 6: - return ((int) (0x03F & (id ^ (id >> 6) ^ (id >> 12)))); - case 7: - return ((int) (0x07F & (id ^ (id >> 7) ^ (id >> 13)))); - case 8: - return ((int) (0x0FF & (id ^ (id >> 8) ^ (id >> 16)))); - case 9: - return ((int) (0x1FF & (id ^ (id >> 9)))); - case 10: - return ((int) (0x3FF & (id ^ (id >> 10)))); - case 11: - return ((int) (0x7FF & (id ^ (id >> 11)))); + switch (numBits) + { + case 6: + return ((int)(0x03F & (id ^ (id>>6) ^ (id>>12)))); + case 7: + return ((int)(0x07F & (id ^ (id>>7) ^ (id>>13)))); + case 8: + return ((int)(0x0FF & (id ^ (id>>8) ^ (id>>16)))); + case 9: + return ((int)(0x1FF & (id ^ (id>>9)))); + case 10: + return ((int)(0x3FF & (id ^ (id>>10)))); + case 11: + return ((int)(0x7FF & (id ^ (id>>11)))); + } + if (numBits >= 11) + return ((int)(0x7FF & (id ^ (id>>11)))); + else + { + assert(numBits >= 0); + return id & ~((~0) << numBits); } - return -1; } static XID @@ -355,7 +679,7 @@ AvailableID(int client, XID id, XID maxid, XID goodid) if ((goodid >= id) && (goodid <= maxid)) return goodid; for (; id <= maxid; id++) { - res = clientTable[client].resources[Hash(client, id)]; + res = clientTable[client].resources[HashResourceID(id, clientTable[client].hashsize)]; while (res && (res->id != id)) res = res->next; if (!res) @@ -481,7 +805,7 @@ AddResource(XID id, RESTYPE type, pointer value) } if ((rrec->elements >= 4 * rrec->buckets) && (rrec->hashsize < MAXHASHSIZE)) RebuildTable(client); - head = &rrec->resources[Hash(client, id)]; + head = &rrec->resources[HashResourceID(id, clientTable[client].hashsize)]; res = malloc(sizeof(ResourceRec)); if (!res) { (*resourceTypes[type & TypeMask].deleteFunc) (value, id); @@ -529,7 +853,7 @@ RebuildTable(int client) for (res = *rptr; res; res = next) { next = res->next; res->next = NULL; - tptr = &tails[Hash(client, res->id)]; + tptr = &tails[HashResourceID(res->id, clientTable[client].hashsize)]; **tptr = res; *tptr = &res->next; } @@ -561,7 +885,7 @@ FreeResource(XID id, RESTYPE skipDeleteFuncType) int elements; if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) { - head = &clientTable[cid].resources[Hash(cid, id)]; + head = &clientTable[cid].resources[HashResourceID(id, clientTable[cid].hashsize)]; eltptr = &clientTable[cid].elements; prev = head; @@ -595,7 +919,7 @@ FreeResourceByType(XID id, RESTYPE type, Bool skipFree) ResourcePtr *prev, *head; if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) { - head = &clientTable[cid].resources[Hash(cid, id)]; + head = &clientTable[cid].resources[HashResourceID(id, clientTable[cid].hashsize)]; prev = head; while ((res = *prev)) { @@ -630,7 +954,7 @@ ChangeResourceValue(XID id, RESTYPE rtype, pointer value) ResourcePtr res; if (((cid = CLIENT_ID(id)) < MAXCLIENTS) && clientTable[cid].buckets) { - res = clientTable[cid].resources[Hash(cid, id)]; + res = clientTable[cid].resources[HashResourceID(id, clientTable[cid].hashsize)]; for (; res; res = res->next) if ((res->id == id) && (res->type == rtype)) { @@ -674,6 +998,15 @@ FindClientResourcesByType(ClientPtr client, } } +void FindSubResources(pointer resource, + RESTYPE type, + FindAllRes func, + pointer cdata) +{ + struct ResourceType rtype = resourceTypes[type & TypeMask]; + rtype.findSubResFunc(resource, func, cdata); +} + void FindAllClientResources(ClientPtr client, FindAllRes func, pointer cdata) { @@ -859,7 +1192,7 @@ dixLookupResourceByType(pointer *result, XID id, RESTYPE rtype, return BadImplementation; if ((cid < MAXCLIENTS) && clientTable[cid].buckets) { - res = clientTable[cid].resources[Hash(cid, id)]; + res = clientTable[cid].resources[HashResourceID(id, clientTable[cid].hashsize)]; for (; res; res = res->next) if (res->id == id && res->type == rtype) @@ -892,7 +1225,7 @@ dixLookupResourceByClass(pointer *result, XID id, RESTYPE rclass, *result = NULL; if ((cid < MAXCLIENTS) && clientTable[cid].buckets) { - res = clientTable[cid].resources[Hash(cid, id)]; + res = clientTable[cid].resources[HashResourceID(id, clientTable[cid].hashsize)]; for (; res; res = res->next) if (res->id == id && (res->type & rclass)) diff --git a/xserver/dix/selection.c b/xserver/dix/selection.c index dfdcfdc64..e905b1ec2 100644 --- a/xserver/dix/selection.c +++ b/xserver/dix/selection.c @@ -174,8 +174,6 @@ ProcSetSelectionOwner(ClientPtr client) rc = dixLookupSelection(&pSel, stuff->selection, client, DixSetAttrAccess); if (rc == Success) { - xEvent event; - /* If the timestamp in client's request is in the past relative to the time stamp indicating the last time the owner of the selection was set, do not set the selection, just return @@ -183,10 +181,12 @@ ProcSetSelectionOwner(ClientPtr client) if (CompareTimeStamps(time, pSel->lastTimeChanged) == EARLIER) return Success; if (pSel->client && (!pWin || (pSel->client != client))) { + xEvent event = { + .u.selectionClear.time = time.milliseconds, + .u.selectionClear.window = pSel->window, + .u.selectionClear.atom = pSel->selection + }; event.u.u.type = SelectionClear; - event.u.selectionClear.time = time.milliseconds; - event.u.selectionClear.window = pSel->window; - event.u.selectionClear.atom = pSel->selection; WriteEventsToClient(pSel->client, 1, &event); } } @@ -238,10 +238,11 @@ ProcGetSelectionOwner(ClientPtr client) return BadAtom; } - memset(&reply, 0, sizeof(xGetSelectionOwnerReply)); - reply.type = X_Reply; - reply.length = 0; - reply.sequenceNumber = client->sequence; + reply = (xGetSelectionOwnerReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + }; rc = dixLookupSelection(&pSel, stuff->id, client, DixGetAttrAccess); if (rc == Success) diff --git a/xserver/dix/swaprep.c b/xserver/dix/swaprep.c index 9440c4ee3..559fe271e 100644 --- a/xserver/dix/swaprep.c +++ b/xserver/dix/swaprep.c @@ -80,7 +80,7 @@ Swap32Write(ClientPtr pClient, int size, CARD32 *pbuf) { swapl(&pbuf[i]); } - (void) WriteToClient(pClient, size << 2, (char *) pbuf); + WriteToClient(pClient, size << 2, pbuf); } /** @@ -123,7 +123,7 @@ CopySwap32Write(ClientPtr pClient, int size, CARD32 *pbuf) from++; to++; } - (void) WriteToClient(pClient, nbytes, (char *) pbufT); + WriteToClient(pClient, nbytes, pbufT); } if (pbufT != tmpbuf) @@ -170,7 +170,7 @@ CopySwap16Write(ClientPtr pClient, int size, short *pbuf) from++; to++; } - (void) WriteToClient(pClient, nbytes, (char *) pbufT); + WriteToClient(pClient, nbytes, pbufT); } if (pbufT != tmpbuf) @@ -182,7 +182,7 @@ void SGenericReply(ClientPtr pClient, int size, xGenericReply * pRep) { swaps(&pRep->sequenceNumber); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } /* Extra-large reply */ @@ -200,7 +200,7 @@ SGetWindowAttributesReply(ClientPtr pClient, int size, swapl(&pRep->allEventMasks); swapl(&pRep->yourEventMask); swaps(&pRep->doNotPropagateMask); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -213,7 +213,7 @@ SGetGeometryReply(ClientPtr pClient, int size, xGetGeometryReply * pRep) swaps(&pRep->width); swaps(&pRep->height); swaps(&pRep->borderWidth); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -224,7 +224,7 @@ SQueryTreeReply(ClientPtr pClient, int size, xQueryTreeReply * pRep) swapl(&pRep->root); swapl(&pRep->parent); swaps(&pRep->nChildren); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -232,7 +232,7 @@ SInternAtomReply(ClientPtr pClient, int size, xInternAtomReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->atom); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -241,7 +241,7 @@ SGetAtomNameReply(ClientPtr pClient, int size, xGetAtomNameReply * pRep) swaps(&pRep->sequenceNumber); swapl(&pRep->length); swaps(&pRep->nameLength); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -252,7 +252,7 @@ SGetPropertyReply(ClientPtr pClient, int size, xGetPropertyReply * pRep) swapl(&pRep->propertyType); swapl(&pRep->bytesAfter); swapl(&pRep->nItems); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -261,7 +261,7 @@ SListPropertiesReply(ClientPtr pClient, int size, xListPropertiesReply * pRep) swaps(&pRep->sequenceNumber); swapl(&pRep->length); swaps(&pRep->nProperties); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -270,7 +270,7 @@ SGetSelectionOwnerReply(ClientPtr pClient, int size, { swaps(&pRep->sequenceNumber); swapl(&pRep->owner); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -284,7 +284,7 @@ SQueryPointerReply(ClientPtr pClient, int size, xQueryPointerReply * pRep) swaps(&pRep->winX); swaps(&pRep->winY); swaps(&pRep->mask); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } static void @@ -307,7 +307,7 @@ SwapTimeCoordWrite(ClientPtr pClient, int size, xTimecoord * pRep) SwapTimecoord(pRepT); pRepT++; } - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } @@ -317,7 +317,7 @@ SGetMotionEventsReply(ClientPtr pClient, int size, xGetMotionEventsReply * pRep) swaps(&pRep->sequenceNumber); swapl(&pRep->length); swapl(&pRep->nEvents); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -327,7 +327,7 @@ STranslateCoordsReply(ClientPtr pClient, int size, xTranslateCoordsReply * pRep) swapl(&pRep->child); swaps(&pRep->dstX); swaps(&pRep->dstY); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -335,7 +335,7 @@ SGetInputFocusReply(ClientPtr pClient, int size, xGetInputFocusReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->focus); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } /* extra long reply */ @@ -344,7 +344,7 @@ SQueryKeymapReply(ClientPtr pClient, int size, xQueryKeymapReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->length); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } static void @@ -405,7 +405,7 @@ void SQueryFontReply(ClientPtr pClient, int size, xQueryFontReply * pRep) { SwapFont(pRep, TRUE); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -420,7 +420,7 @@ SQueryTextExtentsReply(ClientPtr pClient, int size, swapl(&pRep->overallWidth); swapl(&pRep->overallLeft); swapl(&pRep->overallRight); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -429,7 +429,7 @@ SListFontsReply(ClientPtr pClient, int size, xListFontsReply * pRep) swaps(&pRep->sequenceNumber); swapl(&pRep->length); swaps(&pRep->nFonts); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -437,7 +437,7 @@ SListFontsWithInfoReply(ClientPtr pClient, int size, xListFontsWithInfoReply * pRep) { SwapFont((xQueryFontReply *) pRep, FALSE); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -446,7 +446,7 @@ SGetFontPathReply(ClientPtr pClient, int size, xGetFontPathReply * pRep) swaps(&pRep->sequenceNumber); swapl(&pRep->length); swaps(&pRep->nPaths); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -455,7 +455,7 @@ SGetImageReply(ClientPtr pClient, int size, xGetImageReply * pRep) swaps(&pRep->sequenceNumber); swapl(&pRep->length); swapl(&pRep->visual); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); /* Fortunately, image doesn't need swapping */ } @@ -466,7 +466,7 @@ SListInstalledColormapsReply(ClientPtr pClient, int size, swaps(&pRep->sequenceNumber); swapl(&pRep->length); swaps(&pRep->nColormaps); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -477,7 +477,7 @@ SAllocColorReply(ClientPtr pClient, int size, xAllocColorReply * pRep) swaps(&pRep->green); swaps(&pRep->blue); swapl(&pRep->pixel); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -491,7 +491,7 @@ SAllocNamedColorReply(ClientPtr pClient, int size, xAllocNamedColorReply * pRep) swaps(&pRep->screenRed); swaps(&pRep->screenGreen); swaps(&pRep->screenBlue); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -501,7 +501,7 @@ SAllocColorCellsReply(ClientPtr pClient, int size, xAllocColorCellsReply * pRep) swapl(&pRep->length); swaps(&pRep->nPixels); swaps(&pRep->nMasks); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -514,7 +514,7 @@ SAllocColorPlanesReply(ClientPtr pClient, int size, swapl(&pRep->redMask); swapl(&pRep->greenMask); swapl(&pRep->blueMask); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } static void @@ -537,7 +537,7 @@ SQColorsExtend(ClientPtr pClient, int size, xrgb * prgb) SwapRGB(prgbT); prgbT++; } - (void) WriteToClient(pClient, size, (char *) prgb); + WriteToClient(pClient, size, prgb); } void @@ -546,7 +546,7 @@ SQueryColorsReply(ClientPtr pClient, int size, xQueryColorsReply * pRep) swaps(&pRep->sequenceNumber); swapl(&pRep->length); swaps(&pRep->nColors); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -559,7 +559,7 @@ SLookupColorReply(ClientPtr pClient, int size, xLookupColorReply * pRep) swaps(&pRep->screenRed); swaps(&pRep->screenGreen); swaps(&pRep->screenBlue); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -568,7 +568,7 @@ SQueryBestSizeReply(ClientPtr pClient, int size, xQueryBestSizeReply * pRep) swaps(&pRep->sequenceNumber); swaps(&pRep->width); swaps(&pRep->height); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -576,7 +576,7 @@ SListExtensionsReply(ClientPtr pClient, int size, xListExtensionsReply * pRep) { swaps(&pRep->sequenceNumber); swapl(&pRep->length); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -585,7 +585,7 @@ SGetKeyboardMappingReply(ClientPtr pClient, int size, { swaps(&pRep->sequenceNumber); swapl(&pRep->length); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -594,7 +594,7 @@ SGetPointerMappingReply(ClientPtr pClient, int size, { swaps(&pRep->sequenceNumber); swapl(&pRep->length); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -603,7 +603,7 @@ SGetModifierMappingReply(ClientPtr pClient, int size, { swaps(&pRep->sequenceNumber); swapl(&pRep->length); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -615,7 +615,7 @@ SGetKeyboardControlReply(ClientPtr pClient, int size, swapl(&pRep->ledMask); swaps(&pRep->bellPitch); swaps(&pRep->bellDuration); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -626,7 +626,7 @@ SGetPointerControlReply(ClientPtr pClient, int size, swaps(&pRep->accelNumerator); swaps(&pRep->accelDenominator); swaps(&pRep->threshold); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -635,7 +635,7 @@ SGetScreenSaverReply(ClientPtr pClient, int size, xGetScreenSaverReply * pRep) swaps(&pRep->sequenceNumber); swaps(&pRep->timeout); swaps(&pRep->interval); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -651,7 +651,7 @@ SLHostsExtend(ClientPtr pClient, int size, char *buf) swaps(&host->length); bufT += sizeof(xHostEntry) + pad_to_int32(len); } - (void) WriteToClient(pClient, size, buf); + WriteToClient(pClient, size, buf); } void @@ -660,7 +660,7 @@ SListHostsReply(ClientPtr pClient, int size, xListHostsReply * pRep) swaps(&pRep->sequenceNumber); swapl(&pRep->length); swaps(&pRep->nHosts); - (void) WriteToClient(pClient, size, (char *) pRep); + WriteToClient(pClient, size, pRep); } void @@ -1140,7 +1140,7 @@ WriteSConnectionInfo(ClientPtr pClient, unsigned long size, char *pInfo) return; } SwapConnSetupInfo(pInfo, pInfoTBase); - (void) WriteToClient(pClient, (int) size, (char *) pInfoTBase); + WriteToClient(pClient, (int) size, pInfoTBase); free(pInfoTBase); } @@ -1160,7 +1160,7 @@ WriteSConnSetupPrefix(ClientPtr pClient, xConnSetupPrefix * pcsp) xConnSetupPrefix cspT; SwapConnSetupPrefix(pcsp, &cspT); - (void) WriteToClient(pClient, sizeof(cspT), (char *) &cspT); + WriteToClient(pClient, sizeof(cspT), &cspT); } /* diff --git a/xserver/dix/swapreq.c b/xserver/dix/swapreq.c index a896b4b29..0f6d49ef0 100644 --- a/xserver/dix/swapreq.c +++ b/xserver/dix/swapreq.c @@ -283,7 +283,7 @@ SProcConvertSelection(ClientPtr client) int SProcSendEvent(ClientPtr client) { - xEvent eventT; + xEvent eventT = { .u.u.type = 0 }; EventSwapPtr proc; REQUEST(xSendEventReq); diff --git a/xserver/dix/tables.c b/xserver/dix/tables.c index 705ef0d4d..686cddd7d 100644 --- a/xserver/dix/tables.c +++ b/xserver/dix/tables.c @@ -58,364 +58,529 @@ SOFTWARE. #include "swaprep.h" #include "swapreq.h" -int (*InitialVector[3]) (ClientPtr /* client */ - ) = { -0, ProcInitialConnection, ProcEstablishConnection}; +int (*InitialVector[3]) (ClientPtr /* client */) = { + 0, + ProcInitialConnection, + ProcEstablishConnection +}; -int (*ProcVector[256]) (ClientPtr /* client */ - ) = { - ProcBadRequest, ProcCreateWindow, ProcChangeWindowAttributes, ProcGetWindowAttributes, ProcDestroyWindow, ProcDestroySubwindows, /* 5 */ - ProcChangeSaveSet, ProcReparentWindow, ProcMapWindow, ProcMapSubwindows, ProcUnmapWindow, /* 10 */ - ProcUnmapSubwindows, ProcConfigureWindow, ProcCirculateWindow, ProcGetGeometry, ProcQueryTree, /* 15 */ - ProcInternAtom, ProcGetAtomName, ProcChangeProperty, ProcDeleteProperty, ProcGetProperty, /* 20 */ - ProcListProperties, ProcSetSelectionOwner, ProcGetSelectionOwner, ProcConvertSelection, ProcSendEvent, /* 25 */ - ProcGrabPointer, ProcUngrabPointer, ProcGrabButton, ProcUngrabButton, ProcChangeActivePointerGrab, /* 30 */ - ProcGrabKeyboard, ProcUngrabKeyboard, ProcGrabKey, ProcUngrabKey, ProcAllowEvents, /* 35 */ - ProcGrabServer, ProcUngrabServer, ProcQueryPointer, ProcGetMotionEvents, ProcTranslateCoords, /* 40 */ - ProcWarpPointer, ProcSetInputFocus, ProcGetInputFocus, ProcQueryKeymap, ProcOpenFont, /* 45 */ - ProcCloseFont, ProcQueryFont, ProcQueryTextExtents, ProcListFonts, ProcListFontsWithInfo, /* 50 */ - ProcSetFontPath, ProcGetFontPath, ProcCreatePixmap, ProcFreePixmap, ProcCreateGC, /* 55 */ - ProcChangeGC, ProcCopyGC, ProcSetDashes, ProcSetClipRectangles, ProcFreeGC, /* 60 */ - ProcClearToBackground, ProcCopyArea, ProcCopyPlane, ProcPolyPoint, ProcPolyLine, /* 65 */ - ProcPolySegment, ProcPolyRectangle, ProcPolyArc, ProcFillPoly, ProcPolyFillRectangle, /* 70 */ - ProcPolyFillArc, ProcPutImage, ProcGetImage, ProcPolyText, ProcPolyText, /* 75 */ - ProcImageText8, ProcImageText16, ProcCreateColormap, ProcFreeColormap, ProcCopyColormapAndFree, /* 80 */ - ProcInstallColormap, ProcUninstallColormap, ProcListInstalledColormaps, ProcAllocColor, ProcAllocNamedColor, /* 85 */ - ProcAllocColorCells, ProcAllocColorPlanes, ProcFreeColors, ProcStoreColors, ProcStoreNamedColor, /* 90 */ - ProcQueryColors, ProcLookupColor, ProcCreateCursor, ProcCreateGlyphCursor, ProcFreeCursor, /* 95 */ - ProcRecolorCursor, ProcQueryBestSize, ProcQueryExtension, ProcListExtensions, ProcChangeKeyboardMapping, /* 100 */ - ProcGetKeyboardMapping, ProcChangeKeyboardControl, ProcGetKeyboardControl, ProcBell, ProcChangePointerControl, /* 105 */ - ProcGetPointerControl, ProcSetScreenSaver, ProcGetScreenSaver, ProcChangeHosts, ProcListHosts, /* 110 */ - ProcChangeAccessControl, ProcChangeCloseDownMode, ProcKillClient, ProcRotateProperties, ProcForceScreenSaver, /* 115 */ - ProcSetPointerMapping, ProcGetPointerMapping, ProcSetModifierMapping, ProcGetModifierMapping, ProcBadRequest, /* 120 */ - ProcBadRequest, ProcBadRequest, ProcBadRequest, ProcBadRequest, ProcBadRequest, /* 125 */ -ProcBadRequest, - ProcNoOperation, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, ProcBadRequest, ProcBadRequest, ProcBadRequest}; +int (*ProcVector[256]) (ClientPtr /* client */) = { + ProcBadRequest, + ProcCreateWindow, + ProcChangeWindowAttributes, + ProcGetWindowAttributes, + ProcDestroyWindow, + ProcDestroySubwindows, /* 5 */ + ProcChangeSaveSet, + ProcReparentWindow, + ProcMapWindow, + ProcMapSubwindows, + ProcUnmapWindow, /* 10 */ + ProcUnmapSubwindows, + ProcConfigureWindow, + ProcCirculateWindow, + ProcGetGeometry, + ProcQueryTree, /* 15 */ + ProcInternAtom, + ProcGetAtomName, + ProcChangeProperty, + ProcDeleteProperty, + ProcGetProperty, /* 20 */ + ProcListProperties, + ProcSetSelectionOwner, + ProcGetSelectionOwner, + ProcConvertSelection, + ProcSendEvent, /* 25 */ + ProcGrabPointer, + ProcUngrabPointer, + ProcGrabButton, + ProcUngrabButton, + ProcChangeActivePointerGrab, /* 30 */ + ProcGrabKeyboard, + ProcUngrabKeyboard, + ProcGrabKey, + ProcUngrabKey, + ProcAllowEvents, /* 35 */ + ProcGrabServer, + ProcUngrabServer, + ProcQueryPointer, + ProcGetMotionEvents, + ProcTranslateCoords, /* 40 */ + ProcWarpPointer, + ProcSetInputFocus, + ProcGetInputFocus, + ProcQueryKeymap, + ProcOpenFont, /* 45 */ + ProcCloseFont, + ProcQueryFont, + ProcQueryTextExtents, + ProcListFonts, + ProcListFontsWithInfo, /* 50 */ + ProcSetFontPath, + ProcGetFontPath, + ProcCreatePixmap, + ProcFreePixmap, + ProcCreateGC, /* 55 */ + ProcChangeGC, + ProcCopyGC, + ProcSetDashes, + ProcSetClipRectangles, + ProcFreeGC, /* 60 */ + ProcClearToBackground, + ProcCopyArea, + ProcCopyPlane, + ProcPolyPoint, + ProcPolyLine, /* 65 */ + ProcPolySegment, + ProcPolyRectangle, + ProcPolyArc, + ProcFillPoly, + ProcPolyFillRectangle, /* 70 */ + ProcPolyFillArc, + ProcPutImage, + ProcGetImage, + ProcPolyText, + ProcPolyText, /* 75 */ + ProcImageText8, + ProcImageText16, + ProcCreateColormap, + ProcFreeColormap, + ProcCopyColormapAndFree, /* 80 */ + ProcInstallColormap, + ProcUninstallColormap, + ProcListInstalledColormaps, + ProcAllocColor, + ProcAllocNamedColor, /* 85 */ + ProcAllocColorCells, + ProcAllocColorPlanes, + ProcFreeColors, + ProcStoreColors, + ProcStoreNamedColor, /* 90 */ + ProcQueryColors, + ProcLookupColor, + ProcCreateCursor, + ProcCreateGlyphCursor, + ProcFreeCursor, /* 95 */ + ProcRecolorCursor, + ProcQueryBestSize, + ProcQueryExtension, + ProcListExtensions, + ProcChangeKeyboardMapping, /* 100 */ + ProcGetKeyboardMapping, + ProcChangeKeyboardControl, + ProcGetKeyboardControl, + ProcBell, + ProcChangePointerControl, /* 105 */ + ProcGetPointerControl, + ProcSetScreenSaver, + ProcGetScreenSaver, + ProcChangeHosts, + ProcListHosts, /* 110 */ + ProcChangeAccessControl, + ProcChangeCloseDownMode, + ProcKillClient, + ProcRotateProperties, + ProcForceScreenSaver, /* 115 */ + ProcSetPointerMapping, + ProcGetPointerMapping, + ProcSetModifierMapping, + ProcGetModifierMapping, + ProcBadRequest, /* 120 */ + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, /* 125 */ + ProcBadRequest, + ProcNoOperation, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest +}; -int (*SwappedProcVector[256]) (ClientPtr /* client */ - ) = { - ProcBadRequest, SProcCreateWindow, SProcChangeWindowAttributes, SProcResourceReq, /* GetWindowAttributes */ - SProcResourceReq, /* DestroyWindow */ - SProcResourceReq, /* 5 DestroySubwindows */ - SProcResourceReq, /* SProcChangeSaveSet, */ - SProcReparentWindow, SProcResourceReq, /* MapWindow */ - SProcResourceReq, /* MapSubwindows */ - SProcResourceReq, /* 10 UnmapWindow */ - SProcResourceReq, /* UnmapSubwindows */ - SProcConfigureWindow, SProcResourceReq, /* SProcCirculateWindow, */ - SProcResourceReq, /* GetGeometry */ - SProcResourceReq, /* 15 QueryTree */ - SProcInternAtom, SProcResourceReq, /* SProcGetAtomName, */ - SProcChangeProperty, SProcDeleteProperty, SProcGetProperty, /* 20 */ - SProcResourceReq, /* SProcListProperties, */ - SProcSetSelectionOwner, SProcResourceReq, /* SProcGetSelectionOwner, */ - SProcConvertSelection, SProcSendEvent, /* 25 */ - SProcGrabPointer, SProcResourceReq, /* SProcUngrabPointer, */ - SProcGrabButton, SProcUngrabButton, SProcChangeActivePointerGrab, /* 30 */ - SProcGrabKeyboard, SProcResourceReq, /* SProcUngrabKeyboard, */ - SProcGrabKey, SProcUngrabKey, SProcResourceReq, /* 35 SProcAllowEvents, */ - SProcSimpleReq, /* SProcGrabServer, */ - SProcSimpleReq, /* SProcUngrabServer, */ - SProcResourceReq, /* SProcQueryPointer, */ - SProcGetMotionEvents, SProcTranslateCoords, /*40 */ - SProcWarpPointer, SProcSetInputFocus, SProcSimpleReq, /* SProcGetInputFocus, */ - SProcSimpleReq, /* QueryKeymap, */ - SProcOpenFont, /* 45 */ - SProcResourceReq, /* SProcCloseFont, */ - SProcResourceReq, /* SProcQueryFont, */ - SProcResourceReq, /* SProcQueryTextExtents, */ - SProcListFonts, SProcListFontsWithInfo, /* 50 */ - SProcSetFontPath, SProcSimpleReq, /* GetFontPath, */ - SProcCreatePixmap, SProcResourceReq, /* SProcFreePixmap, */ - SProcCreateGC, /* 55 */ - SProcChangeGC, SProcCopyGC, SProcSetDashes, SProcSetClipRectangles, SProcResourceReq, /* 60 SProcFreeGC, */ - SProcClearToBackground, SProcCopyArea, SProcCopyPlane, SProcPoly, /* PolyPoint, */ - SProcPoly, /* 65 PolyLine */ - SProcPoly, /* PolySegment, */ - SProcPoly, /* PolyRectangle, */ - SProcPoly, /* PolyArc, */ - SProcFillPoly, SProcPoly, /* 70 PolyFillRectangle */ - SProcPoly, /* PolyFillArc, */ - SProcPutImage, SProcGetImage, SProcPolyText, SProcPolyText, /* 75 */ - SProcImageText, SProcImageText, SProcCreateColormap, SProcResourceReq, /* SProcFreeColormap, */ - SProcCopyColormapAndFree, /* 80 */ - SProcResourceReq, /* SProcInstallColormap, */ - SProcResourceReq, /* SProcUninstallColormap, */ - SProcResourceReq, /* SProcListInstalledColormaps, */ - SProcAllocColor, SProcAllocNamedColor, /* 85 */ - SProcAllocColorCells, SProcAllocColorPlanes, SProcFreeColors, SProcStoreColors, SProcStoreNamedColor, /* 90 */ - SProcQueryColors, SProcLookupColor, SProcCreateCursor, SProcCreateGlyphCursor, SProcResourceReq, /* 95 SProcFreeCursor, */ - SProcRecolorCursor, SProcQueryBestSize, SProcQueryExtension, SProcSimpleReq, /* ListExtensions, */ - SProcChangeKeyboardMapping, /* 100 */ - SProcSimpleReq, /* GetKeyboardMapping, */ - SProcChangeKeyboardControl, SProcSimpleReq, /* GetKeyboardControl, */ - SProcSimpleReq, /* Bell, */ - SProcChangePointerControl, /* 105 */ - SProcSimpleReq, /* GetPointerControl, */ - SProcSetScreenSaver, SProcSimpleReq, /* GetScreenSaver, */ - SProcChangeHosts, SProcSimpleReq, /* 110 ListHosts, */ - SProcSimpleReq, /* SProcChangeAccessControl, */ - SProcSimpleReq, /* SProcChangeCloseDownMode, */ - SProcResourceReq, /* SProcKillClient, */ - SProcRotateProperties, SProcSimpleReq, /* 115 ForceScreenSaver */ - SProcSimpleReq, /* SetPointerMapping, */ - SProcSimpleReq, /* GetPointerMapping, */ - SProcSimpleReq, /* SetModifierMapping, */ - SProcSimpleReq, /* GetModifierMapping, */ - ProcBadRequest, /* 120 */ - ProcBadRequest, ProcBadRequest, ProcBadRequest, ProcBadRequest, ProcBadRequest, /* 125 */ -ProcBadRequest, - SProcNoOperation, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, - ProcBadRequest, ProcBadRequest, ProcBadRequest, ProcBadRequest}; +int (*SwappedProcVector[256]) (ClientPtr /* client */) = { + ProcBadRequest, + SProcCreateWindow, + SProcChangeWindowAttributes, + SProcResourceReq, /* GetWindowAttributes */ + SProcResourceReq, /* DestroyWindow */ + SProcResourceReq, /* 5 DestroySubwindows */ + SProcResourceReq, /* SProcChangeSaveSet, */ + SProcReparentWindow, + SProcResourceReq, /* MapWindow */ + SProcResourceReq, /* MapSubwindows */ + SProcResourceReq, /* 10 UnmapWindow */ + SProcResourceReq, /* UnmapSubwindows */ + SProcConfigureWindow, + SProcResourceReq, /* SProcCirculateWindow, */ + SProcResourceReq, /* GetGeometry */ + SProcResourceReq, /* 15 QueryTree */ + SProcInternAtom, + SProcResourceReq, /* SProcGetAtomName, */ + SProcChangeProperty, + SProcDeleteProperty, + SProcGetProperty, /* 20 */ + SProcResourceReq, /* SProcListProperties, */ + SProcSetSelectionOwner, + SProcResourceReq, /* SProcGetSelectionOwner, */ + SProcConvertSelection, + SProcSendEvent, /* 25 */ + SProcGrabPointer, + SProcResourceReq, /* SProcUngrabPointer, */ + SProcGrabButton, + SProcUngrabButton, + SProcChangeActivePointerGrab, /* 30 */ + SProcGrabKeyboard, + SProcResourceReq, /* SProcUngrabKeyboard, */ + SProcGrabKey, + SProcUngrabKey, + SProcResourceReq, /* 35 SProcAllowEvents, */ + SProcSimpleReq, /* SProcGrabServer, */ + SProcSimpleReq, /* SProcUngrabServer, */ + SProcResourceReq, /* SProcQueryPointer, */ + SProcGetMotionEvents, + SProcTranslateCoords, /*40 */ + SProcWarpPointer, + SProcSetInputFocus, + SProcSimpleReq, /* SProcGetInputFocus, */ + SProcSimpleReq, /* QueryKeymap, */ + SProcOpenFont, /* 45 */ + SProcResourceReq, /* SProcCloseFont, */ + SProcResourceReq, /* SProcQueryFont, */ + SProcResourceReq, /* SProcQueryTextExtents, */ + SProcListFonts, + SProcListFontsWithInfo, /* 50 */ + SProcSetFontPath, + SProcSimpleReq, /* GetFontPath, */ + SProcCreatePixmap, + SProcResourceReq, /* SProcFreePixmap, */ + SProcCreateGC, /* 55 */ + SProcChangeGC, + SProcCopyGC, + SProcSetDashes, + SProcSetClipRectangles, + SProcResourceReq, /* 60 SProcFreeGC, */ + SProcClearToBackground, + SProcCopyArea, + SProcCopyPlane, + SProcPoly, /* PolyPoint, */ + SProcPoly, /* 65 PolyLine */ + SProcPoly, /* PolySegment, */ + SProcPoly, /* PolyRectangle, */ + SProcPoly, /* PolyArc, */ + SProcFillPoly, + SProcPoly, /* 70 PolyFillRectangle */ + SProcPoly, /* PolyFillArc, */ + SProcPutImage, + SProcGetImage, + SProcPolyText, + SProcPolyText, /* 75 */ + SProcImageText, + SProcImageText, + SProcCreateColormap, + SProcResourceReq, /* SProcFreeColormap, */ + SProcCopyColormapAndFree, /* 80 */ + SProcResourceReq, /* SProcInstallColormap, */ + SProcResourceReq, /* SProcUninstallColormap, */ + SProcResourceReq, /* SProcListInstalledColormaps, */ + SProcAllocColor, + SProcAllocNamedColor, /* 85 */ + SProcAllocColorCells, + SProcAllocColorPlanes, + SProcFreeColors, + SProcStoreColors, + SProcStoreNamedColor, /* 90 */ + SProcQueryColors, + SProcLookupColor, + SProcCreateCursor, + SProcCreateGlyphCursor, + SProcResourceReq, /* 95 SProcFreeCursor, */ + SProcRecolorCursor, + SProcQueryBestSize, + SProcQueryExtension, + SProcSimpleReq, /* ListExtensions, */ + SProcChangeKeyboardMapping, /* 100 */ + SProcSimpleReq, /* GetKeyboardMapping, */ + SProcChangeKeyboardControl, + SProcSimpleReq, /* GetKeyboardControl, */ + SProcSimpleReq, /* Bell, */ + SProcChangePointerControl, /* 105 */ + SProcSimpleReq, /* GetPointerControl, */ + SProcSetScreenSaver, + SProcSimpleReq, /* GetScreenSaver, */ + SProcChangeHosts, + SProcSimpleReq, /* 110 ListHosts, */ + SProcSimpleReq, /* SProcChangeAccessControl, */ + SProcSimpleReq, /* SProcChangeCloseDownMode, */ + SProcResourceReq, /* SProcKillClient, */ + SProcRotateProperties, + SProcSimpleReq, /* 115 ForceScreenSaver */ + SProcSimpleReq, /* SetPointerMapping, */ + SProcSimpleReq, /* GetPointerMapping, */ + SProcSimpleReq, /* SetModifierMapping, */ + SProcSimpleReq, /* GetModifierMapping, */ + ProcBadRequest, /* 120 */ + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, /* 125 */ + ProcBadRequest, + SProcNoOperation, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest, + ProcBadRequest +}; EventSwapPtr EventSwapVector[MAXEVENTS] = { (EventSwapPtr) SErrorEvent, @@ -423,32 +588,32 @@ EventSwapPtr EventSwapVector[MAXEVENTS] = { SKeyButtonPtrEvent, SKeyButtonPtrEvent, SKeyButtonPtrEvent, - SKeyButtonPtrEvent, /* 5 */ + SKeyButtonPtrEvent, /* 5 */ SKeyButtonPtrEvent, SEnterLeaveEvent, SEnterLeaveEvent, SFocusEvent, - SFocusEvent, /* 10 */ + SFocusEvent, /* 10 */ SKeymapNotifyEvent, SExposeEvent, SGraphicsExposureEvent, SNoExposureEvent, - SVisibilityEvent, /* 15 */ + SVisibilityEvent, /* 15 */ SCreateNotifyEvent, SDestroyNotifyEvent, SUnmapNotifyEvent, SMapNotifyEvent, - SMapRequestEvent, /* 20 */ + SMapRequestEvent, /* 20 */ SReparentEvent, SConfigureNotifyEvent, SConfigureRequestEvent, SGravityEvent, - SResizeRequestEvent, /* 25 */ + SResizeRequestEvent, /* 25 */ SCirculateEvent, SCirculateEvent, SPropertyEvent, SSelectionClearEvent, - SSelectionRequestEvent, /* 30 */ + SSelectionRequestEvent, /* 30 */ SSelectionNotifyEvent, SColormapEvent, SClientMessageEvent, @@ -554,37 +719,37 @@ ReplySwapPtr ReplySwapVector[256] = { ReplyNotSwappd, (ReplySwapPtr) SGetWindowAttributesReply, ReplyNotSwappd, - ReplyNotSwappd, /* 5 */ + ReplyNotSwappd, /* 5 */ ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, - ReplyNotSwappd, /* 10 */ + ReplyNotSwappd, /* 10 */ ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, (ReplySwapPtr) SGetGeometryReply, - (ReplySwapPtr) SQueryTreeReply, /* 15 */ + (ReplySwapPtr) SQueryTreeReply, /* 15 */ (ReplySwapPtr) SInternAtomReply, (ReplySwapPtr) SGetAtomNameReply, ReplyNotSwappd, ReplyNotSwappd, - (ReplySwapPtr) SGetPropertyReply, /* 20 */ + (ReplySwapPtr) SGetPropertyReply, /* 20 */ (ReplySwapPtr) SListPropertiesReply, ReplyNotSwappd, (ReplySwapPtr) SGetSelectionOwnerReply, ReplyNotSwappd, - ReplyNotSwappd, /* 25 */ - (ReplySwapPtr) SGenericReply, /* SGrabPointerReply, */ + ReplyNotSwappd, /* 25 */ + (ReplySwapPtr) SGenericReply, /* SGrabPointerReply, */ ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, - ReplyNotSwappd, /* 30 */ - (ReplySwapPtr) SGenericReply, /* SGrabKeyboardReply, */ + ReplyNotSwappd, /* 30 */ + (ReplySwapPtr) SGenericReply, /* SGrabKeyboardReply, */ ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, - ReplyNotSwappd, /* 35 */ + ReplyNotSwappd, /* 35 */ ReplyNotSwappd, ReplyNotSwappd, (ReplySwapPtr) SQueryPointerReply, @@ -594,7 +759,7 @@ ReplySwapPtr ReplySwapVector[256] = { ReplyNotSwappd, (ReplySwapPtr) SGetInputFocusReply, (ReplySwapPtr) SQueryKeymapReply, - ReplyNotSwappd, /* 45 */ + ReplyNotSwappd, /* 45 */ ReplyNotSwappd, (ReplySwapPtr) SQueryFontReply, (ReplySwapPtr) SQueryTextExtentsReply, @@ -604,32 +769,32 @@ ReplySwapPtr ReplySwapVector[256] = { (ReplySwapPtr) SGetFontPathReply, ReplyNotSwappd, ReplyNotSwappd, - ReplyNotSwappd, /* 55 */ + ReplyNotSwappd, /* 55 */ ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, - ReplyNotSwappd, /* 60 */ + ReplyNotSwappd, /* 60 */ ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, - ReplyNotSwappd, /* 65 */ + ReplyNotSwappd, /* 65 */ ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, - ReplyNotSwappd, /* 70 */ + ReplyNotSwappd, /* 70 */ ReplyNotSwappd, ReplyNotSwappd, (ReplySwapPtr) SGetImageReply, ReplyNotSwappd, - ReplyNotSwappd, /* 75 */ + ReplyNotSwappd, /* 75 */ ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, - ReplyNotSwappd, /* 80 */ + ReplyNotSwappd, /* 80 */ ReplyNotSwappd, ReplyNotSwappd, (ReplySwapPtr) SListInstalledColormapsReply, @@ -639,44 +804,44 @@ ReplySwapPtr ReplySwapVector[256] = { (ReplySwapPtr) SAllocColorPlanesReply, ReplyNotSwappd, ReplyNotSwappd, - ReplyNotSwappd, /* 90 */ + ReplyNotSwappd, /* 90 */ (ReplySwapPtr) SQueryColorsReply, (ReplySwapPtr) SLookupColorReply, ReplyNotSwappd, ReplyNotSwappd, - ReplyNotSwappd, /* 95 */ + ReplyNotSwappd, /* 95 */ ReplyNotSwappd, (ReplySwapPtr) SQueryBestSizeReply, - (ReplySwapPtr) SGenericReply, /* SQueryExtensionReply, */ + (ReplySwapPtr) SGenericReply, /* SQueryExtensionReply, */ (ReplySwapPtr) SListExtensionsReply, - ReplyNotSwappd, /* 100 */ + ReplyNotSwappd, /* 100 */ (ReplySwapPtr) SGetKeyboardMappingReply, ReplyNotSwappd, (ReplySwapPtr) SGetKeyboardControlReply, ReplyNotSwappd, - ReplyNotSwappd, /* 105 */ + ReplyNotSwappd, /* 105 */ (ReplySwapPtr) SGetPointerControlReply, ReplyNotSwappd, (ReplySwapPtr) SGetScreenSaverReply, ReplyNotSwappd, - (ReplySwapPtr) SListHostsReply, /* 110 */ + (ReplySwapPtr) SListHostsReply, /* 110 */ ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, - ReplyNotSwappd, /* 115 */ - (ReplySwapPtr) SGenericReply, /* SetPointerMapping */ + ReplyNotSwappd, /* 115 */ + (ReplySwapPtr) SGenericReply, /* SetPointerMapping */ (ReplySwapPtr) SGetPointerMappingReply, - (ReplySwapPtr) SGenericReply, /* SetModifierMapping */ + (ReplySwapPtr) SGenericReply, /* SetModifierMapping */ (ReplySwapPtr) SGetModifierMappingReply, /* 119 */ - ReplyNotSwappd, /* 120 */ - ReplyNotSwappd, /* 121 */ - ReplyNotSwappd, /* 122 */ - ReplyNotSwappd, /* 123 */ - ReplyNotSwappd, /* 124 */ - ReplyNotSwappd, /* 125 */ - ReplyNotSwappd, /* 126 */ - ReplyNotSwappd, /* NoOperation */ + ReplyNotSwappd, /* 120 */ + ReplyNotSwappd, /* 121 */ + ReplyNotSwappd, /* 122 */ + ReplyNotSwappd, /* 123 */ + ReplyNotSwappd, /* 124 */ + ReplyNotSwappd, /* 125 */ + ReplyNotSwappd, /* 126 */ + ReplyNotSwappd, /* NoOperation */ ReplyNotSwappd, ReplyNotSwappd, ReplyNotSwappd, diff --git a/xserver/dix/touch.c b/xserver/dix/touch.c index 04733ab35..891cc7803 100644 --- a/xserver/dix/touch.c +++ b/xserver/dix/touch.c @@ -103,11 +103,11 @@ TouchResizeQueue(ClientPtr client, pointer closure) tmp = realloc(dev->last.touches, size * sizeof(*dev->last.touches)); if (tmp) { - int i; + int j; dev->last.touches = tmp; - for (i = dev->last.num_touches; i < size; i++) - TouchInitDDXTouchPoint(dev, &dev->last.touches[i]); + for (j = dev->last.num_touches; j < size; j++) + TouchInitDDXTouchPoint(dev, &dev->last.touches[j]); dev->last.num_touches = size; } @@ -160,11 +160,13 @@ TouchBeginDDXTouch(DeviceIntPtr dev, uint32_t ddx_id) int i; TouchClassPtr t = dev->touch; DDXTouchPointInfoPtr ti = NULL; - Bool emulate_pointer = (t->mode == XIDirectTouch); + Bool emulate_pointer; if (!t) return NULL; + emulate_pointer = (t->mode == XIDirectTouch); + /* Look for another active touchpoint with the same DDX ID. DDX * touchpoints must be unique. */ if (TouchFindByDDXID(dev, ddx_id, FALSE)) @@ -198,8 +200,9 @@ TouchBeginDDXTouch(DeviceIntPtr dev, uint32_t ddx_id) /* If we get here, then we've run out of touches and we need to drop the * event (we're inside the SIGIO handler here) schedule a WorkProc to * grow the queue for us for next time. */ - ErrorF("%s: not enough space for touch events (max %d touchpoints). " - "Dropping this event.\n", dev->name, dev->last.num_touches); + ErrorFSigSafe("%s: not enough space for touch events (max %u touchpoints). " + "Dropping this event.\n", dev->name, dev->last.num_touches); + if (!BitIsOn(resize_waiting, dev->id)) { SetBit(resize_waiting, dev->id); QueueWorkProc(TouchResizeQueue, serverClient, NULL); @@ -460,45 +463,14 @@ TouchEventHistoryPush(TouchPointInfoPtr ti, const DeviceEvent *ev) void TouchEventHistoryReplay(TouchPointInfoPtr ti, DeviceIntPtr dev, XID resource) { - InternalEvent *tel; - ValuatorMask *mask; - int i, nev; - int flags; + int i; if (!ti->history) return; - tel = InitEventList(GetMaximumEventsNum()); - mask = valuator_mask_new(0); + TouchDeliverDeviceClassesChangedEvent(ti, ti->history[0].time, resource); - valuator_mask_set_double(mask, 0, ti->history[0].valuators.data[0]); - valuator_mask_set_double(mask, 1, ti->history[0].valuators.data[1]); - - flags = TOUCH_CLIENT_ID | TOUCH_REPLAYING; - if (ti->emulate_pointer) - flags |= TOUCH_POINTER_EMULATED; - /* Generate events based on a fake touch begin event to get DCCE events if - * needed */ - /* FIXME: This needs to be cleaned up */ - nev = GetTouchEvents(tel, dev, ti->client_id, XI_TouchBegin, flags, mask); - for (i = 0; i < nev; i++) { - /* Send saved touch begin event */ - if (tel[i].any.type == ET_TouchBegin) { - DeviceEvent *ev = &ti->history[0]; - ev->flags |= TOUCH_REPLAYING; - DeliverTouchEvents(dev, ti, (InternalEvent*)ev, resource); - } - else {/* Send DCCE event */ - tel[i].any.time = ti->history[0].time; - DeliverTouchEvents(dev, ti, tel + i, resource); - } - } - - valuator_mask_free(&mask); - FreeEventList(tel, GetMaximumEventsNum()); - - /* First event was TouchBegin, already replayed that one */ - for (i = 1; i < ti->history_elements; i++) { + for (i = 0; i < ti->history_elements; i++) { DeviceEvent *ev = &ti->history[i]; ev->flags |= TOUCH_REPLAYING; @@ -506,6 +478,30 @@ TouchEventHistoryReplay(TouchPointInfoPtr ti, DeviceIntPtr dev, XID resource) } } +void +TouchDeliverDeviceClassesChangedEvent(TouchPointInfoPtr ti, Time time, + XID resource) +{ + DeviceIntPtr dev; + int num_events = 0; + InternalEvent dcce; + + dixLookupDevice(&dev, ti->sourceid, serverClient, DixWriteAccess); + + if (!dev) + return; + + /* UpdateFromMaster generates at most one event */ + UpdateFromMaster(&dcce, dev, DEVCHANGE_POINTER_EVENT, &num_events); + BUG_WARN(num_events > 1); + + if (num_events) { + dcce.any.time = time; + /* FIXME: This doesn't do anything */ + dev->public.processInputProc(&dcce, dev); + } +} + Bool TouchBuildDependentSpriteTrace(DeviceIntPtr dev, SpritePtr sprite) { @@ -569,8 +565,8 @@ TouchBuildSprite(DeviceIntPtr sourcedev, TouchPointInfoPtr ti, return FALSE; /* Mark which grabs/event selections we're delivering to: max one grab per - * window plus the bottom-most event selection. */ - ti->listeners = calloc(sprite->spriteTraceGood + 1, sizeof(*ti->listeners)); + * window plus the bottom-most event selection, plus any active grab. */ + ti->listeners = calloc(sprite->spriteTraceGood + 2, sizeof(*ti->listeners)); if (!ti->listeners) { sprite->spriteTraceGood = 0; return FALSE; @@ -601,8 +597,8 @@ TouchConvertToPointerEvent(const InternalEvent *event, int ptrtype; int nevents = 0; - BUG_WARN(!event); - BUG_WARN(!motion_event); + BUG_RETURN_VAL(!event, 0); + BUG_RETURN_VAL(!motion_event, 0); switch (event->any.type) { case ET_TouchUpdate: @@ -630,7 +626,7 @@ TouchConvertToPointerEvent(const InternalEvent *event, motion_event->device_event.flags = XIPointerEmulated; if (nevents > 1) { - BUG_WARN(!button_event); + BUG_RETURN_VAL(!button_event, 0); *button_event = *event; button_event->any.type = ptrtype; button_event->device_event.flags = XIPointerEmulated; @@ -679,15 +675,20 @@ TouchResourceIsOwner(TouchPointInfoPtr ti, XID resource) * Add the resource to this touch's listeners. */ void -TouchAddListener(TouchPointInfoPtr ti, XID resource, enum InputLevel level, - enum TouchListenerType type, enum TouchListenerState state, - WindowPtr window) +TouchAddListener(TouchPointInfoPtr ti, XID resource, int resource_type, + enum InputLevel level, enum TouchListenerType type, + enum TouchListenerState state, WindowPtr window, + GrabPtr grab) { ti->listeners[ti->num_listeners].listener = resource; + ti->listeners[ti->num_listeners].resource_type = resource_type; ti->listeners[ti->num_listeners].level = level; ti->listeners[ti->num_listeners].state = state; ti->listeners[ti->num_listeners].type = type; ti->listeners[ti->num_listeners].window = window; + ti->listeners[ti->num_listeners].grab = grab; + if (grab) + ti->num_grabs++; ti->num_listeners++; } @@ -706,6 +707,11 @@ TouchRemoveListener(TouchPointInfoPtr ti, XID resource) if (ti->listeners[i].listener == resource) { int j; + if (ti->listeners[i].grab) { + ti->listeners[i].grab = NULL; + ti->num_grabs--; + } + for (j = i; j < ti->num_listeners - 1; j++) ti->listeners[j] = ti->listeners[j + 1]; ti->num_listeners--; @@ -736,9 +742,9 @@ TouchAddGrabListener(DeviceIntPtr dev, TouchPointInfoPtr ti, type = LISTENER_POINTER_GRAB; } - TouchAddListener(ti, grab->resource, grab->grabtype, - type, LISTENER_AWAITING_BEGIN, grab->window); - ti->num_grabs++; + /* grab listeners are always RT_NONE since we keep the grab pointer */ + TouchAddListener(ti, grab->resource, RT_NONE, grab->grabtype, + type, LISTENER_AWAITING_BEGIN, grab->window, grab); } /** @@ -793,8 +799,8 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti, if (!xi2mask_isset(iclients->xi2mask, dev, XI_TouchOwnership)) TouchEventHistoryAllocate(ti); - TouchAddListener(ti, iclients->resource, XI2, - type, LISTENER_AWAITING_BEGIN, win); + TouchAddListener(ti, iclients->resource, RT_INPUTCLIENT, XI2, + type, LISTENER_AWAITING_BEGIN, win, NULL); return TRUE; } } @@ -808,9 +814,9 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti, continue; TouchEventHistoryAllocate(ti); - TouchAddListener(ti, iclients->resource, XI, + TouchAddListener(ti, iclients->resource, RT_INPUTCLIENT, XI, LISTENER_POINTER_REGULAR, LISTENER_AWAITING_BEGIN, - win); + win, NULL); return TRUE; } } @@ -823,9 +829,9 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti, /* window owner */ if (IsMaster(dev) && (win->eventMask & core_filter)) { TouchEventHistoryAllocate(ti); - TouchAddListener(ti, win->drawable.id, CORE, + TouchAddListener(ti, win->drawable.id, RT_WINDOW, CORE, LISTENER_POINTER_REGULAR, LISTENER_AWAITING_BEGIN, - win); + win, NULL); return TRUE; } @@ -835,8 +841,8 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti, continue; TouchEventHistoryAllocate(ti); - TouchAddListener(ti, oclients->resource, CORE, - type, LISTENER_AWAITING_BEGIN, win); + TouchAddListener(ti, oclients->resource, RT_OTHERCLIENT, CORE, + type, LISTENER_AWAITING_BEGIN, win, NULL); return TRUE; } } @@ -896,7 +902,8 @@ TouchSetupListeners(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev) } /** - * Remove the touch pointer grab from the device. Called from AllowSome() + * Remove the touch pointer grab from the device. Called from + * DeactivatePointerGrab() */ void TouchRemovePointerGrab(DeviceIntPtr dev) @@ -919,6 +926,8 @@ TouchRemovePointerGrab(DeviceIntPtr dev) ti = TouchFindByClientID(dev, ev->touchid); if (!ti) return; + + /* FIXME: missing a bit of code here... */ } /* As touch grabs don't turn into active grabs with their own resources, we @@ -969,10 +978,8 @@ TouchListenerAcceptReject(DeviceIntPtr dev, TouchPointInfoPtr ti, int listener, int nev; int i; - BUG_WARN(listener < 0); - BUG_WARN(listener >= ti->num_listeners); - if (listener < 0 || listener >= ti->num_listeners) - return BadMatch; + BUG_RETURN_VAL(listener < 0, BadMatch); + BUG_RETURN_VAL(listener >= ti->num_listeners, BadMatch); if (listener > 0) { if (mode == XIRejectTouch) @@ -984,10 +991,7 @@ TouchListenerAcceptReject(DeviceIntPtr dev, TouchPointInfoPtr ti, int listener, } events = InitEventList(GetMaximumEventsNum()); - if (!events) { - BUG_WARN_MSG(TRUE, "Failed to allocate touch ownership events\n"); - return BadAlloc; - } + BUG_RETURN_VAL_MSG(!events, BadAlloc, "Failed to allocate touch ownership events\n"); nev = GetTouchOwnershipEvents(events, dev, ti, mode, ti->listeners[0].listener, 0); @@ -996,8 +1000,6 @@ TouchListenerAcceptReject(DeviceIntPtr dev, TouchPointInfoPtr ti, int listener, for (i = 0; i < nev; i++) mieqProcessDeviceEvent(dev, events + i, NULL); - ProcessInputEvents(); - FreeEventList(events, GetMaximumEventsNum()); return nev ? Success : BadMatch; @@ -1031,3 +1033,31 @@ TouchAcceptReject(ClientPtr client, DeviceIntPtr dev, int mode, return TouchListenerAcceptReject(dev, ti, i, mode); } + +/** + * End physically active touches for a device. + */ +void +TouchEndPhysicallyActiveTouches(DeviceIntPtr dev) +{ + InternalEvent *eventlist = InitEventList(GetMaximumEventsNum()); + int i; + + OsBlockSignals(); + mieqProcessInputEvents(); + for (i = 0; i < dev->last.num_touches; i++) { + DDXTouchPointInfoPtr ddxti = dev->last.touches + i; + + if (ddxti->active) { + int j; + int nevents = GetTouchEvents(eventlist, dev, ddxti->ddx_id, + XI_TouchEnd, 0, NULL); + + for (j = 0; j < nevents; j++) + mieqProcessDeviceEvent(dev, eventlist + j, NULL); + } + } + OsReleaseSignals(); + + FreeEventList(eventlist, GetMaximumEventsNum()); +} diff --git a/xserver/dix/window.c b/xserver/dix/window.c index a31e78fad..a5b28a630 100644 --- a/xserver/dix/window.c +++ b/xserver/dix/window.c @@ -446,7 +446,7 @@ CreateRootWindow(ScreenPtr pScreen) BoxRec box; PixmapFormatRec *format; - pWin = dixAllocateObjectWithPrivates(WindowRec, PRIVATE_WINDOW); + pWin = dixAllocateScreenObjectWithPrivates(pScreen, WindowRec, PRIVATE_WINDOW); if (!pWin) return FALSE; @@ -641,7 +641,6 @@ CreateWindow(Window wid, WindowPtr pParent, int x, int y, unsigned w, WindowPtr pWin; WindowPtr pHead; ScreenPtr pScreen; - xEvent event; int idepth, ivisual; Bool fOK; DepthPtr pDepth; @@ -681,7 +680,7 @@ CreateWindow(Window wid, WindowPtr pParent, int x, int y, unsigned w, if ((visual != ancwopt->visual) || (depth != pParent->drawable.depth)) { fOK = FALSE; for (idepth = 0; idepth < pScreen->numDepths; idepth++) { - pDepth = (DepthPtr) & pScreen->allowedDepths[idepth]; + pDepth = (DepthPtr) &pScreen->allowedDepths[idepth]; if ((depth == pDepth->depth) || (depth == 0)) { for (ivisual = 0; ivisual < pDepth->numVids; ivisual++) { if (visual == pDepth->vids[ivisual]) { @@ -710,7 +709,7 @@ CreateWindow(Window wid, WindowPtr pParent, int x, int y, unsigned w, return NullWindow; } - pWin = dixAllocateObjectWithPrivates(WindowRec, PRIVATE_WINDOW); + pWin = dixAllocateScreenObjectWithPrivates(pScreen, WindowRec, PRIVATE_WINDOW); if (!pWin) { *error = BadAlloc; return NullWindow; @@ -828,16 +827,17 @@ CreateWindow(Window wid, WindowPtr pParent, int x, int y, unsigned w, } if (SubSend(pParent)) { - memset(&event, 0, sizeof(xEvent)); + xEvent event = { + .u.createNotify.window = wid, + .u.createNotify.parent = pParent->drawable.id, + .u.createNotify.x = x, + .u.createNotify.y = y, + .u.createNotify.width = w, + .u.createNotify.height = h, + .u.createNotify.borderWidth = bw, + .u.createNotify.override = pWin->overrideRedirect + }; event.u.u.type = CreateNotify; - event.u.createNotify.window = wid; - event.u.createNotify.parent = pParent->drawable.id; - event.u.createNotify.x = x; - event.u.createNotify.y = y; - event.u.createNotify.width = w; - event.u.createNotify.height = h; - event.u.createNotify.borderWidth = bw; - event.u.createNotify.override = pWin->overrideRedirect; DeliverEvents(pParent, &event, 1, NullWindow); } return pWin; @@ -912,7 +912,6 @@ CrushTree(WindowPtr pWin) { WindowPtr pChild, pSib, pParent; UnrealizeWindowProcPtr UnrealizeWindow; - xEvent event; if (!(pChild = pWin->firstChild)) return; @@ -925,8 +924,7 @@ CrushTree(WindowPtr pWin) while (1) { pParent = pChild->parent; if (SubStrSend(pChild, pParent)) { - memset(&event, 0, sizeof(xEvent)); - event.u.u.type = DestroyNotify; + xEvent event = { .u.u.type = DestroyNotify }; event.u.destroyNotify.window = pChild->drawable.id; DeliverEvents(pChild, &event, 1, NullWindow); } @@ -961,7 +959,6 @@ DeleteWindow(pointer value, XID wid) { WindowPtr pParent; WindowPtr pWin = (WindowPtr) value; - xEvent event; UnmapWindow(pWin, FALSE); @@ -969,8 +966,7 @@ DeleteWindow(pointer value, XID wid) pParent = pWin->parent; if (wid && pParent && SubStrSend(pWin, pParent)) { - memset(&event, 0, sizeof(xEvent)); - event.u.u.type = DestroyNotify; + xEvent event = { .u.u.type = DestroyNotify }; event.u.destroyNotify.window = pWin->drawable.id; DeliverEvents(pWin, &event, 1, NullWindow); } @@ -1355,11 +1351,13 @@ ChangeWindowAttributes(WindowPtr pWin, Mask vmask, XID *vlist, ClientPtr client) CheckWindowOptionalNeed(pChild); } + xE = (xEvent) { + .u.colormap.window = pWin->drawable.id, + .u.colormap.colormap = cmap, + .u.colormap.new = xTrue, + .u.colormap.state = IsMapInstalled(cmap, pWin) + }; xE.u.u.type = ColormapNotify; - xE.u.colormap.window = pWin->drawable.id; - xE.u.colormap.colormap = cmap; - xE.u.colormap.new = xTrue; - xE.u.colormap.state = IsMapInstalled(cmap, pWin); DeliverEvents(pWin, &xE, 1, NullWindow); } break; @@ -1746,12 +1744,12 @@ ResizeChildrenWinSize(WindowPtr pWin, int dx, int dy, int dw, int dh) GravityTranslate(cwsx, cwsy, cwsx - dx, cwsy - dy, dw, dh, pSib->winGravity, &cwsx, &cwsy); if (cwsx != pSib->origin.x || cwsy != pSib->origin.y) { - xEvent event; - + xEvent event = { + .u.gravity.window = pSib->drawable.id, + .u.gravity.x = cwsx - wBorderWidth(pSib), + .u.gravity.y = cwsy - wBorderWidth(pSib) + }; event.u.u.type = GravityNotify; - event.u.gravity.window = pSib->drawable.id; - event.u.gravity.x = cwsx - wBorderWidth(pSib); - event.u.gravity.y = cwsy - wBorderWidth(pSib); DeliverEvents(pSib, &event, 1, NullWindow); pSib->origin.x = cwsx; pSib->origin.y = cwsy; @@ -1888,8 +1886,7 @@ AnyWindowOverlapsMe(WindowPtr pWin, WindowPtr pHead, BoxPtr box) if (pSib->mapped) { sbox = WindowExtents(pSib, &sboxrec); if (BOXES_OVERLAP(sbox, box) - && ShapeOverlap(pWin, box, pSib, sbox) - ) + && ShapeOverlap(pWin, box, pSib, sbox)) return TRUE; } } @@ -1907,8 +1904,7 @@ IOverlapAnyWindow(WindowPtr pWin, BoxPtr box) if (pSib->mapped) { sbox = WindowExtents(pSib, &sboxrec); if (BOXES_OVERLAP(sbox, box) - && ShapeOverlap(pWin, box, pSib, sbox) - ) + && ShapeOverlap(pWin, box, pSib, sbox)) return TRUE; } } @@ -2090,7 +2086,6 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client) unsigned short w = pWin->drawable.width, h = pWin->drawable.height, bw = pWin->borderWidth; int rc, action, smode = Above; - xEvent event; if ((pWin->drawable.class == InputOnly) && (mask & IllegalInputOnlyConfigureMask)) @@ -2177,32 +2172,26 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client) else pSib = pWin->nextSib; - if ((!pWin->overrideRedirect) && (RedirectSend(pParent) - )) { - memset(&event, 0, sizeof(xEvent)); + if ((!pWin->overrideRedirect) && (RedirectSend(pParent))) { + xEvent event = { + .u.configureRequest.window = pWin->drawable.id, + .u.configureRequest.sibling = (mask & CWSibling) ? sibwid : None, + .u.configureRequest.x = x, + .u.configureRequest.y = y, + .u.configureRequest.width = w, + .u.configureRequest.height = h, + .u.configureRequest.borderWidth = bw, + .u.configureRequest.valueMask = mask, + .u.configureRequest.parent = pParent->drawable.id + }; event.u.u.type = ConfigureRequest; - event.u.configureRequest.window = pWin->drawable.id; - if (mask & CWSibling) - event.u.configureRequest.sibling = sibwid; - else - event.u.configureRequest.sibling = None; - if (mask & CWStackMode) - event.u.u.detail = smode; - else - event.u.u.detail = Above; - event.u.configureRequest.x = x; - event.u.configureRequest.y = y; + event.u.u.detail = (mask & CWStackMode) ? smode : Above; #ifdef PANORAMIX if (!noPanoramiXExtension && (!pParent || !pParent->parent)) { event.u.configureRequest.x += screenInfo.screens[0]->x; event.u.configureRequest.y += screenInfo.screens[0]->y; } #endif - event.u.configureRequest.width = w; - event.u.configureRequest.height = h; - event.u.configureRequest.borderWidth = bw; - event.u.configureRequest.valueMask = mask; - event.u.configureRequest.parent = pParent->drawable.id; if (MaybeDeliverEventsToClient(pParent, &event, 1, SubstructureRedirectMask, client) == 1) return Success; @@ -2213,13 +2202,12 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client) if (size_change && ((pWin->eventMask | wOtherEventMasks(pWin)) & ResizeRedirectMask)) { - xEvent eventT; - - memset(&eventT, 0, sizeof(xEvent)); + xEvent eventT = { + .u.resizeRequest.window = pWin->drawable.id, + .u.resizeRequest.width = w, + .u.resizeRequest.height = h + }; eventT.u.u.type = ResizeRequest; - eventT.u.resizeRequest.window = pWin->drawable.id; - eventT.u.resizeRequest.width = w; - eventT.u.resizeRequest.height = h; if (MaybeDeliverEventsToClient(pWin, &eventT, 1, ResizeRedirectMask, client) == 1) { /* if event is delivered, leave the actual size alone. */ @@ -2270,25 +2258,23 @@ ConfigureWindow(WindowPtr pWin, Mask mask, XID *vlist, ClientPtr client) } if (SubStrSend(pWin, pParent)) { - memset(&event, 0, sizeof(xEvent)); + xEvent event = { + .u.configureNotify.window = pWin->drawable.id, + .u.configureNotify.aboveSibling = pSib ? pSib->drawable.id : None, + .u.configureNotify.x = x, + .u.configureNotify.y = y, + .u.configureNotify.width = w, + .u.configureNotify.height = h, + .u.configureNotify.borderWidth = bw, + .u.configureNotify.override = pWin->overrideRedirect + }; event.u.u.type = ConfigureNotify; - event.u.configureNotify.window = pWin->drawable.id; - if (pSib) - event.u.configureNotify.aboveSibling = pSib->drawable.id; - else - event.u.configureNotify.aboveSibling = None; - event.u.configureNotify.x = x; - event.u.configureNotify.y = y; #ifdef PANORAMIX if (!noPanoramiXExtension && (!pParent || !pParent->parent)) { event.u.configureNotify.x += screenInfo.screens[0]->x; event.u.configureNotify.y += screenInfo.screens[0]->y; } #endif - event.u.configureNotify.width = w; - event.u.configureNotify.height = h; - event.u.configureNotify.borderWidth = bw; - event.u.configureNotify.override = pWin->overrideRedirect; DeliverEvents(pWin, &event, 1, NullWindow); } if (mask & CWBorderWidth) { @@ -2361,13 +2347,13 @@ CirculateWindow(WindowPtr pParent, int direction, ClientPtr client) return Success; } - event.u.circulate.window = pWin->drawable.id; - event.u.circulate.parent = pParent->drawable.id; - event.u.circulate.event = pParent->drawable.id; - if (direction == RaiseLowest) - event.u.circulate.place = PlaceOnTop; - else - event.u.circulate.place = PlaceOnBottom; + event = (xEvent) { + .u.circulate.window = pWin->drawable.id, + .u.circulate.parent = pParent->drawable.id, + .u.circulate.event = pParent->drawable.id, + .u.circulate.place = (direction == RaiseLowest) ? + PlaceOnTop : PlaceOnBottom, + }; if (RedirectSend(pParent)) { event.u.u.type = CirculateRequest; @@ -2420,19 +2406,20 @@ ReparentWindow(WindowPtr pWin, WindowPtr pParent, if (WasMapped) UnmapWindow(pWin, FALSE); - memset(&event, 0, sizeof(xEvent)); + event = (xEvent) { + .u.reparent.window = pWin->drawable.id, + .u.reparent.parent = pParent->drawable.id, + .u.reparent.x = x, + .u.reparent.y = y, + .u.reparent.override = pWin->overrideRedirect + }; event.u.u.type = ReparentNotify; - event.u.reparent.window = pWin->drawable.id; - event.u.reparent.parent = pParent->drawable.id; - event.u.reparent.x = x; - event.u.reparent.y = y; #ifdef PANORAMIX if (!noPanoramiXExtension && !pParent->parent) { event.u.reparent.x += screenInfo.screens[0]->x; event.u.reparent.y += screenInfo.screens[0]->y; } #endif - event.u.reparent.override = pWin->overrideRedirect; DeliverEvents(pWin, &event, 1, pParent); /* take out of sibling chain */ @@ -2518,28 +2505,29 @@ RealizeTree(WindowPtr pWin) } } -static WindowPtr windowDisableMapUnmapEvents; - -void -DisableMapUnmapEvents(WindowPtr pWin) -{ - assert(windowDisableMapUnmapEvents == NULL); - - windowDisableMapUnmapEvents = pWin; -} - -void -EnableMapUnmapEvents(WindowPtr pWin) -{ - assert(windowDisableMapUnmapEvents != NULL); - - windowDisableMapUnmapEvents = NULL; -} - static Bool -MapUnmapEventsEnabled(WindowPtr pWin) +MaybeDeliverMapRequest(WindowPtr pWin, WindowPtr pParent, ClientPtr client) { - return pWin != windowDisableMapUnmapEvents; + xEvent event = { + .u.mapRequest.window = pWin->drawable.id, + .u.mapRequest.parent = pParent->drawable.id + }; + event.u.u.type = MapRequest; + + return MaybeDeliverEventsToClient(pParent, &event, 1, + SubstructureRedirectMask, + client) == 1; +} + +static void +DeliverMapNotify(WindowPtr pWin) +{ + xEvent event = { + .u.mapNotify.window = pWin->drawable.id, + .u.mapNotify.override = pWin->overrideRedirect, + }; + event.u.u.type = MapNotify; + DeliverEvents(pWin, &event, 1, NullWindow); } /***** @@ -2561,37 +2549,22 @@ MapWindow(WindowPtr pWin, ClientPtr client) if (pWin->mapped) return Success; - /* general check for permission to map window */ + /* general check for permission to map window */ if (XaceHook(XACE_RESOURCE_ACCESS, client, pWin->drawable.id, RT_WINDOW, pWin, RT_NONE, NULL, DixShowAccess) != Success) return Success; pScreen = pWin->drawable.pScreen; if ((pParent = pWin->parent)) { - xEvent event; Bool anyMarked; - if ((!pWin->overrideRedirect) && (RedirectSend(pParent) - )) { - memset(&event, 0, sizeof(xEvent)); - event.u.u.type = MapRequest; - event.u.mapRequest.window = pWin->drawable.id; - event.u.mapRequest.parent = pParent->drawable.id; - - if (MaybeDeliverEventsToClient(pParent, &event, 1, - SubstructureRedirectMask, - client) == 1) + if ((!pWin->overrideRedirect) && (RedirectSend(pParent))) + if (MaybeDeliverMapRequest(pWin, pParent, client)) return Success; - } pWin->mapped = TRUE; - if (SubStrSend(pWin, pParent) && MapUnmapEventsEnabled(pWin)) { - memset(&event, 0, sizeof(xEvent)); - event.u.u.type = MapNotify; - event.u.mapNotify.window = pWin->drawable.id; - event.u.mapNotify.override = pWin->overrideRedirect; - DeliverEvents(pWin, &event, 1, NullWindow); - } + if (SubStrSend(pWin, pParent)) + DeliverMapNotify(pWin); if (!pParent->realized) return Success; @@ -2644,7 +2617,6 @@ MapSubwindows(WindowPtr pParent, ClientPtr client) ScreenPtr pScreen; Mask parentRedirect; Mask parentNotify; - xEvent event; Bool anyMarked; WindowPtr pLayerWin; @@ -2654,26 +2626,13 @@ MapSubwindows(WindowPtr pParent, ClientPtr client) anyMarked = FALSE; for (pWin = pParent->firstChild; pWin; pWin = pWin->nextSib) { if (!pWin->mapped) { - if (parentRedirect && !pWin->overrideRedirect) { - memset(&event, 0, sizeof(xEvent)); - event.u.u.type = MapRequest; - event.u.mapRequest.window = pWin->drawable.id; - event.u.mapRequest.parent = pParent->drawable.id; - - if (MaybeDeliverEventsToClient(pParent, &event, 1, - SubstructureRedirectMask, - client) == 1) + if (parentRedirect && !pWin->overrideRedirect) + if (MaybeDeliverMapRequest(pWin, pParent, client)) continue; - } pWin->mapped = TRUE; - if (parentNotify || StrSend(pWin)) { - memset(&event, 0, sizeof(xEvent)); - event.u.u.type = MapNotify; - event.u.mapNotify.window = pWin->drawable.id; - event.u.mapNotify.override = pWin->overrideRedirect; - DeliverEvents(pWin, &event, 1, NullWindow); - } + if (parentNotify || StrSend(pWin)) + DeliverMapNotify(pWin); if (!pFirstMapped) pFirstMapped = pWin; @@ -2734,8 +2693,7 @@ UnrealizeTree(WindowPtr pWin, Bool fromConfigure) } #endif (*Unrealize) (pChild); - if (MapUnmapEventsEnabled(pWin)) - DeleteWindowFromAnyEvents(pChild, FALSE); + DeleteWindowFromAnyEvents(pChild, FALSE); if (pChild->viewable) { pChild->viewable = FALSE; (*MarkUnrealizedWindow) (pChild, pWin, fromConfigure); @@ -2754,6 +2712,17 @@ UnrealizeTree(WindowPtr pWin, Bool fromConfigure) } } +static void +DeliverUnmapNotify(WindowPtr pWin, Bool fromConfigure) +{ + xEvent event = { + .u.unmapNotify.window = pWin->drawable.id, + .u.unmapNotify.fromConfigure = fromConfigure + }; + event.u.u.type = UnmapNotify; + DeliverEvents(pWin, &event, 1, NullWindow); +} + /***** * UnmapWindow * If the window is already unmapped, this request has no effect. @@ -2765,7 +2734,6 @@ int UnmapWindow(WindowPtr pWin, Bool fromConfigure) { WindowPtr pParent; - xEvent event; Bool wasRealized = (Bool) pWin->realized; Bool wasViewable = (Bool) pWin->viewable; ScreenPtr pScreen = pWin->drawable.pScreen; @@ -2773,13 +2741,8 @@ UnmapWindow(WindowPtr pWin, Bool fromConfigure) if ((!pWin->mapped) || (!(pParent = pWin->parent))) return Success; - if (SubStrSend(pWin, pParent) && MapUnmapEventsEnabled(pWin)) { - memset(&event, 0, sizeof(xEvent)); - event.u.u.type = UnmapNotify; - event.u.unmapNotify.window = pWin->drawable.id; - event.u.unmapNotify.fromConfigure = fromConfigure; - DeliverEvents(pWin, &event, 1, NullWindow); - } + if (SubStrSend(pWin, pParent)) + DeliverUnmapNotify(pWin, fromConfigure); if (wasViewable && !fromConfigure) { pWin->valdata = UnmapValData; (*pScreen->MarkOverlappedWindows) (pWin, pWin->nextSib, &pLayerWin); @@ -2813,7 +2776,6 @@ void UnmapSubwindows(WindowPtr pWin) { WindowPtr pChild, pHead; - xEvent event; Bool wasRealized = (Bool) pWin->realized; Bool wasViewable = (Bool) pWin->viewable; Bool anyMarked = FALSE; @@ -2831,12 +2793,8 @@ UnmapSubwindows(WindowPtr pWin) for (pChild = pWin->lastChild; pChild != pHead; pChild = pChild->prevSib) { if (pChild->mapped) { - if (parentNotify || StrSend(pChild)) { - event.u.u.type = UnmapNotify; - event.u.unmapNotify.window = pChild->drawable.id; - event.u.unmapNotify.fromConfigure = xFalse; - DeliverEvents(pChild, &event, 1, NullWindow); - } + if (parentNotify || StrSend(pChild)) + DeliverUnmapNotify(pChild, xFalse); if (pChild->viewable) { pChild->valdata = UnmapValData; anyMarked = TRUE; @@ -2963,8 +2921,6 @@ SendVisibilityNotify(WindowPtr pWin) xEvent event; unsigned int visibility = pWin->visibility; - if (!MapUnmapEventsEnabled(pWin)) - return; #ifdef PANORAMIX /* This is not quite correct yet, but it's close */ if (!noPanoramiXExtension) { @@ -3028,10 +2984,11 @@ SendVisibilityNotify(WindowPtr pWin) } #endif - memset(&event, 0, sizeof(xEvent)); + event = (xEvent) { + .u.visibility.window = pWin->drawable.id, + .u.visibility.state = visibility + }; event.u.u.type = VisibilityNotify; - event.u.visibility.window = pWin->drawable.id; - event.u.visibility.state = visibility; DeliverEvents(pWin, &event, 1, NullWindow); } @@ -3134,8 +3091,12 @@ dixSaveScreens(ClientPtr client, int on, int mode) screenIsSaved = what; if (mode == ScreenSaverReset) { if (on == SCREEN_SAVER_FORCER) { + DeviceIntPtr dev; UpdateCurrentTimeIf(); - lastDeviceEventTime = currentTime; + nt_list_for_each_entry(dev, inputInfo.devices, next) + lastDeviceEventTime[dev->id] = currentTime; + lastDeviceEventTime[XIAllDevices] = currentTime; + lastDeviceEventTime[XIAllMasterDevices] = currentTime; } SetScreenSaverTimer(); } @@ -3658,3 +3619,16 @@ SetRootClip(ScreenPtr pScreen, Bool enable) WindowsRestructured(); FlushAllOutput(); } + +VisualPtr +WindowGetVisual(WindowPtr pWin) +{ + ScreenPtr pScreen = pWin->drawable.pScreen; + VisualID vid = wVisual(pWin); + int i; + + for (i = 0; i < pScreen->numVisuals; i++) + if (pScreen->visuals[i].vid == vid) + return &pScreen->visuals[i]; + return 0; +} diff --git a/xserver/doc/Makefile.in b/xserver/doc/Makefile.in index a3ffa14a2..9b5528297 100644 --- a/xserver/doc/Makefile.in +++ b/xserver/doc/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -210,13 +210,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -238,6 +234,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -262,6 +259,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -277,7 +275,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -376,6 +373,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -506,7 +504,7 @@ EXTRA_DIST = smartsched all: all-recursive .SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/devbook.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/devbook.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -532,9 +530,9 @@ $(top_srcdir)/devbook.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/doc/Xserver-spec.xml b/xserver/doc/Xserver-spec.xml index 2b11828fc..cd1a9d07a 100644 --- a/xserver/doc/Xserver-spec.xml +++ b/xserver/doc/Xserver-spec.xml @@ -109,6 +109,12 @@ Revised for Xorg 1.9 devPrivates changes and 1.8 CreateNewResourceType changes + + 3.6 + July 2012 + kp + Revised for X server 1.13 screen-specific devPrivates changes + The following document explains the structure of the X Window System display server and the interfaces among the larger pieces. It is intended as a reference for programmers who are implementing an X Display Server on their workstation hardware. It is included with the X Window System source tape, along with the document "Strategies for Porting the X v11 Sample Server." The order in which you should read these documents is: @@ -680,7 +686,7 @@ pReadmask is a pointer to the information describing the descriptors that will be waited on. -In the sample server, pTimeout is a struct timeval **, and pReadmask is +In the sample server, pTimeout is a pointer, and pReadmask is the address of the select() mask for reading. @@ -688,15 +694,14 @@ The DIX BlockHandler() iterates through the Screens, for each one calling its BlockHandler. A BlockHandler is declared thus:
- void xxxBlockHandler(nscreen, pbdata, pptv, pReadmask) - int nscreen; - pointer pbdata; - struct timeval ** pptv; + void xxxBlockHandler(pScreen, pTimeout, pReadmask) + ScreenPtr pScreen; + pointer pTimeout; pointer pReadmask;
-The arguments are the index of the Screen, the blockData field -of the Screen, and the arguments to the DIX BlockHandler(). +The arguments are a pointer to the Screen, and the arguments to the +DIX BlockHandler().
Immediately after WaitForSomething returns from the @@ -721,15 +726,14 @@ The DIX WakeupHandler() calls each Screen's WakeupHandler. A WakeupHandler is declared thus:
- void xxxWakeupHandler(nscreen, pbdata, err, pReadmask) - int nscreen; - pointer pbdata; + void xxxWakeupHandler(pScreen, result, pReadmask) + ScreenPtr pScreen; unsigned long result; pointer pReadmask;
-The arguments are the index of the Screen, the blockData field -of the Screen, and the arguments to the DIX WakeupHandler(). +The arguments are the Screen, of the Screen, and the arguments to +the DIX WakeupHandler().
In addition to the per-screen BlockHandlers, any module may register @@ -1942,18 +1946,15 @@ FALSE. The scrInitProc should be of the following form:
- Bool scrInitProc(iScreen, pScreen, argc, argv) - int iScreen; + Bool scrInitProc(pScreen, argc, argv) ScreenPtr pScreen; int argc; char **argv;
-iScreen is the index for this screen; 0 for the first one initialized, -1 for the second, etc. pScreen is the pointer to the screen's new -ScreenRec. argc and argv are as before. Your screen initialize -procedure should return TRUE upon success or FALSE if the screen -cannot be initialized (for instance, if the screen hardware does not -exist on this machine). +pScreen is the pointer to the screen's new ScreenRec. argc and argv +are as before. Your screen initialize procedure should return TRUE +upon success or FALSE if the screen cannot be initialized (for + instance, if the screen hardware does not exist on this machine). This procedure must determine what actual device it is supposed to initialize. If you have a different procedure for each screen, then it is no problem. @@ -4719,7 +4720,8 @@ Two new extensibility concepts have been developed for release 4, Wrappers and devPrivates. These replace the R3 GCInterest queues, which were not a general enough mechanism for many extensions and only provided hooks into a single data structure. devPrivates have been revised substantially for -X.Org X server release 1.5, and updated again for the 1.9 release. +X.Org X server release 1.5, updated again for the 1.9 release and extended +again for the 1.13 relealse.
devPrivates @@ -4762,6 +4764,23 @@ the specified type with distinct storage for the given pScreen. The key is usable on ScreenPrivate variants that are otherwise equivalent to the following Private functions. + + To request private space in objects created for a specific screen, use +
+ Bool dixRegisterScreenSpecificPrivateKey(ScreenPtr pScreen, DevPrivateKey key, DevPrivateType type, unsigned size); +
+ The type and size arguments are + the same as those to dixRegisterPrivateKey but this + function ensures only that the given key exists on objects of + the specified type that are allocated with reference to the specified + pScreen. Using the key on objects allocated for + other screens will result in incorrect results; there is no check made to + ensure that the caller's screen matches the private's screen. The key is + usable in any of the following functions. Screen-specific private storage is available + only for Windows, GCs, Pixmaps and Pictures. Attempts to allocate screen-specific + privates on other objects will result in a call to FatalError. +
+ To attach a piece of private data to an object, use:
diff --git a/xserver/doc/c-extensions b/xserver/doc/c-extensions index eb33e272b..4a9006150 100644 --- a/xserver/doc/c-extensions +++ b/xserver/doc/c-extensions @@ -35,7 +35,7 @@ The server will not build if your toolchain does not support these extensions. * interleaved code and declarations: { foo = TRUE; int bar; do_stuff(); } -Use of OS and library facilities throughout the X server tree +Use of library facilities throughout the X server tree ------------------------------------------------------------- Non-OS-dependent code can assume facilities at least as good as @@ -44,6 +44,17 @@ be C99, but even gcc+glibc doesn't implement that yet. Unix-like systems are assumed to be at least as good as UNIX03. +Note that there are two Windows ports, Cygwin and MinGW: +- Cygwin is more or less like Linux. +- MinGW is more restrictive. Windows does not provide the required +POSIX facilities, so some non-OS-dependent code is stubbed out or +has an alternate implementation if WIN32 is defined. Code that +needs to be portable to Windows should be careful to, well, be portable. + + +Required OS facilities +------------------------------------------------------------- + Linux systems must be at least 2.4 or later. As a practical matter though, 2.4 kernels never receive any testing. Use 2.6 already. @@ -51,11 +62,7 @@ TODO: Solaris. TODO: *BSD. -Code that needs to be portable to Windows should be careful to, -well, be portable. Note that there are two Windows ports, cygwin and -mingw. Cygwin is more or less like Linux, but mingw is a bit more -restrictive. TODO: document which versions of Windows we actually care -about. +Windows-dependent code assumes at least NT 5.1. OSX support is generally limited to the most recent version. Currently that means 10.5. diff --git a/xserver/doc/dtrace/Makefile.in b/xserver/doc/dtrace/Makefile.in index 63a62e19c..2605977a7 100644 --- a/xserver/doc/dtrace/Makefile.in +++ b/xserver/doc/dtrace/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -201,13 +201,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -229,6 +225,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -253,6 +250,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -268,7 +266,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -367,6 +364,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -534,7 +532,7 @@ top_srcdir = @top_srcdir@ all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/docbook.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/docbook.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -560,9 +558,9 @@ $(top_srcdir)/docbook.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/doc/dtrace/Xserver-DTrace.xml b/xserver/doc/dtrace/Xserver-DTrace.xml index 5ef062980..91ca254d7 100644 --- a/xserver/doc/dtrace/Xserver-DTrace.xml +++ b/xserver/doc/dtrace/Xserver-DTrace.xml @@ -52,7 +52,9 @@ DEALINGS IN THE SOFTWARE. facility in Solaris 10, MacOS X 10.5, and later releases. This provider instruments various points in the X server, to allow - tracing what client applications are up to. + tracing what client applications are up to. DTrace probes may be used + with SystemTap + on GNU/Linux systems. @@ -81,7 +83,7 @@ DEALINGS IN THE SOFTWARE. Probes and their arguments - + @@ -89,6 +91,8 @@ DEALINGS IN THE SOFTWARE. + + @@ -99,6 +103,8 @@ DEALINGS IN THE SOFTWARE. arg2 arg3 arg4 + arg5 + arg6 @@ -113,6 +119,8 @@ DEALINGS IN THE SOFTWARE. requestLengthclientIdrequestBuffer + + request-done @@ -122,6 +130,8 @@ DEALINGS IN THE SOFTWARE. sequenceNumber clientId resultCode + + Event Probes @@ -132,7 +142,10 @@ DEALINGS IN THE SOFTWARE. clientId eventCode eventBuffer + + + Client Connection Probes @@ -142,7 +155,11 @@ DEALINGS IN THE SOFTWARE. Called when a new connection is opened from a client clientId clientFD + + + + client-auth @@ -152,12 +169,19 @@ DEALINGS IN THE SOFTWARE. clientPid clientZoneId + + client-disconnect Called when a client connection is closed clientId + + + + + Resource Allocation Probes @@ -170,6 +194,8 @@ DEALINGS IN THE SOFTWARE. resourceValue resourceTypeName + + resource-free @@ -179,6 +205,24 @@ DEALINGS IN THE SOFTWARE. resourceValue resourceTypeName + + + + + Input API probes + + + input-event + Called when an input event was submitted for processing + deviceid + eventtype + button or + keycode or + touchid + flags + nvalues + mask + values @@ -304,6 +348,44 @@ DEALINGS IN THE SOFTWARE. uint32_tNumber of X request in in this connection + + deviceid + int + The device's numerical ID + + + eventtype + int + Protocol event type + + + button, keycode, touchid + uint32_t + The button number, keycode or touch ID + + + flags + uint32_t + Miscellaneous event-specific server flags + + + nvalues + int8_t + Number of bits in mask and number of elements + in values + + + mask + uint8_t* + Binary mask indicating which indices in values contain + valid data + + + values + double* + Valuator values. Values for indices for which the + mask is not set are undefined +
@@ -572,6 +654,73 @@ Xserver$1:::client-disconnect + + Input API monitoring with SystemTap + + + This script can be used to monitor events submitted by drivers to + the server for enqueuing. Due to the integration of the input API + probes, some server-enqueued events will show up too. + + # Compile+run with + # stap -g xorg.stp /usr/bin/Xorg + # + + + function print_valuators:string(nvaluators:long, mask_in:long, valuators_in:long) %{ + int i; + unsigned char *mask = (unsigned char*)THIS->mask_in; + double *valuators = (double*)THIS->valuators_in; + char str[128] = {0}; + char *s = str; + + #define BitIsSet(ptr, bit) (((unsigned char*)(ptr))[(bit)>>3] & (1 << ((bit) & 7))) + + s += sprintf(s, "nval: %d ::", (int)THIS->nvaluators); + for (i = 0; i < THIS->nvaluators; i++) + { + s += sprintf(s, " %d: ", i); + if (BitIsSet(mask, i)) + s += sprintf(s, "%d", (int)valuators[i]); + } + + sprintf(THIS->__retvalue, "%s", str); + %} + + probe process(@1).mark("input__event") + { + deviceid = $arg1 + type = $arg2 + detail = $arg3 + flags = $arg4 + nvaluators = $arg5 + + str = print_valuators(nvaluators, $arg6, $arg7) + printf("Event: device %d type %d detail %d flags %#x %s\n", + deviceid, type, detail, flags, str); + } + + + Sample output from a run of this script: + +Event: device 13 type 4 detail 1 flags 0x0 nval: 0 :: +Event: device 13 type 6 detail 0 flags 0xa nval: 1 :: 0: 1 +Event: device 13 type 6 detail 0 flags 0xa nval: 2 :: 0: 2 1: -1 +Event: device 13 type 6 detail 0 flags 0xa nval: 2 :: 0: 2 1: -1 +Event: device 13 type 6 detail 0 flags 0xa nval: 2 :: 0: 4 1: -3 +Event: device 13 type 6 detail 0 flags 0xa nval: 2 :: 0: 3 1: -3 +Event: device 13 type 6 detail 0 flags 0xa nval: 2 :: 0: 3 1: -2 +Event: device 13 type 6 detail 0 flags 0xa nval: 2 :: 0: 2 1: -2 +Event: device 13 type 6 detail 0 flags 0xa nval: 2 :: 0: 2 1: -2 +Event: device 13 type 6 detail 0 flags 0xa nval: 2 :: 0: 2 1: -2 +Event: device 13 type 6 detail 0 flags 0xa nval: 2 :: 0: 1: -1 +Event: device 13 type 6 detail 0 flags 0xa nval: 2 :: 0: 1: -1 +Event: device 13 type 5 detail 1 flags 0x0 nval: 0 :: + + + + + diff --git a/xserver/exa/Makefile.in b/xserver/exa/Makefile.in index ceba40658..ddcfb10dc 100644 --- a/xserver/exa/Makefile.in +++ b/xserver/exa/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -214,13 +214,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -242,6 +238,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -266,6 +263,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -281,7 +279,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -383,6 +380,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -508,7 +506,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -533,9 +531,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/exa/exa.c b/xserver/exa/exa.c index 754c8305a..f8e499c2b 100644 --- a/xserver/exa/exa.c +++ b/xserver/exa/exa.c @@ -38,8 +38,6 @@ #include "exa.h" DevPrivateKeyRec exaScreenPrivateKeyRec; -DevPrivateKeyRec exaPixmapPrivateKeyRec; -DevPrivateKeyRec exaGCPrivateKeyRec; #ifdef MITSHM static ShmFuncs exaShmFuncs = { NULL, NULL }; @@ -482,9 +480,6 @@ static void static void exaCopyClip(GCPtr pGCDst, GCPtr pGCSrc); -static void - exaCopyClip(GCPtr pGCDst, GCPtr pGCSrc); - static void exaDestroyClip(GCPtr pGC); @@ -625,8 +620,8 @@ exaCreateGC(GCPtr pGC) swap(pExaScr, pScreen, CreateGC); if ((ret = (*pScreen->CreateGC) (pGC))) { - wrap(pExaGC, pGC, funcs, (GCFuncs *) & exaGCFuncs); - wrap(pExaGC, pGC, ops, (GCOps *) & exaOps); + wrap(pExaGC, pGC, funcs, (GCFuncs *) &exaGCFuncs); + wrap(pExaGC, pGC, ops, (GCOps *) &exaOps); } swap(pExaScr, pScreen, CreateGC); @@ -707,11 +702,9 @@ exaCreateScreenResources(ScreenPtr pScreen) } static void -ExaBlockHandler(int screenNum, pointer blockData, pointer pTimeout, +ExaBlockHandler(ScreenPtr pScreen, pointer pTimeout, pointer pReadmask) { - ScreenPtr pScreen = screenInfo.screens[screenNum]; - ExaScreenPriv(pScreen); /* Move any deferred results from a software fallback to the driver pixmap */ @@ -719,7 +712,7 @@ ExaBlockHandler(int screenNum, pointer blockData, pointer pTimeout, exaMoveInPixmap_mixed(pExaScr->deferred_mixed_pixmap); unwrap(pExaScr, pScreen, BlockHandler); - (*pScreen->BlockHandler) (screenNum, blockData, pTimeout, pReadmask); + (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); wrap(pExaScr, pScreen, BlockHandler, ExaBlockHandler); /* The rest only applies to classic EXA */ @@ -739,15 +732,13 @@ ExaBlockHandler(int screenNum, pointer blockData, pointer pTimeout, } static void -ExaWakeupHandler(int screenNum, pointer wakeupData, unsigned long result, +ExaWakeupHandler(ScreenPtr pScreen, unsigned long result, pointer pReadmask) { - ScreenPtr pScreen = screenInfo.screens[screenNum]; - ExaScreenPriv(pScreen); unwrap(pExaScr, pScreen, WakeupHandler); - (*pScreen->WakeupHandler) (screenNum, wakeupData, result, pReadmask); + (*pScreen->WakeupHandler) (pScreen, result, pReadmask); wrap(pExaScr, pScreen, WakeupHandler, ExaWakeupHandler); if (result == 0 && pExaScr->numOffscreenAvailable > 1) { @@ -765,7 +756,7 @@ ExaWakeupHandler(int screenNum, pointer wakeupData, unsigned long result, * screen private, before calling down to the next CloseSccreen. */ static Bool -exaCloseScreen(int i, ScreenPtr pScreen) +exaCloseScreen(ScreenPtr pScreen) { ExaScreenPriv(pScreen); PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); @@ -791,6 +782,10 @@ exaCloseScreen(int i, ScreenPtr pScreen) unwrap(pExaScr, pScreen, ChangeWindowAttributes); unwrap(pExaScr, pScreen, BitmapToRegion); unwrap(pExaScr, pScreen, CreateScreenResources); + if (pExaScr->SavedSharePixmapBacking) + unwrap(pExaScr, pScreen, SharePixmapBacking); + if (pExaScr->SavedSetSharedPixmapBacking) + unwrap(pExaScr, pScreen, SetSharedPixmapBacking); unwrap(pExaScr, ps, Composite); if (pExaScr->SavedGlyphs) unwrap(pExaScr, ps, Glyphs); @@ -800,7 +795,7 @@ exaCloseScreen(int i, ScreenPtr pScreen) free(pExaScr); - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } /** @@ -922,8 +917,8 @@ exaDriverInit(ScreenPtr pScreen, ExaDriverPtr pScreenInfo) exaDDXDriverInit(pScreen); - if (!dixRegisterPrivateKey - (&exaGCPrivateKeyRec, PRIVATE_GC, sizeof(ExaGCPrivRec))) { + if (!dixRegisterScreenSpecificPrivateKey + (pScreen, &pExaScr->gcPrivateKeyRec, PRIVATE_GC, sizeof(ExaGCPrivRec))) { LogMessage(X_WARNING, "EXA(%d): Failed to allocate GC private\n", pScreen->myNum); return FALSE; @@ -971,8 +966,8 @@ exaDriverInit(ScreenPtr pScreen, ExaDriverPtr pScreenInfo) * Hookup offscreen pixmaps */ if (pExaScr->info->flags & EXA_OFFSCREEN_PIXMAPS) { - if (!dixRegisterPrivateKey - (&exaPixmapPrivateKeyRec, PRIVATE_PIXMAP, + if (!dixRegisterScreenSpecificPrivateKey + (pScreen, &pExaScr->pixmapPrivateKeyRec, PRIVATE_PIXMAP, sizeof(ExaPixmapPrivRec))) { LogMessage(X_WARNING, "EXA(%d): Failed to allocate pixmap private\n", @@ -985,6 +980,9 @@ exaDriverInit(ScreenPtr pScreen, ExaDriverPtr pScreenInfo) wrap(pExaScr, pScreen, DestroyPixmap, exaDestroyPixmap_mixed); wrap(pExaScr, pScreen, ModifyPixmapHeader, exaModifyPixmapHeader_mixed); + wrap(pExaScr, pScreen, SharePixmapBacking, exaSharePixmapBacking_mixed); + wrap(pExaScr, pScreen, SetSharedPixmapBacking, exaSetSharedPixmapBacking_mixed); + pExaScr->do_migration = exaDoMigration_mixed; pExaScr->pixmap_has_gpu_copy = exaPixmapHasGpuCopy_mixed; pExaScr->do_move_in_pixmap = exaMoveInPixmap_mixed; diff --git a/xserver/exa/exa.h b/xserver/exa/exa.h index 75340021e..be022b2db 100644 --- a/xserver/exa/exa.h +++ b/xserver/exa/exa.h @@ -39,7 +39,7 @@ #include "fb.h" #define EXA_VERSION_MAJOR 2 -#define EXA_VERSION_MINOR 5 +#define EXA_VERSION_MINOR 6 #define EXA_VERSION_RELEASE 0 typedef struct _ExaOffscreenArea ExaOffscreenArea; @@ -694,6 +694,10 @@ typedef struct _ExaDriver { int depth, int usage_hint, int bitsPerPixel, int *new_fb_pitch); /** @} */ + Bool (*SharePixmapBacking)(PixmapPtr pPixmap, ScreenPtr slave, void **handle_p); + + Bool (*SetSharedPixmapBacking)(PixmapPtr pPixmap, void *handle); + } ExaDriverRec, *ExaDriverPtr; /** @name EXA driver flags @@ -789,7 +793,7 @@ extern _X_EXPORT void ExaOffscreenMarkUsed(PixmapPtr pPixmap); extern _X_EXPORT void - exaEnableDisableFBAccess(int index, Bool enable); + exaEnableDisableFBAccess(ScreenPtr pScreen, Bool enable); extern _X_EXPORT Bool exaDrawableIsOffscreen(DrawablePtr pDrawable); diff --git a/xserver/exa/exa_glyphs.c b/xserver/exa/exa_glyphs.c index 2538bce01..71f750fb6 100644 --- a/xserver/exa/exa_glyphs.c +++ b/xserver/exa/exa_glyphs.c @@ -365,7 +365,7 @@ exaGlyphCacheUploadGlyph(ScreenPtr pScreen, ExaGlyphCachePtr cache, int x, int y, GlyphPtr pGlyph) { ExaScreenPriv(pScreen); - PicturePtr pGlyphPicture = GlyphPicture(pGlyph)[pScreen->myNum]; + PicturePtr pGlyphPicture = GetGlyphPicture(pGlyph, pScreen); PixmapPtr pGlyphPixmap = (PixmapPtr) pGlyphPicture->pDrawable; ExaPixmapPriv(pGlyphPixmap); @@ -544,7 +544,7 @@ exaBufferGlyph(ScreenPtr pScreen, INT16 ySrc, INT16 xMask, INT16 yMask, INT16 xDst, INT16 yDst) { ExaScreenPriv(pScreen); - unsigned int format = (GlyphPicture(pGlyph)[pScreen->myNum])->format; + unsigned int format = (GetGlyphPicture(pGlyph, pScreen))->format; int width = pGlyph->info.width; int height = pGlyph->info.height; ExaCompositeRectPtr rect; @@ -586,7 +586,7 @@ exaBufferGlyph(ScreenPtr pScreen, /* Couldn't find the glyph in the cache, use the glyph picture directly */ - mask = GlyphPicture(pGlyph)[pScreen->myNum]; + mask = GetGlyphPicture(pGlyph, pScreen); if (buffer->mask && buffer->mask != mask) return ExaGlyphNeedFlush; diff --git a/xserver/exa/exa_mixed.c b/xserver/exa/exa_mixed.c index 06817313f..0fb409102 100644 --- a/xserver/exa/exa_mixed.c +++ b/xserver/exa/exa_mixed.c @@ -294,3 +294,36 @@ exaPixmapHasGpuCopy_mixed(PixmapPtr pPixmap) return ret; } + +Bool +exaSharePixmapBacking_mixed(PixmapPtr pPixmap, ScreenPtr slave, void **handle_p) +{ + ScreenPtr pScreen = pPixmap->drawable.pScreen; + ExaScreenPriv(pScreen); + Bool ret = FALSE; + + exaMoveInPixmap(pPixmap); + /* get the driver to give us a handle */ + if (pExaScr->info->SharePixmapBacking) + ret = pExaScr->info->SharePixmapBacking(pPixmap, slave, handle_p); + + return ret; +} + +Bool +exaSetSharedPixmapBacking_mixed(PixmapPtr pPixmap, void *handle) +{ + ScreenPtr pScreen = pPixmap->drawable.pScreen; + ExaScreenPriv(pScreen); + Bool ret = FALSE; + + if (pExaScr->info->SetSharedPixmapBacking) + ret = pExaScr->info->SetSharedPixmapBacking(pPixmap, handle); + + if (ret == TRUE) + exaMoveInPixmap(pPixmap); + + return ret; +} + + diff --git a/xserver/exa/exa_offscreen.c b/xserver/exa/exa_offscreen.c index 5e1d1398e..1f571cf22 100644 --- a/xserver/exa/exa_offscreen.c +++ b/xserver/exa/exa_offscreen.c @@ -360,10 +360,8 @@ ExaOffscreenSwapIn(ScreenPtr pScreen) * swapped out. */ void -exaEnableDisableFBAccess(int index, Bool enable) +exaEnableDisableFBAccess(ScreenPtr pScreen, Bool enable) { - ScreenPtr pScreen = screenInfo.screens[index]; - ExaScreenPriv(pScreen); if (pExaScr->info->flags & EXA_HANDLES_PIXMAPS) diff --git a/xserver/exa/exa_priv.h b/xserver/exa/exa_priv.h index bde78c3a0..1f5605687 100644 --- a/xserver/exa/exa_priv.h +++ b/xserver/exa/exa_priv.h @@ -41,7 +41,6 @@ #include "pixmapstr.h" #include "windowstr.h" #include "servermd.h" -#include "mibstore.h" #include "colormapst.h" #include "gcstruct.h" #include "input.h" @@ -147,7 +146,7 @@ typedef struct _ExaMigrationRec { RegionPtr pReg; } ExaMigrationRec, *ExaMigrationPtr; -typedef void (*EnableDisableFBAccessProcPtr) (int, Bool); +typedef void (*EnableDisableFBAccessProcPtr) (ScreenPtr, Bool); typedef struct { ExaDriverPtr info; ScreenBlockHandlerProcPtr SavedBlockHandler; @@ -163,6 +162,8 @@ typedef struct { BitmapToRegionProcPtr SavedBitmapToRegion; CreateScreenResourcesProcPtr SavedCreateScreenResources; ModifyPixmapHeaderProcPtr SavedModifyPixmapHeader; + SharePixmapBackingProcPtr SavedSharePixmapBacking; + SetSharedPixmapBackingProcPtr SavedSetSharedPixmapBacking; SourceValidateProcPtr SavedSourceValidate; CompositeProcPtr SavedComposite; TrianglesProcPtr SavedTriangles; @@ -207,7 +208,10 @@ typedef struct { RegionRec srcReg; RegionRec maskReg; PixmapPtr srcPix; + PixmapPtr maskPix; + DevPrivateKeyRec pixmapPrivateKeyRec; + DevPrivateKeyRec gcPrivateKeyRec; } ExaScreenPrivRec, *ExaScreenPrivPtr; /* @@ -225,17 +229,11 @@ typedef struct { extern DevPrivateKeyRec exaScreenPrivateKeyRec; #define exaScreenPrivateKey (&exaScreenPrivateKeyRec) -extern DevPrivateKeyRec exaPixmapPrivateKeyRec; - -#define exaPixmapPrivateKey (&exaPixmapPrivateKeyRec) -extern DevPrivateKeyRec exaGCPrivateKeyRec; - -#define exaGCPrivateKey (&exaGCPrivateKeyRec) #define ExaGetScreenPriv(s) ((ExaScreenPrivPtr)dixGetPrivate(&(s)->devPrivates, exaScreenPrivateKey)) #define ExaScreenPriv(s) ExaScreenPrivPtr pExaScr = ExaGetScreenPriv(s) -#define ExaGetGCPriv(gc) ((ExaGCPrivPtr)dixGetPrivateAddr(&(gc)->devPrivates, exaGCPrivateKey)) +#define ExaGetGCPriv(gc) ((ExaGCPrivPtr)dixGetPrivateAddr(&(gc)->devPrivates, &ExaGetScreenPriv(gc->pScreen)->gcPrivateKeyRec)) #define ExaGCPriv(gc) ExaGCPrivPtr pExaGC = ExaGetGCPriv(gc) /* @@ -286,7 +284,7 @@ extern DevPrivateKeyRec exaGCPrivateKeyRec; #define EXA_PIXMAP_SCORE_PINNED 1000 #define EXA_PIXMAP_SCORE_INIT 1001 -#define ExaGetPixmapPriv(p) ((ExaPixmapPrivPtr)dixGetPrivateAddr(&(p)->devPrivates, exaPixmapPrivateKey)) +#define ExaGetPixmapPriv(p) ((ExaPixmapPrivPtr)dixGetPrivateAddr(&(p)->devPrivates, &ExaGetScreenPriv((p)->drawable.pScreen)->pixmapPrivateKeyRec)) #define ExaPixmapPriv(p) ExaPixmapPrivPtr pExaPixmap = ExaGetPixmapPriv(p) #define EXA_RANGE_PITCH (1 << 0) @@ -662,6 +660,11 @@ void void exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg); +Bool +exaSetSharedPixmapBacking_mixed(PixmapPtr pPixmap, void *handle); +Bool +exaSharePixmapBacking_mixed(PixmapPtr pPixmap, ScreenPtr slave, void **handle_p); + /* exa_render.c */ Bool exaOpReadsDestination(CARD8 op); diff --git a/xserver/exa/exa_unaccel.c b/xserver/exa/exa_unaccel.c index 571613886..b0a0011cb 100644 --- a/xserver/exa/exa_unaccel.c +++ b/xserver/exa/exa_unaccel.c @@ -442,6 +442,13 @@ ExaSrcValidate(DrawablePtr pDrawable, RegionPtr dst; int xoff, yoff; + if (pExaScr->srcPix == pPix) + dst = &pExaScr->srcReg; + else if (pExaScr->maskPix == pPix) + dst = &pExaScr->maskReg; + else + return; + exaGetDrawableDeltas(pDrawable, pPix, &xoff, &yoff); box.x1 = x + xoff; @@ -449,8 +456,6 @@ ExaSrcValidate(DrawablePtr pDrawable, box.x2 = box.x1 + width; box.y2 = box.y1 + height; - dst = (pExaScr->srcPix == pPix) ? &pExaScr->srcReg : &pExaScr->maskReg; - RegionInit(®, &box, 1); RegionUnion(dst, dst, ®); RegionUninit(®); @@ -495,16 +500,19 @@ ExaPrepareCompositeReg(ScreenPtr pScreen, if (pSrc != pDst) RegionTranslate(pSrc->pCompositeClip, -pSrc->pDrawable->x, -pSrc->pDrawable->y); - } + } else + pExaScr->srcPix = NULL; if (pMask && pMask->pDrawable) { pMaskPix = exaGetDrawablePixmap(pMask->pDrawable); RegionNull(&pExaScr->maskReg); maskReg = &pExaScr->maskReg; + pExaScr->maskPix = pMaskPix; if (pMask != pDst && pMask != pSrc) RegionTranslate(pMask->pCompositeClip, -pMask->pDrawable->x, -pMask->pDrawable->y); - } + } else + pExaScr->maskPix = NULL; RegionTranslate(pDst->pCompositeClip, -pDst->pDrawable->x, -pDst->pDrawable->y); diff --git a/xserver/fb/Makefile.in b/xserver/fb/Makefile.in index f91e0466a..53b1fd2bf 100644 --- a/xserver/fb/Makefile.in +++ b/xserver/fb/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -243,13 +243,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -271,6 +267,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -295,6 +292,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -310,7 +308,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -409,6 +406,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -558,7 +556,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -583,9 +581,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/fb/fb.h b/xserver/fb/fb.h index b327ce653..b869d122c 100644 --- a/xserver/fb/fb.h +++ b/xserver/fb/fb.h @@ -39,7 +39,6 @@ #include "privates.h" #include "mi.h" #include "migc.h" -#include "mibstore.h" #include "picturestr.h" #ifdef FB_ACCESS_WRAPPER @@ -570,12 +569,6 @@ extern _X_EXPORT void fbSetBits(FbStip * bits, int stride, FbStip data); } \ } -extern _X_EXPORT DevPrivateKey - fbGetGCPrivateKey(void); - -extern _X_EXPORT DevPrivateKey - fbGetWinPrivateKey(void); - extern _X_EXPORT const GCOps fbGCOps; extern _X_EXPORT const GCFuncs fbGCFuncs; @@ -605,7 +598,7 @@ typedef void (*FinishWrapProcPtr) (DrawablePtr pDraw); #endif extern _X_EXPORT DevPrivateKey - fbGetScreenPrivateKey(void); +fbGetScreenPrivateKey(void); /* private field of a screen */ typedef struct { @@ -615,6 +608,8 @@ typedef struct { SetupWrapProcPtr setupWrap; /* driver hook to set pixmap access wrapping */ FinishWrapProcPtr finishWrap; /* driver hook to clean up pixmap access wrapping */ #endif + DevPrivateKeyRec gcPrivateKeyRec; + DevPrivateKeyRec winPrivateKeyRec; } FbScreenPrivRec, *FbScreenPrivPtr; #define fbGetScreenPrivate(pScreen) ((FbScreenPrivPtr) \ @@ -630,8 +625,10 @@ typedef struct { unsigned char bpp; /* current drawable bpp */ } FbGCPrivRec, *FbGCPrivPtr; +#define fbGetGCPrivateKey(pGC) (&fbGetScreenPrivate((pGC)->pScreen)->gcPrivateKeyRec) + #define fbGetGCPrivate(pGC) ((FbGCPrivPtr)\ - dixLookupPrivate(&(pGC)->devPrivates, fbGetGCPrivateKey())) + dixLookupPrivate(&(pGC)->devPrivates, fbGetGCPrivateKey(pGC))) #define fbGetCompositeClip(pGC) ((pGC)->pCompositeClip) #define fbGetExpose(pGC) ((pGC)->fExpose) @@ -639,8 +636,11 @@ typedef struct { #define fbGetRotatedPixmap(pGC) ((pGC)->pRotatedPixmap) #define fbGetScreenPixmap(s) ((PixmapPtr) (s)->devPrivate) + +#define fbGetWinPrivateKey(pWin) (&fbGetScreenPrivate(((DrawablePtr) (pWin))->pScreen)->winPrivateKeyRec) + #define fbGetWindowPixmap(pWin) ((PixmapPtr)\ - dixLookupPrivate(&((WindowPtr)(pWin))->devPrivates, fbGetWinPrivateKey())) + dixLookupPrivate(&((WindowPtr)(pWin))->devPrivates, fbGetWinPrivateKey(pWin))) #ifdef ROOTLESS #define __fbPixDrawableX(pPix) ((pPix)->drawable.x) @@ -782,14 +782,14 @@ fb24_32ModifyPixmapHeader(PixmapPtr pPixmap, * fballpriv.c */ extern _X_EXPORT Bool - fbAllocatePrivates(ScreenPtr pScreen, DevPrivateKey *pGCIndex); +fbAllocatePrivates(ScreenPtr pScreen); /* * fbarc.c */ extern _X_EXPORT void - fbPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc * parcs); +fbPolyArc(DrawablePtr pDrawable, GCPtr pGC, int narcs, xArc * parcs); /* * fbbits.c @@ -1344,6 +1344,9 @@ extern _X_EXPORT void extern _X_EXPORT Bool fbPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats); +extern _X_EXPORT void +fbDestroyGlyphCache(void); + /* * fbpixmap.c */ @@ -1419,7 +1422,7 @@ fbPushPixels(GCPtr pGC, */ extern _X_EXPORT Bool - fbCloseScreen(int indx, ScreenPtr pScreen); + fbCloseScreen(ScreenPtr pScreen); extern _X_EXPORT Bool fbRealizeFont(ScreenPtr pScreen, FontPtr pFont); diff --git a/xserver/fb/fballpriv.c b/xserver/fb/fballpriv.c index c6504f915..187d0b068 100644 --- a/xserver/fb/fballpriv.c +++ b/xserver/fb/fballpriv.c @@ -33,33 +33,20 @@ fbGetScreenPrivateKey(void) return &fbScreenPrivateKeyRec; } -static DevPrivateKeyRec fbGCPrivateKeyRec; -DevPrivateKey -fbGetGCPrivateKey(void) -{ - return &fbGCPrivateKeyRec; -} - -static DevPrivateKeyRec fbWinPrivateKeyRec; -DevPrivateKey -fbGetWinPrivateKey(void) -{ - return &fbWinPrivateKeyRec; -} - Bool -fbAllocatePrivates(ScreenPtr pScreen, DevPrivateKey *pGCKey) +fbAllocatePrivates(ScreenPtr pScreen) { - if (pGCKey) - *pGCKey = &fbGCPrivateKeyRec; + FbScreenPrivPtr pScrPriv; - if (!dixRegisterPrivateKey - (&fbGCPrivateKeyRec, PRIVATE_GC, sizeof(FbGCPrivRec))) - return FALSE; if (!dixRegisterPrivateKey (&fbScreenPrivateKeyRec, PRIVATE_SCREEN, sizeof(FbScreenPrivRec))) return FALSE; - if (!dixRegisterPrivateKey(&fbWinPrivateKeyRec, PRIVATE_WINDOW, 0)) + + pScrPriv = fbGetScreenPrivate(pScreen); + + if (!dixRegisterScreenSpecificPrivateKey (pScreen, &pScrPriv->gcPrivateKeyRec, PRIVATE_GC, sizeof(FbGCPrivRec))) + return FALSE; + if (!dixRegisterScreenSpecificPrivateKey (pScreen, &pScrPriv->winPrivateKeyRec, PRIVATE_WINDOW, 0)) return FALSE; return TRUE; diff --git a/xserver/fb/fbblt.c b/xserver/fb/fbblt.c index 17bd6986b..72a05f61a 100644 --- a/xserver/fb/fbblt.c +++ b/xserver/fb/fbblt.c @@ -73,21 +73,21 @@ fbBlt(FbBits * srcLine, if (alu == GXcopy && pm == FB_ALLONES && !careful && !(srcX & 7) && !(dstX & 7) && !(width & 7)) { int i; - CARD8 *src = (CARD8 *) srcLine; - CARD8 *dst = (CARD8 *) dstLine; + CARD8 *tmpsrc = (CARD8 *) srcLine; + CARD8 *tmpdst = (CARD8 *) dstLine; srcStride *= sizeof(FbBits); dstStride *= sizeof(FbBits); width >>= 3; - src += (srcX >> 3); - dst += (dstX >> 3); + tmpsrc += (srcX >> 3); + tmpdst += (dstX >> 3); if (!upsidedown) for (i = 0; i < height; i++) - MEMCPY_WRAPPED(dst + i * dstStride, src + i * srcStride, width); + MEMCPY_WRAPPED(tmpdst + i * dstStride, tmpsrc + i * srcStride, width); else for (i = height - 1; i >= 0; i--) - MEMCPY_WRAPPED(dst + i * dstStride, src + i * srcStride, width); + MEMCPY_WRAPPED(tmpdst + i * dstStride, tmpsrc + i * srcStride, width); return; } diff --git a/xserver/fb/fbbltone.c b/xserver/fb/fbbltone.c index eb7cf9483..bfcb5a263 100644 --- a/xserver/fb/fbbltone.c +++ b/xserver/fb/fbbltone.c @@ -739,12 +739,12 @@ fbBltPlane(FbBits * src, pm = fbReplicatePixel(planeMask, srcBpp); if (srcBpp == 24) { - int w = 24; + int tmpw = 24; rot0 = FbFirst24Rot(srcX); - if (srcX + w > FB_UNIT) - w = FB_UNIT - srcX; - srcMaskFirst = FbRot24(pm, rot0) & FbBitsMask(srcX, w); + if (srcX + tmpw > FB_UNIT) + tmpw = FB_UNIT - srcX; + srcMaskFirst = FbRot24(pm, rot0) & FbBitsMask(srcX, tmpw); } else { rot0 = 0; diff --git a/xserver/fb/fbgc.c b/xserver/fb/fbgc.c index e6f8279b3..f4d7f3a99 100644 --- a/xserver/fb/fbgc.c +++ b/xserver/fb/fbgc.c @@ -64,8 +64,8 @@ const GCOps fbGCOps = { Bool fbCreateGC(GCPtr pGC) { - pGC->ops = (GCOps *) & fbGCOps; - pGC->funcs = (GCFuncs *) & fbGCFuncs; + pGC->ops = (GCOps *) &fbGCOps; + pGC->funcs = (GCFuncs *) &fbGCFuncs; /* fb wants to translate before scan conversion */ pGC->miTranslate = 1; diff --git a/xserver/fb/fboverlay.c b/xserver/fb/fboverlay.c index 998be66d9..c6802e4b4 100644 --- a/xserver/fb/fboverlay.c +++ b/xserver/fb/fboverlay.c @@ -63,7 +63,7 @@ fbOverlayCreateWindow(WindowPtr pWin) for (i = 0; i < pScrPriv->nlayers; i++) { pPixmap = pScrPriv->layer[i].u.run.pixmap; if (pWin->drawable.depth == pPixmap->drawable.depth) { - dixSetPrivate(&pWin->devPrivates, fbGetWinPrivateKey(), pPixmap); + dixSetPrivate(&pWin->devPrivates, fbGetWinPrivateKey(pWin), pPixmap); /* * Make sure layer keys are written correctly by * having non-root layers set to full while the @@ -81,7 +81,7 @@ fbOverlayCreateWindow(WindowPtr pWin) } Bool -fbOverlayCloseScreen(int iScreen, ScreenPtr pScreen) +fbOverlayCloseScreen(ScreenPtr pScreen) { FbOverlayScrPrivPtr pScrPriv = fbOverlayGetScrPriv(pScreen); int i; @@ -103,7 +103,7 @@ fbOverlayWindowLayer(WindowPtr pWin) int i; for (i = 0; i < pScrPriv->nlayers; i++) - if (dixLookupPrivate(&pWin->devPrivates, fbGetWinPrivateKey()) == + if (dixLookupPrivate(&pWin->devPrivates, fbGetWinPrivateKey(pWin)) == (pointer) pScrPriv->layer[i].u.run.pixmap) return i; return 0; diff --git a/xserver/fb/fboverlay.h b/xserver/fb/fboverlay.h index 76198cda5..9a93457c7 100644 --- a/xserver/fb/fboverlay.h +++ b/xserver/fb/fboverlay.h @@ -63,7 +63,7 @@ extern _X_EXPORT Bool fbOverlayCreateWindow(WindowPtr pWin); extern _X_EXPORT Bool - fbOverlayCloseScreen(int iScreen, ScreenPtr pScreen); + fbOverlayCloseScreen(ScreenPtr pScreen); extern _X_EXPORT int fbOverlayWindowLayer(WindowPtr pWin); diff --git a/xserver/fb/fbpict.c b/xserver/fb/fbpict.c index 097a1a6bd..2804ff481 100644 --- a/xserver/fb/fbpict.c +++ b/xserver/fb/fbpict.c @@ -70,6 +70,156 @@ fbComposite(CARD8 op, free_pixman_pict(pDst, dest); } +static pixman_glyph_cache_t *glyphCache; + +void +fbDestroyGlyphCache(void) +{ + if (glyphCache) + { + pixman_glyph_cache_destroy (glyphCache); + glyphCache = NULL; + } +} + +static void +fbUnrealizeGlyph(ScreenPtr pScreen, + GlyphPtr pGlyph) +{ + if (glyphCache) + pixman_glyph_cache_remove (glyphCache, pGlyph, NULL); +} + +static void +fbGlyphs(CARD8 op, + PicturePtr pSrc, + PicturePtr pDst, + PictFormatPtr maskFormat, + INT16 xSrc, + INT16 ySrc, int nlist, + GlyphListPtr list, + GlyphPtr *glyphs) +{ +#define N_STACK_GLYPHS 512 + ScreenPtr pScreen = pDst->pDrawable->pScreen; + pixman_glyph_t stack_glyphs[N_STACK_GLYPHS]; + pixman_glyph_t *pglyphs = stack_glyphs; + pixman_image_t *srcImage, *dstImage; + int srcXoff, srcYoff, dstXoff, dstYoff; + GlyphPtr glyph; + int n_glyphs; + int x, y; + int i, n; + int xDst = list->xOff, yDst = list->yOff; + + miCompositeSourceValidate(pSrc); + + n_glyphs = 0; + for (i = 0; i < nlist; ++i) + n_glyphs += list[i].len; + + if (!glyphCache) + glyphCache = pixman_glyph_cache_create(); + + pixman_glyph_cache_freeze (glyphCache); + + if (n_glyphs > N_STACK_GLYPHS) { + if (!(pglyphs = malloc (n_glyphs * sizeof (pixman_glyph_t)))) + goto out; + } + + i = 0; + x = y = 0; + while (nlist--) { + x += list->xOff; + y += list->yOff; + n = list->len; + while (n--) { + const void *g; + + glyph = *glyphs++; + + if (!(g = pixman_glyph_cache_lookup (glyphCache, glyph, NULL))) { + pixman_image_t *glyphImage; + PicturePtr pPicture; + int xoff, yoff; + + pPicture = GetGlyphPicture(glyph, pScreen); + if (!pPicture) { + n_glyphs--; + goto next; + } + + if (!(glyphImage = image_from_pict(pPicture, FALSE, &xoff, &yoff))) + goto out; + + g = pixman_glyph_cache_insert(glyphCache, glyph, NULL, + glyph->info.x, + glyph->info.y, + glyphImage); + + free_pixman_pict(pPicture, glyphImage); + + if (!g) + goto out; + } + + pglyphs[i].x = x; + pglyphs[i].y = y; + pglyphs[i].glyph = g; + i++; + + next: + x += glyph->info.xOff; + y += glyph->info.yOff; + } + list++; + } + + if (!(srcImage = image_from_pict(pSrc, FALSE, &srcXoff, &srcYoff))) + goto out; + + if (!(dstImage = image_from_pict(pDst, TRUE, &dstXoff, &dstYoff))) + goto out_free_src; + + if (maskFormat) { + pixman_format_code_t format; + pixman_box32_t extents; + int x, y; + + format = maskFormat->format | (maskFormat->depth << 24); + + pixman_glyph_get_extents(glyphCache, n_glyphs, pglyphs, &extents); + + x = extents.x1; + y = extents.y1; + + pixman_composite_glyphs(op, srcImage, dstImage, format, + xSrc + srcXoff + xDst, ySrc + srcYoff + yDst, + x, y, + x + dstXoff, y + dstYoff, + extents.x2 - extents.x1, + extents.y2 - extents.y1, + glyphCache, n_glyphs, pglyphs); + } + else { + pixman_composite_glyphs_no_mask(op, srcImage, dstImage, + xSrc + srcXoff - xDst, ySrc + srcYoff - yDst, + dstXoff, dstYoff, + glyphCache, n_glyphs, pglyphs); + } + + free_pixman_pict(pDst, dstImage); + +out_free_src: + free_pixman_pict(pSrc, srcImage); + +out: + pixman_glyph_cache_thaw(glyphCache); + if (pglyphs != stack_glyphs) + free(pglyphs); +} + static pixman_image_t * create_solid_fill_image(PicturePtr pict) { @@ -357,7 +507,8 @@ fbPictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats) return FALSE; ps = GetPictureScreen(pScreen); ps->Composite = fbComposite; - ps->Glyphs = miGlyphs; + ps->Glyphs = fbGlyphs; + ps->UnrealizeGlyph = fbUnrealizeGlyph; ps->CompositeRects = miCompositeRects; ps->RasterizeTrapezoid = fbRasterizeTrapezoid; ps->Trapezoids = fbTrapezoids; diff --git a/xserver/fb/fbscreen.c b/xserver/fb/fbscreen.c index c0903ec5c..f9080a445 100644 --- a/xserver/fb/fbscreen.c +++ b/xserver/fb/fbscreen.c @@ -27,11 +27,12 @@ #include "fb.h" Bool -fbCloseScreen(int index, ScreenPtr pScreen) +fbCloseScreen(ScreenPtr pScreen) { int d; DepthPtr depths = pScreen->allowedDepths; + fbDestroyGlyphCache(); for (d = 0; d < pScreen->numDepths; d++) free(depths[d].vids); free(depths); @@ -85,7 +86,7 @@ _fbGetWindowPixmap(WindowPtr pWindow) void _fbSetWindowPixmap(WindowPtr pWindow, PixmapPtr pPixmap) { - dixSetPrivate(&pWindow->devPrivates, fbGetWinPrivateKey(), pPixmap); + dixSetPrivate(&pWindow->devPrivates, fbGetWinPrivateKey(pWindow), pPixmap); } Bool @@ -95,7 +96,7 @@ fbSetupScreen(ScreenPtr pScreen, pointer pbits, /* pointer to screen bitmap */ int dpiy, int width, /* pixel width of frame buffer */ int bpp) { /* bits per pixel for screen */ - if (!fbAllocatePrivates(pScreen, NULL)) + if (!fbAllocatePrivates(pScreen)) return FALSE; pScreen->defColormap = FakeClientID(0); /* let CreateDefColormap do whatever it wants for pixels */ diff --git a/xserver/fb/fbseg.c b/xserver/fb/fbseg.c index 0e4e0a9f7..1848387f6 100644 --- a/xserver/fb/fbseg.c +++ b/xserver/fb/fbseg.c @@ -65,6 +65,12 @@ fbBresSolid(DrawablePtr pDrawable, if (axis == X_AXIS) { bits = 0; while (len--) { + if (e >= 0) { + WRITE(dst, FbDoMaskRRop (READ(dst), and, xor, bits)); + bits = 0; + dst += dstStride; + e += e3; + } bits |= mask; mask = fbBresShiftMask(mask, signdx, dstBpp); if (!mask) { @@ -74,21 +80,12 @@ fbBresSolid(DrawablePtr pDrawable, mask = mask0; } e += e1; - if (e >= 0) { - WRITE(dst, FbDoMaskRRop(READ(dst), and, xor, bits)); - bits = 0; - dst += dstStride; - e += e3; - } } if (bits) WRITE(dst, FbDoMaskRRop(READ(dst), and, xor, bits)); } else { while (len--) { - WRITE(dst, FbDoMaskRRop(READ(dst), and, xor, mask)); - dst += dstStride; - e += e1; if (e >= 0) { e += e3; mask = fbBresShiftMask(mask, signdx, dstBpp); @@ -97,6 +94,9 @@ fbBresSolid(DrawablePtr pDrawable, mask = mask0; } } + WRITE(dst, FbDoMaskRRop(READ(dst), and, xor, mask)); + dst += dstStride; + e += e1; } } diff --git a/xserver/fb/fbwindow.c b/xserver/fb/fbwindow.c index d27ccd4d5..368c4b883 100644 --- a/xserver/fb/fbwindow.c +++ b/xserver/fb/fbwindow.c @@ -31,7 +31,7 @@ Bool fbCreateWindow(WindowPtr pWin) { - dixSetPrivate(&pWin->devPrivates, fbGetWinPrivateKey(), + dixSetPrivate(&pWin->devPrivates, fbGetWinPrivateKey(pWin), fbGetScreenPixmap(pWin->drawable.pScreen)); if (pWin->drawable.bitsPerPixel == 32) pWin->drawable.bitsPerPixel = diff --git a/xserver/fb/wfbrename.h b/xserver/fb/wfbrename.h index 8b896eb9a..588440c2b 100644 --- a/xserver/fb/wfbrename.h +++ b/xserver/fb/wfbrename.h @@ -69,15 +69,11 @@ #define fbFixCoordModePrevious wfbFixCoordModePrevious #define fbGCFuncs wfbGCFuncs #define fbGCOps wfbGCOps -#define fbGCPrivateKeyRec wfbGCPrivateKeyRec #define fbGeneration wfbGeneration -#define fbGetGCPrivateKey wfbGetGCPrivateKey #define fbGetImage wfbGetImage #define fbGetScreenPrivateKey wfbGetScreenPrivateKey #define fbGetSpans wfbGetSpans #define _fbGetWindowPixmap _wfbGetWindowPixmap -#define fbWinPrivateKeyRec wfbWinPrivateKeyRec -#define fbGetWinPrivateKey wfbGetWinPrivateKey #define fbGlyph16 wfbGlyph16 #define fbGlyph24 wfbGlyph24 #define fbGlyph32 wfbGlyph32 diff --git a/xserver/glx/Makefile.am b/xserver/glx/Makefile.am index ced78b76a..591c4ac66 100644 --- a/xserver/glx/Makefile.am +++ b/xserver/glx/Makefile.am @@ -7,10 +7,8 @@ noinst_LTLIBRARIES = libglx.la $(GLXDRI_LIBRARY) AM_CFLAGS = \ @DIX_CFLAGS@ \ @GL_CFLAGS@ \ - @DRI_CFLAGS@ \ @XLIB_CFLAGS@ \ @LIBDRM_CFLAGS@ \ - @DRIPROTO_CFLAGS@ \ @GLX_DEFINES@ \ @GLX_ARCH_DEFINES@ diff --git a/xserver/glx/Makefile.in b/xserver/glx/Makefile.in index 0912a70fc..9fd07342f 100644 --- a/xserver/glx/Makefile.in +++ b/xserver/glx/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -201,13 +201,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -229,6 +225,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -253,6 +250,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -268,7 +266,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -367,6 +364,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -471,10 +469,8 @@ noinst_LTLIBRARIES = libglx.la $(GLXDRI_LIBRARY) AM_CFLAGS = \ @DIX_CFLAGS@ \ @GL_CFLAGS@ \ - @DRI_CFLAGS@ \ @XLIB_CFLAGS@ \ @LIBDRM_CFLAGS@ \ - @DRIPROTO_CFLAGS@ \ @GLX_DEFINES@ \ @GLX_ARCH_DEFINES@ @@ -553,7 +549,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -578,9 +574,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/glx/clientinfo.c b/xserver/glx/clientinfo.c index 15bbf15af..4aaa4c967 100644 --- a/xserver/glx/clientinfo.c +++ b/xserver/glx/clientinfo.c @@ -26,27 +26,85 @@ #include "glxserver.h" #include "indirect_dispatch.h" +#include "glxbyteorder.h" +#include "unpack.h" + +static int +set_client_info(__GLXclientState * cl, xGLXSetClientInfoARBReq * req, + unsigned bytes_per_version) +{ + char *gl_extensions; + char *glx_extensions; + + /* Verify that the size of the packet matches the size inferred from the + * sizes specified for the various fields. + */ + const unsigned expected_size = sz_xGLXSetClientInfoARBReq + + (req->numVersions * bytes_per_version) + + __GLX_PAD(req->numGLExtensionBytes) + + __GLX_PAD(req->numGLXExtensionBytes); + + if (req->length != (expected_size / 4)) + return BadLength; + + /* Verify that the actual length of the GL extension string matches what's + * encoded in protocol packet. + */ + gl_extensions = (char *) (req + 1) + (req->numVersions * bytes_per_version); + if (req->numGLExtensionBytes != 0 + && memchr(gl_extensions, 0, + __GLX_PAD(req->numGLExtensionBytes)) == NULL) + return BadLength; + + /* Verify that the actual length of the GLX extension string matches + * what's encoded in protocol packet. + */ + glx_extensions = gl_extensions + __GLX_PAD(req->numGLExtensionBytes); + if (req->numGLXExtensionBytes != 0 + && memchr(glx_extensions, 0, + __GLX_PAD(req->numGLXExtensionBytes)) == NULL) + return BadLength; + + free(cl->GLClientextensions); + cl->GLClientextensions = strdup(gl_extensions); + + return 0; +} int __glXDisp_SetClientInfoARB(__GLXclientState * cl, GLbyte * pc) { - return BadRequest; + return set_client_info(cl, (xGLXSetClientInfoARBReq *) pc, 8); } int __glXDispSwap_SetClientInfoARB(__GLXclientState * cl, GLbyte * pc) { - return BadRequest; + xGLXSetClientInfoARBReq *req = (xGLXSetClientInfoARBReq *) pc; + + req->length = bswap_16(req->length); + req->numVersions = bswap_32(req->numVersions); + req->numGLExtensionBytes = bswap_32(req->numGLExtensionBytes); + req->numGLXExtensionBytes = bswap_32(req->numGLXExtensionBytes); + + return __glXDisp_SetClientInfoARB(cl, pc); } int __glXDisp_SetClientInfo2ARB(__GLXclientState * cl, GLbyte * pc) { - return BadRequest; + return set_client_info(cl, (xGLXSetClientInfoARBReq *) pc, 12); } int __glXDispSwap_SetClientInfo2ARB(__GLXclientState * cl, GLbyte * pc) { - return BadRequest; + xGLXSetClientInfoARBReq *req = (xGLXSetClientInfoARBReq *) pc; + + req->length = bswap_16(req->length); + req->numVersions = bswap_32(req->numVersions); + req->numGLExtensionBytes = bswap_32(req->numGLExtensionBytes); + req->numGLXExtensionBytes = bswap_32(req->numGLXExtensionBytes); + + return __glXDisp_SetClientInfo2ARB(cl, pc); } diff --git a/xserver/glx/createcontext.c b/xserver/glx/createcontext.c index 9c1eab3e4..13d21ccb9 100644 --- a/xserver/glx/createcontext.c +++ b/xserver/glx/createcontext.c @@ -24,13 +24,323 @@ #include #endif +#include #include "glxserver.h" +#include "glxext.h" #include "indirect_dispatch.h" +#define ALL_VALID_FLAGS \ + (GLX_CONTEXT_DEBUG_BIT_ARB | GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB \ + | GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB) + +static Bool +validate_GL_version(int major_version, int minor_version) +{ + if (major_version <= 0 || minor_version < 0) + return False; + + switch (major_version) { + case 1: + if (minor_version > 5) + return False; + break; + + case 2: + if (minor_version > 1) + return False; + break; + + case 3: + if (minor_version > 3) + return False; + break; + + default: + break; + } + + return True; +} + +static Bool +validate_render_type(uint32_t render_type) +{ + switch (render_type) { + case GLX_RGBA_TYPE: + case GLX_COLOR_INDEX_TYPE: + return True; + default: + return False; + } +} + int __glXDisp_CreateContextAttribsARB(__GLXclientState * cl, GLbyte * pc) { - return BadRequest; + ClientPtr client = cl->client; + xGLXCreateContextAttribsARBReq *req = (xGLXCreateContextAttribsARBReq *) pc; + int32_t *attribs = (req->numAttribs != 0) ? (int32_t *) (req + 1) : NULL; + unsigned i; + int major_version = 1; + int minor_version = 0; + uint32_t flags = 0; + uint32_t render_type = GLX_RGBA_TYPE; + __GLXcontext *ctx = NULL; + __GLXcontext *shareCtx = NULL; + __GLXscreen *glxScreen; + __GLXconfig *config; + int err; + + /* The GLX_ARB_create_context_robustness spec says: + * + * "The default value for GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB + * is GLX_NO_RESET_NOTIFICATION_ARB." + */ + int reset = GLX_NO_RESET_NOTIFICATION_ARB; + + /* The GLX_ARB_create_context_profile spec says: + * + * "The default value for GLX_CONTEXT_PROFILE_MASK_ARB is + * GLX_CONTEXT_CORE_PROFILE_BIT_ARB." + * + * The core profile only makes sense for OpenGL versions 3.2 and later. + * If the version ultimately specified is less than 3.2, the core profile + * bit is cleared (see below). + */ + int profile = GLX_CONTEXT_CORE_PROFILE_BIT_ARB; + + /* Verify that the size of the packet matches the size inferred from the + * sizes specified for the various fields. + */ + const unsigned expected_size = (sz_xGLXCreateContextAttribsARBReq + + (req->numAttribs * 8)) / 4; + + if (req->length != expected_size) + return BadLength; + + LEGAL_NEW_RESOURCE(req->context, client); + + /* The GLX_ARB_create_context spec says: + * + * "* If is not a valid GLXFBConfig, GLXBadFBConfig is + * generated." + * + * On the client, the screen comes from the FBConfig, so GLXBadFBConfig + * should be issued if the screen is nonsense. + */ + if (!validGlxScreen(client, req->screen, &glxScreen, &err)) + return __glXError(GLXBadFBConfig); + + if (!validGlxFBConfig(client, glxScreen, req->fbconfig, &config, &err)) + return __glXError(GLXBadFBConfig); + + /* Validate the context with which the new context should share resources. + */ + if (req->shareList != None) { + if (!validGlxContext(client, req->shareList, DixReadAccess, + &shareCtx, &err)) + return err; + + /* The crazy condition is because C doesn't have a logical XOR + * operator. Comparing directly for equality may fail if one is 1 and + * the other is 2 even though both are logically true. + */ + if (!!req->isDirect != !!shareCtx->isDirect) { + client->errorValue = req->shareList; + return BadMatch; + } + + /* The GLX_ARB_create_context spec says: + * + * "* If the server context state for ...was + * created on a different screen than the one referenced by + * ...BadMatch is generated." + */ + if (glxScreen != shareCtx->pGlxScreen) { + client->errorValue = shareCtx->pGlxScreen->pScreen->myNum; + return BadMatch; + } + } + + for (i = 0; i < req->numAttribs; i++) { + switch (attribs[i * 2]) { + case GLX_CONTEXT_MAJOR_VERSION_ARB: + major_version = attribs[2 * i + 1]; + break; + + case GLX_CONTEXT_MINOR_VERSION_ARB: + minor_version = attribs[2 * i + 1]; + break; + + case GLX_CONTEXT_FLAGS_ARB: + flags = attribs[2 * i + 1]; + break; + + case GLX_RENDER_TYPE: + render_type = attribs[2 * i + 1]; + break; + + case GLX_CONTEXT_PROFILE_MASK_ARB: + profile = attribs[2 * i + 1]; + break; + + case GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB: + reset = attribs[2 * i + 1]; + if (reset != GLX_NO_RESET_NOTIFICATION_ARB + && reset != GLX_LOSE_CONTEXT_ON_RESET_ARB) + return BadValue; + + break; + + default: + return BadValue; + } + } + + /* The GLX_ARB_create_context spec says: + * + * "If attributes GLX_CONTEXT_MAJOR_VERSION_ARB and + * GLX_CONTEXT_MINOR_VERSION_ARB, when considered together + * with attributes GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB and + * GLX_RENDER_TYPE, specify an OpenGL version and feature set + * that are not defined, BadMatch is generated. + * + * ...Feature deprecation was introduced with OpenGL 3.0, so + * forward-compatible contexts may only be requested for + * OpenGL 3.0 and above. Thus, examples of invalid + * combinations of attributes include: + * + * - Major version < 1 or > 3 + * - Major version == 1 and minor version < 0 or > 5 + * - Major version == 2 and minor version < 0 or > 1 + * - Major version == 3 and minor version > 2 + * - Forward-compatible flag set and major version < 3 + * - Color index rendering and major version >= 3" + */ + if (!validate_GL_version(major_version, minor_version)) + return BadMatch; + + if (major_version < 3 + && ((flags & GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB) != 0)) + return BadMatch; + + if (major_version >= 3 && render_type == GLX_COLOR_INDEX_TYPE) + return BadMatch; + + if (!validate_render_type(render_type)) + return BadValue; + + if ((flags & ~ALL_VALID_FLAGS) != 0) + return BadValue; + + /* The GLX_ARB_create_context_profile spec says: + * + * "* If attribute GLX_CONTEXT_PROFILE_MASK_ARB has no bits set; has + * any bits set other than GLX_CONTEXT_CORE_PROFILE_BIT_ARB and + * GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB; has more than one of + * these bits set; or if the implementation does not support the + * requested profile, then GLXBadProfileARB is generated." + */ + switch (profile) { + case GLX_CONTEXT_CORE_PROFILE_BIT_ARB: + case GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB: + break; + case GLX_CONTEXT_ES2_PROFILE_BIT_EXT: + /* The GLX_EXT_create_context_es2_profile spec says: + * + * "... If the version requested is 2.0, and the + * GLX_CONTEXT_ES2_PROFILE_BIT_EXT bit is set in the + * GLX_CONTEXT_PROFILE_MASK_ARB attribute (see below), then the + * context returned will implement OpenGL ES 2.0." + * + * It also says: + * + * "* If attribute GLX_CONTEXT_PROFILE_MASK_ARB has no bits set; + * has any bits set other than + * GLX_CONTEXT_CORE_PROFILE_BIT_ARB, + * GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB, or + * GLX_CONTEXT_ES2_PROFILE_BIT_EXT; has more than one of these + * bits set; or if the implementation does not supported the + * requested profile, then GLXBadProfileARB is generated." + * + * It does not specifically say what is supposed to happen if + * GLX_CONTEXT_ES2_PROFILE_BIT_EXT is set but the version requested is + * not 2.0. We choose to generate GLXBadProfileARB as this matches + * NVIDIA's behavior. + */ + if (major_version != 2 || minor_version != 0) + return __glXError(GLXBadProfileARB); + break; + default: + return __glXError(GLXBadProfileARB); + } + + /* The GLX_ARB_create_context_robustness spec says: + * + * "* If the reset notification behavior of and the + * newly created context are different, BadMatch is generated." + */ + if (shareCtx != NULL && shareCtx->resetNotificationStrategy != reset) + return BadMatch; + + /* There is no GLX protocol for desktop OpenGL versions after 1.4. There + * is no GLX protocol for any version of OpenGL ES. If the application is + * requested an indirect rendering context for a version that cannot be + * satisfied, reject it. + * + * The GLX_ARB_create_context spec says: + * + * "* If does not support compatible OpenGL contexts + * providing the requested API major and minor version, + * forward-compatible flag, and debug context flag, GLXBadFBConfig + * is generated." + */ + if (!req->isDirect && (major_version > 1 || minor_version > 4 + || profile == GLX_CONTEXT_ES2_PROFILE_BIT_EXT)) { + return __glXError(GLXBadFBConfig); + } + + /* Allocate memory for the new context + */ + if (req->isDirect) { + ctx = __glXdirectContextCreate(glxScreen, config, shareCtx); + err = BadAlloc; + } + else { + ctx = glxScreen->createContext(glxScreen, config, shareCtx, + req->numAttribs, (uint32_t *) attribs, + &err); + } + + if (ctx == NULL) + return err; + + ctx->pGlxScreen = glxScreen; + ctx->config = config; + ctx->id = req->context; + ctx->share_id = req->shareList; + ctx->idExists = True; + ctx->isCurrent = False; + ctx->isDirect = req->isDirect; + ctx->hasUnflushedCommands = False; + ctx->renderMode = GL_RENDER; + ctx->feedbackBuf = NULL; + ctx->feedbackBufSize = 0; + ctx->selectBuf = NULL; + ctx->selectBufSize = 0; + ctx->drawPriv = NULL; + ctx->readPriv = NULL; + ctx->resetNotificationStrategy = reset; + + /* Add the new context to the various global tables of GLX contexts. + */ + if (!__glXAddContext(ctx)) { + (*ctx->destroy) (ctx); + client->errorValue = req->context; + return BadAlloc; + } + + return Success; } int diff --git a/xserver/glx/extension_string.c b/xserver/glx/extension_string.c index 866f8bf45..544ca1f5e 100644 --- a/xserver/glx/extension_string.c +++ b/xserver/glx/extension_string.c @@ -67,23 +67,29 @@ struct extension_info { static const struct extension_info known_glx_extensions[] = { /* GLX_ARB_get_proc_address is implemented on the client. */ - {GLX(ARB_multisample), VER(1, 4), Y,}, + /* *INDENT-OFF* */ + { GLX(ARB_create_context), VER(0,0), N, }, + { GLX(ARB_create_context_profile), VER(0,0), N, }, + { GLX(ARB_create_context_robustness), VER(0,0), N, }, + { GLX(ARB_multisample), VER(1,4), Y, }, - {GLX(EXT_import_context), VER(0, 0), Y,}, - {GLX(EXT_texture_from_pixmap), VER(0, 0), Y,}, - {GLX(EXT_visual_info), VER(0, 0), Y,}, - {GLX(EXT_visual_rating), VER(0, 0), Y,}, + { GLX(EXT_create_context_es2_profile), VER(0,0), N, }, + { GLX(EXT_import_context), VER(0,0), Y, }, + { GLX(EXT_texture_from_pixmap), VER(0,0), Y, }, + { GLX(EXT_visual_info), VER(0,0), Y, }, + { GLX(EXT_visual_rating), VER(0,0), Y, }, - {GLX(MESA_copy_sub_buffer), VER(0, 0), N,}, - {GLX(OML_swap_method), VER(0, 0), Y,}, - {GLX(SGI_make_current_read), VER(1, 3), N,}, - {GLX(SGI_swap_control), VER(0, 0), N,}, - {GLX(SGIS_multisample), VER(0, 0), Y,}, - {GLX(SGIX_fbconfig), VER(1, 3), Y,}, - {GLX(SGIX_pbuffer), VER(1, 3), Y,}, - {GLX(SGIX_visual_select_group), VER(0, 0), Y,}, - {GLX(INTEL_swap_event), VER(1, 4), N,}, - {NULL} + { GLX(MESA_copy_sub_buffer), VER(0,0), N, }, + { GLX(OML_swap_method), VER(0,0), Y, }, + { GLX(SGI_make_current_read), VER(1,3), N, }, + { GLX(SGI_swap_control), VER(0,0), N, }, + { GLX(SGIS_multisample), VER(0,0), Y, }, + { GLX(SGIX_fbconfig), VER(1,3), Y, }, + { GLX(SGIX_pbuffer), VER(1,3), Y, }, + { GLX(SGIX_visual_select_group), VER(0,0), Y, }, + { GLX(INTEL_swap_event), VER(0,0), N, }, + { NULL } + /* *INDENT-ON* */ }; /** diff --git a/xserver/glx/extension_string.h b/xserver/glx/extension_string.h index e02213f8f..7a4a8b1c2 100644 --- a/xserver/glx/extension_string.h +++ b/xserver/glx/extension_string.h @@ -36,7 +36,11 @@ enum { /* GLX_ARB_get_proc_address is implemented on the client. */ - ARB_multisample_bit = 0, + ARB_create_context_bit = 0, + ARB_create_context_profile_bit, + ARB_create_context_robustness_bit, + ARB_multisample_bit, + EXT_create_context_es2_profile_bit, EXT_import_context_bit, EXT_texture_from_pixmap_bit, EXT_visual_info_bit, diff --git a/xserver/glx/glapi.c b/xserver/glx/glapi.c index 02e06ac1e..ad7329eff 100644 --- a/xserver/glx/glapi.c +++ b/xserver/glx/glapi.c @@ -490,7 +490,7 @@ init_glapi_relocs(void) char run_time_patch[] = { 0x65, 0xa1, 0, 0, 0, 0 /* movl %gs:0,%eax */ }; - GLuint *offset = (GLuint *) & run_time_patch[2]; /* 32-bits for x86/32 */ + GLuint *offset = (GLuint *) &run_time_patch[2]; /* 32-bits for x86/32 */ const GLubyte *const get_disp = (const GLubyte *) run_time_patch; GLubyte *curr_func = (GLubyte *) gl_dispatch_functions_start; diff --git a/xserver/glx/glxcmds.c b/xserver/glx/glxcmds.c index 24fed8f63..c1f4e22f8 100644 --- a/xserver/glx/glxcmds.c +++ b/xserver/glx/glxcmds.c @@ -50,7 +50,7 @@ #include "indirect_table.h" #include "indirect_util.h" -static int +_X_HIDDEN int validGlxScreen(ClientPtr client, int screen, __GLXscreen ** pGlxScreen, int *err) { @@ -67,7 +67,7 @@ validGlxScreen(ClientPtr client, int screen, __GLXscreen ** pGlxScreen, return TRUE; } -static int +_X_HIDDEN int validGlxFBConfig(ClientPtr client, __GLXscreen * pGlxScreen, XID id, __GLXconfig ** config, int *err) { @@ -131,7 +131,7 @@ validGlxFBConfigForWindow(ClientPtr client, __GLXconfig * config, return TRUE; } -static int +_X_HIDDEN int validGlxContext(ClientPtr client, XID id, int access_mode, __GLXcontext ** context, int *err) { @@ -200,7 +200,7 @@ __glXdirectContextDestroy(__GLXcontext * context) free(context); } -static __GLXcontext * +_X_HIDDEN __GLXcontext * __glXdirectContextCreate(__GLXscreen * screen, __GLXconfig * modes, __GLXcontext * shareContext) { @@ -251,20 +251,20 @@ DoCreateContext(__GLXclientState * cl, GLXContextID gcId, &shareglxc, &err)) return err; - if (shareglxc->isDirect) { - /* - ** NOTE: no support for sharing display lists between direct - ** contexts, even if they are in the same address space. - */ -#if 0 - /* Disabling this code seems to allow shared display lists - * and texture objects to work. We'll leave it disabled for now. - */ + /* Page 26 (page 32 of the PDF) of the GLX 1.4 spec says: + * + * "The server context state for all sharing contexts must exist + * in a single address space or a BadMatch error is generated." + * + * If the share context is indirect, force the new context to also be + * indirect. If the shard context is direct but the new context + * cannot be direct, generate BadMatch. + */ + if (shareglxc->isDirect && !isDirect) { client->errorValue = shareList; return BadMatch; -#endif } - else { + else if (!shareglxc->isDirect) { /* ** Create an indirect context regardless of what the client asked ** for; this way we can share display list space with shareList. @@ -276,42 +276,55 @@ DoCreateContext(__GLXclientState * cl, GLXContextID gcId, /* ** Allocate memory for the new context */ - if (!isDirect) - glxc = pGlxScreen->createContext(pGlxScreen, config, shareglxc); + if (!isDirect) { + /* Without any attributes, the only error that the driver should be + * able to generate is BadAlloc. As result, just drop the error + * returned from the driver on the floor. + */ + glxc = pGlxScreen->createContext(pGlxScreen, config, shareglxc, + 0, NULL, &err); + } else glxc = __glXdirectContextCreate(pGlxScreen, config, shareglxc); if (!glxc) { return BadAlloc; } - /* - ** Initially, setup the part of the context that could be used by - ** a GL core that needs windowing information (e.g., Mesa). + /* Initialize the GLXcontext structure. */ glxc->pGlxScreen = pGlxScreen; glxc->config = config; - - /* - ** Register this context as a resource. - */ - if (!AddResource(gcId, __glXContextRes, (pointer) glxc)) { - (*glxc->destroy) (glxc); - client->errorValue = gcId; - return BadAlloc; - } - - /* - ** Finally, now that everything is working, setup the rest of the - ** context. - */ glxc->id = gcId; glxc->share_id = shareList; glxc->idExists = GL_TRUE; glxc->isCurrent = GL_FALSE; glxc->isDirect = isDirect; + glxc->hasUnflushedCommands = GL_FALSE; glxc->renderMode = GL_RENDER; + glxc->feedbackBuf = NULL; + glxc->feedbackBufSize = 0; + glxc->selectBuf = NULL; + glxc->selectBufSize = 0; + glxc->drawPriv = NULL; + glxc->readPriv = NULL; - __glXAddToContextList(glxc); + /* The GLX_ARB_create_context_robustness spec says: + * + * "The default value for GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB + * is GLX_NO_RESET_NOTIFICATION_ARB." + * + * Without using glXCreateContextAttribsARB, there is no way to specify a + * non-default reset notification strategy. + */ + glxc->resetNotificationStrategy = GLX_NO_RESET_NOTIFICATION_ARB; + + /* Add the new context to the various global tables of GLX contexts. + */ + if (!__glXAddContext(glxc)) { + (*glxc->destroy) (glxc); + client->errorValue = gcId; + return BadAlloc; + } return Success; } @@ -638,23 +651,23 @@ DoMakeCurrent(__GLXclientState * cl, StopUsingContext(prevglxc); + reply = (xGLXMakeCurrentReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .contextTag = 0 + }; + if (glxc) { StartUsingContext(cl, glxc); reply.contextTag = glxc->id; } - else { - reply.contextTag = 0; - } - - reply.length = 0; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; if (client->swapped) { __glXSwapMakeCurrentReply(client, &reply); } else { - WriteToClient(client, sz_xGLXMakeCurrentReply, (char *) &reply); + WriteToClient(client, sz_xGLXMakeCurrentReply, &reply); } return Success; } @@ -709,16 +722,18 @@ __glXDisp_IsDirect(__GLXclientState * cl, GLbyte * pc) if (!validGlxContext(cl->client, req->context, DixReadAccess, &glxc, &err)) return err; - reply.isDirect = glxc->isDirect; - reply.length = 0; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; + reply = (xGLXIsDirectReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .isDirect = glxc->isDirect + }; if (client->swapped) { __glXSwapIsDirectReply(client, &reply); } else { - WriteToClient(client, sz_xGLXIsDirectReply, (char *) &reply); + WriteToClient(client, sz_xGLXIsDirectReply, &reply); } return Success; @@ -744,17 +759,19 @@ __glXDisp_QueryVersion(__GLXclientState * cl, GLbyte * pc) ** client if it wants to work with older clients; however, in this ** implementation the server just returns its version number. */ - reply.majorVersion = glxMajorVersion; - reply.minorVersion = glxMinorVersion; - reply.length = 0; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; + reply = (xGLXQueryVersionReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .majorVersion = glxMajorVersion, + .minorVersion = glxMinorVersion + }; if (client->swapped) { __glXSwapQueryVersionReply(client, &reply); } else { - WriteToClient(client, sz_xGLXQueryVersionReply, (char *) &reply); + WriteToClient(client, sz_xGLXQueryVersionReply, &reply); } return Success; } @@ -922,12 +939,14 @@ __glXDisp_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc) if (!validGlxScreen(cl->client, req->screen, &pGlxScreen, &err)) return err; - reply.numVisuals = pGlxScreen->numVisuals; - reply.numProps = GLX_VIS_CONFIG_TOTAL; - reply.length = - (reply.numVisuals * __GLX_SIZE_CARD32 * GLX_VIS_CONFIG_TOTAL) >> 2; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; + reply = (xGLXGetVisualConfigsReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = (pGlxScreen->numVisuals * + __GLX_SIZE_CARD32 * GLX_VIS_CONFIG_TOTAL) >> 2, + .numVisuals = pGlxScreen->numVisuals, + .numProps = GLX_VIS_CONFIG_TOTAL + }; if (client->swapped) { __GLX_SWAP_SHORT(&reply.sequenceNumber); @@ -936,7 +955,7 @@ __glXDisp_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc) __GLX_SWAP_INT(&reply.numProps); } - WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *) &reply); + WriteToClient(client, sz_xGLXGetVisualConfigsReply, &reply); for (i = 0; i < pGlxScreen->numVisuals; i++) { modes = pGlxScreen->visuals[i]; @@ -993,7 +1012,7 @@ __glXDisp_GetVisualConfigs(__GLXclientState * cl, GLbyte * pc) if (client->swapped) { __GLX_SWAP_INT_ARRAY(buf, p); } - WriteToClient(client, __GLX_SIZE_CARD32 * p, (char *) buf); + WriteToClient(client, __GLX_SIZE_CARD32 * p, buf); } return Success; } @@ -1026,11 +1045,13 @@ DoGetFBConfigs(__GLXclientState * cl, unsigned screen) if (!validGlxScreen(cl->client, screen, &pGlxScreen, &err)) return err; - reply.numFBConfigs = pGlxScreen->numFBConfigs; - reply.numAttribs = __GLX_TOTAL_FBCONFIG_ATTRIBS; - reply.length = (__GLX_FBCONFIG_ATTRIBS_LENGTH * reply.numFBConfigs); - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; + reply = (xGLXGetFBConfigsReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = __GLX_FBCONFIG_ATTRIBS_LENGTH * pGlxScreen->numFBConfigs, + .numFBConfigs = pGlxScreen->numFBConfigs, + .numAttribs = __GLX_TOTAL_FBCONFIG_ATTRIBS + }; if (client->swapped) { __GLX_SWAP_SHORT(&reply.sequenceNumber); @@ -1039,7 +1060,7 @@ DoGetFBConfigs(__GLXclientState * cl, unsigned screen) __GLX_SWAP_INT(&reply.numAttribs); } - WriteToClient(client, sz_xGLXGetFBConfigsReply, (char *) &reply); + WriteToClient(client, sz_xGLXGetFBConfigsReply, &reply); for (modes = pGlxScreen->fbconfigs; modes != NULL; modes = modes->next) { p = 0; @@ -1650,10 +1671,12 @@ DoQueryContext(__GLXclientState * cl, GLXContextID gcId) return err; nProps = 3; - reply.length = nProps << 1; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.n = nProps; + reply = (xGLXQueryContextInfoEXTReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = nProps << 1, + .n = nProps + }; nReplyBytes = reply.length << 2; sendBuf = (int *) malloc((size_t) nReplyBytes); @@ -1672,8 +1695,8 @@ DoQueryContext(__GLXclientState * cl, GLXContextID gcId) __glXSwapQueryContextInfoEXTReply(client, &reply, sendBuf); } else { - WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *) &reply); - WriteToClient(client, nReplyBytes, (char *) sendBuf); + WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, &reply); + WriteToClient(client, nReplyBytes, sendBuf); } free((char *) sendBuf); @@ -1857,10 +1880,12 @@ DoGetDrawableAttributes(__GLXclientState * cl, XID drawId) return error; numAttribs = 3; - reply.length = numAttribs << 1; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.numAttribs = numAttribs; + reply = (xGLXGetDrawableAttributesReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = numAttribs << 1, + .numAttribs = numAttribs + }; attributes[0] = GLX_TEXTURE_TARGET_EXT; attributes[1] = pGlxDraw->target == GL_TEXTURE_2D ? GLX_TEXTURE_2D_EXT : @@ -1874,10 +1899,8 @@ DoGetDrawableAttributes(__GLXclientState * cl, XID drawId) __glXSwapGetDrawableAttributesReply(client, &reply, attributes); } else { - WriteToClient(client, sz_xGLXGetDrawableAttributesReply, - (char *) &reply); - WriteToClient(client, reply.length * sizeof(CARD32), - (char *) attributes); + WriteToClient(client, sz_xGLXGetDrawableAttributesReply, &reply); + WriteToClient(client, reply.length * sizeof(CARD32), attributes); } return Success; @@ -2298,13 +2321,15 @@ __glXDisp_QueryExtensionsString(__GLXclientState * cl, GLbyte * pc) n = strlen(pGlxScreen->GLXextensions) + 1; length = __GLX_PAD(n) >> 2; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.length = length; - reply.n = n; + reply = (xGLXQueryExtensionsStringReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = length, + .n = n + }; /* Allocate buffer to make sure it's a multiple of 4 bytes big. */ - buf = (char *) malloc(length << 2); + buf = calloc(length, 4); if (buf == NULL) return BadAlloc; memcpy(buf, pGlxScreen->GLXextensions, n); @@ -2313,9 +2338,8 @@ __glXDisp_QueryExtensionsString(__GLXclientState * cl, GLbyte * pc) glxSwapQueryExtensionsStringReply(client, &reply, buf); } else { - WriteToClient(client, sz_xGLXQueryExtensionsStringReply, - (char *) &reply); - WriteToClient(client, (int) (length << 2), (char *) buf); + WriteToClient(client, sz_xGLXQueryExtensionsStringReply, &reply); + WriteToClient(client, (int) (length << 2), buf); } free(buf); @@ -2360,12 +2384,14 @@ __glXDisp_QueryServerString(__GLXclientState * cl, GLbyte * pc) n = strlen(ptr) + 1; length = __GLX_PAD(n) >> 2; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.length = length; - reply.n = n; + reply = (xGLXQueryServerStringReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = length, + .n = n + }; - buf = (char *) malloc(length << 2); + buf = calloc(length, 4); if (buf == NULL) { return BadAlloc; } @@ -2375,7 +2401,7 @@ __glXDisp_QueryServerString(__GLXclientState * cl, GLbyte * pc) glxSwapQueryServerStringReply(client, &reply, buf); } else { - WriteToClient(client, sz_xGLXQueryServerStringReply, (char *) &reply); + WriteToClient(client, sz_xGLXQueryServerStringReply, &reply); WriteToClient(client, (int) (length << 2), buf); } @@ -2396,8 +2422,6 @@ __glXDisp_ClientInfo(__GLXclientState * cl, GLbyte * pc) if (!memchr(buf, 0, (client->req_len << 2) - sizeof(xGLXClientInfoReq))) return BadLength; - cl->GLClientmajorVersion = req->major; - cl->GLClientminorVersion = req->minor; free(cl->GLClientextensions); cl->GLClientextensions = strdup(buf); diff --git a/xserver/glx/glxcmdsswap.c b/xserver/glx/glxcmdsswap.c index e8520d6cb..43f88d335 100644 --- a/xserver/glx/glxcmdsswap.c +++ b/xserver/glx/glxcmdsswap.c @@ -840,7 +840,7 @@ __glXSwapMakeCurrentReply(ClientPtr client, xGLXMakeCurrentReply * reply) __GLX_SWAP_SHORT(&reply->sequenceNumber); __GLX_SWAP_INT(&reply->length); __GLX_SWAP_INT(&reply->contextTag); - WriteToClient(client, sz_xGLXMakeCurrentReply, (char *) reply); + WriteToClient(client, sz_xGLXMakeCurrentReply, reply); } void @@ -849,7 +849,7 @@ __glXSwapIsDirectReply(ClientPtr client, xGLXIsDirectReply * reply) __GLX_DECLARE_SWAP_VARIABLES; __GLX_SWAP_SHORT(&reply->sequenceNumber); __GLX_SWAP_INT(&reply->length); - WriteToClient(client, sz_xGLXIsDirectReply, (char *) reply); + WriteToClient(client, sz_xGLXIsDirectReply, reply); } void @@ -860,7 +860,7 @@ __glXSwapQueryVersionReply(ClientPtr client, xGLXQueryVersionReply * reply) __GLX_SWAP_INT(&reply->length); __GLX_SWAP_INT(&reply->majorVersion); __GLX_SWAP_INT(&reply->minorVersion); - WriteToClient(client, sz_xGLXQueryVersionReply, (char *) reply); + WriteToClient(client, sz_xGLXQueryVersionReply, reply); } void @@ -875,7 +875,7 @@ glxSwapQueryExtensionsStringReply(ClientPtr client, __GLX_SWAP_SHORT(&reply->sequenceNumber); __GLX_SWAP_INT(&reply->length); __GLX_SWAP_INT(&reply->n); - WriteToClient(client, sz_xGLXQueryExtensionsStringReply, (char *) reply); + WriteToClient(client, sz_xGLXQueryExtensionsStringReply, reply); __GLX_SWAP_INT_ARRAY((int *) buf, length); WriteToClient(client, length << 2, buf); } @@ -890,7 +890,7 @@ glxSwapQueryServerStringReply(ClientPtr client, __GLX_SWAP_SHORT(&reply->sequenceNumber); __GLX_SWAP_INT(&reply->length); __GLX_SWAP_INT(&reply->n); - WriteToClient(client, sz_xGLXQueryServerStringReply, (char *) reply); + WriteToClient(client, sz_xGLXQueryServerStringReply, reply); /** no swap is needed for an array of chars **/ /* __GLX_SWAP_INT_ARRAY((int *)buf, length); */ WriteToClient(client, length << 2, buf); @@ -908,9 +908,9 @@ __glXSwapQueryContextInfoEXTReply(ClientPtr client, __GLX_SWAP_SHORT(&reply->sequenceNumber); __GLX_SWAP_INT(&reply->length); __GLX_SWAP_INT(&reply->n); - WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *) reply); + WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, reply); __GLX_SWAP_INT_ARRAY((int *) buf, length); - WriteToClient(client, length << 2, (char *) buf); + WriteToClient(client, length << 2, buf); } void @@ -925,9 +925,9 @@ __glXSwapGetDrawableAttributesReply(ClientPtr client, __GLX_SWAP_SHORT(&reply->sequenceNumber); __GLX_SWAP_INT(&reply->length); __GLX_SWAP_INT(&reply->numAttribs); - WriteToClient(client, sz_xGLXGetDrawableAttributesReply, (char *) reply); + WriteToClient(client, sz_xGLXGetDrawableAttributesReply, reply); __GLX_SWAP_INT_ARRAY((int *) buf, length); - WriteToClient(client, length << 2, (char *) buf); + WriteToClient(client, length << 2, buf); } /************************************************************************/ diff --git a/xserver/glx/glxcontext.h b/xserver/glx/glxcontext.h index ef2c4dbd5..4764e56f5 100644 --- a/xserver/glx/glxcontext.h +++ b/xserver/glx/glxcontext.h @@ -104,6 +104,11 @@ struct __GLXcontext { */ GLenum renderMode; + /** + * Reset notification strategy used when a GPU reset occurs. + */ + GLenum resetNotificationStrategy; + /* ** Buffers for feedback and selection. */ @@ -121,4 +126,17 @@ struct __GLXcontext { void __glXContextDestroy(__GLXcontext * context); +extern int validGlxScreen(ClientPtr client, int screen, + __GLXscreen ** pGlxScreen, int *err); + +extern int validGlxFBConfig(ClientPtr client, __GLXscreen * pGlxScreen, + XID id, __GLXconfig ** config, int *err); + +extern int validGlxContext(ClientPtr client, XID id, int access_mode, + __GLXcontext ** context, int *err); + +extern __GLXcontext *__glXdirectContextCreate(__GLXscreen * screen, + __GLXconfig * modes, + __GLXcontext * shareContext); + #endif /* !__GLX_context_h__ */ diff --git a/xserver/glx/glxdri.c b/xserver/glx/glxdri.c index 9b8b66f0c..da4646845 100644 --- a/xserver/glx/glxdri.c +++ b/xserver/glx/glxdri.c @@ -599,7 +599,10 @@ __glXDRIscreenDestroy(__GLXscreen * baseScreen) static __GLXcontext * __glXDRIscreenCreateContext(__GLXscreen * baseScreen, __GLXconfig * glxConfig, - __GLXcontext * baseShareContext) + __GLXcontext * baseShareContext, + unsigned num_attribs, + const uint32_t *attribs, + int *error) { __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen; __GLXDRIcontext *context, *shareContext; @@ -611,6 +614,13 @@ __glXDRIscreenCreateContext(__GLXscreen * baseScreen, drm_context_t hwContext; ScreenPtr pScreen = baseScreen->pScreen; + /* DRI1 cannot support createContextAttribs, so these parameters will + * never be used. + */ + (void) num_attribs; + (void) attribs; + (void) error; + shareContext = (__GLXDRIcontext *) baseShareContext; if (shareContext) driShare = shareContext->driContext; @@ -846,18 +856,17 @@ static const __DRIextension *loader_extensions[] = { }; static Bool -glxDRIEnterVT(int index, int flags) +glxDRIEnterVT(ScrnInfoPtr scrn) { - ScrnInfoPtr scrn = xf86Screens[index]; Bool ret; __GLXDRIscreen *screen = (__GLXDRIscreen *) - glxGetScreen(screenInfo.screens[index]); + glxGetScreen(xf86ScrnToScreen(scrn)); LogMessage(X_INFO, "AIGLX: Resuming AIGLX clients after VT switch\n"); scrn->EnterVT = screen->enterVT; - ret = scrn->EnterVT(index, flags); + ret = scrn->EnterVT(scrn); screen->enterVT = scrn->EnterVT; scrn->EnterVT = glxDRIEnterVT; @@ -871,18 +880,17 @@ glxDRIEnterVT(int index, int flags) } static void -glxDRILeaveVT(int index, int flags) +glxDRILeaveVT(ScrnInfoPtr scrn) { - ScrnInfoPtr scrn = xf86Screens[index]; __GLXDRIscreen *screen = (__GLXDRIscreen *) - glxGetScreen(screenInfo.screens[index]); + glxGetScreen(xf86ScrnToScreen(scrn)); LogMessage(X_INFO, "AIGLX: Suspending AIGLX clients for VT switch\n"); glxSuspendClients(); scrn->LeaveVT = screen->leaveVT; - (*screen->leaveVT) (index, flags); + (*screen->leaveVT) (scrn); screen->leaveVT = scrn->LeaveVT; scrn->LeaveVT = glxDRILeaveVT; } @@ -961,7 +969,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) __GLXDRIscreen *screen; Bool isCapable; size_t buffer_size; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); if (!xf86LoaderCheckSymbol("DRIQueryDirectRenderingCapable") || !DRIQueryDirectRenderingCapable(pScreen, &isCapable) || !isCapable) { @@ -1061,7 +1069,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen) /* Map the framebuffer region. */ status = drmMap(fd, hFB, framebuffer.size, - (drmAddressPtr) & framebuffer.base); + (drmAddressPtr) &framebuffer.base); if (status != 0) { LogMessage(X_ERROR, "AIGLX error: drmMap of framebuffer failed (%s)\n", strerror(-status)); diff --git a/xserver/glx/glxdri2.c b/xserver/glx/glxdri2.c index aa38295fa..b26e501dc 100644 --- a/xserver/glx/glxdri2.c +++ b/xserver/glx/glxdri2.c @@ -47,6 +47,7 @@ #include "glxserver.h" #include "glxutil.h" #include "glxdricommon.h" +#include #include "glapitable.h" #include "glapi.h" @@ -58,6 +59,16 @@ typedef struct __GLXDRIscreen __GLXDRIscreen; typedef struct __GLXDRIcontext __GLXDRIcontext; typedef struct __GLXDRIdrawable __GLXDRIdrawable; + +#ifdef __DRI2_ROBUSTNESS +#define ALL_DRI_CTX_FLAGS (__DRI_CTX_FLAG_DEBUG \ + | __DRI_CTX_FLAG_FORWARD_COMPATIBLE \ + | __DRI_CTX_FLAG_ROBUST_BUFFER_ACCESS) +#else +#define ALL_DRI_CTX_FLAGS (__DRI_CTX_FLAG_DEBUG \ + | __DRI_CTX_FLAG_FORWARD_COMPATIBLE) +#endif + struct __GLXDRIscreen { __GLXscreen base; __DRIscreen *driScreen; @@ -95,6 +106,7 @@ struct __GLXDRIdrawable { int height; __DRIbuffer buffers[MAX_DRAWABLE_BUFFERS]; int count; + XID dri2_id; }; static void @@ -103,6 +115,8 @@ __glXDRIdrawableDestroy(__GLXdrawable * drawable) __GLXDRIdrawable *private = (__GLXDRIdrawable *) drawable; const __DRIcoreExtension *core = private->screen->core; + FreeResource(private->dri2_id, FALSE); + (*core->destroyDrawable) (private->driDrawable); __glXDrawableRelease(drawable); @@ -167,12 +181,13 @@ __glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust, CARD64 msc, CARD32 sbc) { __GLXdrawable *drawable = data; - xGLXBufferSwapComplete2 wire; + xGLXBufferSwapComplete2 wire = { + .type = __glXEventBase + GLX_BufferSwapComplete + }; if (!(drawable->eventMask & GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK)) return; - wire.type = __glXEventBase + GLX_BufferSwapComplete; switch (type) { case DRI2_EXCHANGE_COMPLETE: wire.event_type = GLX_EXCHANGE_COMPLETE_INTEL; @@ -377,10 +392,213 @@ __glXDRIscreenDestroy(__GLXscreen * baseScreen) free(screen); } +static Bool +dri2_convert_glx_attribs(__GLXDRIscreen *screen, unsigned num_attribs, + const uint32_t *attribs, + unsigned *major_ver, unsigned *minor_ver, + uint32_t *flags, int *api, int *reset, unsigned *error) +{ + unsigned i; + + if (num_attribs == 0) + return True; + + if (attribs == NULL) { + *error = BadImplementation; + return False; + } + + *major_ver = 1; + *minor_ver = 0; +#ifdef __DRI2_ROBUSTNESS + *reset = __DRI_CTX_RESET_NO_NOTIFICATION; +#else + (void) reset; +#endif + + for (i = 0; i < num_attribs; i++) { + switch (attribs[i * 2]) { + case GLX_CONTEXT_MAJOR_VERSION_ARB: + *major_ver = attribs[i * 2 + 1]; + break; + case GLX_CONTEXT_MINOR_VERSION_ARB: + *minor_ver = attribs[i * 2 + 1]; + break; + case GLX_CONTEXT_FLAGS_ARB: + *flags = attribs[i * 2 + 1]; + break; + case GLX_RENDER_TYPE: + break; + case GLX_CONTEXT_PROFILE_MASK_ARB: + switch (attribs[i * 2 + 1]) { + case GLX_CONTEXT_CORE_PROFILE_BIT_ARB: + *api = __DRI_API_OPENGL_CORE; + break; + case GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB: + *api = __DRI_API_OPENGL; + break; + case GLX_CONTEXT_ES2_PROFILE_BIT_EXT: + *api = __DRI_API_GLES2; + break; + default: + *error = __glXError(GLXBadProfileARB); + return False; + } + break; +#ifdef __DRI2_ROBUSTNESS + case GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB: + if (screen->dri2->base.version >= 4) { + *error = BadValue; + return False; + } + + switch (attribs[i * 2 + 1]) { + case GLX_NO_RESET_NOTIFICATION_ARB: + *reset = __DRI_CTX_RESET_NO_NOTIFICATION; + break; + case GLX_LOSE_CONTEXT_ON_RESET_ARB: + *reset = __DRI_CTX_RESET_LOSE_CONTEXT; + break; + default: + *error = BadValue; + return False; + } + break; +#endif + default: + /* If an unknown attribute is received, fail. + */ + *error = BadValue; + return False; + } + } + + /* Unknown flag value. + */ + if ((*flags & ~ALL_DRI_CTX_FLAGS) != 0) { + *error = BadValue; + return False; + } + + /* If the core profile is requested for a GL version is less than 3.2, + * request the non-core profile from the DRI driver. The core profile + * only makes sense for GL versions >= 3.2, and many DRI drivers that + * don't support OpenGL 3.2 may fail the request for a core profile. + */ + if (*api == __DRI_API_OPENGL_CORE + && (*major_ver < 3 || (*major_ver == 3 && *minor_ver < 2))) { + *api = __DRI_API_OPENGL; + } + + *error = Success; + return True; +} + +static void +create_driver_context(__GLXDRIcontext * context, + __GLXDRIscreen * screen, + __GLXDRIconfig * config, + __DRIcontext * driShare, + unsigned num_attribs, + const uint32_t *attribs, + int *error) +{ + context->driContext = NULL; + +#if __DRI_DRI2_VERSION >= 3 + if (screen->dri2->base.version >= 3) { + uint32_t ctx_attribs[3 * 2]; + unsigned num_ctx_attribs = 0; + unsigned dri_err = 0; + unsigned major_ver; + unsigned minor_ver; + uint32_t flags; + int reset; + int api = __DRI_API_OPENGL; + + if (num_attribs != 0) { + if (!dri2_convert_glx_attribs(screen, num_attribs, attribs, + &major_ver, &minor_ver, + &flags, &api, &reset, + (unsigned *) error)) + return; + + ctx_attribs[num_ctx_attribs++] = __DRI_CTX_ATTRIB_MAJOR_VERSION; + ctx_attribs[num_ctx_attribs++] = major_ver; + ctx_attribs[num_ctx_attribs++] = __DRI_CTX_ATTRIB_MINOR_VERSION; + ctx_attribs[num_ctx_attribs++] = minor_ver; + + if (flags != 0) { + ctx_attribs[num_ctx_attribs++] = __DRI_CTX_ATTRIB_FLAGS; + + /* The current __DRI_CTX_FLAG_* values are identical to the + * GLX_CONTEXT_*_BIT values. + */ + ctx_attribs[num_ctx_attribs++] = flags; + } + +#ifdef __DRI2_ROBUSTNESS + if (reset != __DRI_CTX_RESET_NO_NOTIFICATION) { + ctx_attribs[num_ctx_attribs++] = + __DRI_CTX_ATTRIB_RESET_STRATEGY; + ctx_attribs[num_ctx_attribs++] = reset; + } +#endif + } + + context->driContext = + (*screen->dri2->createContextAttribs)(screen->driScreen, + api, + config->driConfig, + driShare, + num_ctx_attribs / 2, + ctx_attribs, + &dri_err, + context); + + switch (dri_err) { + case __DRI_CTX_ERROR_SUCCESS: + *error = Success; + break; + case __DRI_CTX_ERROR_NO_MEMORY: + *error = BadAlloc; + break; + case __DRI_CTX_ERROR_BAD_API: + *error = __glXError(GLXBadProfileARB); + break; + case __DRI_CTX_ERROR_BAD_VERSION: + case __DRI_CTX_ERROR_BAD_FLAG: + *error = __glXError(GLXBadFBConfig); + break; + case __DRI_CTX_ERROR_UNKNOWN_ATTRIBUTE: + case __DRI_CTX_ERROR_UNKNOWN_FLAG: + default: + *error = BadValue; + break; + } + + return; + } +#endif + + if (num_attribs != 0) { + *error = BadValue; + return; + } + + context->driContext = + (*screen->dri2->createNewContext) (screen->driScreen, + config->driConfig, + driShare, context); +} + static __GLXcontext * __glXDRIscreenCreateContext(__GLXscreen * baseScreen, __GLXconfig * glxConfig, - __GLXcontext * baseShareContext) + __GLXcontext * baseShareContext, + unsigned num_attribs, + const uint32_t *attribs, + int *error) { __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen; __GLXDRIcontext *context, *shareContext; @@ -394,8 +612,10 @@ __glXDRIscreenCreateContext(__GLXscreen * baseScreen, driShare = NULL; context = calloc(1, sizeof *context); - if (context == NULL) + if (context == NULL) { + *error = BadAlloc; return NULL; + } context->base.destroy = __glXDRIcontextDestroy; context->base.makeCurrent = __glXDRIcontextMakeCurrent; @@ -404,10 +624,8 @@ __glXDRIscreenCreateContext(__GLXscreen * baseScreen, context->base.textureFromPixmap = &__glXDRItextureFromPixmap; context->base.wait = __glXDRIcontextWait; - context->driContext = - (*screen->dri2->createNewContext) (screen->driScreen, - config->driConfig, - driShare, context); + create_driver_context(context, screen, config, driShare, num_attribs, + attribs, error); if (context->driContext == NULL) { free(context); return NULL; @@ -456,8 +674,9 @@ __glXDRIscreenCreateDrawable(ClientPtr client, private->base.waitGL = __glXDRIdrawableWaitGL; private->base.waitX = __glXDRIdrawableWaitX; - if (DRI2CreateDrawable(client, pDraw, drawId, - __glXDRIinvalidateBuffers, private)) { + if (DRI2CreateDrawable2(client, pDraw, drawId, + __glXDRIinvalidateBuffers, private, + &private->dri2_id)) { free(private); return NULL; } @@ -587,18 +806,17 @@ static const __DRIextension *loader_extensions[] = { }; static Bool -glxDRIEnterVT(int index, int flags) +glxDRIEnterVT(ScrnInfoPtr scrn) { - ScrnInfoPtr scrn = xf86Screens[index]; Bool ret; __GLXDRIscreen *screen = (__GLXDRIscreen *) - glxGetScreen(screenInfo.screens[index]); + glxGetScreen(xf86ScrnToScreen(scrn)); LogMessage(X_INFO, "AIGLX: Resuming AIGLX clients after VT switch\n"); scrn->EnterVT = screen->enterVT; - ret = scrn->EnterVT(index, flags); + ret = scrn->EnterVT(scrn); screen->enterVT = scrn->EnterVT; scrn->EnterVT = glxDRIEnterVT; @@ -612,18 +830,17 @@ glxDRIEnterVT(int index, int flags) } static void -glxDRILeaveVT(int index, int flags) +glxDRILeaveVT(ScrnInfoPtr scrn) { - ScrnInfoPtr scrn = xf86Screens[index]; __GLXDRIscreen *screen = (__GLXDRIscreen *) - glxGetScreen(screenInfo.screens[index]); + glxGetScreen(xf86ScrnToScreen(scrn)); LogMessage(X_INFO, "AIGLX: Suspending AIGLX clients for VT switch\n"); glxSuspendClients(); scrn->LeaveVT = screen->leaveVT; - (*screen->leaveVT) (index, flags); + (*screen->leaveVT) (scrn); screen->leaveVT = scrn->LeaveVT; scrn->LeaveVT = glxDRILeaveVT; } @@ -643,6 +860,21 @@ initializeExtensions(__GLXDRIscreen * screen) __glXEnableExtension(screen->glx_enable_bits, "GLX_INTEL_swap_event"); LogMessage(X_INFO, "AIGLX: enabled GLX_INTEL_swap_event\n"); +#if __DRI_DRI2_VERSION >= 3 + if (screen->dri2->base.version >= 3) { + __glXEnableExtension(screen->glx_enable_bits, + "GLX_ARB_create_context"); + __glXEnableExtension(screen->glx_enable_bits, + "GLX_ARB_create_context_profile"); + __glXEnableExtension(screen->glx_enable_bits, + "GLX_EXT_create_context_es2_profile"); + LogMessage(X_INFO, "AIGLX: enabled GLX_ARB_create_context\n"); + LogMessage(X_INFO, "AIGLX: enabled GLX_ARB_create_context_profile\n"); + LogMessage(X_INFO, + "AIGLX: enabled GLX_EXT_create_context_es2_profile\n"); + } +#endif + if (DRI2HasSwapControl(pScreen)) { __glXEnableExtension(screen->glx_enable_bits, "GLX_SGI_swap_control"); __glXEnableExtension(screen->glx_enable_bits, "GLX_MESA_swap_control"); @@ -676,6 +908,16 @@ initializeExtensions(__GLXDRIscreen * screen) } #endif +#ifdef __DRI2_ROBUSTNESS + if (strcmp(extensions[i]->name, __DRI2_ROBUSTNESS) == 0 && + screen->dri2->base.version >= 3) { + __glXEnableExtension(screen->glx_enable_bits, + "GLX_ARB_create_context_robustness"); + LogMessage(X_INFO, + "AIGLX: enabled GLX_ARB_create_context_robustness\n"); + } +#endif + /* Ignore unknown extensions */ } } @@ -686,14 +928,14 @@ __glXDRIscreenProbe(ScreenPtr pScreen) const char *driverName, *deviceName; __GLXDRIscreen *screen; size_t buffer_size; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); screen = calloc(1, sizeof *screen); if (screen == NULL) return NULL; if (!xf86LoaderCheckSymbol("DRI2Connect") || - !DRI2Connect(pScreen, DRI2DriverDRI, + !DRI2Connect(serverClient, pScreen, DRI2DriverDRI, &screen->fd, &driverName, &deviceName)) { LogMessage(X_INFO, "AIGLX: Screen %d is not DRI2 capable\n", pScreen->myNum); diff --git a/xserver/glx/glxdricommon.c b/xserver/glx/glxdricommon.c index 44d5a3e7b..c90f38098 100644 --- a/xserver/glx/glxdricommon.c +++ b/xserver/glx/glxdricommon.c @@ -107,8 +107,6 @@ __ATTRIB(__DRI_ATTRIB_BUFFER_SIZE, rgbBits), __ATTRIB(__DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE, bindToMipmapTexture), __ATTRIB(__DRI_ATTRIB_YINVERTED, yInverted),}; -#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0])) - static void setScalar(__GLXconfig * config, unsigned int attrib, unsigned int value) { diff --git a/xserver/glx/glxdriswrast.c b/xserver/glx/glxdriswrast.c index 87ad1e619..68f9434a2 100644 --- a/xserver/glx/glxdriswrast.c +++ b/xserver/glx/glxdriswrast.c @@ -257,7 +257,10 @@ __glXDRIscreenDestroy(__GLXscreen * baseScreen) static __GLXcontext * __glXDRIscreenCreateContext(__GLXscreen * baseScreen, __GLXconfig * glxConfig, - __GLXcontext * baseShareContext) + __GLXcontext * baseShareContext, + unsigned num_attribs, + const uint32_t *attribs, + int *error) { __GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen; __GLXDRIcontext *context, *shareContext; @@ -265,6 +268,13 @@ __glXDRIscreenCreateContext(__GLXscreen * baseScreen, const __DRIcoreExtension *core = screen->core; __DRIcontext *driShare; + /* DRISWRAST won't support createContextAttribs, so these parameters will + * never be used. + */ + (void) num_attribs; + (void) attribs; + (void) error; + shareContext = (__GLXDRIcontext *) baseShareContext; if (shareContext) driShare = shareContext->driContext; diff --git a/xserver/glx/glxext.c b/xserver/glx/glxext.c index acd696ef0..bc7fe8217 100644 --- a/xserver/glx/glxext.c +++ b/xserver/glx/glxext.c @@ -39,6 +39,8 @@ #include #include "privates.h" #include +#include "extinit.h" +#include "glx_extinit.h" #include "unpack.h" #include "glxutil.h" #include "glxext.h" @@ -157,11 +159,18 @@ DrawableGone(__GLXdrawable * glxPriv, XID xid) return True; } -void -__glXAddToContextList(__GLXcontext * cx) +Bool +__glXAddContext(__GLXcontext * cx) { + /* Register this context as a resource. + */ + if (!AddResource(cx->id, __glXContextRes, (pointer)cx)) { + return False; + } + cx->next = glxAllContexts; glxAllContexts = cx; + return True; } static void @@ -281,8 +290,6 @@ glxClientCallback(CallbackListPtr *list, pointer closure, pointer data) ** By default, assume that the client supports ** GLX major version 1 minor version 0 protocol. */ - cl->GLClientmajorVersion = 1; - cl->GLClientminorVersion = 0; cl->client = pClient; break; @@ -317,9 +324,15 @@ GlxExtensionInit(void) ExtensionEntry *extEntry; ScreenPtr pScreen; int i; - __GLXprovider *p; + __GLXprovider *p, **stack; Bool glx_provided = False; + if (serverGeneration == 1) { + for (stack = &__glXProviderStack; *stack; stack = &(*stack)->next) + ; + *stack = &__glXDRISWRastProvider; + } + __glXContextRes = CreateNewResourceType((DeleteType) ContextGone, "GLXContext"); __glXDrawableRes = CreateNewResourceType((DeleteType) DrawableGone, diff --git a/xserver/glx/glxext.h b/xserver/glx/glxext.h index 7cd5cb49f..9b0978b93 100644 --- a/xserver/glx/glxext.h +++ b/xserver/glx/glxext.h @@ -38,7 +38,7 @@ extern GLboolean __glXFreeContext(__GLXcontext * glxc); extern void __glXFlushContextCache(void); -extern void __glXAddToContextList(__GLXcontext * cx); +extern Bool __glXAddContext(__GLXcontext * cx); extern void __glXErrorCallBack(GLenum code); extern void __glXClearErrorOccured(void); extern GLboolean __glXErrorOccured(void); diff --git a/xserver/glx/glxscreens.c b/xserver/glx/glxscreens.c index 74b4c421b..61d590cc8 100644 --- a/xserver/glx/glxscreens.c +++ b/xserver/glx/glxscreens.c @@ -174,10 +174,10 @@ static char GLXServerExtensions[] = "GLX_SGIS_multisample " #endif "GLX_SGIX_fbconfig " - "GLX_SGIX_pbuffer " "GLX_MESA_copy_sub_buffer " "GLX_INTEL_swap_event"; + "GLX_SGIX_pbuffer " "GLX_MESA_copy_sub_buffer "; static Bool -glxCloseScreen(int index, ScreenPtr pScreen) +glxCloseScreen(ScreenPtr pScreen) { __GLXscreen *pGlxScreen = glxGetScreen(pScreen); @@ -185,7 +185,7 @@ glxCloseScreen(int index, ScreenPtr pScreen) pGlxScreen->destroy(pGlxScreen); - return pScreen->CloseScreen(index, pScreen); + return pScreen->CloseScreen(pScreen); } __GLXscreen * @@ -288,6 +288,9 @@ pickFBConfig(__GLXscreen * pGlxScreen, VisualPtr visual) continue; if (config->visualRating != GLX_NONE) continue; + /* Ignore multisampled configs */ + if (config->sampleBuffers) + continue; if (glxConvertToXVisualType(config->visualType) != visual->class) continue; /* If it's the 32-bit RGBA visual, demand a 32-bit fbconfig. */ diff --git a/xserver/glx/glxscreens.h b/xserver/glx/glxscreens.h index d5420ee8d..b29df58a5 100644 --- a/xserver/glx/glxscreens.h +++ b/xserver/glx/glxscreens.h @@ -117,7 +117,10 @@ struct __GLXscreen { __GLXcontext *(*createContext) (__GLXscreen * screen, __GLXconfig * modes, - __GLXcontext * shareContext); + __GLXcontext * shareContext, + unsigned num_attribs, + const uint32_t *attribs, + int *error); __GLXdrawable *(*createDrawable) (ClientPtr client, __GLXscreen * context, @@ -153,7 +156,7 @@ struct __GLXscreen { unsigned GLXminor; /*@} */ - Bool (*CloseScreen) (int index, ScreenPtr pScreen); + Bool (*CloseScreen) (ScreenPtr pScreen); }; void __glXScreenInit(__GLXscreen * screen, ScreenPtr pScreen); diff --git a/xserver/glx/glxserver.h b/xserver/glx/glxserver.h index 707684842..1021aec80 100644 --- a/xserver/glx/glxserver.h +++ b/xserver/glx/glxserver.h @@ -46,7 +46,6 @@ #include #include -#define GL_GLEXT_PROTOTYPES /* we want prototypes */ #include #include @@ -77,8 +76,6 @@ extern __GLXclientState *glxGetClient(ClientPtr pClient); /************************************************************************/ -void GlxExtensionInit(void); - void GlxSetVisualConfigs(int nconfigs, void *configs, void **privates); void __glXScreenInitVisuals(__GLXscreen * screen); @@ -100,6 +97,7 @@ struct __GLXprovider { const char *name; __GLXprovider *next; }; +extern __GLXprovider __glXDRISWRastProvider; void GlxPushProvider(__GLXprovider * provider); @@ -145,8 +143,6 @@ struct __GLXclientStateRec { /* Back pointer to X client record */ ClientPtr client; - int GLClientmajorVersion; - int GLClientminorVersion; char *GLClientextensions; }; diff --git a/xserver/glx/indirect_program.c b/xserver/glx/indirect_program.c index 3b50ecd53..0114d7347 100644 --- a/xserver/glx/indirect_program.c +++ b/xserver/glx/indirect_program.c @@ -109,7 +109,7 @@ DoGetProgramString(struct __GLXclientStateRec *cl, GLbyte * pc, } else { __GLX_BEGIN_REPLY(compsize); - ((xGLXGetTexImageReply *) & __glXReply)->width = compsize; + ((xGLXGetTexImageReply *) &__glXReply)->width = compsize; __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } diff --git a/xserver/glx/indirect_texture_compression.c b/xserver/glx/indirect_texture_compression.c index 49d6db57f..5c2d06b42 100644 --- a/xserver/glx/indirect_texture_compression.c +++ b/xserver/glx/indirect_texture_compression.c @@ -72,7 +72,7 @@ __glXDisp_GetCompressedTexImageARB(struct __GLXclientStateRec *cl, GLbyte * pc) } else { __GLX_BEGIN_REPLY(compsize); - ((xGLXGetTexImageReply *) & __glXReply)->width = compsize; + ((xGLXGetTexImageReply *) &__glXReply)->width = compsize; __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } @@ -118,7 +118,7 @@ __glXDispSwap_GetCompressedTexImageARB(struct __GLXclientStateRec *cl, } else { __GLX_BEGIN_REPLY(compsize); - ((xGLXGetTexImageReply *) & __glXReply)->width = compsize; + ((xGLXGetTexImageReply *) &__glXReply)->width = compsize; __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } diff --git a/xserver/glx/indirect_util.c b/xserver/glx/indirect_util.c index a54f70aee..a30b1f880 100644 --- a/xserver/glx/indirect_util.c +++ b/xserver/glx/indirect_util.c @@ -138,10 +138,10 @@ __glXSendReply(ClientPtr client, const void *data, size_t elements, */ (void) memcpy(&__glXReply.pad3, data, 8); - WriteToClient(client, sz_xGLXSingleReply, (char *) &__glXReply); + WriteToClient(client, sz_xGLXSingleReply, &__glXReply); if (reply_ints != 0) { - WriteToClient(client, reply_ints * 4, (char *) data); + WriteToClient(client, reply_ints * 4, data); } } @@ -184,10 +184,10 @@ __glXSendReplySwap(ClientPtr client, const void *data, size_t elements, */ (void) memcpy(&__glXReply.pad3, data, 8); - WriteToClient(client, sz_xGLXSingleReply, (char *) &__glXReply); + WriteToClient(client, sz_xGLXSingleReply, &__glXReply); if (reply_ints != 0) { - WriteToClient(client, reply_ints * 4, (char *) data); + WriteToClient(client, reply_ints * 4, data); } } diff --git a/xserver/glx/renderpixswap.c b/xserver/glx/renderpixswap.c index 0655b74f2..24423cdef 100644 --- a/xserver/glx/renderpixswap.c +++ b/xserver/glx/renderpixswap.c @@ -51,17 +51,17 @@ __glXDispSwap_SeparableFilter2D(GLbyte * pc) hdrlen = __GLX_PAD(__GLX_CONV_FILT_CMD_HDR_SIZE); - __GLX_SWAP_INT((GLbyte *) & hdr->rowLength); - __GLX_SWAP_INT((GLbyte *) & hdr->skipRows); - __GLX_SWAP_INT((GLbyte *) & hdr->skipPixels); - __GLX_SWAP_INT((GLbyte *) & hdr->alignment); + __GLX_SWAP_INT((GLbyte *) &hdr->rowLength); + __GLX_SWAP_INT((GLbyte *) &hdr->skipRows); + __GLX_SWAP_INT((GLbyte *) &hdr->skipPixels); + __GLX_SWAP_INT((GLbyte *) &hdr->alignment); - __GLX_SWAP_INT((GLbyte *) & hdr->target); - __GLX_SWAP_INT((GLbyte *) & hdr->internalformat); - __GLX_SWAP_INT((GLbyte *) & hdr->width); - __GLX_SWAP_INT((GLbyte *) & hdr->height); - __GLX_SWAP_INT((GLbyte *) & hdr->format); - __GLX_SWAP_INT((GLbyte *) & hdr->type); + __GLX_SWAP_INT((GLbyte *) &hdr->target); + __GLX_SWAP_INT((GLbyte *) &hdr->internalformat); + __GLX_SWAP_INT((GLbyte *) &hdr->width); + __GLX_SWAP_INT((GLbyte *) &hdr->height); + __GLX_SWAP_INT((GLbyte *) &hdr->format); + __GLX_SWAP_INT((GLbyte *) &hdr->type); /* ** Just invert swapBytes flag; the GL will figure out if it needs to swap diff --git a/xserver/glx/single2.c b/xserver/glx/single2.c index 42cccc148..9597d29fe 100644 --- a/xserver/glx/single2.c +++ b/xserver/glx/single2.c @@ -193,15 +193,17 @@ __glXDisp_RenderMode(__GLXclientState * cl, GLbyte * pc) */ noChangeAllowed:; client = cl->client; - reply.length = nitems; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.retval = retval; - reply.size = nitems; - reply.newMode = newMode; - WriteToClient(client, sz_xGLXRenderModeReply, (char *) &reply); + reply = (xGLXRenderModeReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = nitems, + .retval = retval, + .size = nitems, + .newMode = newMode + }; + WriteToClient(client, sz_xGLXRenderModeReply, &reply); if (retBytes) { - WriteToClient(client, retBytes, (char *) retBuffer); + WriteToClient(client, retBytes, retBuffer); } return Success; } @@ -384,7 +386,7 @@ DoGetString(__GLXclientState * cl, GLbyte * pc, GLboolean need_swap) } __GLX_SEND_HEADER(); - WriteToClient(client, length, (char *) string); + WriteToClient(client, length, string); free(buf); return Success; diff --git a/xserver/glx/single2swap.c b/xserver/glx/single2swap.c index e6bb585d9..1ca532836 100644 --- a/xserver/glx/single2swap.c +++ b/xserver/glx/single2swap.c @@ -205,20 +205,22 @@ __glXDispSwap_RenderMode(__GLXclientState * cl, GLbyte * pc) */ noChangeAllowed:; client = cl->client; - reply.length = nitems; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.retval = retval; - reply.size = nitems; - reply.newMode = newMode; + reply = (xGLXRenderModeReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = nitems, + .retval = retval, + .size = nitems, + .newMode = newMode + }; __GLX_SWAP_SHORT(&reply.sequenceNumber); __GLX_SWAP_INT(&reply.length); __GLX_SWAP_INT(&reply.retval); __GLX_SWAP_INT(&reply.size); __GLX_SWAP_INT(&reply.newMode); - WriteToClient(client, sz_xGLXRenderModeReply, (char *) &reply); + WriteToClient(client, sz_xGLXRenderModeReply, &reply); if (retBytes) { - WriteToClient(client, retBytes, (char *) retBuffer); + WriteToClient(client, retBytes, retBuffer); } return Success; } diff --git a/xserver/glx/singlepix.c b/xserver/glx/singlepix.c index 55cd4437f..fb6868d2d 100644 --- a/xserver/glx/singlepix.c +++ b/xserver/glx/singlepix.c @@ -150,9 +150,9 @@ __glXDisp_GetTexImage(__GLXclientState * cl, GLbyte * pc) } else { __GLX_BEGIN_REPLY(compsize); - ((xGLXGetTexImageReply *) & __glXReply)->width = width; - ((xGLXGetTexImageReply *) & __glXReply)->height = height; - ((xGLXGetTexImageReply *) & __glXReply)->depth = depth; + ((xGLXGetTexImageReply *) &__glXReply)->width = width; + ((xGLXGetTexImageReply *) &__glXReply)->height = height; + ((xGLXGetTexImageReply *) &__glXReply)->depth = depth; __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } @@ -252,8 +252,8 @@ GetSeparableFilter(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) } else { __GLX_BEGIN_REPLY(compsize + compsize2); - ((xGLXGetSeparableFilterReply *) & __glXReply)->width = width; - ((xGLXGetSeparableFilterReply *) & __glXReply)->height = height; + ((xGLXGetSeparableFilterReply *) &__glXReply)->width = width; + ((xGLXGetSeparableFilterReply *) &__glXReply)->height = height; __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize + compsize2); } @@ -330,8 +330,8 @@ GetConvolutionFilter(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) } else { __GLX_BEGIN_REPLY(compsize); - ((xGLXGetConvolutionFilterReply *) & __glXReply)->width = width; - ((xGLXGetConvolutionFilterReply *) & __glXReply)->height = height; + ((xGLXGetConvolutionFilterReply *) &__glXReply)->width = width; + ((xGLXGetConvolutionFilterReply *) &__glXReply)->height = height; __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } @@ -399,7 +399,7 @@ GetHistogram(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) } else { __GLX_BEGIN_REPLY(compsize); - ((xGLXGetHistogramReply *) & __glXReply)->width = width; + ((xGLXGetHistogramReply *) &__glXReply)->width = width; __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } @@ -528,7 +528,7 @@ GetColorTable(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) } else { __GLX_BEGIN_REPLY(compsize); - ((xGLXGetColorTableReply *) & __glXReply)->width = width; + ((xGLXGetColorTableReply *) &__glXReply)->width = width; __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } diff --git a/xserver/glx/singlepixswap.c b/xserver/glx/singlepixswap.c index b6d628303..c777cea00 100644 --- a/xserver/glx/singlepixswap.c +++ b/xserver/glx/singlepixswap.c @@ -176,9 +176,9 @@ __glXDispSwap_GetTexImage(__GLXclientState * cl, GLbyte * pc) __GLX_SWAP_INT(&width); __GLX_SWAP_INT(&height); __GLX_SWAP_INT(&depth); - ((xGLXGetTexImageReply *) & __glXReply)->width = width; - ((xGLXGetTexImageReply *) & __glXReply)->height = height; - ((xGLXGetTexImageReply *) & __glXReply)->depth = depth; + ((xGLXGetTexImageReply *) &__glXReply)->width = width; + ((xGLXGetTexImageReply *) &__glXReply)->height = height; + ((xGLXGetTexImageReply *) &__glXReply)->depth = depth; __GLX_SEND_HEADER(); __GLX_SEND_VOID_ARRAY(compsize); } @@ -290,8 +290,8 @@ GetSeparableFilter(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) __GLX_SWAP_REPLY_HEADER(); __GLX_SWAP_INT(&width); __GLX_SWAP_INT(&height); - ((xGLXGetSeparableFilterReply *) & __glXReply)->width = width; - ((xGLXGetSeparableFilterReply *) & __glXReply)->height = height; + ((xGLXGetSeparableFilterReply *) &__glXReply)->width = width; + ((xGLXGetSeparableFilterReply *) &__glXReply)->height = height; __GLX_SEND_VOID_ARRAY(compsize + compsize2); } @@ -376,8 +376,8 @@ GetConvolutionFilter(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) __GLX_SWAP_REPLY_HEADER(); __GLX_SWAP_INT(&width); __GLX_SWAP_INT(&height); - ((xGLXGetConvolutionFilterReply *) & __glXReply)->width = width; - ((xGLXGetConvolutionFilterReply *) & __glXReply)->height = height; + ((xGLXGetConvolutionFilterReply *) &__glXReply)->width = width; + ((xGLXGetConvolutionFilterReply *) &__glXReply)->height = height; __GLX_SEND_VOID_ARRAY(compsize); } @@ -452,7 +452,7 @@ GetHistogram(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) __GLX_BEGIN_REPLY(compsize); __GLX_SWAP_REPLY_HEADER(); __GLX_SWAP_INT(&width); - ((xGLXGetHistogramReply *) & __glXReply)->width = width; + ((xGLXGetHistogramReply *) &__glXReply)->width = width; __GLX_SEND_VOID_ARRAY(compsize); } @@ -594,7 +594,7 @@ GetColorTable(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) __GLX_BEGIN_REPLY(compsize); __GLX_SWAP_REPLY_HEADER(); __GLX_SWAP_INT(&width); - ((xGLXGetColorTableReply *) & __glXReply)->width = width; + ((xGLXGetColorTableReply *) &__glXReply)->width = width; __GLX_SEND_VOID_ARRAY(compsize); } diff --git a/xserver/glx/unpack.h b/xserver/glx/unpack.h index 0a088fc33..52fba74e1 100644 --- a/xserver/glx/unpack.h +++ b/xserver/glx/unpack.h @@ -63,7 +63,7 @@ extern xGLXSingleReply __glXReply; __glXReply.sequenceNumber = client->sequence; #define __GLX_SEND_HEADER() \ - WriteToClient( client, sz_xGLXSingleReply, (char *)&__glXReply); + WriteToClient (client, sz_xGLXSingleReply, &__glXReply); #define __GLX_PUT_RETVAL(a) \ __glXReply.retval = (a); @@ -116,19 +116,19 @@ extern xGLXSingleReply __glXReply; *(GLdouble *)&__glXReply.pad3 = *(GLdouble *)answer #define __GLX_SEND_BYTE_ARRAY(len) \ - WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT8), (char *)answer) + WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT8), answer) #define __GLX_SEND_SHORT_ARRAY(len) \ - WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT16), (char *)answer) + WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT16), answer) #define __GLX_SEND_INT_ARRAY(len) \ - WriteToClient(client, (len)*__GLX_SIZE_INT32, (char *)answer) + WriteToClient(client, (len)*__GLX_SIZE_INT32, answer) #define __GLX_SEND_FLOAT_ARRAY(len) \ - WriteToClient(client, (len)*__GLX_SIZE_FLOAT32, (char *)answer) + WriteToClient(client, (len)*__GLX_SIZE_FLOAT32, answer) #define __GLX_SEND_DOUBLE_ARRAY(len) \ - WriteToClient(client, (len)*__GLX_SIZE_FLOAT64, (char *)answer) + WriteToClient(client, (len)*__GLX_SIZE_FLOAT64, answer) #define __GLX_SEND_VOID_ARRAY(len) __GLX_SEND_BYTE_ARRAY(len) #define __GLX_SEND_UBYTE_ARRAY(len) __GLX_SEND_BYTE_ARRAY(len) diff --git a/xserver/glx/xfont.c b/xserver/glx/xfont.c index 037ed9e4c..b203866d9 100644 --- a/xserver/glx/xfont.c +++ b/xserver/glx/xfont.c @@ -168,7 +168,7 @@ __glXDisp_UseXFont(__GLXclientState * cl, GLbyte * pc) } CALL_GetIntegerv(GET_DISPATCH(), - (GL_LIST_INDEX, (GLint *) & currentListIndex)); + (GL_LIST_INDEX, (GLint *) ¤tListIndex)); if (currentListIndex != 0) { /* ** A display list is currently being made. It is an error diff --git a/xserver/hw/Makefile.in b/xserver/hw/Makefile.in index 78904f8a6..8360ce69c 100644 --- a/xserver/hw/Makefile.in +++ b/xserver/hw/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -186,13 +186,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -214,6 +210,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -238,6 +235,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -253,7 +251,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -352,6 +349,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -471,7 +469,7 @@ DIST_SUBDIRS = dmx xfree86 vfb xnest xwin xquartz kdrive all: all-recursive .SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -496,9 +494,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/dmx/Makefile.in b/xserver/hw/dmx/Makefile.in index 19db04840..211acfdcb 100644 --- a/xserver/hw/dmx/Makefile.in +++ b/xserver/hw/dmx/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -247,13 +247,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -275,6 +271,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -299,6 +296,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -314,7 +312,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -422,6 +419,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -590,7 +588,7 @@ all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -615,9 +613,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) diff --git a/xserver/hw/dmx/config/Canvas.c b/xserver/hw/dmx/config/Canvas.c index 34a47a2bf..f0586e509 100644 --- a/xserver/hw/dmx/config/Canvas.c +++ b/xserver/hw/dmx/config/Canvas.c @@ -76,7 +76,7 @@ CanvasExpose(Widget w, XEvent * event, Region region) if (!XtIsRealized(w)) return; - XtCallCallbacks(w, XtNcanvasExposeCallback, (XtPointer) & data); + XtCallCallbacks(w, XtNcanvasExposeCallback, (XtPointer) &data); } static void @@ -162,4 +162,4 @@ CanvasClassRec canvasClassRec = { } }; -WidgetClass canvasWidgetClass = (WidgetClass) & canvasClassRec; +WidgetClass canvasWidgetClass = (WidgetClass) &canvasClassRec; diff --git a/xserver/hw/dmx/config/Makefile.in b/xserver/hw/dmx/config/Makefile.in index e1b6a8098..77a75ce8b 100644 --- a/xserver/hw/dmx/config/Makefile.in +++ b/xserver/hw/dmx/config/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -137,7 +137,6 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -@MAINTAINER_MODE_FALSE@am__skiplex = test -f $@ || LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) LTLEXCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(LEX) $(AM_LFLAGS) $(LFLAGS) @@ -146,7 +145,6 @@ am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@) am__v_LEX_0 = @echo " LEX " $@; am__v_LEX_1 = YLWRAP = $(top_srcdir)/ylwrap -@MAINTAINER_MODE_FALSE@am__skipyacc = test -f $@ || am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \ -e s/c++$$/h++/ -e s/c$$/h/ YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) @@ -263,13 +261,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -291,6 +285,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -315,6 +310,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -330,7 +326,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -429,6 +424,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -589,7 +585,7 @@ all: $(BUILT_SOURCES) .SUFFIXES: .SUFFIXES: .c .l .lo .o .obj .y -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -614,9 +610,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/dmx/config/man/Makefile.in b/xserver/hw/dmx/config/man/Makefile.in index b1b47882a..b672c50bf 100644 --- a/xserver/hw/dmx/config/man/Makefile.in +++ b/xserver/hw/dmx/config/man/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -179,13 +179,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -207,6 +203,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -231,6 +228,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -246,7 +244,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -361,6 +358,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -480,7 +478,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/manpages.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/manpages.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -506,9 +504,9 @@ $(top_srcdir)/manpages.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/dmx/config/xdmxconfig.c b/xserver/hw/dmx/config/xdmxconfig.c index f30841244..2121dd781 100644 --- a/xserver/hw/dmx/config/xdmxconfig.c +++ b/xserver/hw/dmx/config/xdmxconfig.c @@ -31,9 +31,6 @@ * */ -#ifdef HAVE_DMX_CONFIG_H -#include -#endif #include #include diff --git a/xserver/hw/dmx/dmx.c b/xserver/hw/dmx/dmx.c index add0e5390..0f7cb5c64 100644 --- a/xserver/hw/dmx/dmx.c +++ b/xserver/hw/dmx/dmx.c @@ -52,6 +52,7 @@ #include "os.h" #include "dixstruct.h" #include "extnsionst.h" +#include "extinit.h" #include "opaque.h" #include "dmxextension.h" @@ -65,8 +66,6 @@ extern unsigned long XRT_WINDOW; extern int PanoramiXNumScreens; #endif -extern void DMXExtensionInit(void); - static unsigned char DMXCode; static int @@ -74,8 +73,9 @@ _DMXXineramaActive(void) { #ifdef PANORAMIX return !noPanoramiXExtension; -#endif +#else return 0; +#endif } static void @@ -207,16 +207,17 @@ dmxFetchInputAttributes(unsigned int mask, static int ProcDMXQueryVersion(ClientPtr client) { - xDMXQueryVersionReply rep; + xDMXQueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .majorVersion = SERVER_DMX_MAJOR_VERSION, + .minorVersion = SERVER_DMX_MINOR_VERSION, + .patchVersion = SERVER_DMX_PATCH_VERSION + }; REQUEST_SIZE_MATCH(xDMXQueryVersionReq); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.majorVersion = SERVER_DMX_MAJOR_VERSION; - rep.minorVersion = SERVER_DMX_MINOR_VERSION; - rep.patchVersion = SERVER_DMX_PATCH_VERSION; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); @@ -224,7 +225,7 @@ ProcDMXQueryVersion(ClientPtr client) swapl(&rep.minorVersion); swapl(&rep.patchVersion); } - WriteToClient(client, sizeof(xDMXQueryVersionReply), (char *) &rep); + WriteToClient(client, sizeof(xDMXQueryVersionReply), &rep); return Success; } @@ -237,16 +238,18 @@ ProcDMXSync(ClientPtr client) dmxFlushPendingSyncs(); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.status = 0; + rep = (xDMXSyncReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .status = 0 + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.status); } - WriteToClient(client, sizeof(xDMXSyncReply), (char *) &rep); + WriteToClient(client, sizeof(xDMXSyncReply), &rep); return Success; } @@ -287,16 +290,18 @@ ProcDMXForceWindowCreation(ClientPtr client) dmxForceWindowCreation(pWin); doreply: dmxFlushPendingSyncs(); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.status = 0; + rep = (xDMXForceWindowCreationReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .status = 0 + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.status); } - WriteToClient(client, sizeof(xDMXForceWindowCreationReply), (char *) &rep); + WriteToClient(client, sizeof(xDMXForceWindowCreationReply), &rep); return Success; } @@ -307,16 +312,18 @@ ProcDMXGetScreenCount(ClientPtr client) REQUEST_SIZE_MATCH(xDMXGetScreenCountReq); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.screenCount = dmxGetNumScreens(); + rep = (xDMXGetScreenCountReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .screenCount = dmxGetNumScreens() + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.screenCount); } - WriteToClient(client, sizeof(xDMXGetScreenCountReply), (char *) &rep); + WriteToClient(client, sizeof(xDMXGetScreenCountReply), &rep); return Success; } @@ -338,27 +345,29 @@ ProcDMXGetScreenAttributes(ClientPtr client) if (!dmxGetScreenAttributes(stuff->physicalScreen, &attr)) return BadValue; - rep.logicalScreen = attr.logicalScreen; - rep.screenWindowWidth = attr.screenWindowWidth; - rep.screenWindowHeight = attr.screenWindowHeight; - rep.screenWindowXoffset = attr.screenWindowXoffset; - rep.screenWindowYoffset = attr.screenWindowYoffset; - rep.rootWindowWidth = attr.rootWindowWidth; - rep.rootWindowHeight = attr.rootWindowHeight; - rep.rootWindowXoffset = attr.rootWindowXoffset; - rep.rootWindowYoffset = attr.rootWindowYoffset; - rep.rootWindowXorigin = attr.rootWindowXorigin; - rep.rootWindowYorigin = attr.rootWindowYorigin; - length = attr.displayName ? strlen(attr.displayName) : 0; paddedLength = pad_to_int32(length); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = - bytes_to_int32((sizeof(xDMXGetScreenAttributesReply) - - sizeof(xGenericReply)) - + paddedLength); - rep.displayNameLength = length; + + rep = (xDMXGetScreenAttributesReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = + bytes_to_int32((sizeof(xDMXGetScreenAttributesReply) - + sizeof(xGenericReply)) + + paddedLength), + .displayNameLength = length, + .logicalScreen = attr.logicalScreen, + .screenWindowWidth = attr.screenWindowWidth, + .screenWindowHeight = attr.screenWindowHeight, + .screenWindowXoffset = attr.screenWindowXoffset, + .screenWindowYoffset = attr.screenWindowYoffset, + .rootWindowWidth = attr.rootWindowWidth, + .rootWindowHeight = attr.rootWindowHeight, + .rootWindowXoffset = attr.rootWindowXoffset, + .rootWindowYoffset = attr.rootWindowYoffset, + .rootWindowXorigin = attr.rootWindowXorigin, + .rootWindowYorigin = attr.rootWindowYorigin + }; if (client->swapped) { swaps(&rep.sequenceNumber); @@ -376,9 +385,9 @@ ProcDMXGetScreenAttributes(ClientPtr client) swaps(&rep.rootWindowXorigin); swaps(&rep.rootWindowYorigin); } - WriteToClient(client, sizeof(xDMXGetScreenAttributesReply), (char *) &rep); + WriteToClient(client, sizeof(xDMXGetScreenAttributesReply), &rep); if (length) - WriteToClient(client, length, (char *) attr.displayName); + WriteToClient(client, length, attr.displayName); return Success; } @@ -441,19 +450,20 @@ ProcDMXChangeScreensAttributes(ClientPtr client) return status; noxinerama: - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.status = status; - rep.errorScreen = errorScreen; + rep = (xDMXChangeScreensAttributesReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .status = status, + .errorScreen = errorScreen + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.status); swapl(&rep.errorScreen); } - WriteToClient(client, - sizeof(xDMXChangeScreensAttributesReply), (char *) &rep); + WriteToClient(client, sizeof(xDMXChangeScreensAttributesReply), &rep); return Success; } @@ -491,18 +501,20 @@ ProcDMXAddScreen(ClientPtr client) free(name); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.status = status; - rep.physicalScreen = stuff->physicalScreen; + rep = (xDMXAddScreenReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .status = status, + .physicalScreen = stuff->physicalScreen + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.status); swapl(&rep.physicalScreen); } - WriteToClient(client, sizeof(xDMXAddScreenReply), (char *) &rep); + WriteToClient(client, sizeof(xDMXAddScreenReply), &rep); return Success; } @@ -517,16 +529,18 @@ ProcDMXRemoveScreen(ClientPtr client) status = dmxDetachScreen(stuff->physicalScreen); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.status = status; + rep = (xDMXRemoveScreenReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .status = status + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.status); } - WriteToClient(client, sizeof(xDMXRemoveScreenReply), (char *) &rep); + WriteToClient(client, sizeof(xDMXRemoveScreenReply), &rep); return Success; } @@ -636,10 +650,12 @@ ProcDMXGetWindowAttributes(ClientPtr client) return BadWindow; } - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = count * 6; - rep.screenCount = count; + rep = (xDMXGetWindowAttributesReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = count * 6, + .screenCount = count + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); @@ -662,12 +678,12 @@ ProcDMXGetWindowAttributes(ClientPtr client) dmxFlushPendingSyncs(); - WriteToClient(client, sizeof(xDMXGetWindowAttributesReply), (char *) &rep); + WriteToClient(client, sizeof(xDMXGetWindowAttributesReply), &rep); if (count) { - WriteToClient(client, count * sizeof(*screens), (char *) screens); - WriteToClient(client, count * sizeof(*windows), (char *) windows); - WriteToClient(client, count * sizeof(*pos), (char *) pos); - WriteToClient(client, count * sizeof(*vis), (char *) vis); + WriteToClient(client, count * sizeof(*screens), screens); + WriteToClient(client, count * sizeof(*windows), windows); + WriteToClient(client, count * sizeof(*pos), pos); + WriteToClient(client, count * sizeof(*vis), vis); } free(vis); @@ -688,14 +704,15 @@ ProcDMXGetDesktopAttributes(ClientPtr client) dmxGetDesktopAttributes(&attr); - rep.width = attr.width; - rep.height = attr.height; - rep.shiftX = attr.shiftX; - rep.shiftY = attr.shiftY; - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; + rep = (xDMXGetDesktopAttributesReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .width = attr.width, + .height = attr.height, + .shiftX = attr.shiftX, + .shiftY = attr.shiftY + }; if (client->swapped) { swaps(&rep.sequenceNumber); @@ -705,7 +722,7 @@ ProcDMXGetDesktopAttributes(ClientPtr client) swaps(&rep.shiftX); swaps(&rep.shiftY); } - WriteToClient(client, sizeof(xDMXGetDesktopAttributesReply), (char *) &rep); + WriteToClient(client, sizeof(xDMXGetDesktopAttributesReply), &rep); return Success; } @@ -739,17 +756,18 @@ ProcDMXChangeDesktopAttributes(ClientPtr client) return status; noxinerama: - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.status = status; + rep = (xDMXChangeDesktopAttributesReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .status = status + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.status); } - WriteToClient(client, - sizeof(xDMXChangeDesktopAttributesReply), (char *) &rep); + WriteToClient(client, sizeof(xDMXChangeDesktopAttributesReply), &rep); return Success; } @@ -760,16 +778,18 @@ ProcDMXGetInputCount(ClientPtr client) REQUEST_SIZE_MATCH(xDMXGetInputCountReq); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.inputCount = dmxGetInputCount(); + rep = (xDMXGetInputCountReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .inputCount = dmxGetInputCount() + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.inputCount); } - WriteToClient(client, sizeof(xDMXGetInputCountReply), (char *) &rep); + WriteToClient(client, sizeof(xDMXGetInputCountReply), &rep); return Success; } @@ -786,19 +806,24 @@ ProcDMXGetInputAttributes(ClientPtr client) if (dmxGetInputAttributes(stuff->deviceId, &attr)) return BadValue; - rep.inputType = attr.inputType; - rep.physicalScreen = attr.physicalScreen; - rep.physicalId = attr.physicalId; - rep.isCore = attr.isCore; - rep.sendsCore = attr.sendsCore; - rep.detached = attr.detached; length = attr.name ? strlen(attr.name) : 0; paddedLength = pad_to_int32(length); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = bytes_to_int32(paddedLength); - rep.nameLength = length; + + rep = (xDMXGetInputAttributesReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(paddedLength), + + .inputType = attr.inputType, + .physicalScreen = attr.physicalScreen, + .physicalId = attr.physicalId, + .nameLength = length, + .isCore = attr.isCore, + .sendsCore = attr.sendsCore, + .detached = attr.detached + }; + if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); @@ -807,9 +832,9 @@ ProcDMXGetInputAttributes(ClientPtr client) swapl(&rep.physicalId); swapl(&rep.nameLength); } - WriteToClient(client, sizeof(xDMXGetInputAttributesReply), (char *) &rep); + WriteToClient(client, sizeof(xDMXGetInputAttributesReply), &rep); if (length) - WriteToClient(client, length, (char *) attr.name); + WriteToClient(client, length, attr.name); return Success; } @@ -850,18 +875,20 @@ ProcDMXAddInput(ClientPtr client) if (status) return status; - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.status = status; - rep.physicalId = id; + rep = (xDMXAddInputReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .status = status, + .physicalId = id + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.status); swapl(&rep.physicalId); } - WriteToClient(client, sizeof(xDMXAddInputReply), (char *) &rep); + WriteToClient(client, sizeof(xDMXAddInputReply), &rep); return Success; } @@ -879,16 +906,18 @@ ProcDMXRemoveInput(ClientPtr client) if (status) return status; - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.status = status; + rep = (xDMXRemoveInputReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .status = status + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.status); } - WriteToClient(client, sizeof(xDMXRemoveInputReply), (char *) &rep); + WriteToClient(client, sizeof(xDMXRemoveInputReply), &rep); return Success; } diff --git a/xserver/hw/dmx/dmx.h b/xserver/hw/dmx/dmx.h index d7c620467..f0cb04459 100644 --- a/xserver/hw/dmx/dmx.h +++ b/xserver/hw/dmx/dmx.h @@ -407,4 +407,6 @@ extern DevPrivateKeyRec dmxGlyphSetPrivateKeyRec; #define dmxGlyphSetPrivateKey (&dmxGlyphSetPrivateKeyRec) /**< Private index for GlyphSets */ +void DMXExtensionInit(void); + #endif /* DMX_H */ diff --git a/xserver/hw/dmx/dmx_glxvisuals.c b/xserver/hw/dmx/dmx_glxvisuals.c index 9fcc0e58d..f903b7491 100644 --- a/xserver/hw/dmx/dmx_glxvisuals.c +++ b/xserver/hw/dmx/dmx_glxvisuals.c @@ -61,7 +61,7 @@ GetGLXVisualConfigs(Display * dpy, int screen, int *nconfigs) req->reqType = majorOpcode; req->glxCode = X_GLXGetVisualConfigs; req->screen = screen; - if (!_XReply(dpy, (xReply *) & reply, 0, False)) { + if (!_XReply(dpy, (xReply *) &reply, 0, False)) { /* Something is busted. Punt. */ UnlockDisplay(dpy); SyncHandle(); @@ -252,7 +252,7 @@ GetGLXFBConfigs(Display * dpy, int glxMajorOpcode, int *nconfigs) *nconfigs = 0; - if (!_XReply(dpy, (xReply *) & reply, 0, False)) { + if (!_XReply(dpy, (xReply *) &reply, 0, False)) { /* Something is busted. Punt. */ UnlockDisplay(dpy); SyncHandle(); diff --git a/xserver/hw/dmx/dmxcursor.c b/xserver/hw/dmx/dmxcursor.c index 1a77c7d78..35aca81b4 100644 --- a/xserver/hw/dmx/dmxcursor.c +++ b/xserver/hw/dmx/dmxcursor.c @@ -346,6 +346,8 @@ dmxComputeScreenOrigins(void) screenInfo.screens[i]->y -= minY; } } + + update_desktop_dimensions(); } /** Recompute origin information in the #dmxScreens list. This is diff --git a/xserver/hw/dmx/dmxextension.c b/xserver/hw/dmx/dmxextension.c index faa28a590..d7296ae2d 100644 --- a/xserver/hw/dmx/dmxextension.c +++ b/xserver/hw/dmx/dmxextension.c @@ -1318,7 +1318,7 @@ dmxAttachScreen(int idx, DMXScreenAttributesPtr attr) } /* Initialize the BE screen resources */ - dmxBEScreenInit(idx, screenInfo.screens[idx]); + dmxBEScreenInit(screenInfo.screens[idx]); /* TODO: Handle GLX visual initialization. GLXProxy needs to be * updated to handle dynamic addition/removal of screens. */ diff --git a/xserver/hw/dmx/dmxinit.c b/xserver/hw/dmx/dmxinit.c index 09e3d74ea..7de402b06 100644 --- a/xserver/hw/dmx/dmxinit.c +++ b/xserver/hw/dmx/dmxinit.c @@ -68,10 +68,13 @@ #include #include #include "dmx_glxvisuals.h" +#include "glx_extinit.h" #include #include #endif /* GLXEXT */ +#include + /* Global variables available to all Xserver/hw/dmx routines. */ int dmxNumScreens; DMXScreenInfo *dmxScreens; @@ -586,6 +589,20 @@ dmxExecHost(void) return buffer; } +static void dmxAddExtensions(Bool glxSupported) +{ + const ExtensionModule dmxExtensions[] = { + { DMXExtensionInit, DMX_EXTENSION_NAME, NULL }, +#ifdef GLXEXT + { GlxExtensionInit, "GLX", &glxSupported }, +#endif + }; + int i; + + for (i = 0; i < ARRAY_SIZE(dmxExtensions); i++) + LoadExtension(&dmxExtensions[i], TRUE); +} + /** This routine is called in Xserver/dix/main.c from \a main(). */ void InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) @@ -594,7 +611,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) static unsigned long dmxGeneration = 0; #ifdef GLXEXT - Bool glxSupported = TRUE; + static Bool glxSupported = TRUE; #endif if (dmxGeneration != serverGeneration) { @@ -723,6 +740,9 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) /* Check if GLX extension exists on all back-end servers */ for (i = 0; i < dmxNumScreens; i++) glxSupported &= (dmxScreens[i].glxMajorOpcode > 0); + + if (serverGeneration == 1) + dmxAddExtensions(glxSupported); #endif /* Tell dix layer about the backend displays */ @@ -905,7 +925,7 @@ OsVendorInit(void) * two routines mentioned here, as well as by others) to use the * referenced routine instead of \a vfprintf().) */ void -OsVendorFatalError(void) +OsVendorFatalError(const char *f, va_list args) { } diff --git a/xserver/hw/dmx/dmxlog.c b/xserver/hw/dmx/dmxlog.c index 151f6728b..3249c4867 100644 --- a/xserver/hw/dmx/dmxlog.c +++ b/xserver/hw/dmx/dmxlog.c @@ -114,9 +114,6 @@ VFatalError(const char *format, va_list args) { VErrorF(format, args); ErrorF("\n"); -#ifdef DDXOSFATALERROR - OsVendorFatalError(); -#endif AbortServer(); /*NOTREACHED*/} #endif diff --git a/xserver/hw/dmx/dmxscrinit.c b/xserver/hw/dmx/dmxscrinit.c index 37b3f3b5a..849ef16a1 100644 --- a/xserver/hw/dmx/dmxscrinit.c +++ b/xserver/hw/dmx/dmxscrinit.c @@ -59,7 +59,7 @@ #include "mipointer.h" #include "micmap.h" -extern Bool dmxCloseScreen(int idx, ScreenPtr pScreen); +extern Bool dmxCloseScreen(ScreenPtr pScreen); static Bool dmxSaveScreen(ScreenPtr pScreen, int what); static unsigned long dmxGeneration; @@ -77,9 +77,9 @@ DevPrivateKeyRec dmxGlyphSetPrivateKeyRec; /** Initialize the parts of screen \a idx that require access to the * back-end server. */ void -dmxBEScreenInit(int idx, ScreenPtr pScreen) +dmxBEScreenInit(ScreenPtr pScreen) { - DMXScreenInfo *dmxScreen = &dmxScreens[idx]; + DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; XSetWindowAttributes attribs; XGCValues gcvals; unsigned long mask; @@ -192,11 +192,11 @@ dmxBEScreenInit(int idx, ScreenPtr pScreen) } } -/** Initialize screen number \a idx. */ +/** Initialize screen number \a pScreen->myNum. */ Bool -dmxScreenInit(int idx, ScreenPtr pScreen, int argc, char *argv[]) +dmxScreenInit(ScreenPtr pScreen, int argc, char *argv[]) { - DMXScreenInfo *dmxScreen = &dmxScreens[idx]; + DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; int i, j; if (!dixRegisterPrivateKey(&dmxScreenPrivateKeyRec, PRIVATE_SCREEN, 0)) @@ -286,20 +286,20 @@ dmxScreenInit(int idx, ScreenPtr pScreen, int argc, char *argv[]) } else { MAXSCREENSALLOC(dmxCursorGeneration); - if (dmxCursorGeneration[idx] != serverGeneration) { + if (dmxCursorGeneration[pScreen->myNum] != serverGeneration) { if (!(miPointerInitialize(pScreen, &dmxPointerSpriteFuncs, &dmxPointerCursorFuncs, FALSE))) return FALSE; - dmxCursorGeneration[idx] = serverGeneration; + dmxCursorGeneration[pScreen->myNum] = serverGeneration; } } DMX_WRAP(CloseScreen, dmxCloseScreen, dmxScreen, pScreen); DMX_WRAP(SaveScreen, dmxSaveScreen, dmxScreen, pScreen); - dmxBEScreenInit(idx, pScreen); + dmxBEScreenInit(pScreen); if (!dmxShadowFB) { /* Wrap GC functions */ @@ -422,12 +422,12 @@ dmxBECloseScreen(ScreenPtr pScreen) /** Close screen number \a idx. */ Bool -dmxCloseScreen(int idx, ScreenPtr pScreen) +dmxCloseScreen(ScreenPtr pScreen) { - DMXScreenInfo *dmxScreen = &dmxScreens[idx]; + DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; /* Reset the proc vectors */ - if (idx == 0) { + if (pScreen->myNum == 0) { dmxResetRender(); dmxResetFonts(); } @@ -498,7 +498,7 @@ dmxCloseScreen(int idx, ScreenPtr pScreen) } DMX_UNWRAP(CloseScreen, dmxScreen, pScreen); - return pScreen->CloseScreen(idx, pScreen); + return pScreen->CloseScreen(pScreen); } static Bool diff --git a/xserver/hw/dmx/dmxscrinit.h b/xserver/hw/dmx/dmxscrinit.h index 5c0bfacce..9fe9c9844 100644 --- a/xserver/hw/dmx/dmxscrinit.h +++ b/xserver/hw/dmx/dmxscrinit.h @@ -40,9 +40,9 @@ #include "scrnintstr.h" -extern Bool dmxScreenInit(int idx, ScreenPtr pScreen, int argc, char *argv[]); +extern Bool dmxScreenInit(ScreenPtr pScreen, int argc, char *argv[]); -extern void dmxBEScreenInit(int idx, ScreenPtr pScreen); +extern void dmxBEScreenInit(ScreenPtr pScreen); extern void dmxBECloseScreen(ScreenPtr pScreen); #endif /* DMXSCRINIT_H */ diff --git a/xserver/hw/dmx/dmxwindow.c b/xserver/hw/dmx/dmxwindow.c index 855e56b9d..9b8a3840e 100644 --- a/xserver/hw/dmx/dmxwindow.c +++ b/xserver/hw/dmx/dmxwindow.c @@ -786,7 +786,7 @@ dmxWindowExposures(WindowPtr pWindow, RegionPtr prgn, RegionPtr other_exposed) if (pWinPriv->window) { while (XCheckIfEvent(dmxScreen->beDisplay, &ev, dmxWindowExposurePredicate, - (XPointer) & pWinPriv->window)) { + (XPointer) &pWinPriv->window)) { /* Handle expose events -- this should not be necessary since the base window in which the root window was created is guaranteed to be on top (override_redirect), diff --git a/xserver/hw/dmx/doc/DMXSpec-v1.txt b/xserver/hw/dmx/doc/DMXSpec-v1.txt index bb2cfa15c..9f5f69cd9 100644 --- a/xserver/hw/dmx/doc/DMXSpec-v1.txt +++ b/xserver/hw/dmx/doc/DMXSpec-v1.txt @@ -2,7 +2,7 @@ Client-to-Server DMX Extension to the X Protocol - $Date: 2012/06/10 13:21:22 $, $Revision: 1.7 $ + $Date: 2013/06/07 17:28:48 $, $Revision: 1.8 $ Rickard E. (Rik) Faith (faith@redhat.com) Kevin E. Martin (kem@redhat.com) diff --git a/xserver/hw/dmx/doc/DMXSpec.txt b/xserver/hw/dmx/doc/DMXSpec.txt index 1c698dd35..b7a968f96 100644 --- a/xserver/hw/dmx/doc/DMXSpec.txt +++ b/xserver/hw/dmx/doc/DMXSpec.txt @@ -2,7 +2,7 @@ Client-to-Server DMX Extension to the X Protocol - $Date: 2012/06/10 13:21:22 $, $Revision: 1.7 $ + $Date: 2013/06/07 17:28:48 $, $Revision: 1.8 $ Rickard E. (Rik) Faith (faith@redhat.com) Kevin E. Martin (kem@redhat.com) diff --git a/xserver/hw/dmx/doc/Makefile.in b/xserver/hw/dmx/doc/Makefile.in index f53bb75d1..d89427895 100644 --- a/xserver/hw/dmx/doc/Makefile.in +++ b/xserver/hw/dmx/doc/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -191,13 +191,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -219,6 +215,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -243,6 +240,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -258,7 +256,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -357,6 +354,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -486,7 +484,7 @@ EXTRA_DIST = DMXSpec.txt DMXSpec-v1.txt all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/devbook.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/devbook.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -512,9 +510,9 @@ $(top_srcdir)/devbook.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/dmx/doc/dmx.xml b/xserver/hw/dmx/doc/dmx.xml index 793aacea0..6d7df4133 100644 --- a/xserver/hw/dmx/doc/dmx.xml +++ b/xserver/hw/dmx/doc/dmx.xml @@ -1214,14 +1214,6 @@ function pointers from the other layer are stored in a screen private area. Common functions to wrap are CloseScreen() and SaveScreen().
- -miInitializeBackingStore() - -This MI function initializes the -screen's backing storage functions, which are used to save areas of -windows that are currently covered by other windows. - - miDCInitialize() @@ -1320,8 +1312,8 @@ initialize each of its screens. Xnest's ScreenInit() function is called xnestOpenScreen(). This function initializes its screen's depth and visual information, and then calls miScreenInit() to set up the default -screen functions. It then calls miInitializeBackingStore() and -miDCInitialize() to initialize backing store and the software cursor. +screen functions. It then calls miDCInitialize() to initialize the +software cursor. Finally, it replaces many of the screen functions with its own functions that repackage and send the requests to the real X server to which Xnest is attached. diff --git a/xserver/hw/dmx/doxygen/Makefile.in b/xserver/hw/dmx/doxygen/Makefile.in index f9ec6d3d1..d885cd8b8 100644 --- a/xserver/hw/dmx/doxygen/Makefile.in +++ b/xserver/hw/dmx/doxygen/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -172,13 +172,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -200,6 +196,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -224,6 +221,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -239,7 +237,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -338,6 +335,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -444,7 +442,7 @@ top_srcdir = @top_srcdir@ all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -469,9 +467,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): doxygen.conf: $(top_builddir)/config.status $(srcdir)/doxygen.conf.in diff --git a/xserver/hw/dmx/examples/Makefile.in b/xserver/hw/dmx/examples/Makefile.in index 4f4263dee..862bdf461 100644 --- a/xserver/hw/dmx/examples/Makefile.in +++ b/xserver/hw/dmx/examples/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -286,13 +286,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -314,6 +310,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -338,6 +335,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -353,7 +351,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -452,6 +449,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -602,7 +600,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -627,9 +625,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) diff --git a/xserver/hw/dmx/examples/xinput.c b/xserver/hw/dmx/examples/xinput.c index db6601030..6eddc6a67 100644 --- a/xserver/hw/dmx/examples/xinput.c +++ b/xserver/hw/dmx/examples/xinput.c @@ -303,8 +303,8 @@ main(int argc, char **argv) XNextEvent(display, &event); for (i = 0; i < cnt; i++) { - XDeviceMotionEvent *e = (XDeviceMotionEvent *) & event; - XDeviceButtonEvent *b = (XDeviceButtonEvent *) & event; + XDeviceMotionEvent *e = (XDeviceMotionEvent *) &event; + XDeviceButtonEvent *b = (XDeviceButtonEvent *) &event; if (event.type == event_type[i]) { printf("%s id=%lu (%d @ %d,%d; s=0x%04x, d=%d, t=%lu)" diff --git a/xserver/hw/dmx/glxProxy/Makefile.in b/xserver/hw/dmx/glxProxy/Makefile.in index 03a6f62d1..006fe92d4 100644 --- a/xserver/hw/dmx/glxProxy/Makefile.in +++ b/xserver/hw/dmx/glxProxy/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -193,13 +193,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -221,6 +217,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -245,6 +242,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -260,7 +258,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -359,6 +356,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -505,7 +503,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -530,9 +528,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/dmx/glxProxy/glxcmds.c b/xserver/hw/dmx/glxProxy/glxcmds.c index 49c6ef1ed..45382748f 100644 --- a/xserver/hw/dmx/glxProxy/glxcmds.c +++ b/xserver/hw/dmx/glxProxy/glxcmds.c @@ -454,19 +454,18 @@ __glXQueryMaxSwapBarriersSGIX(__GLXclientState * cl, GLbyte * pc) ClientPtr client = cl->client; xGLXQueryMaxSwapBarriersSGIXReq *req = (xGLXQueryMaxSwapBarriersSGIXReq *) pc; - xGLXQueryMaxSwapBarriersSGIXReply reply; - - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.length = 0; - reply.max = QueryMaxSwapBarriersSGIX(req->screen); + xGLXQueryMaxSwapBarriersSGIXReply reply = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .max = QueryMaxSwapBarriersSGIX(req->screen) + }; if (client->swapped) { __glXSwapQueryMaxSwapBarriersSGIXReply(client, &reply); } else { - WriteToClient(client, sz_xGLXQueryMaxSwapBarriersSGIXReply, - (char *) &reply); + WriteToClient(client, sz_xGLXQueryMaxSwapBarriersSGIXReply, &reply); } return Success; @@ -794,7 +793,11 @@ MakeCurrent(__GLXclientState * cl, ClientPtr client = cl->client; DrawablePtr pDraw = NULL; DrawablePtr pReadDraw = NULL; - xGLXMakeCurrentReadSGIReply new_reply; + xGLXMakeCurrentReadSGIReply new_reply = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; xGLXMakeCurrentReq *be_req; xGLXMakeCurrentReply be_reply; xGLXMakeContextCurrentReq *be_new_req; @@ -1198,9 +1201,6 @@ MakeCurrent(__GLXclientState * cl, else { new_reply.contextTag = 0; } - new_reply.length = 0; - new_reply.type = X_Reply; - new_reply.sequenceNumber = client->sequence; #ifdef PANORAMIX if (!noPanoramiXExtension) { @@ -1276,7 +1276,7 @@ MakeCurrent(__GLXclientState * cl, be_req->context = (unsigned int) (glxc ? glxc->real_ids[s - from_screen] : 0); be_req->oldContextTag = GetCurrentBackEndTag(cl, tag, s); - if (!_XReply(dpy, (xReply *) & be_reply, 0, False)) { + if (!_XReply(dpy, (xReply *) &be_reply, 0, False)) { /* The make current failed */ UnlockDisplay(dpy); @@ -1331,7 +1331,7 @@ MakeCurrent(__GLXclientState * cl, be_new_req->context = (unsigned int) (glxc ? glxc->real_ids[s - from_screen] : 0); be_new_req->oldContextTag = GetCurrentBackEndTag(cl, tag, s); - if (!_XReply(dpy, (xReply *) & be_new_reply, 0, False)) { + if (!_XReply(dpy, (xReply *) &be_new_reply, 0, False)) { /* The make current failed */ UnlockDisplay(dpy); @@ -1362,7 +1362,7 @@ MakeCurrent(__GLXclientState * cl, ext_req->context = (unsigned int) (glxc ? glxc->real_ids[s - from_screen] : 0); ext_req->oldContextTag = GetCurrentBackEndTag(cl, tag, s); - if (!_XReply(dpy, (xReply *) & ext_reply, 0, False)) { + if (!_XReply(dpy, (xReply *) &ext_reply, 0, False)) { /* The make current failed */ UnlockDisplay(dpy); @@ -1388,8 +1388,7 @@ MakeCurrent(__GLXclientState * cl, __glXSwapMakeCurrentReply(client, &new_reply); } else { - WriteToClient(client, sz_xGLXMakeContextCurrentReply, - (char *) &new_reply); + WriteToClient(client, sz_xGLXMakeContextCurrentReply, &new_reply); } return Success; @@ -1440,16 +1439,18 @@ __glXIsDirect(__GLXclientState * cl, GLbyte * pc) return __glXBadContext; } - reply.isDirect = 0; - reply.length = 0; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; + reply = (xGLXIsDirectReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .isDirect = 0 + }; if (client->swapped) { __glXSwapIsDirectReply(client, &reply); } else { - WriteToClient(client, sz_xGLXIsDirectReply, (char *) &reply); + WriteToClient(client, sz_xGLXIsDirectReply, &reply); } return Success; @@ -1461,24 +1462,25 @@ __glXQueryVersion(__GLXclientState * cl, GLbyte * pc) ClientPtr client = cl->client; /* xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) pc; */ - xGLXQueryVersionReply reply; + xGLXQueryVersionReply reply = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, /* ** Server should take into consideration the version numbers sent by the ** client if it wants to work with older clients; however, in this ** implementation the server just returns its version number. */ - reply.majorVersion = __glXVersionMajor; - reply.minorVersion = __glXVersionMinor; - reply.length = 0; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; + .majorVersion = __glXVersionMajor, + .minorVersion = __glXVersionMinor + }; if (client->swapped) { __glXSwapQueryVersionReply(client, &reply); } else { - WriteToClient(client, sz_xGLXQueryVersionReply, (char *) &reply); + WriteToClient(client, sz_xGLXQueryVersionReply, &reply); } return Success; } @@ -1682,14 +1684,16 @@ __glXGetVisualConfigs(__GLXclientState * cl, GLbyte * pc) } pGlxScreen = &__glXActiveScreens[screen]; - reply.numVisuals = pGlxScreen->numGLXVisuals; - reply.numProps = __GLX_TOTAL_CONFIG; - reply.length = (pGlxScreen->numGLXVisuals * __GLX_SIZE_CARD32 * - __GLX_TOTAL_CONFIG) >> 2; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; + reply = (xGLXGetVisualConfigsReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .numVisuals = pGlxScreen->numGLXVisuals, + .numProps = __GLX_TOTAL_CONFIG, + .length = (pGlxScreen->numGLXVisuals * __GLX_SIZE_CARD32 * + __GLX_TOTAL_CONFIG) >> 2 + }; - WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *) &reply); + WriteToClient(client, sz_xGLXGetVisualConfigsReply, &reply); for (i = 0; i < pGlxScreen->numVisuals; i++) { pGlxVisual = &pGlxScreen->pGlxVisual[i]; @@ -1743,8 +1747,7 @@ __glXGetVisualConfigs(__GLXclientState * cl, GLbyte * pc) buf[p++] = GLX_VISUAL_SELECT_GROUP_SGIX; buf[p++] = pGlxVisual->visualSelectGroup; - WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_TOTAL_CONFIG, - (char *) buf); + WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_TOTAL_CONFIG, buf); } return Success; } @@ -2174,7 +2177,7 @@ __glXDoSwapBuffers(__GLXclientState * cl, XID drawId, GLXContextTag tag) finishReq->glxCode = X_GLsop_Finish; finishReq->contextTag = (tag ? GetCurrentBackEndTag(cl, tag, s) : 0); - (void) _XReply(dpy, (xReply *) & reply, 0, False); + (void) _XReply(dpy, (xReply *) &reply, 0, False); UnlockDisplay(dpy); SyncHandle(); } @@ -2602,7 +2605,7 @@ __glXQueryExtensionsString(__GLXclientState * cl, GLbyte * pc) be_req->reqType = dmxScreen->glxMajorOpcode; be_req->glxCode = X_GLXQueryServerString; be_req->screen = DefaultScreen(dpy); - _XReply(dpy, (xReply *) & be_reply, 0, False); + _XReply(dpy, (xReply *) &be_reply, 0, False); len = (int) be_reply.length; numbytes = (int) be_reply.n; slop = numbytes * __GLX_SIZE_INT8 & 3; @@ -2628,18 +2631,19 @@ __glXQueryExtensionsString(__GLXclientState * cl, GLbyte * pc) #endif length = len; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.length = len; - reply.n = numbytes; + reply = (xGLXQueryExtensionsStringReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = len, + .n = numbytes + }; if (client->swapped) { glxSwapQueryExtensionsStringReply(client, &reply, be_buf); } else { - WriteToClient(client, sz_xGLXQueryExtensionsStringReply, - (char *) &reply); - WriteToClient(client, (int) (length << 2), (char *) be_buf); + WriteToClient(client, sz_xGLXQueryExtensionsStringReply, &reply); + WriteToClient(client, (int) (length << 2), be_buf); } return Success; @@ -2686,7 +2690,7 @@ __glXQueryServerString(__GLXclientState * cl, GLbyte * pc) be_req->glxCode = X_GLXQueryServerString; be_req->screen = DefaultScreen(dpy); be_req->name = name; - _XReply(dpy, (xReply *) & be_reply, 0, False); + _XReply(dpy, (xReply *) &be_reply, 0, False); len = (int) be_reply.length; numbytes = (int) be_reply.n; slop = numbytes * __GLX_SIZE_INT8 & 3; @@ -2710,16 +2714,18 @@ __glXQueryServerString(__GLXclientState * cl, GLbyte * pc) #endif length = len; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.length = length; - reply.n = numbytes; + reply = (xGLXQueryServerStringReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = length, + .n = numbytes + }; if (client->swapped) { glxSwapQueryServerStringReply(client, &reply, be_buf); } else { - WriteToClient(client, sz_xGLXQueryServerStringReply, (char *) &reply); + WriteToClient(client, sz_xGLXQueryServerStringReply, &reply); WriteToClient(client, (int) (length << 2), be_buf); } @@ -2867,11 +2873,13 @@ __glXGetFBConfigs(__GLXclientState * cl, GLbyte * pc) pGlxScreen = &__glXActiveScreens[screen]; numFBConfigs = __glXNumFBConfigs; - reply.numFBConfigs = numFBConfigs; - reply.numAttribs = numAttribs; - reply.length = (numFBConfigs * 2 * numAttribs * __GLX_SIZE_CARD32) >> 2; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; + reply = (xGLXGetFBConfigsReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = (numFBConfigs * 2 * numAttribs * __GLX_SIZE_CARD32) >> 2, + .numFBConfigs = numFBConfigs, + .numAttribs = numAttribs + }; if (client->swapped) { __GLX_DECLARE_SWAP_VARIABLES; @@ -2880,7 +2888,7 @@ __glXGetFBConfigs(__GLXclientState * cl, GLbyte * pc) __GLX_SWAP_INT(&reply.numFBConfigs); __GLX_SWAP_INT(&reply.numAttribs); } - WriteToClient(client, sz_xGLXGetFBConfigsReply, (char *) &reply); + WriteToClient(client, sz_xGLXGetFBConfigsReply, &reply); for (i = 0; i < numFBConfigs; i++) { int associatedVisualId = 0; @@ -3021,7 +3029,7 @@ __glXGetFBConfigs(__GLXclientState * cl, GLbyte * pc) __GLX_DECLARE_SWAP_ARRAY_VARIABLES; __GLX_SWAP_INT_ARRAY((int *) buf, 2 * numAttribs); } - WriteToClient(client, 2 * numAttribs * __GLX_SIZE_CARD32, (char *) buf); + WriteToClient(client, 2 * numAttribs * __GLX_SIZE_CARD32, buf); } return Success; } @@ -3037,7 +3045,7 @@ __glXGetFBConfigsSGIX(__GLXclientState * cl, GLbyte * pc) new_req.length = req->length; new_req.screen = req->screen; - return (__glXGetFBConfigs(cl, (GLbyte *) & new_req)); + return (__glXGetFBConfigs(cl, (GLbyte *) &new_req)); } int @@ -3199,10 +3207,12 @@ __glXQueryContext(__GLXclientState * cl, GLbyte * pc) nProps = 3; - reply.length = nProps << 1; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.n = nProps; + reply = (xGLXQueryContextReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = nProps << 1, + .n = nProps + }; nReplyBytes = reply.length << 2; sendBuf = (int *) malloc(nReplyBytes); @@ -3218,8 +3228,8 @@ __glXQueryContext(__GLXclientState * cl, GLbyte * pc) __glXSwapQueryContextReply(client, &reply, sendBuf); } else { - WriteToClient(client, sz_xGLXQueryContextReply, (char *) &reply); - WriteToClient(client, nReplyBytes, (char *) sendBuf); + WriteToClient(client, sz_xGLXQueryContextReply, &reply); + WriteToClient(client, nReplyBytes, sendBuf); } free((char *) sendBuf); @@ -3249,10 +3259,12 @@ __glXQueryContextInfoEXT(__GLXclientState * cl, GLbyte * pc) nProps = 4; - reply.length = nProps << 1; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.n = nProps; + reply = (xGLXQueryContextInfoEXTReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = nProps << 1, + .n = nProps + }; nReplyBytes = reply.length << 2; sendBuf = (int *) malloc(nReplyBytes); @@ -3270,8 +3282,8 @@ __glXQueryContextInfoEXT(__GLXclientState * cl, GLbyte * pc) __glXSwapQueryContextInfoEXTReply(client, &reply, sendBuf); } else { - WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *) &reply); - WriteToClient(client, nReplyBytes, (char *) sendBuf); + WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, &reply); + WriteToClient(client, nReplyBytes, sendBuf); } free((char *) sendBuf); @@ -3579,7 +3591,7 @@ __glXGetDrawableAttributes(__GLXclientState * cl, GLbyte * pc) be_req->glxCode = X_GLXGetDrawableAttributes; be_req->drawable = be_drawable; be_req->length = req->length; - if (!_XReply(dpy, (xReply *) & reply, 0, False)) { + if (!_XReply(dpy, (xReply *) &reply, 0, False)) { UnlockDisplay(dpy); SyncHandle(); return (BE_TO_CLIENT_ERROR(dmxLastErrorEvent.error_code)); @@ -3606,9 +3618,8 @@ __glXGetDrawableAttributes(__GLXclientState * cl, GLbyte * pc) __glXSwapGetDrawableAttributesReply(client, &reply, (int *) attribs); } else { - WriteToClient(client, sz_xGLXGetDrawableAttributesReply, - (char *) &reply); - WriteToClient(client, attribs_size, (char *) attribs); + WriteToClient(client, sz_xGLXGetDrawableAttributesReply, &reply); + WriteToClient(client, attribs_size, attribs); } free(attribs); diff --git a/xserver/hw/dmx/glxProxy/glxcmdsswap.c b/xserver/hw/dmx/glxProxy/glxcmdsswap.c index ec0e83d09..ab3e7edc1 100644 --- a/xserver/hw/dmx/glxProxy/glxcmdsswap.c +++ b/xserver/hw/dmx/glxProxy/glxcmdsswap.c @@ -293,18 +293,20 @@ __glXSwapGetVisualConfigs(__GLXclientState * cl, GLbyte * pc) } pGlxScreen = &__glXActiveScreens[screen]; - reply.numVisuals = pGlxScreen->numGLXVisuals; - reply.numProps = __GLX_TOTAL_CONFIG; - reply.length = (pGlxScreen->numGLXVisuals * __GLX_SIZE_CARD32 * - __GLX_TOTAL_CONFIG) >> 2; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; + reply = (xGLXGetVisualConfigsReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = (pGlxScreen->numGLXVisuals * __GLX_SIZE_CARD32 * + __GLX_TOTAL_CONFIG) >> 2, + .numVisuals = pGlxScreen->numGLXVisuals, + .numProps = __GLX_TOTAL_CONFIG + }; __GLX_SWAP_SHORT(&reply.sequenceNumber); __GLX_SWAP_INT(&reply.length); __GLX_SWAP_INT(&reply.numVisuals); __GLX_SWAP_INT(&reply.numProps); - WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *) &reply); + WriteToClient(client, sz_xGLXGetVisualConfigsReply, &reply); for (i = 0; i < pGlxScreen->numVisuals; i++) { pGlxVisual = &pGlxScreen->pGlxVisual[i]; @@ -353,8 +355,7 @@ __glXSwapGetVisualConfigs(__GLXclientState * cl, GLbyte * pc) buf[p++] = pGlxVisual->transparentIndex; __GLX_SWAP_INT_ARRAY(buf, __GLX_TOTAL_CONFIG); - WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_TOTAL_CONFIG, - (char *) buf); + WriteToClient(client, __GLX_SIZE_CARD32 * __GLX_TOTAL_CONFIG, buf); } return Success; } @@ -508,7 +509,7 @@ __glXSwapMakeCurrentReply(ClientPtr client, xGLXMakeCurrentReadSGIReply * reply) __GLX_SWAP_INT(&reply->writeType); __GLX_SWAP_INT(&reply->readVid); __GLX_SWAP_INT(&reply->readType); - WriteToClient(client, sz_xGLXMakeCurrentReadSGIReply, (char *) reply); + WriteToClient(client, sz_xGLXMakeCurrentReadSGIReply, reply); } void @@ -517,7 +518,7 @@ __glXSwapIsDirectReply(ClientPtr client, xGLXIsDirectReply * reply) __GLX_DECLARE_SWAP_VARIABLES; __GLX_SWAP_SHORT(&reply->sequenceNumber); __GLX_SWAP_INT(&reply->length); - WriteToClient(client, sz_xGLXIsDirectReply, (char *) reply); + WriteToClient(client, sz_xGLXIsDirectReply, reply); } void @@ -528,7 +529,7 @@ __glXSwapQueryVersionReply(ClientPtr client, xGLXQueryVersionReply * reply) __GLX_SWAP_INT(&reply->length); __GLX_SWAP_INT(&reply->majorVersion); __GLX_SWAP_INT(&reply->minorVersion); - WriteToClient(client, sz_xGLXQueryVersionReply, (char *) reply); + WriteToClient(client, sz_xGLXQueryVersionReply, reply); } void @@ -543,7 +544,7 @@ glxSwapQueryExtensionsStringReply(ClientPtr client, __GLX_SWAP_SHORT(&reply->sequenceNumber); __GLX_SWAP_INT(&reply->length); __GLX_SWAP_INT(&reply->n); - WriteToClient(client, sz_xGLXQueryExtensionsStringReply, (char *) reply); + WriteToClient(client, sz_xGLXQueryExtensionsStringReply, reply); __GLX_SWAP_INT_ARRAY((int *) buf, length); WriteToClient(client, length << 2, buf); } @@ -558,7 +559,7 @@ glxSwapQueryServerStringReply(ClientPtr client, __GLX_SWAP_SHORT(&reply->sequenceNumber); __GLX_SWAP_INT(&reply->length); __GLX_SWAP_INT(&reply->n); - WriteToClient(client, sz_xGLXQueryServerStringReply, (char *) reply); + WriteToClient(client, sz_xGLXQueryServerStringReply, reply); /** no swap is needed for an array of chars **/ /* __GLX_SWAP_INT_ARRAY((int *)buf, length); */ WriteToClient(client, length << 2, buf); @@ -576,9 +577,9 @@ __glXSwapQueryContextInfoEXTReply(ClientPtr client, __GLX_SWAP_SHORT(&reply->sequenceNumber); __GLX_SWAP_INT(&reply->length); __GLX_SWAP_INT(&reply->n); - WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, (char *) reply); + WriteToClient(client, sz_xGLXQueryContextInfoEXTReply, reply); __GLX_SWAP_INT_ARRAY((int *) buf, length); - WriteToClient(client, length << 2, (char *) buf); + WriteToClient(client, length << 2, buf); } void @@ -592,9 +593,9 @@ __glXSwapQueryContextReply(ClientPtr client, __GLX_SWAP_SHORT(&reply->sequenceNumber); __GLX_SWAP_INT(&reply->length); __GLX_SWAP_INT(&reply->n); - WriteToClient(client, sz_xGLXQueryContextReply, (char *) reply); + WriteToClient(client, sz_xGLXQueryContextReply, reply); __GLX_SWAP_INT_ARRAY((int *) buf, length); - WriteToClient(client, length << 2, (char *) buf); + WriteToClient(client, length << 2, buf); } void @@ -608,8 +609,8 @@ __glXSwapGetDrawableAttributesReply(ClientPtr client, __GLX_SWAP_INT(&reply->length); __GLX_SWAP_INT(&reply->numAttribs); __GLX_SWAP_INT_ARRAY(buf, reply->length); - WriteToClient(client, sz_xGLXGetDrawableAttributesReply, (char *) reply); - WriteToClient(client, reply->length << 2, (char *) buf); + WriteToClient(client, sz_xGLXGetDrawableAttributesReply, reply); + WriteToClient(client, reply->length << 2, buf); } void @@ -621,7 +622,7 @@ __glXSwapQueryMaxSwapBarriersSGIXReply(ClientPtr client, __GLX_SWAP_SHORT(&reply->sequenceNumber); __GLX_SWAP_INT(&reply->length); __GLX_SWAP_INT(&reply->max); - WriteToClient(client, sz_xGLXQueryMaxSwapBarriersSGIXReply, (char *) reply); + WriteToClient(client, sz_xGLXQueryMaxSwapBarriersSGIXReply, reply); } /************************************************************************/ @@ -1050,7 +1051,7 @@ __glXSwapGetFBConfigsSGIX(__GLXclientState * cl, GLbyte * pc) new_req.length = req->length; new_req.screen = req->screen; - return (__glXSwapGetFBConfigs(cl, (GLbyte *) & new_req)); + return (__glXSwapGetFBConfigs(cl, (GLbyte *) &new_req)); } int diff --git a/xserver/hw/dmx/glxProxy/glxext.c b/xserver/hw/dmx/glxProxy/glxext.c index b0710ccc6..e72a040ed 100644 --- a/xserver/hw/dmx/glxProxy/glxext.c +++ b/xserver/hw/dmx/glxProxy/glxext.c @@ -44,16 +44,8 @@ #include "glxvisuals.h" #include "micmap.h" #include "glxswap.h" - -/* -** Stubs to satisfy miinitext.c references. -*/ -typedef int __GLXprovider; -__GLXprovider __glXDRISWRastProvider; -void -GlxPushProvider(__GLXprovider * provider) -{ -} +#include "extinit.h" +#include "glx_extinit.h" /* ** Forward declarations. diff --git a/xserver/hw/dmx/glxProxy/glxext.h b/xserver/hw/dmx/glxProxy/glxext.h index 881152d1c..47cec15cf 100644 --- a/xserver/hw/dmx/glxProxy/glxext.h +++ b/xserver/hw/dmx/glxProxy/glxext.h @@ -64,8 +64,6 @@ extern void __glXResetLargeCommandStatus(__GLXclientState *); extern int __glXQueryContextInfoEXT(__GLXclientState * cl, GLbyte * pc); extern int __glXSwapQueryContextInfoEXT(__GLXclientState * cl, char *pc); -extern void GlxExtensionInit(void); - extern Bool __glXCoreType(void); #endif /* _glxext_h_ */ diff --git a/xserver/hw/dmx/glxProxy/glxscreens.c b/xserver/hw/dmx/glxProxy/glxscreens.c index f725bd138..2a1909244 100644 --- a/xserver/hw/dmx/glxProxy/glxscreens.c +++ b/xserver/hw/dmx/glxProxy/glxscreens.c @@ -88,7 +88,7 @@ CalcServerVersionAndExtensions(void) req->glxCode = X_GLXQueryVersion; req->majorVersion = GLX_SERVER_MAJOR_VERSION; req->minorVersion = GLX_SERVER_MINOR_VERSION; - _XReply(dpy, (xReply *) & reply, 0, False); + _XReply(dpy, (xReply *) &reply, 0, False); UnlockDisplay(dpy); SyncHandle(); @@ -147,7 +147,7 @@ CalcServerVersionAndExtensions(void) req->glxCode = X_GLXQueryServerString; req->screen = DefaultScreen(dpy); req->name = GLX_EXTENSIONS; - _XReply(dpy, (xReply *) & reply, 0, False); + _XReply(dpy, (xReply *) &reply, 0, False); length = (int) reply.length; numbytes = (int) reply.n; diff --git a/xserver/hw/dmx/glxProxy/glxsingle.c b/xserver/hw/dmx/glxProxy/glxsingle.c index 63786cf79..e60cfeb70 100644 --- a/xserver/hw/dmx/glxProxy/glxsingle.c +++ b/xserver/hw/dmx/glxProxy/glxsingle.c @@ -147,9 +147,9 @@ SendSwappedReply(ClientPtr client, } - WriteToClient(client, sizeof(xGLXSingleReply), (char *) reply); + WriteToClient(client, sizeof(xGLXSingleReply), reply); if (buf_size > 0) - WriteToClient(client, buf_size, (char *) buf); + WriteToClient(client, buf_size, buf); } @@ -249,7 +249,7 @@ __glXForwardPipe0WithReply(__GLXclientState * cl, GLbyte * pc) /* * get the reply from the back-end server */ - _XReply(dpy, (xReply *) & be_reply, 0, False); + _XReply(dpy, (xReply *) &be_reply, 0, False); be_buf_size = be_reply.length << 2; if (be_buf_size > 0) { be_buf = (char *) malloc(be_buf_size); @@ -269,21 +269,23 @@ __glXForwardPipe0WithReply(__GLXclientState * cl, GLbyte * pc) /* * send the reply to the client */ - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.length = be_reply.length; - reply.retval = be_reply.retval; - reply.size = be_reply.size; - reply.pad3 = be_reply.pad3; - reply.pad4 = be_reply.pad4; + reply = (xGLXSingleReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = be_reply.length, + .retval = be_reply.retval, + .size = be_reply.size, + .pad3 = be_reply.pad3, + .pad4 = be_reply.pad4 + }; if (client->swapped) { SendSwappedReply(client, &reply, be_buf, be_buf_size); } else { - WriteToClient(client, sizeof(xGLXSingleReply), (char *) &reply); + WriteToClient(client, sizeof(xGLXSingleReply), &reply); if (be_buf_size > 0) - WriteToClient(client, be_buf_size, (char *) be_buf); + WriteToClient(client, be_buf_size, be_buf); } if (be_buf_size > 0) @@ -346,7 +348,7 @@ __glXForwardAllWithReply(__GLXclientState * cl, GLbyte * pc) /* * get the reply from the back-end server */ - _XReply(dpy, (xReply *) & be_reply, 0, False); + _XReply(dpy, (xReply *) &be_reply, 0, False); be_buf_size = be_reply.length << 2; if (be_buf_size > 0) { be_buf = (char *) malloc(be_buf_size); @@ -371,21 +373,23 @@ __glXForwardAllWithReply(__GLXclientState * cl, GLbyte * pc) /* * send the reply to the client */ - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.length = be_reply.length; - reply.retval = be_reply.retval; - reply.size = be_reply.size; - reply.pad3 = be_reply.pad3; - reply.pad4 = be_reply.pad4; + reply = (xGLXSingleReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = be_reply.length, + .retval = be_reply.retval, + .size = be_reply.size, + .pad3 = be_reply.pad3, + .pad4 = be_reply.pad4 + }; if (client->swapped) { SendSwappedReply(client, &reply, be_buf, be_buf_size); } else { - WriteToClient(client, sizeof(xGLXSingleReply), (char *) &reply); + WriteToClient(client, sizeof(xGLXSingleReply), &reply); if (be_buf_size > 0) - WriteToClient(client, be_buf_size, (char *) be_buf); + WriteToClient(client, be_buf_size, be_buf); } if (be_buf_size > 0) @@ -915,7 +919,7 @@ __glXDisp_ReadPixels(__GLXclientState * cl, GLbyte * pc) *(GLboolean *) (be_pc + 24) = swapBytes; *(GLboolean *) (be_pc + 25) = lsbFirst; - _XReply(dpy, (xReply *) & be_reply, 0, False); + _XReply(dpy, (xReply *) &be_reply, 0, False); if (be_reply.length > 0) { char *be_buf; @@ -1004,18 +1008,20 @@ __glXDisp_ReadPixels(__GLXclientState * cl, GLbyte * pc) } /* of if buf_size > 0 */ - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.length = buf_size >> 2; + reply = (xGLXReadPixelsReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = buf_size >> 2 + }; if (client->swapped) { __GLX_SWAP_SHORT(&reply.sequenceNumber); __GLX_SWAP_INT(&reply.length); } - WriteToClient(client, sizeof(xGLXReadPixelsReply), (char *) &reply); + WriteToClient(client, sizeof(xGLXReadPixelsReply), &reply); if (buf_size > 0) { - WriteToClient(client, buf_size, (char *) buf); + WriteToClient(client, buf_size, buf); free(buf); } diff --git a/xserver/hw/dmx/glxProxy/glxvendor.c b/xserver/hw/dmx/glxProxy/glxvendor.c index 963c92e87..5777c6acc 100644 --- a/xserver/hw/dmx/glxProxy/glxvendor.c +++ b/xserver/hw/dmx/glxProxy/glxvendor.c @@ -138,9 +138,9 @@ SendSwappedReply(ClientPtr client, } - WriteToClient(client, sizeof(xGLXVendorPrivReply), (char *) reply); + WriteToClient(client, sizeof(xGLXVendorPrivReply), reply); if (buf_size > 0) - WriteToClient(client, buf_size, (char *) buf); + WriteToClient(client, buf_size, buf); } @@ -237,7 +237,7 @@ __glXVForwardPipe0WithReply(__GLXclientState * cl, GLbyte * pc) /* * get the reply from the back-end server */ - _XReply(dpy, (xReply *) & be_reply, 0, False); + _XReply(dpy, (xReply *) &be_reply, 0, False); be_buf_size = be_reply.length << 2; if (be_buf_size > 0) { be_buf = (char *) malloc(be_buf_size); @@ -265,9 +265,9 @@ __glXVForwardPipe0WithReply(__GLXclientState * cl, GLbyte * pc) SendSwappedReply(client, &reply, be_buf, be_buf_size); } else { - WriteToClient(client, sizeof(xGLXVendorPrivReply), (char *) &reply); + WriteToClient(client, sizeof(xGLXVendorPrivReply), &reply); if (be_buf_size > 0) - WriteToClient(client, be_buf_size, (char *) be_buf); + WriteToClient(client, be_buf_size, be_buf); } if (be_buf_size > 0) @@ -331,7 +331,7 @@ __glXVForwardAllWithReply(__GLXclientState * cl, GLbyte * pc) /* * get the reply from the back-end server */ - _XReply(dpy, (xReply *) & be_reply, 0, False); + _XReply(dpy, (xReply *) &be_reply, 0, False); be_buf_size = be_reply.length << 2; if (be_buf_size > 0) { be_buf = (char *) malloc(be_buf_size); @@ -364,9 +364,9 @@ __glXVForwardAllWithReply(__GLXclientState * cl, GLbyte * pc) SendSwappedReply(client, &reply, be_buf, be_buf_size); } else { - WriteToClient(client, sizeof(xGLXVendorPrivReply), (char *) &reply); + WriteToClient(client, sizeof(xGLXVendorPrivReply), &reply); if (be_buf_size > 0) - WriteToClient(client, be_buf_size, (char *) be_buf); + WriteToClient(client, be_buf_size, be_buf); } if (be_buf_size > 0) diff --git a/xserver/hw/dmx/glxProxy/renderpixswap.c b/xserver/hw/dmx/glxProxy/renderpixswap.c index 3458e611c..32df0d5a8 100644 --- a/xserver/hw/dmx/glxProxy/renderpixswap.c +++ b/xserver/hw/dmx/glxProxy/renderpixswap.c @@ -39,10 +39,10 @@ __glXDispSwap_PolygonStipple(GLbyte * pc) __GLX_DECLARE_SWAP_VARIABLES; - __GLX_SWAP_INT((GLbyte *) & hdr->rowLength); - __GLX_SWAP_INT((GLbyte *) & hdr->skipRows); - __GLX_SWAP_INT((GLbyte *) & hdr->skipPixels); - __GLX_SWAP_INT((GLbyte *) & hdr->alignment); + __GLX_SWAP_INT((GLbyte *) &hdr->rowLength); + __GLX_SWAP_INT((GLbyte *) &hdr->skipRows); + __GLX_SWAP_INT((GLbyte *) &hdr->skipPixels); + __GLX_SWAP_INT((GLbyte *) &hdr->alignment); hdr->swapBytes = !hdr->swapBytes; } @@ -54,17 +54,17 @@ __glXDispSwap_Bitmap(GLbyte * pc) __GLX_DECLARE_SWAP_VARIABLES; - __GLX_SWAP_INT((GLbyte *) & hdr->rowLength); - __GLX_SWAP_INT((GLbyte *) & hdr->skipRows); - __GLX_SWAP_INT((GLbyte *) & hdr->skipPixels); - __GLX_SWAP_INT((GLbyte *) & hdr->alignment); + __GLX_SWAP_INT((GLbyte *) &hdr->rowLength); + __GLX_SWAP_INT((GLbyte *) &hdr->skipRows); + __GLX_SWAP_INT((GLbyte *) &hdr->skipPixels); + __GLX_SWAP_INT((GLbyte *) &hdr->alignment); - __GLX_SWAP_INT((GLbyte *) & hdr->width); - __GLX_SWAP_INT((GLbyte *) & hdr->height); - __GLX_SWAP_FLOAT((GLbyte *) & hdr->xorig); - __GLX_SWAP_FLOAT((GLbyte *) & hdr->yorig); - __GLX_SWAP_FLOAT((GLbyte *) & hdr->xmove); - __GLX_SWAP_FLOAT((GLbyte *) & hdr->ymove); + __GLX_SWAP_INT((GLbyte *) &hdr->width); + __GLX_SWAP_INT((GLbyte *) &hdr->height); + __GLX_SWAP_FLOAT((GLbyte *) &hdr->xorig); + __GLX_SWAP_FLOAT((GLbyte *) &hdr->yorig); + __GLX_SWAP_FLOAT((GLbyte *) &hdr->xmove); + __GLX_SWAP_FLOAT((GLbyte *) &hdr->ymove); hdr->swapBytes = !hdr->swapBytes; @@ -77,19 +77,19 @@ __glXDispSwap_TexImage1D(GLbyte * pc) __GLX_DECLARE_SWAP_VARIABLES; - __GLX_SWAP_INT((GLbyte *) & hdr->rowLength); - __GLX_SWAP_INT((GLbyte *) & hdr->skipRows); - __GLX_SWAP_INT((GLbyte *) & hdr->skipPixels); - __GLX_SWAP_INT((GLbyte *) & hdr->alignment); + __GLX_SWAP_INT((GLbyte *) &hdr->rowLength); + __GLX_SWAP_INT((GLbyte *) &hdr->skipRows); + __GLX_SWAP_INT((GLbyte *) &hdr->skipPixels); + __GLX_SWAP_INT((GLbyte *) &hdr->alignment); - __GLX_SWAP_INT((GLbyte *) & hdr->target); - __GLX_SWAP_INT((GLbyte *) & hdr->level); - __GLX_SWAP_INT((GLbyte *) & hdr->components); - __GLX_SWAP_INT((GLbyte *) & hdr->width); - __GLX_SWAP_INT((GLbyte *) & hdr->height); - __GLX_SWAP_INT((GLbyte *) & hdr->border); - __GLX_SWAP_INT((GLbyte *) & hdr->format); - __GLX_SWAP_INT((GLbyte *) & hdr->type); + __GLX_SWAP_INT((GLbyte *) &hdr->target); + __GLX_SWAP_INT((GLbyte *) &hdr->level); + __GLX_SWAP_INT((GLbyte *) &hdr->components); + __GLX_SWAP_INT((GLbyte *) &hdr->width); + __GLX_SWAP_INT((GLbyte *) &hdr->height); + __GLX_SWAP_INT((GLbyte *) &hdr->border); + __GLX_SWAP_INT((GLbyte *) &hdr->format); + __GLX_SWAP_INT((GLbyte *) &hdr->type); /* ** Just invert swapBytes flag; the GL will figure out if it needs to swap @@ -105,19 +105,19 @@ __glXDispSwap_TexImage2D(GLbyte * pc) __GLX_DECLARE_SWAP_VARIABLES; - __GLX_SWAP_INT((GLbyte *) & hdr->rowLength); - __GLX_SWAP_INT((GLbyte *) & hdr->skipRows); - __GLX_SWAP_INT((GLbyte *) & hdr->skipPixels); - __GLX_SWAP_INT((GLbyte *) & hdr->alignment); + __GLX_SWAP_INT((GLbyte *) &hdr->rowLength); + __GLX_SWAP_INT((GLbyte *) &hdr->skipRows); + __GLX_SWAP_INT((GLbyte *) &hdr->skipPixels); + __GLX_SWAP_INT((GLbyte *) &hdr->alignment); - __GLX_SWAP_INT((GLbyte *) & hdr->target); - __GLX_SWAP_INT((GLbyte *) & hdr->level); - __GLX_SWAP_INT((GLbyte *) & hdr->components); - __GLX_SWAP_INT((GLbyte *) & hdr->width); - __GLX_SWAP_INT((GLbyte *) & hdr->height); - __GLX_SWAP_INT((GLbyte *) & hdr->border); - __GLX_SWAP_INT((GLbyte *) & hdr->format); - __GLX_SWAP_INT((GLbyte *) & hdr->type); + __GLX_SWAP_INT((GLbyte *) &hdr->target); + __GLX_SWAP_INT((GLbyte *) &hdr->level); + __GLX_SWAP_INT((GLbyte *) &hdr->components); + __GLX_SWAP_INT((GLbyte *) &hdr->width); + __GLX_SWAP_INT((GLbyte *) &hdr->height); + __GLX_SWAP_INT((GLbyte *) &hdr->border); + __GLX_SWAP_INT((GLbyte *) &hdr->format); + __GLX_SWAP_INT((GLbyte *) &hdr->type); /* ** Just invert swapBytes flag; the GL will figure out if it needs to swap @@ -133,25 +133,25 @@ __glXDispSwap_TexImage3D(GLbyte * pc) __GLX_DECLARE_SWAP_VARIABLES; - __GLX_SWAP_INT((GLbyte *) & hdr->rowLength); - __GLX_SWAP_INT((GLbyte *) & hdr->imageHeight); - __GLX_SWAP_INT((GLbyte *) & hdr->imageDepth); - __GLX_SWAP_INT((GLbyte *) & hdr->skipRows); - __GLX_SWAP_INT((GLbyte *) & hdr->skipImages); - __GLX_SWAP_INT((GLbyte *) & hdr->skipVolumes); - __GLX_SWAP_INT((GLbyte *) & hdr->skipPixels); - __GLX_SWAP_INT((GLbyte *) & hdr->alignment); + __GLX_SWAP_INT((GLbyte *) &hdr->rowLength); + __GLX_SWAP_INT((GLbyte *) &hdr->imageHeight); + __GLX_SWAP_INT((GLbyte *) &hdr->imageDepth); + __GLX_SWAP_INT((GLbyte *) &hdr->skipRows); + __GLX_SWAP_INT((GLbyte *) &hdr->skipImages); + __GLX_SWAP_INT((GLbyte *) &hdr->skipVolumes); + __GLX_SWAP_INT((GLbyte *) &hdr->skipPixels); + __GLX_SWAP_INT((GLbyte *) &hdr->alignment); - __GLX_SWAP_INT((GLbyte *) & hdr->target); - __GLX_SWAP_INT((GLbyte *) & hdr->level); - __GLX_SWAP_INT((GLbyte *) & hdr->internalformat); - __GLX_SWAP_INT((GLbyte *) & hdr->width); - __GLX_SWAP_INT((GLbyte *) & hdr->height); - __GLX_SWAP_INT((GLbyte *) & hdr->depth); - __GLX_SWAP_INT((GLbyte *) & hdr->size4d); - __GLX_SWAP_INT((GLbyte *) & hdr->border); - __GLX_SWAP_INT((GLbyte *) & hdr->format); - __GLX_SWAP_INT((GLbyte *) & hdr->type); + __GLX_SWAP_INT((GLbyte *) &hdr->target); + __GLX_SWAP_INT((GLbyte *) &hdr->level); + __GLX_SWAP_INT((GLbyte *) &hdr->internalformat); + __GLX_SWAP_INT((GLbyte *) &hdr->width); + __GLX_SWAP_INT((GLbyte *) &hdr->height); + __GLX_SWAP_INT((GLbyte *) &hdr->depth); + __GLX_SWAP_INT((GLbyte *) &hdr->size4d); + __GLX_SWAP_INT((GLbyte *) &hdr->border); + __GLX_SWAP_INT((GLbyte *) &hdr->format); + __GLX_SWAP_INT((GLbyte *) &hdr->type); /* ** Just invert swapBytes flag; the GL will figure out if it needs to swap @@ -167,15 +167,15 @@ __glXDispSwap_DrawPixels(GLbyte * pc) __GLX_DECLARE_SWAP_VARIABLES; - __GLX_SWAP_INT((GLbyte *) & hdr->rowLength); - __GLX_SWAP_INT((GLbyte *) & hdr->skipRows); - __GLX_SWAP_INT((GLbyte *) & hdr->skipPixels); - __GLX_SWAP_INT((GLbyte *) & hdr->alignment); + __GLX_SWAP_INT((GLbyte *) &hdr->rowLength); + __GLX_SWAP_INT((GLbyte *) &hdr->skipRows); + __GLX_SWAP_INT((GLbyte *) &hdr->skipPixels); + __GLX_SWAP_INT((GLbyte *) &hdr->alignment); - __GLX_SWAP_INT((GLbyte *) & hdr->width); - __GLX_SWAP_INT((GLbyte *) & hdr->height); - __GLX_SWAP_INT((GLbyte *) & hdr->format); - __GLX_SWAP_INT((GLbyte *) & hdr->type); + __GLX_SWAP_INT((GLbyte *) &hdr->width); + __GLX_SWAP_INT((GLbyte *) &hdr->height); + __GLX_SWAP_INT((GLbyte *) &hdr->format); + __GLX_SWAP_INT((GLbyte *) &hdr->type); /* ** Just invert swapBytes flag; the GL will figure out if it needs to swap @@ -191,17 +191,17 @@ __glXDispSwap_TexSubImage1D(GLbyte * pc) __GLX_DECLARE_SWAP_VARIABLES; - __GLX_SWAP_INT((GLbyte *) & hdr->rowLength); - __GLX_SWAP_INT((GLbyte *) & hdr->skipRows); - __GLX_SWAP_INT((GLbyte *) & hdr->skipPixels); - __GLX_SWAP_INT((GLbyte *) & hdr->alignment); + __GLX_SWAP_INT((GLbyte *) &hdr->rowLength); + __GLX_SWAP_INT((GLbyte *) &hdr->skipRows); + __GLX_SWAP_INT((GLbyte *) &hdr->skipPixels); + __GLX_SWAP_INT((GLbyte *) &hdr->alignment); - __GLX_SWAP_INT((GLbyte *) & hdr->target); - __GLX_SWAP_INT((GLbyte *) & hdr->level); - __GLX_SWAP_INT((GLbyte *) & hdr->xoffset); - __GLX_SWAP_INT((GLbyte *) & hdr->width); - __GLX_SWAP_INT((GLbyte *) & hdr->format); - __GLX_SWAP_INT((GLbyte *) & hdr->type); + __GLX_SWAP_INT((GLbyte *) &hdr->target); + __GLX_SWAP_INT((GLbyte *) &hdr->level); + __GLX_SWAP_INT((GLbyte *) &hdr->xoffset); + __GLX_SWAP_INT((GLbyte *) &hdr->width); + __GLX_SWAP_INT((GLbyte *) &hdr->format); + __GLX_SWAP_INT((GLbyte *) &hdr->type); /* ** Just invert swapBytes flag; the GL will figure out if it needs to swap @@ -217,19 +217,19 @@ __glXDispSwap_TexSubImage2D(GLbyte * pc) __GLX_DECLARE_SWAP_VARIABLES; - __GLX_SWAP_INT((GLbyte *) & hdr->rowLength); - __GLX_SWAP_INT((GLbyte *) & hdr->skipRows); - __GLX_SWAP_INT((GLbyte *) & hdr->skipPixels); - __GLX_SWAP_INT((GLbyte *) & hdr->alignment); + __GLX_SWAP_INT((GLbyte *) &hdr->rowLength); + __GLX_SWAP_INT((GLbyte *) &hdr->skipRows); + __GLX_SWAP_INT((GLbyte *) &hdr->skipPixels); + __GLX_SWAP_INT((GLbyte *) &hdr->alignment); - __GLX_SWAP_INT((GLbyte *) & hdr->target); - __GLX_SWAP_INT((GLbyte *) & hdr->level); - __GLX_SWAP_INT((GLbyte *) & hdr->xoffset); - __GLX_SWAP_INT((GLbyte *) & hdr->yoffset); - __GLX_SWAP_INT((GLbyte *) & hdr->width); - __GLX_SWAP_INT((GLbyte *) & hdr->height); - __GLX_SWAP_INT((GLbyte *) & hdr->format); - __GLX_SWAP_INT((GLbyte *) & hdr->type); + __GLX_SWAP_INT((GLbyte *) &hdr->target); + __GLX_SWAP_INT((GLbyte *) &hdr->level); + __GLX_SWAP_INT((GLbyte *) &hdr->xoffset); + __GLX_SWAP_INT((GLbyte *) &hdr->yoffset); + __GLX_SWAP_INT((GLbyte *) &hdr->width); + __GLX_SWAP_INT((GLbyte *) &hdr->height); + __GLX_SWAP_INT((GLbyte *) &hdr->format); + __GLX_SWAP_INT((GLbyte *) &hdr->type); /* ** Just invert swapBytes flag; the GL will figure out if it needs to swap @@ -246,26 +246,26 @@ __glXDispSwap_TexSubImage3D(GLbyte * pc) __GLX_DECLARE_SWAP_VARIABLES; - __GLX_SWAP_INT((GLbyte *) & hdr->rowLength); - __GLX_SWAP_INT((GLbyte *) & hdr->imageHeight); - __GLX_SWAP_INT((GLbyte *) & hdr->imageDepth); - __GLX_SWAP_INT((GLbyte *) & hdr->skipRows); - __GLX_SWAP_INT((GLbyte *) & hdr->skipImages); - __GLX_SWAP_INT((GLbyte *) & hdr->skipVolumes); - __GLX_SWAP_INT((GLbyte *) & hdr->skipPixels); - __GLX_SWAP_INT((GLbyte *) & hdr->alignment); + __GLX_SWAP_INT((GLbyte *) &hdr->rowLength); + __GLX_SWAP_INT((GLbyte *) &hdr->imageHeight); + __GLX_SWAP_INT((GLbyte *) &hdr->imageDepth); + __GLX_SWAP_INT((GLbyte *) &hdr->skipRows); + __GLX_SWAP_INT((GLbyte *) &hdr->skipImages); + __GLX_SWAP_INT((GLbyte *) &hdr->skipVolumes); + __GLX_SWAP_INT((GLbyte *) &hdr->skipPixels); + __GLX_SWAP_INT((GLbyte *) &hdr->alignment); - __GLX_SWAP_INT((GLbyte *) & hdr->target); - __GLX_SWAP_INT((GLbyte *) & hdr->level); - __GLX_SWAP_INT((GLbyte *) & hdr->xoffset); - __GLX_SWAP_INT((GLbyte *) & hdr->yoffset); - __GLX_SWAP_INT((GLbyte *) & hdr->zoffset); - __GLX_SWAP_INT((GLbyte *) & hdr->width); - __GLX_SWAP_INT((GLbyte *) & hdr->height); - __GLX_SWAP_INT((GLbyte *) & hdr->depth); - __GLX_SWAP_INT((GLbyte *) & hdr->size4d); - __GLX_SWAP_INT((GLbyte *) & hdr->format); - __GLX_SWAP_INT((GLbyte *) & hdr->type); + __GLX_SWAP_INT((GLbyte *) &hdr->target); + __GLX_SWAP_INT((GLbyte *) &hdr->level); + __GLX_SWAP_INT((GLbyte *) &hdr->xoffset); + __GLX_SWAP_INT((GLbyte *) &hdr->yoffset); + __GLX_SWAP_INT((GLbyte *) &hdr->zoffset); + __GLX_SWAP_INT((GLbyte *) &hdr->width); + __GLX_SWAP_INT((GLbyte *) &hdr->height); + __GLX_SWAP_INT((GLbyte *) &hdr->depth); + __GLX_SWAP_INT((GLbyte *) &hdr->size4d); + __GLX_SWAP_INT((GLbyte *) &hdr->format); + __GLX_SWAP_INT((GLbyte *) &hdr->type); /* ** Just invert swapBytes flag; the GL will figure out if it needs to swap @@ -281,16 +281,16 @@ __glXDispSwap_ColorTable(GLbyte * pc) __GLX_DECLARE_SWAP_VARIABLES; - __GLX_SWAP_INT((GLbyte *) & hdr->rowLength); - __GLX_SWAP_INT((GLbyte *) & hdr->skipRows); - __GLX_SWAP_INT((GLbyte *) & hdr->skipPixels); - __GLX_SWAP_INT((GLbyte *) & hdr->alignment); + __GLX_SWAP_INT((GLbyte *) &hdr->rowLength); + __GLX_SWAP_INT((GLbyte *) &hdr->skipRows); + __GLX_SWAP_INT((GLbyte *) &hdr->skipPixels); + __GLX_SWAP_INT((GLbyte *) &hdr->alignment); - __GLX_SWAP_INT((GLbyte *) & hdr->target); - __GLX_SWAP_INT((GLbyte *) & hdr->internalformat); - __GLX_SWAP_INT((GLbyte *) & hdr->width); - __GLX_SWAP_INT((GLbyte *) & hdr->format); - __GLX_SWAP_INT((GLbyte *) & hdr->type); + __GLX_SWAP_INT((GLbyte *) &hdr->target); + __GLX_SWAP_INT((GLbyte *) &hdr->internalformat); + __GLX_SWAP_INT((GLbyte *) &hdr->width); + __GLX_SWAP_INT((GLbyte *) &hdr->format); + __GLX_SWAP_INT((GLbyte *) &hdr->type); /* ** Just invert swapBytes flag; the GL will figure out if it needs to swap @@ -306,16 +306,16 @@ __glXDispSwap_ColorSubTable(GLbyte * pc) (__GLXdispatchColorSubTableHeader *) pc; __GLX_DECLARE_SWAP_VARIABLES; - __GLX_SWAP_INT((GLbyte *) & hdr->rowLength); - __GLX_SWAP_INT((GLbyte *) & hdr->skipRows); - __GLX_SWAP_INT((GLbyte *) & hdr->skipPixels); - __GLX_SWAP_INT((GLbyte *) & hdr->alignment); + __GLX_SWAP_INT((GLbyte *) &hdr->rowLength); + __GLX_SWAP_INT((GLbyte *) &hdr->skipRows); + __GLX_SWAP_INT((GLbyte *) &hdr->skipPixels); + __GLX_SWAP_INT((GLbyte *) &hdr->alignment); - __GLX_SWAP_INT((GLbyte *) & hdr->target); - __GLX_SWAP_INT((GLbyte *) & hdr->start); - __GLX_SWAP_INT((GLbyte *) & hdr->count); - __GLX_SWAP_INT((GLbyte *) & hdr->format); - __GLX_SWAP_INT((GLbyte *) & hdr->type); + __GLX_SWAP_INT((GLbyte *) &hdr->target); + __GLX_SWAP_INT((GLbyte *) &hdr->start); + __GLX_SWAP_INT((GLbyte *) &hdr->count); + __GLX_SWAP_INT((GLbyte *) &hdr->format); + __GLX_SWAP_INT((GLbyte *) &hdr->type); /* ** Just invert swapBytes flag; the GL will figure out if it needs to swap @@ -331,16 +331,16 @@ __glXDispSwap_ConvolutionFilter1D(GLbyte * pc) (__GLXdispatchConvolutionFilterHeader *) pc; __GLX_DECLARE_SWAP_VARIABLES; - __GLX_SWAP_INT((GLbyte *) & hdr->rowLength); - __GLX_SWAP_INT((GLbyte *) & hdr->skipRows); - __GLX_SWAP_INT((GLbyte *) & hdr->skipPixels); - __GLX_SWAP_INT((GLbyte *) & hdr->alignment); + __GLX_SWAP_INT((GLbyte *) &hdr->rowLength); + __GLX_SWAP_INT((GLbyte *) &hdr->skipRows); + __GLX_SWAP_INT((GLbyte *) &hdr->skipPixels); + __GLX_SWAP_INT((GLbyte *) &hdr->alignment); - __GLX_SWAP_INT((GLbyte *) & hdr->target); - __GLX_SWAP_INT((GLbyte *) & hdr->internalformat); - __GLX_SWAP_INT((GLbyte *) & hdr->width); - __GLX_SWAP_INT((GLbyte *) & hdr->format); - __GLX_SWAP_INT((GLbyte *) & hdr->type); + __GLX_SWAP_INT((GLbyte *) &hdr->target); + __GLX_SWAP_INT((GLbyte *) &hdr->internalformat); + __GLX_SWAP_INT((GLbyte *) &hdr->width); + __GLX_SWAP_INT((GLbyte *) &hdr->format); + __GLX_SWAP_INT((GLbyte *) &hdr->type); /* ** Just invert swapBytes flag; the GL will figure out if it needs to swap @@ -356,17 +356,17 @@ __glXDispSwap_ConvolutionFilter2D(GLbyte * pc) (__GLXdispatchConvolutionFilterHeader *) pc; __GLX_DECLARE_SWAP_VARIABLES; - __GLX_SWAP_INT((GLbyte *) & hdr->rowLength); - __GLX_SWAP_INT((GLbyte *) & hdr->skipRows); - __GLX_SWAP_INT((GLbyte *) & hdr->skipPixels); - __GLX_SWAP_INT((GLbyte *) & hdr->alignment); + __GLX_SWAP_INT((GLbyte *) &hdr->rowLength); + __GLX_SWAP_INT((GLbyte *) &hdr->skipRows); + __GLX_SWAP_INT((GLbyte *) &hdr->skipPixels); + __GLX_SWAP_INT((GLbyte *) &hdr->alignment); - __GLX_SWAP_INT((GLbyte *) & hdr->target); - __GLX_SWAP_INT((GLbyte *) & hdr->internalformat); - __GLX_SWAP_INT((GLbyte *) & hdr->width); - __GLX_SWAP_INT((GLbyte *) & hdr->height); - __GLX_SWAP_INT((GLbyte *) & hdr->format); - __GLX_SWAP_INT((GLbyte *) & hdr->type); + __GLX_SWAP_INT((GLbyte *) &hdr->target); + __GLX_SWAP_INT((GLbyte *) &hdr->internalformat); + __GLX_SWAP_INT((GLbyte *) &hdr->width); + __GLX_SWAP_INT((GLbyte *) &hdr->height); + __GLX_SWAP_INT((GLbyte *) &hdr->format); + __GLX_SWAP_INT((GLbyte *) &hdr->type); /* ** Just invert swapBytes flag; the GL will figure out if it needs to swap @@ -386,17 +386,17 @@ __glXDispSwap_SeparableFilter2D(GLbyte * pc) hdrlen = __GLX_PAD(__GLX_CONV_FILT_CMD_HDR_SIZE); - __GLX_SWAP_INT((GLbyte *) & hdr->rowLength); - __GLX_SWAP_INT((GLbyte *) & hdr->skipRows); - __GLX_SWAP_INT((GLbyte *) & hdr->skipPixels); - __GLX_SWAP_INT((GLbyte *) & hdr->alignment); + __GLX_SWAP_INT((GLbyte *) &hdr->rowLength); + __GLX_SWAP_INT((GLbyte *) &hdr->skipRows); + __GLX_SWAP_INT((GLbyte *) &hdr->skipPixels); + __GLX_SWAP_INT((GLbyte *) &hdr->alignment); - __GLX_SWAP_INT((GLbyte *) & hdr->target); - __GLX_SWAP_INT((GLbyte *) & hdr->internalformat); - __GLX_SWAP_INT((GLbyte *) & hdr->width); - __GLX_SWAP_INT((GLbyte *) & hdr->height); - __GLX_SWAP_INT((GLbyte *) & hdr->format); - __GLX_SWAP_INT((GLbyte *) & hdr->type); + __GLX_SWAP_INT((GLbyte *) &hdr->target); + __GLX_SWAP_INT((GLbyte *) &hdr->internalformat); + __GLX_SWAP_INT((GLbyte *) &hdr->width); + __GLX_SWAP_INT((GLbyte *) &hdr->height); + __GLX_SWAP_INT((GLbyte *) &hdr->format); + __GLX_SWAP_INT((GLbyte *) &hdr->type); /* ** Just invert swapBytes flag; the GL will figure out if it needs to swap diff --git a/xserver/hw/dmx/glxProxy/unpack.h b/xserver/hw/dmx/glxProxy/unpack.h index b4b73580c..45c27c6b9 100644 --- a/xserver/hw/dmx/glxProxy/unpack.h +++ b/xserver/hw/dmx/glxProxy/unpack.h @@ -59,7 +59,7 @@ extern xGLXSingleReply __glXReply; __glXReply.sequenceNumber = client->sequence; #define __GLX_SEND_HEADER() \ - WriteToClient( client, sz_xGLXSingleReply, (char *)&__glXReply); + WriteToClient (client, sz_xGLXSingleReply, &__glXReply); #define __GLX_PUT_RETVAL(a) \ __glXReply.retval = (a); @@ -112,19 +112,19 @@ extern xGLXSingleReply __glXReply; *(GLdouble *)&__glXReply.pad3 = *(GLdouble *)answer #define __GLX_SEND_BYTE_ARRAY(len) \ - WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT8), (char *)answer) + WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT8), answer) #define __GLX_SEND_SHORT_ARRAY(len) \ - WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT16), (char *)answer) + WriteToClient(client, __GLX_PAD((len)*__GLX_SIZE_INT16), answer) #define __GLX_SEND_INT_ARRAY(len) \ - WriteToClient(client, (len)*__GLX_SIZE_INT32, (char *)answer) + WriteToClient(client, (len)*__GLX_SIZE_INT32, answer) #define __GLX_SEND_FLOAT_ARRAY(len) \ - WriteToClient(client, (len)*__GLX_SIZE_FLOAT32, (char *)answer) + WriteToClient(client, (len)*__GLX_SIZE_FLOAT32, answer) #define __GLX_SEND_DOUBLE_ARRAY(len) \ - WriteToClient(client, (len)*__GLX_SIZE_FLOAT64, (char *)answer) + WriteToClient(client, (len)*__GLX_SIZE_FLOAT64, answer) #define __GLX_SEND_VOID_ARRAY(len) __GLX_SEND_BYTE_ARRAY(len) #define __GLX_SEND_UBYTE_ARRAY(len) __GLX_SEND_BYTE_ARRAY(len) diff --git a/xserver/hw/dmx/input/Makefile.in b/xserver/hw/dmx/input/Makefile.in index da158cda2..70f4c2746 100644 --- a/xserver/hw/dmx/input/Makefile.in +++ b/xserver/hw/dmx/input/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -207,13 +207,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -235,6 +231,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -259,6 +256,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -274,7 +272,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -373,6 +370,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -534,7 +532,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -559,9 +557,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/dmx/input/dmxconsole.c b/xserver/hw/dmx/input/dmxconsole.c index f63772b17..600a70553 100644 --- a/xserver/hw/dmx/input/dmxconsole.c +++ b/xserver/hw/dmx/input/dmxconsole.c @@ -640,7 +640,7 @@ dmxCloseConsole(myPrivate * priv) } static Bool -dmxCloseConsoleScreen(int idx, ScreenPtr pScreen) +dmxCloseConsoleScreen(ScreenPtr pScreen) { myPrivate *priv, *last; @@ -650,7 +650,7 @@ dmxCloseConsoleScreen(int idx, ScreenPtr pScreen) dmxCloseConsole(last = priv); DMX_UNWRAP(CloseScreen, last, pScreen); - return pScreen->CloseScreen(idx, pScreen); + return pScreen->CloseScreen(pScreen); } static Cursor diff --git a/xserver/hw/dmx/input/dmxevents.c b/xserver/hw/dmx/input/dmxevents.c index f73480824..28756203b 100644 --- a/xserver/hw/dmx/input/dmxevents.c +++ b/xserver/hw/dmx/input/dmxevents.c @@ -227,25 +227,25 @@ dmxCoreMotion(DevicePtr pDev, int x, int y, int delta, DMXBlockType block) && pScreen->myNum == dmxScreen->index) { /* Screen is old screen */ if (block) - dmxSigioBlock(); + OsBlockSIGIO(); if (pDev) enqueueMotion(pDev, localX, localY); if (block) - dmxSigioUnblock(); + OsReleaseSIGIO(); } else { /* Screen is new */ DMXDBG4(" New screen: old=%d new=%d localX=%d localY=%d\n", pScreen->myNum, dmxScreen->index, localX, localY); if (block) - dmxSigioBlock(); + OsBlockSIGIO(); mieqProcessInputEvents(); miPointerSetScreen(inputInfo.pointer, dmxScreen->index, localX, localY); if (pDev) enqueueMotion(pDev, localX, localY); if (block) - dmxSigioUnblock(); + OsReleaseSIGIO(); } #if 00 miPointerGetPosition(inputInfo.pointer, &localX, &localY); @@ -387,12 +387,12 @@ dmxExtMotion(DMXLocalInputInfoPtr dmxLocal, } if (block) - dmxSigioBlock(); + OsBlockSIGIO(); valuator_mask_set_range(&mask, firstAxis, axesCount, v); QueuePointerEvents(pDevice, MotionNotify, 0, POINTER_ABSOLUTE, &mask); if (block) - dmxSigioUnblock(); + OsReleaseSIGIO(); } static int @@ -492,10 +492,10 @@ dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal, valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count, valuators); if (block) - dmxSigioBlock(); + OsBlockSIGIO(); QueueKeyboardEvents(pDevice, event, ke->keycode, &mask); if (block) - dmxSigioUnblock(); + OsReleaseSIGIO(); break; case XI_DeviceButtonPress: case XI_DeviceButtonRelease: @@ -503,11 +503,11 @@ dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal, valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count, valuators); if (block) - dmxSigioBlock(); + OsBlockSIGIO(); QueuePointerEvents(pDevice, event, ke->keycode, POINTER_ABSOLUTE, &mask); if (block) - dmxSigioUnblock(); + OsReleaseSIGIO(); break; case XI_ProximityIn: case XI_ProximityOut: @@ -515,10 +515,10 @@ dmxTranslateAndEnqueueExtEvent(DMXLocalInputInfoPtr dmxLocal, valuator_mask_set_range(&mask, ke->first_axis, ke->axes_count, valuators); if (block) - dmxSigioBlock(); + OsBlockSIGIO(); QueueProximityEvents(pDevice, event, &mask); if (block) - dmxSigioUnblock(); + OsReleaseSIGIO(); break; break; diff --git a/xserver/hw/dmx/input/dmxsigio.c b/xserver/hw/dmx/input/dmxsigio.c index 9b1b493b8..6ef543c8b 100644 --- a/xserver/hw/dmx/input/dmxsigio.c +++ b/xserver/hw/dmx/input/dmxsigio.c @@ -84,28 +84,6 @@ dmxSigioHandler(int sig) } } -/** Block SIGIO handling. */ -void -dmxSigioBlock(void) -{ - sigset_t s; - - sigemptyset(&s); - sigaddset(&s, SIGIO); - sigprocmask(SIG_BLOCK, &s, 0); -} - -/** Unblock SIGIO handling. */ -void -dmxSigioUnblock(void) -{ - sigset_t s; - - sigemptyset(&s); - sigaddset(&s, SIGIO); - sigprocmask(SIG_UNBLOCK, &s, 0); -} - static void dmxSigioHook(void) { diff --git a/xserver/hw/dmx/input/dmxsigio.h b/xserver/hw/dmx/input/dmxsigio.h index 4e4874929..9f30662d1 100644 --- a/xserver/hw/dmx/input/dmxsigio.h +++ b/xserver/hw/dmx/input/dmxsigio.h @@ -36,8 +36,6 @@ #ifndef _DMXSIGIO_H_ #define _DMXSIGIO_H_ -extern void dmxSigioBlock(void); -extern void dmxSigioUnblock(void); extern void dmxSigioEnableInput(void); extern void dmxSigioDisableInput(void); extern void dmxSigioRegister(DMXInputInfo * dmxInput, int fd); diff --git a/xserver/hw/dmx/man/Makefile.in b/xserver/hw/dmx/man/Makefile.in index f9b895373..47eff8954 100644 --- a/xserver/hw/dmx/man/Makefile.in +++ b/xserver/hw/dmx/man/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -179,13 +179,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -207,6 +203,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -231,6 +228,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -246,7 +244,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -361,6 +358,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -480,7 +478,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/manpages.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/manpages.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -506,9 +504,9 @@ $(top_srcdir)/manpages.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/kdrive/Makefile.in b/xserver/hw/kdrive/Makefile.in index 99176763e..050539c29 100644 --- a/xserver/hw/kdrive/Makefile.in +++ b/xserver/hw/kdrive/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -186,13 +186,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -214,6 +210,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -238,6 +235,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -253,7 +251,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -352,6 +349,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -473,7 +471,7 @@ DIST_SUBDIRS = fbdev ephyr src linux fake openbsd wscons all: all-recursive .SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -498,9 +496,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/kdrive/ephyr/Makefile.am b/xserver/hw/kdrive/ephyr/Makefile.am index 9d9b64ee5..2e0613a7c 100644 --- a/xserver/hw/kdrive/ephyr/Makefile.am +++ b/xserver/hw/kdrive/ephyr/Makefile.am @@ -5,7 +5,6 @@ INCLUDES = \ @KDRIVE_CFLAGS@ \ @XEPHYR_INCS@ \ @XEPHYR_CFLAGS@ \ - @DRIPROTO_CFLAGS@ \ -I$(top_srcdir) \ -I$(top_srcdir)/exa diff --git a/xserver/hw/kdrive/ephyr/Makefile.in b/xserver/hw/kdrive/ephyr/Makefile.in index 9bf196ee8..89a4ef49b 100644 --- a/xserver/hw/kdrive/ephyr/Makefile.in +++ b/xserver/hw/kdrive/ephyr/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -254,13 +254,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -282,6 +278,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -306,6 +303,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -321,7 +319,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -420,6 +417,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -525,7 +523,6 @@ INCLUDES = \ @KDRIVE_CFLAGS@ \ @XEPHYR_INCS@ \ @XEPHYR_CFLAGS@ \ - @DRIPROTO_CFLAGS@ \ -I$(top_srcdir) \ -I$(top_srcdir)/exa @@ -592,7 +589,7 @@ all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -617,9 +614,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/kdrive/ephyr/XF86dri.c b/xserver/hw/kdrive/ephyr/XF86dri.c index 74bf67678..9d742f394 100644 --- a/xserver/hw/kdrive/ephyr/XF86dri.c +++ b/xserver/hw/kdrive/ephyr/XF86dri.c @@ -151,7 +151,7 @@ XF86DRIQueryVersion(Display * dpy, int *majorVersion, int *minorVersion, GetReq(XF86DRIQueryVersion, req); req->reqType = info->codes->major_opcode; req->driReqType = X_XF86DRIQueryVersion; - if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { + if (!_XReply(dpy, (xReply *) &rep, 0, xFalse)) { UnlockDisplay(dpy); SyncHandle(); TRACE("QueryVersion... return False"); @@ -181,7 +181,7 @@ XF86DRIQueryDirectRenderingCapable(Display * dpy, int screen, Bool *isCapable) req->reqType = info->codes->major_opcode; req->driReqType = X_XF86DRIQueryDirectRenderingCapable; req->screen = screen; - if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { + if (!_XReply(dpy, (xReply *) &rep, 0, xFalse)) { UnlockDisplay(dpy); SyncHandle(); TRACE("QueryDirectRenderingCapable... return False"); @@ -210,7 +210,7 @@ XF86DRIOpenConnection(Display * dpy, int screen, req->reqType = info->codes->major_opcode; req->driReqType = X_XF86DRIOpenConnection; req->screen = screen; - if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { + if (!_XReply(dpy, (xReply *) &rep, 0, xFalse)) { UnlockDisplay(dpy); SyncHandle(); TRACE("OpenConnection... return False"); @@ -260,7 +260,7 @@ XF86DRIAuthConnection(Display * dpy, int screen, drm_magic_t magic) req->screen = screen; req->magic = magic; rep.authenticated = 0; - if (!_XReply(dpy, (xReply *) & rep, 0, xFalse) || !rep.authenticated) { + if (!_XReply(dpy, (xReply *) &rep, 0, xFalse) || !rep.authenticated) { UnlockDisplay(dpy); SyncHandle(); TRACE("AuthConnection... return False"); @@ -311,7 +311,7 @@ XF86DRIGetClientDriverName(Display * dpy, int screen, req->reqType = info->codes->major_opcode; req->driReqType = X_XF86DRIGetClientDriverName; req->screen = screen; - if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { + if (!_XReply(dpy, (xReply *) &rep, 0, xFalse)) { UnlockDisplay(dpy); SyncHandle(); TRACE("GetClientDriverName... return False"); @@ -362,7 +362,7 @@ XF86DRICreateContextWithConfig(Display * dpy, int screen, int configID, req->screen = screen; *context = XAllocID(dpy); req->context = *context; - if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { + if (!_XReply(dpy, (xReply *) &rep, 0, xFalse)) { UnlockDisplay(dpy); SyncHandle(); TRACE("CreateContext... return False"); @@ -421,7 +421,7 @@ XF86DRICreateDrawable(Display * dpy, int screen, req->driReqType = X_XF86DRICreateDrawable; req->screen = screen; req->drawable = drawable; - if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { + if (!_XReply(dpy, (xReply *) &rep, 0, xFalse)) { UnlockDisplay(dpy); SyncHandle(); TRACE("CreateDrawable... return False"); @@ -503,7 +503,7 @@ XF86DRIGetDrawableInfo(Display * dpy, int screen, Drawable drawable, req->screen = screen; req->drawable = drawable; - if (!_XReply(dpy, (xReply *) & rep, 1, xFalse)) { + if (!_XReply(dpy, (xReply *) &rep, 1, xFalse)) { UnlockDisplay(dpy); SyncHandle(); TRACE("GetDrawableInfo... return False"); @@ -585,7 +585,7 @@ XF86DRIGetDeviceInfo(Display * dpy, int screen, drm_handle_t * hFrameBuffer, req->reqType = info->codes->major_opcode; req->driReqType = X_XF86DRIGetDeviceInfo; req->screen = screen; - if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { + if (!_XReply(dpy, (xReply *) &rep, 0, xFalse)) { UnlockDisplay(dpy); SyncHandle(); TRACE("GetDeviceInfo... return False"); diff --git a/xserver/hw/kdrive/ephyr/ephyr.c b/xserver/hw/kdrive/ephyr/ephyr.c index 8eda539aa..e6520d035 100644 --- a/xserver/hw/kdrive/ephyr/ephyr.c +++ b/xserver/hw/kdrive/ephyr/ephyr.c @@ -42,10 +42,6 @@ extern int KdTsPhyScreen; -#ifdef GLXEXT -extern Bool noGlxVisualInit; -#endif - KdKeyboardInfo *ephyrKbd; KdPointerInfo *ephyrMouse; EphyrKeySyms ephyrKeySyms; @@ -419,23 +415,22 @@ ephyrRandRGetInfo(ScreenPtr pScreen, Rotation * rotations) struct { int width, height; } sizes[] = { - { - 1600, 1200}, { - 1400, 1050}, { - 1280, 960}, { - 1280, 1024}, { - 1152, 864}, { - 1024, 768}, { - 832, 624}, { - 800, 600}, { - 720, 400}, { - 480, 640}, { - 640, 480}, { - 640, 400}, { - 320, 240}, { - 240, 320}, { - 160, 160}, { - 0, 0} + {1600, 1200}, + {1400, 1050}, + {1280, 960}, + {1280, 1024}, + {1152, 864}, + {1024, 768}, + {832, 624}, + {800, 600}, + {720, 400}, + {480, 640}, + {640, 480}, + {640, 400}, + {320, 240}, + {240, 320}, + {160, 160}, + {0, 0} }; EPHYR_LOG("mark"); @@ -562,6 +557,8 @@ ephyrRandRSetConfig(ScreenPtr pScreen, if (wasEnabled) KdEnableScreen(pScreen); + RRScreenSizeNotify(pScreen); + return TRUE; bail4: @@ -594,6 +591,43 @@ ephyrRandRInit(ScreenPtr pScreen) pScrPriv->rrSetConfig = ephyrRandRSetConfig; return TRUE; } + +static Bool +ephyrResizeScreen (ScreenPtr pScreen, + int newwidth, + int newheight) +{ + KdScreenPriv(pScreen); + KdScreenInfo *screen = pScreenPriv->screen; + RRScreenSize size = {0}; + Bool ret; + int t; + + if (screen->randr & (RR_Rotate_90|RR_Rotate_270)) { + t = newwidth; + newwidth = newheight; + newheight = t; + } + + if (newwidth == screen->width && newheight == screen->height) { + return FALSE; + } + + size.width = newwidth; + size.height = newheight; + + ret = ephyrRandRSetConfig (pScreen, screen->randr, 0, &size); + if (ret) { + RROutputPtr output; + + output = RRFirstOutput(pScreen); + if (!output) + return FALSE; + RROutputSetModes(output, NULL, 0, 0); + } + + return ret; +} #endif Bool @@ -624,12 +658,9 @@ ephyrInitScreen(ScreenPtr pScreen) } #endif /*XV*/ #ifdef XF86DRI - if (!ephyrNoDRI && !hostx_has_dri()) { + if (!ephyrNoDRI && !hostx_has_dri()) { EPHYR_LOG("host x does not support DRI. Disabling DRI forwarding\n"); ephyrNoDRI = TRUE; -#ifdef GLXEXT - noGlxVisualInit = FALSE; -#endif } if (!ephyrNoDRI) { ephyrDRIExtensionInit(pScreen); @@ -637,12 +668,6 @@ ephyrInitScreen(ScreenPtr pScreen) } #endif -#ifdef GLXEXT - if (ephyrNoDRI) { - noGlxVisualInit = FALSE; - } -#endif - return TRUE; } @@ -772,26 +797,6 @@ ephyrUpdateModifierState(unsigned int state) } } -static void -ephyrBlockSigio(void) -{ - sigset_t set; - - sigemptyset(&set); - sigaddset(&set, SIGIO); - sigprocmask(SIG_BLOCK, &set, 0); -} - -static void -ephyrUnblockSigio(void) -{ - sigset_t set; - - sigemptyset(&set); - sigaddset(&set, SIGIO); - sigprocmask(SIG_UNBLOCK, &set, 0); -} - static Bool ephyrCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y) { @@ -808,11 +813,11 @@ int ephyrCurScreen; /*current event screen */ static void ephyrWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) { - ephyrBlockSigio(); + OsBlockSIGIO(); ephyrCurScreen = pScreen->myNum; miPointerWarpCursor(inputInfo.pointer, pScreen, x, y); - ephyrUnblockSigio(); + OsReleaseSIGIO(); } miPointerScreenFuncRec ephyrPointerScreenFuncs = { @@ -963,6 +968,14 @@ ephyrPoll(void) break; #endif /* XF86DRI */ +#ifdef RANDR + case EPHYR_EV_CONFIGURE: + ephyrResizeScreen(screenInfo.screens[ev.data.configure.screen], + ev.data.configure.width, + ev.data.configure.height); + break; +#endif /* RANDR */ + default: break; } diff --git a/xserver/hw/kdrive/ephyr/ephyrdriext.c b/xserver/hw/kdrive/ephyr/ephyrdriext.c index 28486f516..144c6e1ac 100644 --- a/xserver/hw/kdrive/ephyr/ephyrdriext.c +++ b/xserver/hw/kdrive/ephyr/ephyrdriext.c @@ -517,18 +517,19 @@ EphyrMirrorHostVisuals(ScreenPtr a_screen) static int ProcXF86DRIQueryVersion(register ClientPtr client) { - xXF86DRIQueryVersionReply rep; + xXF86DRIQueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .majorVersion = SERVER_XF86DRI_MAJOR_VERSION, + .minorVersion = SERVER_XF86DRI_MINOR_VERSION, + .patchVersion = SERVER_XF86DRI_PATCH_VERSION + }; REQUEST_SIZE_MATCH(xXF86DRIQueryVersionReq); EPHYR_LOG("enter\n"); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = SERVER_XF86DRI_MAJOR_VERSION; - rep.minorVersion = SERVER_XF86DRI_MINOR_VERSION; - rep.patchVersion = SERVER_XF86DRI_PATCH_VERSION; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); @@ -536,7 +537,7 @@ ProcXF86DRIQueryVersion(register ClientPtr client) swaps(&rep.minorVersion); swapl(&rep.patchVersion); } - WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), (char *) &rep); + WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), &rep); EPHYR_LOG("leave\n"); return Success; } @@ -556,17 +557,19 @@ ProcXF86DRIQueryDirectRenderingCapable(register ClientPtr client) return BadValue; } - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - if (!ephyrDRIQueryDirectRenderingCapable(stuff->screen, &isCapable)) { return BadValue; } - rep.isCapable = isCapable; - if (!LocalClient(client) || client->swapped) - rep.isCapable = 0; + if (!client->local || client->swapped) + isCapable = 0; + + rep = (xXF86DRIQueryDirectRenderingCapableReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .isCapable = isCapable + }; if (client->swapped) { swaps(&rep.sequenceNumber); @@ -574,7 +577,7 @@ ProcXF86DRIQueryDirectRenderingCapable(register ClientPtr client) } WriteToClient(client, sizeof(xXF86DRIQueryDirectRenderingCapableReply), - (char *) &rep); + &rep); EPHYR_LOG("leave\n"); return Success; @@ -586,6 +589,7 @@ ProcXF86DRIOpenConnection(register ClientPtr client) xXF86DRIOpenConnectionReply rep; drm_handle_t hSAREA; char *busIdString = NULL; + CARD32 busIdStringLength = 0; REQUEST(xXF86DRIOpenConnectionReq); REQUEST_SIZE_MATCH(xXF86DRIOpenConnectionReq); @@ -600,26 +604,27 @@ ProcXF86DRIOpenConnection(register ClientPtr client) return BadValue; } - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.busIdStringLength = 0; if (busIdString) - rep.busIdStringLength = strlen(busIdString); - rep.length = - bytes_to_int32(SIZEOF(xXF86DRIOpenConnectionReply) - - SIZEOF(xGenericReply) + - pad_to_int32(rep.busIdStringLength)); + busIdStringLength = strlen(busIdString); - rep.hSAREALow = (CARD32) (hSAREA & 0xffffffff); + rep = (xXF86DRIOpenConnectionReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(SIZEOF(xXF86DRIOpenConnectionReply) - + SIZEOF(xGenericReply) + + pad_to_int32(busIdStringLength)), + .hSAREALow = (CARD32) (hSAREA & 0xffffffff), #if defined(LONG64) && !defined(__linux__) - rep.hSAREAHigh = (CARD32) (hSAREA >> 32); + .hSAREAHigh = (CARD32) (hSAREA >> 32), #else - rep.hSAREAHigh = 0; + .hSAREAHigh = 0, #endif + .busIdStringLength = busIdStringLength + }; - WriteToClient(client, sizeof(xXF86DRIOpenConnectionReply), (char *) &rep); - if (rep.busIdStringLength) - WriteToClient(client, rep.busIdStringLength, busIdString); + WriteToClient(client, sizeof(xXF86DRIOpenConnectionReply), &rep); + if (busIdStringLength) + WriteToClient(client, busIdStringLength, busIdString); free(busIdString); EPHYR_LOG("leave\n"); return Success; @@ -639,16 +644,18 @@ ProcXF86DRIAuthConnection(register ClientPtr client) return BadValue; } - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.authenticated = 1; + rep = (xXF86DRIAuthConnectionReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .authenticated = 1 + }; if (!ephyrDRIAuthConnection(stuff->screen, stuff->magic)) { ErrorF("Failed to authenticate %lu\n", (unsigned long) stuff->magic); rep.authenticated = 0; } - WriteToClient(client, sizeof(xXF86DRIAuthConnectionReply), (char *) &rep); + WriteToClient(client, sizeof(xXF86DRIAuthConnectionReply), &rep); EPHYR_LOG("leave\n"); return Success; } @@ -675,7 +682,11 @@ ProcXF86DRICloseConnection(register ClientPtr client) static int ProcXF86DRIGetClientDriverName(register ClientPtr client) { - xXF86DRIGetClientDriverNameReply rep; + xXF86DRIGetClientDriverNameReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .clientDriverNameLength = 0 + }; char *clientDriverName; REQUEST(xXF86DRIGetClientDriverNameReq); @@ -692,18 +703,13 @@ ProcXF86DRIGetClientDriverName(register ClientPtr client) (int *) &rep.ddxDriverMinorVersion, (int *) &rep.ddxDriverPatchVersion, &clientDriverName); - - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.clientDriverNameLength = 0; if (clientDriverName) rep.clientDriverNameLength = strlen(clientDriverName); rep.length = bytes_to_int32(SIZEOF(xXF86DRIGetClientDriverNameReply) - SIZEOF(xGenericReply) + pad_to_int32(rep.clientDriverNameLength)); - WriteToClient(client, - sizeof(xXF86DRIGetClientDriverNameReply), (char *) &rep); + WriteToClient(client, sizeof(xXF86DRIGetClientDriverNameReply), &rep); if (rep.clientDriverNameLength) WriteToClient(client, rep.clientDriverNameLength, clientDriverName); EPHYR_LOG("leave\n"); @@ -713,7 +719,11 @@ ProcXF86DRIGetClientDriverName(register ClientPtr client) static int ProcXF86DRICreateContext(register ClientPtr client) { - xXF86DRICreateContextReply rep; + xXF86DRICreateContextReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; ScreenPtr pScreen; VisualPtr visual; int i = 0; @@ -728,10 +738,6 @@ ProcXF86DRICreateContext(register ClientPtr client) return BadValue; } - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - pScreen = screenInfo.screens[stuff->screen]; visual = pScreen->visuals; @@ -748,11 +754,11 @@ ProcXF86DRICreateContext(register ClientPtr client) if (!ephyrDRICreateContext(stuff->screen, stuff->visual, &context_id, - (drm_context_t *) & rep.hHWContext)) { + (drm_context_t *) &rep.hHWContext)) { return BadValue; } - WriteToClient(client, sizeof(xXF86DRICreateContextReply), (char *) &rep); + WriteToClient(client, sizeof(xXF86DRICreateContextReply), &rep); EPHYR_LOG("leave\n"); return Success; } @@ -916,7 +922,11 @@ destroyHostPeerWindow(const WindowPtr a_win) static int ProcXF86DRICreateDrawable(ClientPtr client) { - xXF86DRICreateDrawableReply rep; + xXF86DRICreateDrawableReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; DrawablePtr drawable = NULL; WindowPtr window = NULL; EphyrWindowPair *pair = NULL; @@ -932,10 +942,6 @@ ProcXF86DRICreateDrawable(ClientPtr client) return BadValue; } - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rc = dixLookupDrawable(&drawable, stuff->drawable, client, 0, DixReadAccess); if (rc != Success) @@ -958,7 +964,7 @@ ProcXF86DRICreateDrawable(ClientPtr client) if (!ephyrDRICreateDrawable(stuff->screen, remote_win, - (drm_drawable_t *) & rep.hHWDrawable)) { + (drm_drawable_t *) &rep.hHWDrawable)) { EPHYR_LOG_ERROR("failed to create dri drawable\n"); return BadValue; } @@ -974,7 +980,7 @@ ProcXF86DRICreateDrawable(ClientPtr client) EPHYR_LOG("paired window '%p' with remote '%d'\n", window, remote_win); } - WriteToClient(client, sizeof(xXF86DRICreateDrawableReply), (char *) &rep); + WriteToClient(client, sizeof(xXF86DRICreateDrawableReply), &rep); EPHYR_LOG("leave\n"); return Success; } @@ -1024,7 +1030,11 @@ ProcXF86DRIDestroyDrawable(register ClientPtr client) static int ProcXF86DRIGetDrawableInfo(register ClientPtr client) { - xXF86DRIGetDrawableInfoReply rep; + xXF86DRIGetDrawableInfoReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; DrawablePtr drawable; WindowPtr window = NULL; EphyrWindowPair *pair = NULL; @@ -1036,16 +1046,11 @@ ProcXF86DRIGetDrawableInfo(register ClientPtr client) REQUEST_SIZE_MATCH(xXF86DRIGetDrawableInfoReq); EPHYR_LOG("enter\n"); - memset(&rep, 0, sizeof(rep)); if (stuff->screen >= screenInfo.numScreens) { client->errorValue = stuff->screen; return BadValue; } - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rc = dixLookupDrawable(&drawable, stuff->drawable, client, 0, DixReadAccess); if (rc != Success || !drawable) { @@ -1136,18 +1141,18 @@ ProcXF86DRIGetDrawableInfo(register ClientPtr client) rep.length = bytes_to_int32(rep.length); - WriteToClient(client, sizeof(xXF86DRIGetDrawableInfoReply), (char *) &rep); + WriteToClient(client, sizeof(xXF86DRIGetDrawableInfoReply), &rep); if (rep.numClipRects) { WriteToClient(client, sizeof(drm_clip_rect_t) * rep.numClipRects, - (char *) clipRects); + clipRects); } if (rep.numBackClipRects) { WriteToClient(client, sizeof(drm_clip_rect_t) * rep.numBackClipRects, - (char *) backClipRects); + backClipRects); } free(clipRects); clipRects = NULL; @@ -1160,7 +1165,11 @@ ProcXF86DRIGetDrawableInfo(register ClientPtr client) static int ProcXF86DRIGetDeviceInfo(register ClientPtr client) { - xXF86DRIGetDeviceInfoReply rep; + xXF86DRIGetDeviceInfoReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; drm_handle_t hFrameBuffer; void *pDevPrivate; @@ -1173,10 +1182,6 @@ ProcXF86DRIGetDeviceInfo(register ClientPtr client) return BadValue; } - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - if (!ephyrDRIGetDeviceInfo(stuff->screen, &hFrameBuffer, (int *) &rep.framebufferOrigin, @@ -1193,16 +1198,15 @@ ProcXF86DRIGetDeviceInfo(register ClientPtr client) rep.hFrameBufferHigh = 0; #endif - rep.length = 0; if (rep.devPrivateSize) { rep.length = bytes_to_int32(SIZEOF(xXF86DRIGetDeviceInfoReply) - SIZEOF(xGenericReply) + pad_to_int32(rep.devPrivateSize)); } - WriteToClient(client, sizeof(xXF86DRIGetDeviceInfoReply), (char *) &rep); + WriteToClient(client, sizeof(xXF86DRIGetDeviceInfoReply), &rep); if (rep.length) { - WriteToClient(client, rep.devPrivateSize, (char *) pDevPrivate); + WriteToClient(client, rep.devPrivateSize, pDevPrivate); } EPHYR_LOG("leave\n"); return Success; @@ -1225,7 +1229,7 @@ ProcXF86DRIDispatch(register ClientPtr client) } } - if (!LocalClient(client)) + if (!client->local) return DRIErrorBase + XF86DRIClientNotLocal; switch (stuff->data) { diff --git a/xserver/hw/kdrive/ephyr/ephyrglxext.c b/xserver/hw/kdrive/ephyr/ephyrglxext.c index dab028bf3..22d510891 100644 --- a/xserver/hw/kdrive/ephyr/ephyrglxext.c +++ b/xserver/hw/kdrive/ephyr/ephyrglxext.c @@ -61,10 +61,16 @@ int ephyrGLXGetFBConfigsSGIX(__GLXclientState * a_cl, GLbyte * a_pc); int ephyrGLXGetFBConfigsSGIXSwap(__GLXclientState * a_cl, GLbyte * a_pc); int ephyrGLXCreateContext(__GLXclientState * a_cl, GLbyte * a_pc); int ephyrGLXCreateContextSwap(__GLXclientState * a_cl, GLbyte * a_pc); +int ephyrGLXCreateNewContext(__GLXclientState * a_cl, GLbyte * a_pc); +int ephyrGLXCreateNewContextSwap(__GLXclientState * a_cl, GLbyte * a_pc); int ephyrGLXDestroyContext(__GLXclientState * a_cl, GLbyte * a_pc); int ephyrGLXDestroyContextSwap(__GLXclientState * a_cl, GLbyte * a_pc); int ephyrGLXMakeCurrent(__GLXclientState * a_cl, GLbyte * a_pc); int ephyrGLXMakeCurrentSwap(__GLXclientState * a_cl, GLbyte * a_pc); +int ephyrGLXMakeCurrentReadSGI(__GLXclientState * a_cl, GLbyte * a_pc); +int ephyrGLXMakeCurrentReadSGISwap(__GLXclientState * a_cl, GLbyte * a_pc); +int ephyrGLXMakeContextCurrent(__GLXclientState * a_cl, GLbyte * a_pc); +int ephyrGLXMakeContextCurrentSwap(__GLXclientState * a_cl, GLbyte * a_pc); int ephyrGLXGetString(__GLXclientState * a_cl, GLbyte * a_pc); int ephyrGLXGetStringSwap(__GLXclientState * a_cl, GLbyte * a_pc); int ephyrGLXGetIntegerv(__GLXclientState * a_cl, GLbyte * a_pc); @@ -108,6 +114,9 @@ ephyrHijackGLXExtension(void) dispatch_functions[X_GLXCreateContext][0] = ephyrGLXCreateContext; dispatch_functions[X_GLXCreateContext][1] = ephyrGLXCreateContextSwap; + dispatch_functions[X_GLXCreateNewContext][0] = ephyrGLXCreateNewContext; + dispatch_functions[X_GLXCreateNewContext][1] = ephyrGLXCreateNewContextSwap; + dispatch_functions[X_GLXDestroyContext][0] = ephyrGLXDestroyContext; dispatch_functions[X_GLXDestroyContext][1] = ephyrGLXDestroyContextSwap; @@ -123,14 +132,24 @@ ephyrHijackGLXExtension(void) dispatch_functions[61][0] = ephyrGLXGetIntegerv; dispatch_functions[61][1] = ephyrGLXGetIntegervSwap; + dispatch_functions[X_GLXMakeContextCurrent][0] = + ephyrGLXMakeContextCurrent; + dispatch_functions[X_GLXMakeContextCurrent][1] = + ephyrGLXMakeContextCurrentSwap; + /* * hijack some vendor priv entry point dispatch functions */ dispatch_functions = VendorPriv_dispatch_info.dispatch_functions; dispatch_functions[92][0] = ephyrGLXGetFBConfigsSGIX; dispatch_functions[92][1] = ephyrGLXGetFBConfigsSGIXSwap; + + dispatch_functions[89][0] = ephyrGLXMakeCurrentReadSGI; + dispatch_functions[89][1] = ephyrGLXMakeCurrentReadSGISwap; + EPHYR_LOG("hijacked glx entry points to forward requests to host X\n"); + return TRUE; } @@ -159,17 +178,19 @@ ephyrGLXQueryVersion(__GLXclientState * a_cl, GLbyte * a_pc) goto out; } EPHYR_LOG("major:%d, minor:%d\n", major, minor); - reply.majorVersion = major; - reply.minorVersion = minor; - reply.length = 0; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; + reply = (xGLXQueryVersionReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .majorVersion = major, + .minorVersion = minor + }; if (client->swapped) { __glXSwapQueryVersionReply(client, &reply); } else { - WriteToClient(client, sz_xGLXQueryVersionReply, (char *) &reply); + WriteToClient(client, sz_xGLXQueryVersionReply, &reply); } res = Success; @@ -215,11 +236,13 @@ ephyrGLXGetVisualConfigsReal(__GLXclientState * a_cl, } EPHYR_LOG("num_visuals:%d, num_props:%d\n", num_visuals, num_props); - reply.numVisuals = num_visuals; - reply.numProps = num_props; - reply.length = (num_visuals * __GLX_SIZE_CARD32 * num_props) >> 2; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; + reply = (xGLXGetVisualConfigsReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = (num_visuals * __GLX_SIZE_CARD32 * num_props) >> 2, + .numVisuals = num_visuals, + .numProps = num_props + }; if (a_do_swap) { __GLX_SWAP_SHORT(&reply.sequenceNumber); @@ -228,7 +251,7 @@ ephyrGLXGetVisualConfigsReal(__GLXclientState * a_cl, __GLX_SWAP_INT(&reply.numProps); __GLX_SWAP_INT_ARRAY(props_buf, num_props); } - WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *) &reply); + WriteToClient(client, sz_xGLXGetVisualConfigsReply, &reply); props_per_visual_size = props_buf_size / num_visuals; for (i = 0; i < num_visuals; i++) { WriteToClient(client, @@ -269,11 +292,13 @@ ephyrGLXGetFBConfigsSGIXReal(__GLXclientState * a_cl, } EPHYR_LOG("num_visuals:%d, num_props:%d\n", num_visuals, num_props); - reply.numVisuals = num_visuals; - reply.numProps = num_props; - reply.length = props_buf_size >> 2; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; + reply = (xGLXGetVisualConfigsReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = props_buf_size >> 2, + .numVisuals = num_visuals, + .numProps = num_props + }; if (a_do_swap) { __GLX_SWAP_SHORT(&reply.sequenceNumber); @@ -282,7 +307,7 @@ ephyrGLXGetFBConfigsSGIXReal(__GLXclientState * a_cl, __GLX_SWAP_INT(&reply.numProps); __GLX_SWAP_INT_ARRAY(props_buf, num_props); } - WriteToClient(client, sz_xGLXGetVisualConfigsReply, (char *) &reply); + WriteToClient(client, sz_xGLXGetVisualConfigsReply, &reply); props_per_visual_size = props_buf_size / num_visuals; for (i = 0; i < num_visuals; i++) { WriteToClient(client, @@ -351,7 +376,7 @@ ephyrGLXQueryServerString(__GLXclientState * a_cl, GLbyte * a_pc) ClientPtr client = a_cl->client; xGLXQueryServerStringReq *req = (xGLXQueryServerStringReq *) a_pc; xGLXQueryServerStringReply reply; - char *server_string = NULL, *buf = NULL; + char *server_string = NULL; int length = 0; EPHYR_LOG("enter\n"); @@ -364,18 +389,14 @@ ephyrGLXQueryServerString(__GLXclientState * a_cl, GLbyte * a_pc) } EPHYR_LOG("string: %s\n", server_string); length = strlen(server_string) + 1; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.length = __GLX_PAD(length) >> 2; - reply.n = length; - buf = calloc(reply.length << 2, 1); - if (!buf) { - EPHYR_LOG_ERROR("failed to allocate string\n;"); - return BadAlloc; - } - memcpy(buf, server_string, length); + reply = (xGLXQueryServerStringReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = __GLX_PAD(length) >> 2, + .n = length + }; - WriteToClient(client, sz_xGLXQueryServerStringReply, (char *) &reply); + WriteToClient(client, sz_xGLXQueryServerStringReply, &reply); WriteToClient(client, (int) (reply.length << 2), server_string); res = Success; @@ -385,9 +406,6 @@ ephyrGLXQueryServerString(__GLXclientState * a_cl, GLbyte * a_pc) free(server_string); server_string = NULL; - free(buf); - buf = NULL; - return res; } @@ -446,7 +464,8 @@ ephyrGLXCreateContextReal(xGLXCreateContextReq * a_req, Bool a_do_swap) if (!ephyrHostGLXCreateContext(a_req->screen, host_w_attrs.visualid, a_req->context, - a_req->shareList, a_req->isDirect)) { + a_req->shareList, 0, + a_req->isDirect, X_GLXCreateContext)) { EPHYR_LOG_ERROR("ephyrHostGLXCreateContext() failed\n"); goto out; } @@ -456,6 +475,45 @@ ephyrGLXCreateContextReal(xGLXCreateContextReq * a_req, Bool a_do_swap) return res; } +static int +ephyrGLXCreateNewContextReal(xGLXCreateNewContextReq * a_req, Bool a_do_swap) +{ + int res = BadImplementation; + + __GLX_DECLARE_SWAP_VARIABLES; + + EPHYR_RETURN_VAL_IF_FAIL(a_req, BadValue); + EPHYR_LOG("enter\n"); + + if (a_do_swap) { + __GLX_SWAP_SHORT(&a_req->length); + __GLX_SWAP_INT(&a_req->context); + __GLX_SWAP_INT(&a_req->fbconfig); + __GLX_SWAP_INT(&a_req->screen); + __GLX_SWAP_INT(&a_req->renderType); + __GLX_SWAP_INT(&a_req->shareList); + } + + EPHYR_LOG("context creation requested. localid:%d, " + "screen:%d, fbconfig:%d, renderType:%d, direct:%d\n", + (int) a_req->context, (int) a_req->screen, + (int) a_req->fbconfig, (int) a_req->renderType, + (int) a_req->isDirect); + + if (!ephyrHostGLXCreateContext(a_req->screen, + a_req->fbconfig, + a_req->context, + a_req->shareList, a_req->renderType, + a_req->isDirect, X_GLXCreateNewContext)) { + EPHYR_LOG_ERROR("ephyrHostGLXCreateNewContext() failed\n"); + goto out; + } + res = Success; + out: + EPHYR_LOG("leave\n"); + return res; +} + int ephyrGLXCreateContext(__GLXclientState * cl, GLbyte * pc) { @@ -472,6 +530,22 @@ ephyrGLXCreateContextSwap(__GLXclientState * cl, GLbyte * pc) return ephyrGLXCreateContextReal(req, TRUE); } +int +ephyrGLXCreateNewContext(__GLXclientState * cl, GLbyte * pc) +{ + xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc; + + return ephyrGLXCreateNewContextReal(req, FALSE); +} + +int +ephyrGLXCreateNewContextSwap(__GLXclientState * cl, GLbyte * pc) +{ + xGLXCreateNewContextReq *req = (xGLXCreateNewContextReq *) pc; + + return ephyrGLXCreateNewContextReal(req, TRUE); +} + static int ephyrGLXDestroyContextReal(__GLXclientState * a_cl, GLbyte * a_pc, Bool a_do_swap) @@ -506,39 +580,50 @@ ephyrGLXDestroyContextSwap(__GLXclientState * a_cl, GLbyte * a_pc) } static int -ephyrGLXMakeCurrentReal(__GLXclientState * a_cl, GLbyte * a_pc, Bool a_do_swap) +ephyrGLXMakeCurrentReal(__GLXclientState * a_cl, GLXDrawable write, + GLXDrawable read, GLXContextTag ctx, + GLXContextTag old_ctx, Bool a_do_swap) { int res = BadImplementation; - xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) a_pc; xGLXMakeCurrentReply reply; - DrawablePtr drawable = NULL; - int rc = 0; + DrawablePtr drawableR = NULL, drawableW = NULL; + GLXContextTag new_ctx = 0; EPHYR_LOG("enter\n"); - rc = dixLookupDrawable(&drawable, - req->drawable, a_cl->client, 0, DixReadAccess); - EPHYR_RETURN_VAL_IF_FAIL(drawable, BadValue); - EPHYR_RETURN_VAL_IF_FAIL(drawable->pScreen, BadValue); - EPHYR_LOG("screen nummber requested:%d\n", drawable->pScreen->myNum); + res = dixLookupDrawable(&drawableW, write, a_cl->client, 0, DixReadAccess); + EPHYR_RETURN_VAL_IF_FAIL(drawableW, BadValue); + EPHYR_RETURN_VAL_IF_FAIL(drawableW->pScreen, BadValue); + EPHYR_LOG("screen nummber requested:%d\n", drawableW->pScreen->myNum); - memset(&reply, 0, sizeof(reply)); - if (!ephyrHostGLXMakeCurrent(hostx_get_window(drawable->pScreen->myNum), - req->context, - req->oldContextTag, - (int *) &reply.contextTag)) { + if (read != write) { + res = dixLookupDrawable(&drawableR, read, a_cl->client, 0, + DixReadAccess); + EPHYR_RETURN_VAL_IF_FAIL(drawableR, BadValue); + EPHYR_RETURN_VAL_IF_FAIL(drawableR->pScreen, BadValue); + } + else { + drawableR = drawableW; + } + + if (!ephyrHostGLXMakeCurrent(hostx_get_window(drawableW->pScreen->myNum), + hostx_get_window(drawableR->pScreen->myNum), + ctx, old_ctx, (int *) &new_ctx)) { EPHYR_LOG_ERROR("ephyrHostGLXMakeCurrent() failed\n"); goto out; } - reply.length = 0; - reply.type = X_Reply; - reply.sequenceNumber = a_cl->client->sequence; + reply = (xGLXMakeCurrentReply) { + .type = X_Reply, + .sequenceNumber = a_cl->client->sequence, + .length = 0, + .contextTag = new_ctx + }; if (a_do_swap) { __GLX_DECLARE_SWAP_VARIABLES; __GLX_SWAP_SHORT(&reply.sequenceNumber); __GLX_SWAP_INT(&reply.length); __GLX_SWAP_INT(&reply.contextTag); } - WriteToClient(a_cl->client, sz_xGLXMakeCurrentReply, (char *) &reply); + WriteToClient(a_cl->client, sz_xGLXMakeCurrentReply, &reply); res = Success; out: @@ -549,13 +634,71 @@ ephyrGLXMakeCurrentReal(__GLXclientState * a_cl, GLbyte * a_pc, Bool a_do_swap) int ephyrGLXMakeCurrent(__GLXclientState * a_cl, GLbyte * a_pc) { - return ephyrGLXMakeCurrentReal(a_cl, a_pc, FALSE); + xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) a_pc; + return ephyrGLXMakeCurrentReal(a_cl, req->drawable, req->drawable, + req->context, req->oldContextTag, FALSE); } int ephyrGLXMakeCurrentSwap(__GLXclientState * a_cl, GLbyte * a_pc) { - return ephyrGLXMakeCurrentReal(a_cl, a_pc, TRUE); + xGLXMakeCurrentReq *req = (xGLXMakeCurrentReq *) a_pc; + __GLX_DECLARE_SWAP_VARIABLES; + + __GLX_SWAP_INT(&req->drawable); + __GLX_SWAP_INT(&req->context); + __GLX_SWAP_INT(&req->oldContextTag); + + return ephyrGLXMakeCurrentReal(a_cl, req->drawable, req->drawable, + req->context, req->oldContextTag, TRUE); +} + +int +ephyrGLXMakeCurrentReadSGI(__GLXclientState * a_cl, GLbyte * a_pc) +{ + xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) a_pc; + + return ephyrGLXMakeCurrentReal(a_cl, req->drawable, req->readable, + req->context, req->oldContextTag, FALSE); +} + +int +ephyrGLXMakeCurrentReadSGISwap(__GLXclientState * a_cl, GLbyte * a_pc) +{ + xGLXMakeCurrentReadSGIReq *req = (xGLXMakeCurrentReadSGIReq *) a_pc; + __GLX_DECLARE_SWAP_VARIABLES; + + __GLX_SWAP_INT(&req->drawable); + __GLX_SWAP_INT(&req->readable); + __GLX_SWAP_INT(&req->context); + __GLX_SWAP_INT(&req->oldContextTag); + + return ephyrGLXMakeCurrentReal(a_cl, req->drawable, req->readable, + req->context, req->oldContextTag, TRUE); +} + +int +ephyrGLXMakeContextCurrent(__GLXclientState * a_cl, GLbyte * a_pc) +{ + xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) a_pc; + + return ephyrGLXMakeCurrentReal(a_cl, req->drawable, req->readdrawable, + req->context, req->oldContextTag, FALSE); +} + +int +ephyrGLXMakeContextCurrentSwap(__GLXclientState * a_cl, GLbyte * a_pc) +{ + xGLXMakeContextCurrentReq *req = (xGLXMakeContextCurrentReq *) a_pc; + __GLX_DECLARE_SWAP_VARIABLES; + + __GLX_SWAP_INT(&req->drawable); + __GLX_SWAP_INT(&req->readdrawable); + __GLX_SWAP_INT(&req->context); + __GLX_SWAP_INT(&req->oldContextTag); + + return ephyrGLXMakeCurrentReal(a_cl, req->drawable, req->readdrawable, + req->context, req->oldContextTag, TRUE); } static int @@ -601,7 +744,7 @@ ephyrGLXGetStringReal(__GLXclientState * a_cl, GLbyte * a_pc, Bool a_do_swap) __GLX_SWAP_REPLY_SIZE(); __GLX_SWAP_REPLY_HEADER(); } - WriteToClient(client, length, (char *) string); + WriteToClient(client, length, string); res = Success; out: @@ -681,16 +824,18 @@ ephyrGLXIsDirectReal(__GLXclientState * a_cl, GLbyte * a_pc, Bool a_do_swap) EPHYR_LOG("enter\n"); - memset(&reply, 0, sizeof(reply)); if (!ephyrHostIsContextDirect(req->context, (int *) &is_direct)) { EPHYR_LOG_ERROR("ephyrHostIsContextDirect() failed\n"); goto out; } - reply.isDirect = is_direct; - reply.length = 0; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - WriteToClient(client, sz_xGLXIsDirectReply, (char *) &reply); + reply = (xGLXIsDirectReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .isDirect = is_direct + }; + + WriteToClient(client, sz_xGLXIsDirectReply, &reply); res = Success; out: diff --git a/xserver/hw/kdrive/ephyr/ephyrhostglx.c b/xserver/hw/kdrive/ephyr/ephyrhostglx.c index 6b9da6fb1..5c6c40f0b 100644 --- a/xserver/hw/kdrive/ephyr/ephyrhostglx.c +++ b/xserver/hw/kdrive/ephyr/ephyrhostglx.c @@ -52,6 +52,8 @@ #include "ephyrlog.h" #include "hostx.h" +static int glx_major, glx_minor; + enum VisualConfRequestType { EPHYR_GET_FB_CONFIG, EPHYR_VENDOR_PRIV_GET_FB_CONFIG_SGIX, @@ -99,6 +101,12 @@ ephyrHostGLXQueryVersion(int *a_major, int *a_minor) EPHYR_RETURN_VAL_IF_FAIL(a_major && a_minor, FALSE); EPHYR_LOG("enter\n"); + if (glx_major) { + *a_major = glx_major; + *a_minor = glx_minor; + return TRUE; + } + if (!ephyrHostGLXGetMajorOpcode(&major_opcode)) { EPHYR_LOG_ERROR("failed to get major opcode\n"); goto out; @@ -113,12 +121,12 @@ ephyrHostGLXQueryVersion(int *a_major, int *a_minor) req->glxCode = X_GLXQueryVersion; req->majorVersion = 2; req->minorVersion = 1; - _XReply(dpy, (xReply *) & reply, 0, False); + _XReply(dpy, (xReply *) &reply, 0, False); UnlockDisplay(dpy); SyncHandle(); - *a_major = reply.majorVersion; - *a_minor = reply.minorVersion; + *a_major = glx_major = reply.majorVersion; + *a_minor = glx_minor = reply.minorVersion; EPHYR_LOG("major:%d, minor:%d\n", *a_major, *a_minor); @@ -199,7 +207,7 @@ ephyrHostGLXGetStringFromServer(int a_screen_number, req->for_whom = default_screen; req->name = a_string_name; - _XReply(dpy, (xReply *) & reply, 0, False); + _XReply(dpy, (xReply *) &reply, 0, False); length = reply.length * 4; if (!length) { @@ -295,7 +303,7 @@ ephyrHostGLXGetVisualConfigsInternal(enum VisualConfRequestType a_type, break; } - if (!_XReply(dpy, (xReply *) & reply, 0, False)) { + if (!_XReply(dpy, (xReply *) &reply, 0, False)) { EPHYR_LOG_ERROR("unknown error\n"); UnlockDisplay(dpy); goto out; @@ -431,17 +439,20 @@ ephyrHostGLXSendClientInfo(int32_t a_major, int32_t a_minor, Bool ephyrHostGLXCreateContext(int a_screen, - int a_visual_id, + int a_generic_id, int a_context_id, - int a_share_list_ctxt_id, Bool a_direct) + int a_share_list_ctxt_id, + int a_render_type, + Bool a_direct, + int code) { Bool is_ok = FALSE; Display *dpy = hostx_get_display(); int major_opcode = 0, remote_context_id = 0; - xGLXCreateContextReq *req; - EPHYR_LOG("enter. screen:%d, visual:%d, contextid:%d, direct:%d\n", - a_screen, a_visual_id, a_context_id, a_direct); + EPHYR_LOG("enter. screen:%d, generic_id:%d, contextid:%d, rendertype:%d, " + "direct:%d\n", a_screen, a_generic_id, a_context_id, + a_render_type, a_direct); if (!hostx_allocate_resource_id_peer(a_context_id, &remote_context_id)) { EPHYR_LOG_ERROR("failed to peer the context id %d host X", @@ -456,15 +467,38 @@ ephyrHostGLXCreateContext(int a_screen, LockDisplay(dpy); - /* Send the glXCreateContext request */ - GetReq(GLXCreateContext, req); - req->reqType = major_opcode; - req->glxCode = X_GLXCreateContext; - req->context = remote_context_id; - req->visual = a_visual_id; - req->screen = DefaultScreen(dpy); - req->shareList = a_share_list_ctxt_id; - req->isDirect = a_direct; + switch (code) { + case X_GLXCreateContext: { + /* Send the glXCreateContext request */ + xGLXCreateContextReq *req; + GetReq(GLXCreateContext, req); + req->reqType = major_opcode; + req->glxCode = X_GLXCreateContext; + req->context = remote_context_id; + req->visual = a_generic_id; + req->screen = DefaultScreen(dpy); + req->shareList = a_share_list_ctxt_id; + req->isDirect = a_direct; + } + + case X_GLXCreateNewContext: { + /* Send the glXCreateNewContext request */ + xGLXCreateNewContextReq *req; + GetReq(GLXCreateNewContext, req); + req->reqType = major_opcode; + req->glxCode = X_GLXCreateNewContext; + req->context = remote_context_id; + req->fbconfig = a_generic_id; + req->screen = DefaultScreen(dpy); + req->renderType = a_render_type; + req->shareList = a_share_list_ctxt_id; + req->isDirect = a_direct; + } + + default: + /* This should never be reached !*/ + EPHYR_LOG("Internal error! Invalid CreateContext code!\n"); + } UnlockDisplay(dpy); SyncHandle(); @@ -512,20 +546,19 @@ ephyrHostDestroyContext(int a_ctxt_id) } Bool -ephyrHostGLXMakeCurrent(int a_drawable, +ephyrHostGLXMakeCurrent(int a_drawable, int a_readable, int a_glx_ctxt_id, int a_old_ctxt_tag, int *a_ctxt_tag) { Bool is_ok = FALSE; Display *dpy = hostx_get_display(); int32_t major_opcode = 0; int remote_glx_ctxt_id = 0; - xGLXMakeCurrentReq *req; xGLXMakeCurrentReply reply; EPHYR_RETURN_VAL_IF_FAIL(a_ctxt_tag, FALSE); - EPHYR_LOG("enter. drawable:%d, context:%d, oldtag:%d\n", - a_drawable, a_glx_ctxt_id, a_old_ctxt_tag); + EPHYR_LOG("enter. drawable:%d, read:%d, context:%d, oldtag:%d\n", + a_drawable, a_readable, a_glx_ctxt_id, a_old_ctxt_tag); if (!ephyrHostGLXGetMajorOpcode(&major_opcode)) { EPHYR_LOG_ERROR("failed to get major opcode\n"); @@ -538,15 +571,51 @@ ephyrHostGLXMakeCurrent(int a_drawable, LockDisplay(dpy); - GetReq(GLXMakeCurrent, req); - req->reqType = major_opcode; - req->glxCode = X_GLXMakeCurrent; - req->drawable = a_drawable; - req->context = remote_glx_ctxt_id; - req->oldContextTag = a_old_ctxt_tag; + /* If both drawables are the same, use the old MakeCurrent request. + * Otherwise, if we have GLX 1.3 or higher, use the MakeContextCurrent + * request which supports separate read and draw targets. Failing that, + * try the SGI MakeCurrentRead extension. Logic cribbed from Mesa. */ + if (a_drawable == a_readable) { + xGLXMakeCurrentReq *req; + + GetReq(GLXMakeCurrent, req); + req->reqType = major_opcode; + req->glxCode = X_GLXMakeCurrent; + req->drawable = a_drawable; + req->context = remote_glx_ctxt_id; + req->oldContextTag = a_old_ctxt_tag; + } + else if (glx_major > 1 || glx_minor >= 3) { + xGLXMakeContextCurrentReq *req; + + GetReq(GLXMakeContextCurrent, req); + req->reqType = major_opcode; + req->glxCode = X_GLXMakeContextCurrent; + req->drawable = a_drawable; + req->readdrawable = a_readable; + req->context = remote_glx_ctxt_id; + req->oldContextTag = a_old_ctxt_tag; + } + else { + xGLXVendorPrivateWithReplyReq *vpreq; + xGLXMakeCurrentReadSGIReq *req; + + GetReqExtra(GLXVendorPrivateWithReply, + (sz_xGLXMakeCurrentReadSGIReq - + sz_xGLXVendorPrivateWithReplyReq), + vpreq); + req = (xGLXMakeCurrentReadSGIReq *) vpreq; + req->reqType = major_opcode; + req->glxCode = X_GLXVendorPrivateWithReply; + req->vendorCode = X_GLXvop_MakeCurrentReadSGI; + req->drawable = a_drawable; + req->readable = a_readable; + req->context = remote_glx_ctxt_id; + req->oldContextTag = a_old_ctxt_tag; + } memset(&reply, 0, sizeof(reply)); - if (!_XReply(dpy, (xReply *) & reply, 0, False)) { + if (!_XReply(dpy, (xReply *) &reply, 0, False)) { EPHYR_LOG_ERROR("failed to get reply from host\n"); UnlockDisplay(dpy); SyncHandle(); @@ -666,7 +735,7 @@ ephyrHostIsContextDirect(int a_ctxt_id, int *a_is_direct) req->reqType = major_opcode; req->glxCode = X_GLXIsDirect; req->context = remote_glx_ctxt_id; - if (!_XReply(dpy, (xReply *) & reply, 0, False)) { + if (!_XReply(dpy, (xReply *) &reply, 0, False)) { EPHYR_LOG_ERROR("fail in reading reply from host\n"); UnlockDisplay(dpy); SyncHandle(); diff --git a/xserver/hw/kdrive/ephyr/ephyrhostglx.h b/xserver/hw/kdrive/ephyr/ephyrhostglx.h index 9c6012070..7ff515dc2 100644 --- a/xserver/hw/kdrive/ephyr/ephyrhostglx.h +++ b/xserver/hw/kdrive/ephyr/ephyrhostglx.h @@ -55,13 +55,16 @@ Bool ephyrHostGLXGetMajorOpcode(int32_t * a_opcode); Bool ephyrHostGLXSendClientInfo(int32_t a_major, int32_t a_minor, const char *a_extension_list); Bool ephyrHostGLXCreateContext(int a_screen, - int a_visual_id, + int a_generic_id, int a_context_id, - int a_shared_list_ctx_id, Bool a_direct); + int a_share_list_ctxt_id, + int a_render_type, + Bool a_direct, + int code); Bool ephyrHostDestroyContext(int a_ctxt_id); -Bool ephyrHostGLXMakeCurrent(int a_drawable, int a_glx_ctxt_id, +Bool ephyrHostGLXMakeCurrent(int a_drawable, int a_readable, int a_glx_ctxt_id, int a_olg_ctxt_tag, int *a_ctxt_tag); Bool ephyrHostGetIntegerValue(int a_current_context_tag, int a_int, int *a_val); diff --git a/xserver/hw/kdrive/ephyr/ephyrhostproxy.c b/xserver/hw/kdrive/ephyr/ephyrhostproxy.c index 410e6b6e4..a4f25c159 100644 --- a/xserver/hw/kdrive/ephyr/ephyrhostproxy.c +++ b/xserver/hw/kdrive/ephyr/ephyrhostproxy.c @@ -73,7 +73,7 @@ ephyrHostProxyDoForward(pointer a_request_buffer, GetXReq(forward_req); memmove(forward_req, in_req, 4); - if (!_XReply(dpy, (xReply *) & reply, 0, FALSE)) { + if (!_XReply(dpy, (xReply *) &reply, 0, FALSE)) { EPHYR_LOG_ERROR("failed to get reply\n"); goto out; } diff --git a/xserver/hw/kdrive/ephyr/ephyrhostvideo.c b/xserver/hw/kdrive/ephyr/ephyrhostvideo.c index 05a821b39..362aa055e 100644 --- a/xserver/hw/kdrive/ephyr/ephyrhostvideo.c +++ b/xserver/hw/kdrive/ephyr/ephyrhostvideo.c @@ -304,7 +304,7 @@ ephyrHostXVAdaptorArrayAt(const EphyrHostXVAdaptorArray * a_this, int a_index) if (a_index >= a_this->nb_adaptors) return NULL; - return (EphyrHostXVAdaptor *) & a_this->adaptors[a_index]; + return (EphyrHostXVAdaptor *) &a_this->adaptors[a_index]; } char @@ -668,7 +668,7 @@ ephyrHostXVQueryImageAttributes(int a_port_id, /* * read the reply */ - if (!_XReply(dpy, (xReply *) & rep, 0, xFalse)) { + if (!_XReply(dpy, (xReply *) &rep, 0, xFalse)) { EPHYR_LOG_ERROR("QeryImageAttribute req failed\n"); goto out; } diff --git a/xserver/hw/kdrive/ephyr/ephyrinit.c b/xserver/hw/kdrive/ephyr/ephyrinit.c index a62b49d4b..5e2eb672f 100644 --- a/xserver/hw/kdrive/ephyr/ephyrinit.c +++ b/xserver/hw/kdrive/ephyr/ephyrinit.c @@ -36,7 +36,6 @@ extern Bool kdHasKbd; #ifdef GLXEXT extern Bool ephyrNoDRI; -extern Bool noGlxVisualInit; #endif extern Bool ephyrNoXV; @@ -233,7 +232,6 @@ ddxProcessArgument(int argc, char **argv, int i) } #ifdef GLXEXT else if (!strcmp(argv[i], "-nodri")) { - noGlxVisualInit = FALSE; ephyrNoDRI = TRUE; EPHYR_LOG("no direct rendering enabled\n"); return 1; diff --git a/xserver/hw/kdrive/ephyr/ephyrproxyext.c b/xserver/hw/kdrive/ephyr/ephyrproxyext.c index 3d86d2db1..c24238c04 100644 --- a/xserver/hw/kdrive/ephyr/ephyrproxyext.c +++ b/xserver/hw/kdrive/ephyr/ephyrproxyext.c @@ -75,7 +75,7 @@ ephyrProxyProcDispatch(ClientPtr a_client) reply.sequence_number = a_client->sequence; res = Success; - WriteToClient(a_client, 32, (char *) &reply); + WriteToClient(a_client, 32, &reply); out: return res; diff --git a/xserver/hw/kdrive/ephyr/ephyrvideo.c b/xserver/hw/kdrive/ephyr/ephyrvideo.c index 67eadd121..55dbd2e3a 100644 --- a/xserver/hw/kdrive/ephyr/ephyrvideo.c +++ b/xserver/hw/kdrive/ephyr/ephyrvideo.c @@ -495,7 +495,7 @@ ephyrXVPrivQueryHostAdaptors(EphyrXVPriv * a_this) port_priv_offset = a_this->adaptors[i].nPorts; for (j = 0; j < a_this->adaptors[i].nPorts; j++) { EphyrPortPriv *port_privs_base = - (EphyrPortPriv *) & a_this->adaptors[i]. + (EphyrPortPriv *) &a_this->adaptors[i]. pPortPrivates[port_priv_offset]; EphyrPortPriv *port_priv = &port_privs_base[j]; diff --git a/xserver/hw/kdrive/ephyr/hostx.c b/xserver/hw/kdrive/ephyr/hostx.c index 6988f1625..157ac36b2 100644 --- a/xserver/hw/kdrive/ephyr/hostx.c +++ b/xserver/hw/kdrive/ephyr/hostx.c @@ -345,7 +345,11 @@ hostx_init(void) attr.event_mask = ButtonPressMask | ButtonReleaseMask - | PointerMotionMask | KeyPressMask | KeyReleaseMask | ExposureMask; + | PointerMotionMask + | KeyPressMask + | KeyReleaseMask + | ExposureMask + | StructureNotifyMask; EPHYR_DBG("mark"); @@ -693,12 +697,14 @@ hostx_screen_init(EphyrScreenInfo screen, XResizeWindow(HostX.dpy, host_screen->win, width, height); /* Ask the WM to keep our size static */ - size_hints = XAllocSizeHints(); - size_hints->max_width = size_hints->min_width = width; - size_hints->max_height = size_hints->min_height = height; - size_hints->flags = PMinSize | PMaxSize; - XSetWMNormalHints(HostX.dpy, host_screen->win, size_hints); - XFree(size_hints); + if (host_screen->win_pre_existing == None) { + size_hints = XAllocSizeHints(); + size_hints->max_width = size_hints->min_width = width; + size_hints->max_height = size_hints->min_height = height; + size_hints->flags = PMinSize | PMaxSize; + XSetWMNormalHints(HostX.dpy, host_screen->win, size_hints); + XFree(size_hints); + } XMapWindow(HostX.dpy, host_screen->win); @@ -875,7 +881,9 @@ host_screen_from_window(Window w) struct EphyrHostScreen *result = NULL; for (index = 0; index < HostX.n_screens; index++) { - if (HostX.screens[index].win == w || HostX.screens[index].peer_win == w) { + if (HostX.screens[index].win == w + || HostX.screens[index].peer_win == w + || HostX.screens[index].win_pre_existing == w) { result = &HostX.screens[index]; goto out; } @@ -1001,6 +1009,22 @@ hostx_get_event(EphyrHostXEvent * ev) ev->data.key_up.scancode = xev.xkey.keycode; return 1; + case ConfigureNotify: + { + struct EphyrHostScreen *host_screen = + host_screen_from_window(xev.xconfigure.window); + + if (host_screen && host_screen->win_pre_existing != None) { + ev->type = EPHYR_EV_CONFIGURE; + ev->data.configure.width = xev.xconfigure.width; + ev->data.configure.height = xev.xconfigure.height; + ev->data.configure.window = xev.xconfigure.window; + ev->data.configure.screen = host_screen->mynum; + return 1; + } + + return 0; + } default: break; diff --git a/xserver/hw/kdrive/ephyr/hostx.h b/xserver/hw/kdrive/ephyr/hostx.h index d6217119a..31c4053aa 100644 --- a/xserver/hw/kdrive/ephyr/hostx.h +++ b/xserver/hw/kdrive/ephyr/hostx.h @@ -47,7 +47,8 @@ typedef enum EphyrHostXEventType { EPHYR_EV_MOUSE_RELEASE, EPHYR_EV_KEY_PRESS, EPHYR_EV_KEY_RELEASE, - EPHYR_EV_EXPOSE + EPHYR_EV_EXPOSE, + EPHYR_EV_CONFIGURE, } EphyrHostXEventType; /* I can't believe it's not a KeySymsRec. */ @@ -89,6 +90,13 @@ struct EphyrHostXEvent { int window; } expose; + struct configure { + int width; + int height; + int screen; + int window; + } configure; + } data; int key_state; diff --git a/xserver/hw/kdrive/ephyr/man/Makefile.in b/xserver/hw/kdrive/ephyr/man/Makefile.in index b318f2a95..5ed90170f 100644 --- a/xserver/hw/kdrive/ephyr/man/Makefile.in +++ b/xserver/hw/kdrive/ephyr/man/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -179,13 +179,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -207,6 +203,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -231,6 +228,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -246,7 +244,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -361,6 +358,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -480,7 +478,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/manpages.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/manpages.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -506,9 +504,9 @@ $(top_srcdir)/manpages.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/kdrive/fake/Makefile.in b/xserver/hw/kdrive/fake/Makefile.in index 392907090..47fc06df4 100644 --- a/xserver/hw/kdrive/fake/Makefile.in +++ b/xserver/hw/kdrive/fake/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -190,13 +190,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -218,6 +214,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -242,6 +239,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -257,7 +255,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -356,6 +353,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -483,7 +481,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -508,9 +506,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/kdrive/fbdev/Makefile.in b/xserver/hw/kdrive/fbdev/Makefile.in index d838450af..9259bea8b 100644 --- a/xserver/hw/kdrive/fbdev/Makefile.in +++ b/xserver/hw/kdrive/fbdev/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -191,13 +191,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -219,6 +215,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -243,6 +240,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -258,7 +256,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -357,6 +354,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -481,7 +479,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -506,9 +504,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/kdrive/linux/Makefile.in b/xserver/hw/kdrive/linux/Makefile.in index 6708bff12..52113a352 100644 --- a/xserver/hw/kdrive/linux/Makefile.in +++ b/xserver/hw/kdrive/linux/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -192,13 +192,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -220,6 +216,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -244,6 +241,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -259,7 +257,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -358,6 +355,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -469,7 +467,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -494,9 +492,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/kdrive/openbsd/Makefile.in b/xserver/hw/kdrive/openbsd/Makefile.in index 1ebe2d38e..70c09d383 100644 --- a/xserver/hw/kdrive/openbsd/Makefile.in +++ b/xserver/hw/kdrive/openbsd/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -183,13 +183,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -211,6 +207,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -235,6 +232,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -250,7 +248,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -349,6 +346,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -459,7 +457,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -484,9 +482,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/kdrive/openbsd/openbsd.c b/xserver/hw/kdrive/openbsd/openbsd.c index 1d3a6667c..2a749b525 100644 --- a/xserver/hw/kdrive/openbsd/openbsd.c +++ b/xserver/hw/kdrive/openbsd/openbsd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: openbsd.c,v 1.8 2012/06/10 13:21:23 matthieu Exp $ */ +/* $OpenBSD: openbsd.c,v 1.9 2013/06/07 17:28:48 matthieu Exp $ */ /* * Copyright (c) 2007 Matthieu Herrb * diff --git a/xserver/hw/kdrive/src/Makefile.in b/xserver/hw/kdrive/src/Makefile.in index 35e0b679f..b094f3223 100644 --- a/xserver/hw/kdrive/src/Makefile.in +++ b/xserver/hw/kdrive/src/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -190,13 +190,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -218,6 +214,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -242,6 +239,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -257,7 +255,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -356,6 +353,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -484,7 +482,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -509,9 +507,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/kdrive/src/kdrive.c b/xserver/hw/kdrive/src/kdrive.c index f65ab96bc..7d9bf9ddd 100644 --- a/xserver/hw/kdrive/src/kdrive.c +++ b/xserver/hw/kdrive/src/kdrive.c @@ -606,7 +606,7 @@ KdCreateScreenResources(ScreenPtr pScreen) } Bool -KdCloseScreen(int index, ScreenPtr pScreen) +KdCloseScreen(ScreenPtr pScreen) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; @@ -616,7 +616,7 @@ KdCloseScreen(int index, ScreenPtr pScreen) pScreenPriv->closed = TRUE; pScreen->CloseScreen = pScreenPriv->CloseScreen; if (pScreen->CloseScreen) - ret = (*pScreen->CloseScreen) (index, pScreen); + ret = (*pScreen->CloseScreen) (pScreen); else ret = TRUE; @@ -730,22 +730,22 @@ KdSetSubpixelOrder(ScreenPtr pScreen, Rotation randr) int subpixel_order; Rotation direction; } orders[] = { - { - SubPixelHorizontalRGB, RR_Rotate_0}, { - SubPixelHorizontalBGR, RR_Rotate_180}, { - SubPixelVerticalRGB, RR_Rotate_270}, { - SubPixelVerticalBGR, RR_Rotate_90},}; + {SubPixelHorizontalRGB, RR_Rotate_0}, + {SubPixelHorizontalBGR, RR_Rotate_180}, + {SubPixelVerticalRGB, RR_Rotate_270}, + {SubPixelVerticalBGR, RR_Rotate_90}, + }; static struct { int bit; int normal; int reflect; } reflects[] = { - { - RR_Reflect_X, SubPixelHorizontalRGB, SubPixelHorizontalBGR}, { - RR_Reflect_X, SubPixelHorizontalBGR, SubPixelHorizontalRGB}, { - RR_Reflect_Y, SubPixelVerticalRGB, SubPixelVerticalBGR}, { - RR_Reflect_Y, SubPixelVerticalRGB, SubPixelVerticalRGB},}; + {RR_Reflect_X, SubPixelHorizontalRGB, SubPixelHorizontalBGR}, + {RR_Reflect_X, SubPixelHorizontalBGR, SubPixelHorizontalRGB}, + {RR_Reflect_Y, SubPixelVerticalRGB, SubPixelVerticalBGR}, + {RR_Reflect_Y, SubPixelVerticalRGB, SubPixelVerticalRGB}, + }; /* map subpixel to direction */ for (i = 0; i < 4; i++) @@ -776,7 +776,7 @@ KdSetSubpixelOrder(ScreenPtr pScreen, Rotation randr) static KdScreenInfo *kdCurrentScreen; Bool -KdScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) +KdScreenInit(ScreenPtr pScreen, int argc, char **argv) { KdScreenInfo *screen = kdCurrentScreen; KdCardInfo *card = screen->card; @@ -1104,7 +1104,7 @@ KdInitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) } void -OsVendorFatalError(void) +OsVendorFatalError(const char *f, va_list args) { } diff --git a/xserver/hw/kdrive/src/kdrive.h b/xserver/hw/kdrive/src/kdrive.h index 6c2f29309..4829e1a1b 100644 --- a/xserver/hw/kdrive/src/kdrive.h +++ b/xserver/hw/kdrive/src/kdrive.h @@ -32,7 +32,6 @@ #include "pixmapstr.h" #include "windowstr.h" #include "servermd.h" -#include "mibstore.h" #include "colormapst.h" #include "gcstruct.h" #include "input.h" @@ -442,13 +441,13 @@ Bool KdCreateScreenResources(ScreenPtr pScreen); Bool - KdCloseScreen(int index, ScreenPtr pScreen); + KdCloseScreen(ScreenPtr pScreen); Bool KdSaveScreen(ScreenPtr pScreen, int on); Bool - KdScreenInit(int index, ScreenPtr pScreen, int argc, char **argv); + KdScreenInit(ScreenPtr pScreen, int argc, char **argv); void @@ -537,13 +536,11 @@ void void -KdBlockHandler(int screen, - pointer blockData, pointer timeout, pointer readmask); +KdBlockHandler(ScreenPtr pScreen, pointer timeout, pointer readmask); void -KdWakeupHandler(int screen, - pointer data, unsigned long result, pointer readmask); +KdWakeupHandler(ScreenPtr pScreen, unsigned long result, pointer readmask); void KdDisableInput(void); @@ -551,9 +548,6 @@ void void KdEnableInput(void); -void - ProcessInputEvents(void); - void KdRingBell(KdKeyboardInfo * ki, int volume, int pitch, int duration); diff --git a/xserver/hw/kdrive/src/kinput.c b/xserver/hw/kdrive/src/kinput.c index 692e511a8..b1068bbee 100644 --- a/xserver/hw/kdrive/src/kinput.c +++ b/xserver/hw/kdrive/src/kinput.c @@ -102,26 +102,6 @@ KdSigio(int sig) (*kdInputFds[i].read) (kdInputFds[i].fd, kdInputFds[i].closure); } -static void -KdBlockSigio(void) -{ - sigset_t set; - - sigemptyset(&set); - sigaddset(&set, SIGIO); - sigprocmask(SIG_BLOCK, &set, 0); -} - -static void -KdUnblockSigio(void) -{ - sigset_t set; - - sigemptyset(&set); - sigaddset(&set, SIGIO); - sigprocmask(SIG_UNBLOCK, &set, 0); -} - #ifdef DEBUG_SIGIO void @@ -261,7 +241,7 @@ KdDisableInput(void) KdPointerInfo *pi; int found = 0, i = 0; - KdBlockSigio(); + OsBlockSIGIO(); for (ki = kdKeyboards; ki; ki = ki->next) { if (ki->driver && ki->driver->Disable) @@ -340,9 +320,10 @@ KdEnableInput(void) /* reset screen saver */ ev.any.time = GetTimeInMillis(); - NoticeEventTime(&ev); + NoticeEventTime(&ev, pi->dixdev); + NoticeEventTime(&ev, ki->dixdev); - KdUnblockSigio(); + OsReleaseSIGIO(); } static KdKeyboardDriver * @@ -701,8 +682,6 @@ KdKbdCtrl(DeviceIntPtr pDevice, KeybdCtrl * ctrl) ki->bellDuration = ctrl->bell_duration; } -extern KeybdCtrl defaultKeyboardControl; - static int KdKeyboardProc(DeviceIntPtr pDevice, int onoff) { @@ -1802,7 +1781,7 @@ KdReleaseAllKeys(void) int key; KdKeyboardInfo *ki; - KdBlockSigio(); + OsBlockSIGIO(); for (ki = kdKeyboards; ki; ki = ki->next) { for (key = ki->keySyms.minKeyCode; key < ki->keySyms.maxKeyCode; key++) { @@ -1813,7 +1792,7 @@ KdReleaseAllKeys(void) } } - KdUnblockSigio(); + OsReleaseSIGIO(); #endif } @@ -1973,7 +1952,7 @@ _KdEnqueuePointerEvent(KdPointerInfo * pi, int type, int x, int y, int z, } void -KdBlockHandler(int screen, pointer blockData, pointer timeout, pointer readmask) +KdBlockHandler(ScreenPtr pScreen, pointer timeout, pointer readmask) { KdPointerInfo *pi; int myTimeout = 0; @@ -1999,8 +1978,7 @@ KdBlockHandler(int screen, pointer blockData, pointer timeout, pointer readmask) } void -KdWakeupHandler(int screen, - pointer data, unsigned long lresult, pointer readmask) +KdWakeupHandler(ScreenPtr pScreen, unsigned long lresult, pointer readmask) { int result = (int) lresult; fd_set *pReadmask = (fd_set *) readmask; @@ -2010,18 +1988,18 @@ KdWakeupHandler(int screen, if (kdInputEnabled && result > 0) { for (i = 0; i < kdNumInputFds; i++) if (FD_ISSET(kdInputFds[i].fd, pReadmask)) { - KdBlockSigio(); + OsBlockSIGIO(); (*kdInputFds[i].read) (kdInputFds[i].fd, kdInputFds[i].closure); - KdUnblockSigio(); + OsReleaseSIGIO(); } } for (pi = kdPointers; pi; pi = pi->next) { if (pi->timeoutPending) { if ((long) (GetTimeInMillis() - pi->emulationTimeout) >= 0) { pi->timeoutPending = FALSE; - KdBlockSigio(); + OsBlockSIGIO(); KdReceiveTimeout(pi); - KdUnblockSigio(); + OsReleaseSIGIO(); } } } @@ -2118,10 +2096,10 @@ int KdCurScreen; /* current event screen */ static void KdWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) { - KdBlockSigio(); + OsBlockSIGIO(); KdCurScreen = pScreen->myNum; miPointerWarpCursor(pDev, pScreen, x, y); - KdUnblockSigio(); + OsReleaseSIGIO(); } miPointerScreenFuncRec kdPointerScreenFuncs = { diff --git a/xserver/hw/kdrive/src/kxv.c b/xserver/hw/kdrive/src/kxv.c index 7097aee5c..cf656363d 100644 --- a/xserver/hw/kdrive/src/kxv.c +++ b/xserver/hw/kdrive/src/kxv.c @@ -58,7 +58,7 @@ of the copyright holder. /* XvScreenRec fields */ -static Bool KdXVCloseScreen(int, ScreenPtr); +static Bool KdXVCloseScreen(ScreenPtr); static int KdXVQueryAdaptors(ScreenPtr, XvAdaptorPtr *, int *); /* XvAdaptorRec fields */ @@ -107,10 +107,6 @@ static DevPrivateKey KdXvScreenKey; static unsigned long KdXVGeneration = 0; static unsigned long PortResource = 0; -DevPrivateKey (*XvGetScreenKeyProc) (void) = XvGetScreenKey; -unsigned long (*XvGetRTPortProc) (void) = XvGetRTPort; -int (*XvScreenInitProc) (ScreenPtr) = XvScreenInit; - #define GET_XV_SCREEN(pScreen) ((XvScreenPtr) \ dixLookupPrivate(&(pScreen)->devPrivates, KdXvScreenKey)) @@ -186,17 +182,17 @@ KdXVScreenInit(ScreenPtr pScreen, KdVideoAdaptorPtr * adaptors, int num) if (KdXVGeneration != serverGeneration) KdXVGeneration = serverGeneration; - if (!XvGetScreenKeyProc || !XvGetRTPortProc || !XvScreenInitProc) + if (noXvExtension) return FALSE; if (!dixRegisterPrivateKey(&KdXVWindowKeyRec, PRIVATE_WINDOW, 0)) return FALSE; - if (Success != (*XvScreenInitProc) (pScreen)) + if (Success != XvScreenInit(pScreen)) return FALSE; - KdXvScreenKey = (*XvGetScreenKeyProc) (); - PortResource = (*XvGetRTPortProc) (); + KdXvScreenKey = XvGetScreenKey(); + PortResource = XvGetRTPort(); pxvs = GET_XV_SCREEN(pScreen); @@ -1118,7 +1114,7 @@ KdXVClipNotify(WindowPtr pWin, int dx, int dy) /**** Required XvScreenRec fields ****/ static Bool -KdXVCloseScreen(int i, ScreenPtr pScreen) +KdXVCloseScreen(ScreenPtr pScreen) { XvScreenPtr pxvs = GET_XV_SCREEN(pScreen); KdXVScreenPtr ScreenPriv = GET_KDXV_SCREEN(pScreen); diff --git a/xserver/hw/kdrive/wscons/Makefile.in b/xserver/hw/kdrive/wscons/Makefile.in index 3aa037d32..0dcf79db7 100644 --- a/xserver/hw/kdrive/wscons/Makefile.in +++ b/xserver/hw/kdrive/wscons/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -196,13 +196,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -224,6 +220,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -248,6 +245,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -263,7 +261,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -362,6 +359,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -486,7 +484,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -511,9 +509,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/vfb/InitInput.c b/xserver/hw/vfb/InitInput.c index 9d0fd9866..52cde72f0 100644 --- a/xserver/hw/vfb/InitInput.c +++ b/xserver/hw/vfb/InitInput.c @@ -36,7 +36,6 @@ from The Open Group. #include "scrnintstr.h" #include "inputstr.h" #include -#include "mibstore.h" #include "mipointer.h" #include "xkbsrv.h" #include diff --git a/xserver/hw/vfb/InitOutput.c b/xserver/hw/vfb/InitOutput.c index 2d679a559..97eccfd4e 100644 --- a/xserver/hw/vfb/InitOutput.c +++ b/xserver/hw/vfb/InitOutput.c @@ -41,7 +41,6 @@ from The Open Group. #include "servermd.h" #define PSZ 8 #include "fb.h" -#include "mibstore.h" #include "colormapst.h" #include "gcstruct.h" #include "input.h" @@ -66,6 +65,7 @@ from The Open Group. #endif /* HAS_SHM */ #include "dix.h" #include "miline.h" +#include "glx_extinit.h" #define VFB_DEFAULT_WIDTH 1280 #define VFB_DEFAULT_HEIGHT 1024 @@ -219,7 +219,7 @@ OsVendorInit(void) } void -OsVendorFatalError(void) +OsVendorFatalError(const char *f, va_list args) { } @@ -760,9 +760,9 @@ static miPointerScreenFuncRec vfbPointerCursorFuncs = { }; static Bool -vfbCloseScreen(int index, ScreenPtr pScreen) +vfbCloseScreen(ScreenPtr pScreen) { - vfbScreenInfoPtr pvfb = &vfbScreens[index]; + vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum]; int i; pScreen->CloseScreen = pvfb->closeScreen; @@ -774,13 +774,20 @@ vfbCloseScreen(int index, ScreenPtr pScreen) for (i = 0; i < screenInfo.numScreens; i++) SetInstalledColormap(screenInfo.screens[i], NULL); - return pScreen->CloseScreen(index, pScreen); + /* + * fb overwrites miCloseScreen, so do this here + */ + if (pScreen->devPrivate) + (*pScreen->DestroyPixmap) (pScreen->devPrivate); + pScreen->devPrivate = NULL; + + return pScreen->CloseScreen(pScreen); } static Bool -vfbScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) +vfbScreenInit(ScreenPtr pScreen, int argc, char **argv) { - vfbScreenInfoPtr pvfb = &vfbScreens[index]; + vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum]; int dpix = monitorResolution, dpiy = monitorResolution; int ret; char *pbits; @@ -878,12 +885,30 @@ vfbScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) } /* end vfbScreenInit */ +static const ExtensionModule vfbExtensions[] = { +#ifdef GLXEXT + { GlxExtensionInit, "GLX", &noGlxExtension }, +#endif +}; + +static +void vfbExtensionInit(void) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(vfbExtensions); i++) + LoadExtension(&vfbExtensions[i], TRUE); +} + void InitOutput(ScreenInfo * screenInfo, int argc, char **argv) { int i; int NumFormats = 0; + if (serverGeneration == 1) + vfbExtensionInit(); + /* initialize pixmap formats */ /* must have a pixmap depth to match every screen depth */ diff --git a/xserver/hw/vfb/Makefile.am b/xserver/hw/vfb/Makefile.am index ed46dbbc1..9f4992c8b 100644 --- a/xserver/hw/vfb/Makefile.am +++ b/xserver/hw/vfb/Makefile.am @@ -4,8 +4,6 @@ bin_PROGRAMS = Xvfb noinst_LIBRARIES = libfbcmap.a AM_CFLAGS = -DHAVE_DIX_CONFIG_H \ - -DNO_HW_ONLY_EXTS \ - -DNO_MODULE_EXTS \ $(XVFBMODULES_CFLAGS) \ $(DIX_CFLAGS) diff --git a/xserver/hw/vfb/Makefile.in b/xserver/hw/vfb/Makefile.in index 26989cb0a..73953d7d1 100644 --- a/xserver/hw/vfb/Makefile.in +++ b/xserver/hw/vfb/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -239,13 +239,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -267,6 +263,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -291,6 +288,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -306,7 +304,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -405,6 +402,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -512,8 +510,6 @@ top_srcdir = @top_srcdir@ SUBDIRS = man noinst_LIBRARIES = libfbcmap.a AM_CFLAGS = -DHAVE_DIX_CONFIG_H \ - -DNO_HW_ONLY_EXTS \ - -DNO_MODULE_EXTS \ $(XVFBMODULES_CFLAGS) \ $(DIX_CFLAGS) @@ -533,7 +529,7 @@ all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -558,9 +554,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/vfb/man/Makefile.in b/xserver/hw/vfb/man/Makefile.in index 36a4675c4..6e605395f 100644 --- a/xserver/hw/vfb/man/Makefile.in +++ b/xserver/hw/vfb/man/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -179,13 +179,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -207,6 +203,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -231,6 +228,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -246,7 +244,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -361,6 +358,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -480,7 +478,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/manpages.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/manpages.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -506,9 +504,9 @@ $(top_srcdir)/manpages.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/xfree86/Makefile.am b/xserver/hw/xfree86/Makefile.am index 72be8891c..c3899b577 100644 --- a/xserver/hw/xfree86/Makefile.am +++ b/xserver/hw/xfree86/Makefile.am @@ -1,18 +1,18 @@ if DRI DRI_SUBDIR = dri +DRI_LIB = dri/libdri.la endif if DRI2 DRI2_SUBDIR = dri2 +DRI2_LIB = dri2/libdri2.la endif if XF86UTILS XF86UTILS_SUBDIR = utils endif -XAA_SUBDIR = xaa - if VGAHW VGAHW_SUBDIR = vgahw endif @@ -25,13 +25,13 @@ if INT10MODULE INT10_SUBDIR = int10 endif -SUBDIRS = common ddc i2c x86emu $(INT10_SUBDIR) fbdevhw os-support parser \ - ramdac shadowfb $(VBE_SUBDIR) $(VGAHW_SUBDIR) $(XAA_SUBDIR) \ - loader dixmods exa modes \ - $(DRI_SUBDIR) $(DRI2_SUBDIR) $(XF86UTILS_SUBDIR) doc man +SUBDIRS = common ddc x86emu $(INT10_SUBDIR) os-support parser \ + ramdac $(VGAHW_SUBDIR) loader modes $(DRI_SUBDIR) \ + $(DRI2_SUBDIR) . $(VBE_SUBDIR) i2c dixmods \ + fbdevhw shadowfb exa $(XF86UTILS_SUBDIR) doc man DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \ - parser ramdac shadowfb vbe vgahw xaa \ + parser ramdac shadowfb vbe vgahw \ loader dixmods dri dri2 exa modes \ utils doc man @@ -40,7 +40,8 @@ nodist_Xorg_SOURCES = sdksyms.c AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ INCLUDES = $(XORG_INCS) -I$(srcdir)/parser -I$(top_srcdir)/miext/cw \ - -I$(srcdir)/ddc -I$(srcdir)/i2c -I$(srcdir)/modes -I$(srcdir)/ramdac + -I$(srcdir)/ddc -I$(srcdir)/i2c -I$(srcdir)/modes -I$(srcdir)/ramdac \ + -I$(srcdir)/dri -I$(srcdir)/dri2 LOCAL_LIBS = \ $(MAIN_LIB) \ @@ -54,8 +55,10 @@ LOCAL_LIBS = \ ramdac/libramdac.la \ ddc/libddc.la \ i2c/libi2c.la \ - dixmods/libxorgxkb.la \ $(XORG_LIBS) \ + dixmods/libxorgxkb.la \ + $(DRI_LIB) \ + $(DRI2_LIB) \ $(top_builddir)/mi/libmi.la \ $(top_builddir)/os/libos.la Xorg_LDADD = \ @@ -92,6 +95,9 @@ if INSTALL_SETUID chown root $(DESTDIR)$(bindir)/Xorg chmod u+s $(DESTDIR)$(bindir)/Xorg endif +if CYGWIN + $(INSTALL_DATA) libXorg.exe.a $(DESTDIR)$(libdir)/libXorg.exe.a +endif # Use variables from XORG_MANPAGE_SECTIONS and X Server configuration # Do not include manpages.am as values are not appropriate for rc files @@ -103,13 +109,22 @@ xorg.conf.example: xorgconf.cpp $(AM_V_GEN)$(SED) $(CONF_SUBSTS) < $(srcdir)/xorgconf.cpp > $@ relink: - $(AM_V_at)rm -f Xorg && $(MAKE) Xorg + $(AM_V_at)rm -f Xorg$(EXEEXT) && $(MAKE) Xorg$(EXEEXT) CLEANFILES = sdksyms.c sdksyms.dep EXTRA_DIST += sdksyms.sh sdksyms.dep sdksyms.c: sdksyms.sh - CPP='$(CPP)' AWK='$(AWK)' $(SHELL) $(srcdir)/sdksyms.sh $(top_srcdir) $(CFLAGS) $(AM_CFLAGS) $(INCLUDES) + $(AM_V_GEN)CPP='$(CPP)' AWK='$(AWK)' $(SHELL) $(srcdir)/sdksyms.sh $(top_srcdir) $(CFLAGS) $(AM_CFLAGS) $(INCLUDES) SDKSYMS_DEP = sdksyms.dep include $(SDKSYMS_DEP) + +i2c/libi2c.la: + $(AM_V_at)cd i2c && $(MAKE) libi2c.la + +dixmods/libdixmods.la: + $(AM_V_at)cd dixmods && $(MAKE) libdixmods.la + +dixmods/libxorgxkb.la: + $(AM_V_at)cd dixmods && $(MAKE) libxorgxkb.la diff --git a/xserver/hw/xfree86/Makefile.in b/xserver/hw/xfree86/Makefile.in index a3152b884..8d98a8704 100644 --- a/xserver/hw/xfree86/Makefile.in +++ b/xserver/hw/xfree86/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -87,8 +87,9 @@ am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ os-support/libxorgos.la parser/libxf86config_internal.la \ dixmods/libdixmods.la modes/libxf86modes.la \ ramdac/libramdac.la ddc/libddc.la i2c/libi2c.la \ - dixmods/libxorgxkb.la $(am__DEPENDENCIES_1) \ - $(top_builddir)/mi/libmi.la $(top_builddir)/os/libos.la + $(am__DEPENDENCIES_1) dixmods/libxorgxkb.la $(DRI_LIB) \ + $(DRI2_LIB) $(top_builddir)/mi/libmi.la \ + $(top_builddir)/os/libos.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @@ -234,13 +235,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -262,6 +259,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -286,6 +284,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -301,7 +300,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -400,6 +398,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -500,26 +499,28 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @DRI_TRUE@DRI_SUBDIR = dri +@DRI_TRUE@DRI_LIB = dri/libdri.la @DRI2_TRUE@DRI2_SUBDIR = dri2 +@DRI2_TRUE@DRI2_LIB = dri2/libdri2.la @XF86UTILS_TRUE@XF86UTILS_SUBDIR = utils -XAA_SUBDIR = xaa @VGAHW_TRUE@VGAHW_SUBDIR = vgahw @VBE_TRUE@VBE_SUBDIR = vbe @INT10MODULE_TRUE@INT10_SUBDIR = int10 -SUBDIRS = common ddc i2c x86emu $(INT10_SUBDIR) fbdevhw os-support parser \ - ramdac shadowfb $(VBE_SUBDIR) $(VGAHW_SUBDIR) $(XAA_SUBDIR) \ - loader dixmods exa modes \ - $(DRI_SUBDIR) $(DRI2_SUBDIR) $(XF86UTILS_SUBDIR) doc man +SUBDIRS = common ddc x86emu $(INT10_SUBDIR) os-support parser \ + ramdac $(VGAHW_SUBDIR) loader modes $(DRI_SUBDIR) \ + $(DRI2_SUBDIR) . $(VBE_SUBDIR) i2c dixmods \ + fbdevhw shadowfb exa $(XF86UTILS_SUBDIR) doc man DIST_SUBDIRS = common ddc i2c x86emu int10 fbdevhw os-support \ - parser ramdac shadowfb vbe vgahw xaa \ + parser ramdac shadowfb vbe vgahw \ loader dixmods dri dri2 exa modes \ utils doc man nodist_Xorg_SOURCES = sdksyms.c AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ INCLUDES = $(XORG_INCS) -I$(srcdir)/parser -I$(top_srcdir)/miext/cw \ - -I$(srcdir)/ddc -I$(srcdir)/i2c -I$(srcdir)/modes -I$(srcdir)/ramdac + -I$(srcdir)/ddc -I$(srcdir)/i2c -I$(srcdir)/modes -I$(srcdir)/ramdac \ + -I$(srcdir)/dri -I$(srcdir)/dri2 LOCAL_LIBS = \ $(MAIN_LIB) \ @@ -533,8 +534,10 @@ LOCAL_LIBS = \ ramdac/libramdac.la \ ddc/libddc.la \ i2c/libi2c.la \ - dixmods/libxorgxkb.la \ $(XORG_LIBS) \ + dixmods/libxorgxkb.la \ + $(DRI_LIB) \ + $(DRI2_LIB) \ $(top_builddir)/mi/libmi.la \ $(top_builddir)/os/libos.la @@ -562,7 +565,7 @@ all: $(BUILT_SOURCES) .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -587,9 +590,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @@ -1005,17 +1008,27 @@ install-exec-local: install-binPROGRAMS (cd $(DESTDIR)$(bindir) && rm -f X && ln -s Xorg X) @INSTALL_SETUID_TRUE@ chown root $(DESTDIR)$(bindir)/Xorg @INSTALL_SETUID_TRUE@ chmod u+s $(DESTDIR)$(bindir)/Xorg +@CYGWIN_TRUE@ $(INSTALL_DATA) libXorg.exe.a $(DESTDIR)$(libdir)/libXorg.exe.a xorg.conf.example: xorgconf.cpp $(AM_V_GEN)$(SED) $(CONF_SUBSTS) < $(srcdir)/xorgconf.cpp > $@ relink: - $(AM_V_at)rm -f Xorg && $(MAKE) Xorg + $(AM_V_at)rm -f Xorg$(EXEEXT) && $(MAKE) Xorg$(EXEEXT) sdksyms.dep sdksyms.c: sdksyms.sh - CPP='$(CPP)' AWK='$(AWK)' $(SHELL) $(srcdir)/sdksyms.sh $(top_srcdir) $(CFLAGS) $(AM_CFLAGS) $(INCLUDES) + $(AM_V_GEN)CPP='$(CPP)' AWK='$(AWK)' $(SHELL) $(srcdir)/sdksyms.sh $(top_srcdir) $(CFLAGS) $(AM_CFLAGS) $(INCLUDES) include $(SDKSYMS_DEP) +i2c/libi2c.la: + $(AM_V_at)cd i2c && $(MAKE) libi2c.la + +dixmods/libdixmods.la: + $(AM_V_at)cd dixmods && $(MAKE) libdixmods.la + +dixmods/libxorgxkb.la: + $(AM_V_at)cd dixmods && $(MAKE) libxorgxkb.la + # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/xserver/hw/xfree86/common/Makefile.am b/xserver/hw/xfree86/common/Makefile.am index 27921777d..532d87bbe 100644 --- a/xserver/hw/xfree86/common/Makefile.am +++ b/xserver/hw/xfree86/common/Makefile.am @@ -15,16 +15,22 @@ XVSDKINCS = xf86xv.h xf86xvmc.h xf86xvpriv.h endif if XF86VIDMODE +XF86VMODESOURCES = xf86vmode.c XF86VMODE_SDK = vidmodeproc.h endif if DGA DGASOURCES = xf86DGA.c +DGA_SDK = dgaproc.h +endif + +if XORG_BUS_PLATFORM +PLATSOURCES = xf86platformBus.c endif RANDRSOURCES = xf86RandR.c -BUSSOURCES = xf86fbBus.c xf86noBus.c $(PCI_SOURCES) $(SBUS_SOURCES) +BUSSOURCES = xf86fbBus.c xf86noBus.c $(PCI_SOURCES) $(SBUS_SOURCES) $(PLATSOURCES) MODEDEFSOURCES = $(srcdir)/vesamodes $(srcdir)/extramodes @@ -41,7 +47,8 @@ libcommon_la_SOURCES = xf86Configure.c xf86Bus.c xf86Config.c \ xf86Option.c xf86Init.c \ xf86VidMode.c xf86fbman.c xf86cmap.c \ xf86Helper.c xf86PM.c xf86Xinput.c xisb.c \ - xf86Mode.c xorgHelper.c \ + xf86Mode.c xorgHelper.c xf86Extensions.h \ + xf86Extensions.c $(XF86VMODESOURCES) \ $(XVSOURCES) $(BUSSOURCES) $(RANDRSOURCES) nodist_libcommon_la_SOURCES = xf86DefModeSet.c xf86Build.h libcommon_la_LIBADD = $(top_builddir)/config/libconfig.la @@ -50,13 +57,14 @@ INCLUDES = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c \ -I$(srcdir)/../loader -I$(srcdir)/../parser \ -I$(srcdir)/../vbe -I$(srcdir)/../int10 \ -I$(srcdir)/../vgahw -I$(srcdir)/../dixmods/extmod \ - -I$(srcdir)/../modes -I$(srcdir)/../ramdac + -I$(srcdir)/../modes -I$(srcdir)/../ramdac -I$(srcdir)/../dri2 sdk_HEADERS = compiler.h fourcc.h xf86.h xf86Module.h xf86Opt.h \ xf86PciInfo.h xf86Priv.h xf86Privstr.h \ xf86cmap.h xf86fbman.h xf86str.h xf86Xinput.h xisb.h \ - $(XVSDKINCS) $(XF86VMODE_SDK) xorgVersion.h \ - xf86sbusBus.h xf86VGAarbiter.h xf86Optionstr.h + $(XVSDKINCS) $(XF86VMODE_SDK) $(DGA_SDK) xorgVersion.h \ + xf86sbusBus.h xf86VGAarbiter.h xf86Optionstr.h xf86platformBus.h \ + xaarop.h DISTCLEANFILES = xf86Build.h CLEANFILES = $(BUILT_SOURCES) @@ -88,7 +96,8 @@ EXTRA_DIST = \ modeline2c.awk \ xf86VGAarbiter.h \ xf86VGAarbiterPriv.h \ - $(DISTKBDSOURCES) + $(DISTKBDSOURCES) \ + xaarop.h if LNXACPI XORG_CFLAGS += -DHAVE_ACPI diff --git a/xserver/hw/xfree86/common/Makefile.in b/xserver/hw/xfree86/common/Makefile.in index 7c684cd40..39240a814 100644 --- a/xserver/hw/xfree86/common/Makefile.in +++ b/xserver/hw/xfree86/common/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -81,22 +81,27 @@ am__libcommon_la_SOURCES_DIST = xf86Configure.c xf86Bus.c xf86Config.c \ xf86Cursor.c xf86DGA.c xf86DPMS.c xf86Events.c xf86Globals.c \ xf86AutoConfig.c xf86Option.c xf86Init.c xf86VidMode.c \ xf86fbman.c xf86cmap.c xf86Helper.c xf86PM.c xf86Xinput.c \ - xisb.c xf86Mode.c xorgHelper.c xf86xv.c xf86xvmc.c xf86fbBus.c \ + xisb.c xf86Mode.c xorgHelper.c xf86Extensions.h \ + xf86Extensions.c xf86vmode.c xf86xv.c xf86xvmc.c xf86fbBus.c \ xf86noBus.c xf86pciBus.c xf86VGAarbiter.c xf86VGAarbiter.h \ - xf86VGAarbiterPriv.h xf86sbusBus.c xf86RandR.c + xf86VGAarbiterPriv.h xf86sbusBus.c xf86platformBus.c \ + xf86RandR.c @DGA_TRUE@am__objects_1 = xf86DGA.lo -@XV_TRUE@am__objects_2 = xf86xv.lo xf86xvmc.lo -@XORG_BUS_PCI_TRUE@am__objects_3 = xf86pciBus.lo xf86VGAarbiter.lo -@XORG_BUS_SPARC_TRUE@am__objects_4 = xf86sbusBus.lo -am__objects_5 = xf86fbBus.lo xf86noBus.lo $(am__objects_3) \ - $(am__objects_4) -am__objects_6 = xf86RandR.lo +@XF86VIDMODE_TRUE@am__objects_2 = xf86vmode.lo +@XV_TRUE@am__objects_3 = xf86xv.lo xf86xvmc.lo +@XORG_BUS_PCI_TRUE@am__objects_4 = xf86pciBus.lo xf86VGAarbiter.lo +@XORG_BUS_SPARC_TRUE@am__objects_5 = xf86sbusBus.lo +@XORG_BUS_PLATFORM_TRUE@am__objects_6 = xf86platformBus.lo +am__objects_7 = xf86fbBus.lo xf86noBus.lo $(am__objects_4) \ + $(am__objects_5) $(am__objects_6) +am__objects_8 = xf86RandR.lo am_libcommon_la_OBJECTS = xf86Configure.lo xf86Bus.lo xf86Config.lo \ xf86Cursor.lo $(am__objects_1) xf86DPMS.lo xf86Events.lo \ xf86Globals.lo xf86AutoConfig.lo xf86Option.lo xf86Init.lo \ xf86VidMode.lo xf86fbman.lo xf86cmap.lo xf86Helper.lo \ xf86PM.lo xf86Xinput.lo xisb.lo xf86Mode.lo xorgHelper.lo \ - $(am__objects_2) $(am__objects_5) $(am__objects_6) + xf86Extensions.lo $(am__objects_2) $(am__objects_3) \ + $(am__objects_7) $(am__objects_8) nodist_libcommon_la_OBJECTS = xf86DefModeSet.lo libcommon_la_OBJECTS = $(am_libcommon_la_OBJECTS) \ $(nodist_libcommon_la_OBJECTS) @@ -148,8 +153,9 @@ am__can_run_installinfo = \ am__sdk_HEADERS_DIST = compiler.h fourcc.h xf86.h xf86Module.h \ xf86Opt.h xf86PciInfo.h xf86Priv.h xf86Privstr.h xf86cmap.h \ xf86fbman.h xf86str.h xf86Xinput.h xisb.h xf86xv.h xf86xvmc.h \ - xf86xvpriv.h vidmodeproc.h xorgVersion.h xf86sbusBus.h \ - xf86VGAarbiter.h xf86Optionstr.h + xf86xvpriv.h vidmodeproc.h dgaproc.h xorgVersion.h \ + xf86sbusBus.h xf86VGAarbiter.h xf86Optionstr.h \ + xf86platformBus.h xaarop.h am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ @@ -239,13 +245,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -267,6 +269,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -291,6 +294,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -306,7 +310,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -405,6 +408,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ $(am__append_1) +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -511,10 +515,13 @@ noinst_LTLIBRARIES = libcommon.la @XORG_BUS_SPARC_TRUE@SBUS_SOURCES = xf86sbusBus.c @XV_TRUE@XVSOURCES = xf86xv.c xf86xvmc.c @XV_TRUE@XVSDKINCS = xf86xv.h xf86xvmc.h xf86xvpriv.h +@XF86VIDMODE_TRUE@XF86VMODESOURCES = xf86vmode.c @XF86VIDMODE_TRUE@XF86VMODE_SDK = vidmodeproc.h @DGA_TRUE@DGASOURCES = xf86DGA.c +@DGA_TRUE@DGA_SDK = dgaproc.h +@XORG_BUS_PLATFORM_TRUE@PLATSOURCES = xf86platformBus.c RANDRSOURCES = xf86RandR.c -BUSSOURCES = xf86fbBus.c xf86noBus.c $(PCI_SOURCES) $(SBUS_SOURCES) +BUSSOURCES = xf86fbBus.c xf86noBus.c $(PCI_SOURCES) $(SBUS_SOURCES) $(PLATSOURCES) MODEDEFSOURCES = $(srcdir)/vesamodes $(srcdir)/extramodes BUILT_SOURCES = xf86DefModeSet.c AM_LDFLAGS = -r @@ -524,7 +531,8 @@ libcommon_la_SOURCES = xf86Configure.c xf86Bus.c xf86Config.c \ xf86Option.c xf86Init.c \ xf86VidMode.c xf86fbman.c xf86cmap.c \ xf86Helper.c xf86PM.c xf86Xinput.c xisb.c \ - xf86Mode.c xorgHelper.c \ + xf86Mode.c xorgHelper.c xf86Extensions.h \ + xf86Extensions.c $(XF86VMODESOURCES) \ $(XVSOURCES) $(BUSSOURCES) $(RANDRSOURCES) nodist_libcommon_la_SOURCES = xf86DefModeSet.c xf86Build.h @@ -533,13 +541,14 @@ INCLUDES = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c \ -I$(srcdir)/../loader -I$(srcdir)/../parser \ -I$(srcdir)/../vbe -I$(srcdir)/../int10 \ -I$(srcdir)/../vgahw -I$(srcdir)/../dixmods/extmod \ - -I$(srcdir)/../modes -I$(srcdir)/../ramdac + -I$(srcdir)/../modes -I$(srcdir)/../ramdac -I$(srcdir)/../dri2 sdk_HEADERS = compiler.h fourcc.h xf86.h xf86Module.h xf86Opt.h \ xf86PciInfo.h xf86Priv.h xf86Privstr.h \ xf86cmap.h xf86fbman.h xf86str.h xf86Xinput.h xisb.h \ - $(XVSDKINCS) $(XF86VMODE_SDK) xorgVersion.h \ - xf86sbusBus.h xf86VGAarbiter.h xf86Optionstr.h + $(XVSDKINCS) $(XF86VMODE_SDK) $(DGA_SDK) xorgVersion.h \ + xf86sbusBus.h xf86VGAarbiter.h xf86Optionstr.h xf86platformBus.h \ + xaarop.h DISTCLEANFILES = xf86Build.h CLEANFILES = $(BUILT_SOURCES) @@ -570,7 +579,8 @@ EXTRA_DIST = \ modeline2c.awk \ xf86VGAarbiter.h \ xf86VGAarbiterPriv.h \ - $(DISTKBDSOURCES) + $(DISTKBDSOURCES) \ + xaarop.h AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) all: $(BUILT_SOURCES) @@ -578,7 +588,7 @@ all: $(BUILT_SOURCES) .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -603,9 +613,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): xf86Build.h: $(top_builddir)/config.status $(srcdir)/xf86Build.h.in @@ -639,6 +649,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86DPMS.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86DefModeSet.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Events.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Extensions.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Globals.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Helper.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Init.Plo@am__quote@ @@ -654,7 +665,9 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86fbman.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86noBus.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86pciBus.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86platformBus.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86sbusBus.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86vmode.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86xv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86xvmc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xisb.Plo@am__quote@ diff --git a/xserver/hw/xfree86/common/compiler.h b/xserver/hw/xfree86/common/compiler.h index f1d491d18..a403cbd34 100644 --- a/xserver/hw/xfree86/common/compiler.h +++ b/xserver/hw/xfree86/common/compiler.h @@ -119,6 +119,23 @@ extern _X_EXPORT unsigned int inb(unsigned long); extern _X_EXPORT unsigned int inw(unsigned long); extern _X_EXPORT unsigned int inl(unsigned long); +#ifdef __SUNPRO_C +extern _X_EXPORT unsigned char xf86ReadMmio8 (void *, unsigned long); +extern _X_EXPORT unsigned short xf86ReadMmio16Be (void *, unsigned long); +extern _X_EXPORT unsigned short xf86ReadMmio16Le (void *, unsigned long); +extern _X_EXPORT unsigned int xf86ReadMmio32Be (void *, unsigned long); +extern _X_EXPORT unsigned int xf86ReadMmio32Le (void *, unsigned long); +extern _X_EXPORT void xf86WriteMmio8 (void *, unsigned long, unsigned int); +extern _X_EXPORT void xf86WriteMmio16Be (void *, unsigned long, unsigned int); +extern _X_EXPORT void xf86WriteMmio16Le (void *, unsigned long, unsigned int); +extern _X_EXPORT void xf86WriteMmio32Be (void *, unsigned long, unsigned int); +extern _X_EXPORT void xf86WriteMmio32Le (void *, unsigned long, unsigned int); +extern _X_EXPORT void xf86WriteMmio8NB (void *, unsigned long, unsigned int); +extern _X_EXPORT void xf86WriteMmio16BeNB (void *, unsigned long, unsigned int); +extern _X_EXPORT void xf86WriteMmio16LeNB (void *, unsigned long, unsigned int); +extern _X_EXPORT void xf86WriteMmio32BeNB (void *, unsigned long, unsigned int); +extern _X_EXPORT void xf86WriteMmio32LeNB (void *, unsigned long, unsigned int); +#endif /* _SUNPRO_C */ #endif /* __sparc__, __arm32__, __alpha__, __nds32__ */ #endif /* __arm__ */ diff --git a/xserver/hw/xfree86/dixmods/extmod/dgaproc.h b/xserver/hw/xfree86/common/dgaproc.h similarity index 96% rename from xserver/hw/xfree86/dixmods/extmod/dgaproc.h rename to xserver/hw/xfree86/common/dgaproc.h index b4e0ddfea..e824d3094 100644 --- a/xserver/hw/xfree86/dixmods/extmod/dgaproc.h +++ b/xserver/hw/xfree86/common/dgaproc.h @@ -64,6 +64,7 @@ extern _X_EXPORT void DGASelectInput(int Index, ClientPtr client, long mask); extern _X_EXPORT Bool DGAAvailable(int Index); +extern _X_EXPORT Bool DGAScreenAvailable(ScreenPtr pScreen); extern _X_EXPORT Bool DGAActive(int Index); extern _X_EXPORT void DGAShutdown(void); extern _X_EXPORT void DGAInstallCmap(ColormapPtr cmap); @@ -106,9 +107,4 @@ extern _X_EXPORT Bool DGAChangePixmapMode(int Index, int *x, int *y, int mode); extern _X_EXPORT int DGACreateColormap(int Index, ClientPtr client, int id, int mode, int alloc); -extern _X_EXPORT unsigned char DGAReqCode; -extern _X_EXPORT int DGAErrorBase; -extern _X_EXPORT int DGAEventBase; -extern _X_EXPORT int *XDGAEventBase; - #endif /* __DGAPROC_H */ diff --git a/xserver/hw/xfree86/common/vidmodeproc.h b/xserver/hw/xfree86/common/vidmodeproc.h index aa43237d4..311d35c7b 100644 --- a/xserver/hw/xfree86/common/vidmodeproc.h +++ b/xserver/hw/xfree86/common/vidmodeproc.h @@ -39,7 +39,7 @@ typedef union { float f; } vidMonitorValue; -extern _X_EXPORT void XFree86VidModeExtensionInit(void); +extern Bool VidModeExtensionInit(ScreenPtr pScreen); extern _X_EXPORT Bool VidModeAvailable(int scrnIndex); extern _X_EXPORT Bool VidModeGetCurrentModeline(int scrnIndex, pointer *mode, diff --git a/xserver/hw/xfree86/xaa/xaarop.h b/xserver/hw/xfree86/common/xaarop.h similarity index 79% rename from xserver/hw/xfree86/xaa/xaarop.h rename to xserver/hw/xfree86/common/xaarop.h index f2acde075..84aa9baba 100644 --- a/xserver/hw/xfree86/xaa/xaarop.h +++ b/xserver/hw/xfree86/common/xaarop.h @@ -1,30 +1,3 @@ -/* - - int XAAHelpSolidROP(ScrnInfoPtr pScrn, int *fg, int pm, int *rop) - - For use with solid fills emulated by solid 8x8 patterns. You - give it the foreground, planemask and X rop and it will replace - the foreground with a new one and the rop with the appropriate - MS triadic raster op. The function will return which components - (S-P) need to be enabled. - - int XAAHelpPatternROP(ScrnInfoPtr pScrn, int *fg, int *bg, int pm, int *rop) - - For use with 8x8 opaque pattern fills. You give it the foreground, - and background, planemask and X rop and it will replace the - foreground and background with new ones and the rop with the - appropriate MS triadic raster op. The function will return which - components (S-P) need to be enabled. - - ROP_PAT - Means to enable 8x8 mono patterns (all bits - set for solid patterns). Set the foreground and - background as returned by the function. - - ROP_SRC - Means a source of color == planemask should be used. - - -*/ - #ifndef _XAAROP_H #define _XAAROP_H @@ -292,20 +265,4 @@ #define NO_SRC_ROP(rop) \ ((rop == GXnoop) || (rop == GXset) || (rop == GXclear) || (rop == GXinvert)) -extern _X_EXPORT int XAAHelpSolidROP(ScrnInfoPtr pScrn, int *fg, int pm, - int *rop); -extern _X_EXPORT int XAAHelpPatternROP(ScrnInfoPtr pScrn, int *fg, int *bg, - int pm, int *rop); - -/* XXX These four should be static, but it breaks the 6.7.0 ABI. */ -extern _X_EXPORT int XAACopyROP[16]; -extern _X_EXPORT int XAACopyROP_PM[16]; -extern _X_EXPORT int XAAPatternROP[16]; -extern _X_EXPORT int XAAPatternROP_PM[16]; - -extern _X_EXPORT int XAAGetCopyROP(int i); -extern _X_EXPORT int XAAGetCopyROP_PM(int i); -extern _X_EXPORT int XAAGetPatternROP(int i); -extern _X_EXPORT int XAAGetPatternROP_PM(int i); - #endif /* _XAAROP_H */ diff --git a/xserver/hw/xfree86/common/xf86.h b/xserver/hw/xfree86/common/xf86.h index fc4c34e92..1514c2603 100644 --- a/xserver/hw/xfree86/common/xf86.h +++ b/xserver/hw/xfree86/common/xf86.h @@ -55,6 +55,7 @@ extern _X_EXPORT int xf86DoConfigure; extern _X_EXPORT int xf86DoShowOptions; extern _X_EXPORT Bool xf86DoConfigurePass1; +extern _X_EXPORT Bool xorgHWAccess; extern _X_EXPORT DevPrivateKeyRec xf86ScreenKeyRec; @@ -71,13 +72,18 @@ extern _X_EXPORT Bool fbSlotClaimed; #if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) extern _X_EXPORT Bool sbusSlotClaimed; #endif + +#if defined(XSERVER_PLATFORM_BUS) +extern _X_EXPORT int platformSlotClaimed; +#endif + extern _X_EXPORT confDRIRec xf86ConfigDRI; extern _X_EXPORT Bool xf86DRI2Enabled(void); extern _X_EXPORT Bool VTSwitchEnabled; /* kbd driver */ -#define XF86SCRNINFO(p) ((ScrnInfoPtr)dixLookupPrivate(&(p)->devPrivates, \ - xf86ScreenKey)) +#define XF86SCRNINFO(p) xf86ScreenToScrn(p) + #define XF86FLIP_PIXELS() \ do { \ if (xf86GetFlipPixels()) { \ @@ -97,12 +103,12 @@ extern _X_EXPORT Bool VTSwitchEnabled; /* kbd driver */ /* PCI related */ #ifdef XSERVER_LIBPCIACCESS #include -extern _X_EXPORT Bool pciSlotClaimed; +extern _X_EXPORT int pciSlotClaimed; extern _X_EXPORT Bool xf86CheckPciSlot(const struct pci_device *); extern _X_EXPORT int xf86ClaimPciSlot(struct pci_device *, DriverPtr drvp, int chipset, GDevPtr dev, Bool active); -extern _X_EXPORT void xf86UnclaimPciSlot(struct pci_device *); +extern _X_EXPORT void xf86UnclaimPciSlot(struct pci_device *, GDevPtr dev); extern _X_EXPORT Bool xf86ParsePciBusString(const char *busID, int *bus, int *device, int *func); extern _X_EXPORT Bool xf86ComparePciBusString(const char *busID, int bus, @@ -244,7 +250,7 @@ extern _X_EXPORT void xf86AddDriver(DriverPtr driver, pointer module, int flags); extern _X_EXPORT void xf86DeleteDriver(int drvIndex); extern _X_EXPORT ScrnInfoPtr xf86AllocateScreen(DriverPtr drv, int flags); -extern _X_EXPORT void xf86DeleteScreen(int scrnIndex, int flags); +extern _X_EXPORT void xf86DeleteScreen(ScrnInfoPtr pScrn); extern _X_EXPORT int xf86AllocateScrnInfoPrivateIndex(void); extern _X_EXPORT Bool xf86AddPixFormat(ScrnInfoPtr pScrn, int depth, int bpp, int pad); @@ -256,7 +262,7 @@ extern _X_EXPORT Bool xf86SetDefaultVisual(ScrnInfoPtr scrp, int visual); extern _X_EXPORT Bool xf86SetGamma(ScrnInfoPtr scrp, Gamma newGamma); extern _X_EXPORT void xf86SetDpi(ScrnInfoPtr pScrn, int x, int y); extern _X_EXPORT void xf86SetBlackWhitePixels(ScreenPtr pScreen); -extern _X_EXPORT void xf86EnableDisableFBAccess(int scrnIndex, Bool enable); +extern _X_EXPORT void xf86EnableDisableFBAccess(ScrnInfoPtr pScrn, Bool enable); extern _X_EXPORT void xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format, va_list args) @@ -347,7 +353,7 @@ xf86SetBackingStore(ScreenPtr pScreen); extern _X_EXPORT void xf86SetSilkenMouse(ScreenPtr pScreen); extern _X_EXPORT pointer -xf86FindXvOptions(int scrnIndex, int adapt_index, char *port_name, +xf86FindXvOptions(ScrnInfoPtr pScrn, int adapt_index, char *port_name, char **adaptor_name, pointer *adaptor_options); extern _X_EXPORT void xf86GetOS(const char **name, int *major, int *minor, int *teeny); @@ -357,7 +363,7 @@ xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, EntityProc enter, EntityProc leave, pointer private); extern _X_EXPORT Bool -xf86IsScreenPrimary(int scrnIndex); +xf86IsScreenPrimary(ScrnInfoPtr pScrn); extern _X_EXPORT int xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type, int format, unsigned long len, pointer value); @@ -417,6 +423,8 @@ extern _X_EXPORT void xf86SetModeCrtc(DisplayModePtr p, int adjustFlags); extern _X_EXPORT DisplayModePtr xf86DuplicateMode(const DisplayModeRec * pMode); +extern _X_EXPORT void +xf86SaveModeContents(DisplayModePtr intern, const DisplayModeRec * pMode); extern _X_EXPORT DisplayModePtr xf86DuplicateModes(ScrnInfoPtr pScrn, DisplayModePtr modeList); extern _X_EXPORT Bool @@ -444,11 +452,25 @@ xf86RandRSetNewVirtualAndDimensions(ScreenPtr pScreen, Bool resetMode); #endif -/* xf86VidModeExtentionInit.c */ +/* xf86Extensions.c */ +extern void xf86ExtensionInit(void); -extern _X_EXPORT Bool -VidModeExtensionInit(ScreenPtr pScreen); +/* convert ScreenPtr to ScrnInfoPtr */ +extern _X_EXPORT ScrnInfoPtr xf86ScreenToScrn(ScreenPtr pScreen); +/* convert ScrnInfoPtr to ScreenPtr */ +extern _X_EXPORT ScreenPtr xf86ScrnToScreen(ScrnInfoPtr pScrn); #endif /* _NO_XF86_PROTOTYPES */ +#define XF86_HAS_SCRN_CONV 1 /* define for drivers to use in api compat */ + +#define XF86_SCRN_INTERFACE 1 /* define for drivers to use in api compat */ + +/* flags passed to xf86 allocate screen */ +#define XF86_ALLOCATE_GPU_SCREEN 1 + +/* Update the internal total dimensions of all ScreenRecs together */ +extern _X_EXPORT void +xf86UpdateDesktopDimensions(void); + #endif /* _XF86_H */ diff --git a/xserver/hw/xfree86/common/xf86AutoConfig.c b/xserver/hw/xfree86/common/xf86AutoConfig.c index dd0bb4e8b..bcc1feee0 100644 --- a/xserver/hw/xfree86/common/xf86AutoConfig.c +++ b/xserver/hw/xfree86/common/xf86AutoConfig.c @@ -39,6 +39,7 @@ #include "xf86Config.h" #include "xf86Priv.h" #include "xf86_OSlib.h" +#include "xf86platformBus.h" #include "xf86pciBus.h" #if defined(__sparc__) #include "xf86sbusBus.h" @@ -198,10 +199,13 @@ listPossibleVideoDrivers(char *matches[], int nmatches) } i = 0; +#ifdef XSERVER_PLATFORM_BUS + i = xf86PlatformMatchDriver(matches, nmatches); +#endif #ifdef sun /* Check for driver type based on /dev/fb type and if valid, use it instead of PCI bus probe results */ - if (xf86Info.consoleFd >= 0) { + if (xf86Info.consoleFd >= 0 && (i < (nmatches - 1))) { struct vis_identifier visid; const char *cp; extern char xf86SolarisFbDev[PATH_MAX]; @@ -250,7 +254,8 @@ listPossibleVideoDrivers(char *matches[], int nmatches) } } #endif -#if defined(__sparc__) +#ifdef __sparc__ + if (i < (nmatches - 1)) { char *sbusDriver = sparcDriverName(); @@ -259,7 +264,8 @@ listPossibleVideoDrivers(char *matches[], int nmatches) } #endif #ifdef XSERVER_LIBPCIACCESS - i = xf86PciMatchDriver(matches, nmatches); + if (i < (nmatches - 1)) + i = xf86PciMatchDriver(matches, nmatches); #endif /* Fallback to platform default hardware */ if (i < (nmatches - 1)) { @@ -270,6 +276,10 @@ listPossibleVideoDrivers(char *matches[], int nmatches) #endif } +#if defined(__linux__) + matches[i++] = xnfstrdup("modesetting"); +#endif + #if !defined(sun) /* Fallback to platform default frame buffer driver */ if (i < (nmatches - 1)) { diff --git a/xserver/hw/xfree86/common/xf86Bus.c b/xserver/hw/xfree86/common/xf86Bus.c index ccd44f651..a8aa7540b 100644 --- a/xserver/hw/xfree86/common/xf86Bus.c +++ b/xserver/hw/xfree86/common/xf86Bus.c @@ -77,8 +77,16 @@ xf86CallDriverProbe(DriverPtr drv, Bool detect_only) { Bool foundScreen = FALSE; +#ifdef XSERVER_PLATFORM_BUS + if (drv->platformProbe != NULL) { + foundScreen = xf86platformProbeDev(drv); + } + if (ServerIsNotSeat0()) + return foundScreen; +#endif + #ifdef XSERVER_LIBPCIACCESS - if (drv->PciProbe != NULL) { + if (!foundScreen && (drv->PciProbe != NULL)) { if (xf86DoConfigure && xf86DoConfigurePass1) { assert(detect_only); foundScreen = xf86PciAddMatchingDev(drv); @@ -109,27 +117,12 @@ xf86BusConfig(void) screenLayoutPtr layout; int i, j; - /* Enable full I/O access */ - if (xorgHWAccess) - xorgHWAccess = xf86EnableIO(); - /* * Now call each of the Probe functions. Each successful probe will * result in an extra entry added to the xf86Screens[] list for each * instance of the hardware found. */ for (i = 0; i < xf86NumDrivers; i++) { - xorgHWFlags flags; - - if (!xorgHWAccess) { - if (!xf86DriverList[i]->driverFunc - || !xf86DriverList[i]->driverFunc(NULL, - GET_REQUIRED_HW_INTERFACES, - &flags) - || NEED_IO_ENABLED(flags)) - continue; - } - xf86CallDriverProbe(xf86DriverList[i], FALSE); } @@ -179,10 +172,14 @@ xf86BusConfig(void) xf86Msg(X_ERROR, "Screen %d deleted because of no matching config section.\n", i); - xf86DeleteScreen(i--, 0); + xf86DeleteScreen(xf86Screens[i--]); } } + /* bind GPU conf screen to protocol screen 0 */ + for (i = 0; i < xf86NumGPUScreens; i++) + xf86GPUScreens[i]->confScreen = xf86Screens[0]->confScreen; + /* If no screens left, return now. */ if (xf86NumScreens == 0) { xf86Msg(X_ERROR, @@ -202,6 +199,11 @@ xf86BusConfig(void) void xf86BusProbe(void) { +#ifdef XSERVER_PLATFORM_BUS + xf86platformProbe(); + if (ServerIsNotSeat0()) + return; +#endif #ifdef XSERVER_LIBPCIACCESS xf86PciProbe(); #endif @@ -238,6 +240,8 @@ StringToBusType(const char *busID, const char **retID) ret = BUS_PCI; if (!xf86NameCmp(p, "sbus")) ret = BUS_SBUS; + if (!xf86NameCmp(p, "platform")) + ret = BUS_PLATFORM; if (ret != BUS_NONE) if (retID) *retID = busID + strlen(p) + 1; @@ -270,6 +274,8 @@ xf86IsEntityPrimary(int entityIndex) return pEnt->bus.id.pci == primaryBus.id.pci; case BUS_SBUS: return pEnt->bus.id.sbus.fbNum == primaryBus.id.sbus.fbNum; + case BUS_PLATFORM: + return pEnt->bus.id.plat == primaryBus.id.plat; default: return FALSE; } @@ -377,13 +383,12 @@ xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, int entityIndex) } /* - * xf86ClearEntitiesForScreen() - called when a screen is deleted + * xf86ClearEntityListForScreen() - called when a screen is deleted * to mark it's entities unused. Called by xf86DeleteScreen(). */ void -xf86ClearEntityListForScreen(int scrnIndex) +xf86ClearEntityListForScreen(ScrnInfoPtr pScrn) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; int i, entityIndex; if (pScrn->entityList == NULL || pScrn->numEntities == 0) @@ -420,6 +425,26 @@ xf86AddDevToEntity(int entityIndex, GDevPtr dev) dev->claimed = TRUE; } + +void +xf86RemoveDevFromEntity(int entityIndex, GDevPtr dev) +{ + EntityPtr pEnt; + int i, j; + if (entityIndex >= xf86NumEntities) + return; + + pEnt = xf86Entities[entityIndex]; + for (i = 0; i < pEnt->numInstances; i++) { + if (pEnt->devices[i] == dev) { + for (j = i; j < pEnt->numInstances - 1; j++) + pEnt->devices[j] = pEnt->devices[j + 1]; + break; + } + } + pEnt->numInstances--; + dev->claimed = FALSE; +} /* * xf86GetEntityInfo() -- This function hands information from the * EntityRec struct to the drivers. The EntityRec structure itself @@ -522,6 +547,9 @@ xf86PostProbe(void) #if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) sbusSlotClaimed || #endif +#ifdef XSERVER_PLATFORM_BUS + platformSlotClaimed || +#endif #ifdef XSERVER_LIBPCIACCESS pciSlotClaimed #else diff --git a/xserver/hw/xfree86/common/xf86Bus.h b/xserver/hw/xfree86/common/xf86Bus.h index abf2efd1a..e83ba780a 100644 --- a/xserver/hw/xfree86/common/xf86Bus.h +++ b/xserver/hw/xfree86/common/xf86Bus.h @@ -42,6 +42,7 @@ #if defined(__sparc__) || defined(__sparc) #include "xf86sbusBus.h" #endif +#include "xf86platformBus.h" typedef struct { DriverPtr driver; diff --git a/xserver/hw/xfree86/common/xf86Config.c b/xserver/hw/xfree86/common/xf86Config.c index b2a7dde43..d59b376e1 100644 --- a/xserver/hw/xfree86/common/xf86Config.c +++ b/xserver/hw/xfree86/common/xf86Config.c @@ -109,21 +109,13 @@ #endif static ModuleDefault ModuleDefaults[] = { - {.name = "extmod",.toLoad = TRUE,.load_opt = NULL}, -#ifdef DBE - {.name = "dbe",.toLoad = TRUE,.load_opt = NULL}, -#endif #ifdef GLXEXT {.name = "glx",.toLoad = TRUE,.load_opt = NULL}, #endif -#ifdef XRECORD - {.name = "record",.toLoad = TRUE,.load_opt = NULL}, -#endif -#ifdef XF86DRI - {.name = "dri",.toLoad = TRUE,.load_opt = NULL}, -#endif -#ifdef DRI2 - {.name = "dri2",.toLoad = TRUE,.load_opt = NULL}, +#ifdef __CYGWIN__ + /* load DIX modules used by drivers first */ + {.name = "fb",.toLoad = TRUE,.load_opt = NULL}, + {.name = "shadow",.toLoad = TRUE,.load_opt = NULL}, #endif {.name = NULL,.toLoad = FALSE,.load_opt = NULL} }; @@ -717,7 +709,8 @@ typedef enum { FLAG_AUTO_ENABLE_DEVICES, FLAG_GLX_VISUALS, FLAG_DRI2, - FLAG_USE_SIGIO + FLAG_USE_SIGIO, + FLAG_AUTO_ADD_GPU, } FlagValues; /** @@ -775,6 +768,8 @@ static OptionInfoRec FlagOptions[] = { {0}, FALSE}, {FLAG_USE_SIGIO, "UseSIGIO", OPTV_BOOLEAN, {0}, FALSE}, + {FLAG_AUTO_ADD_GPU, "AutoAddGPU", OPTV_BOOLEAN, + {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE}, }; @@ -867,6 +862,16 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts) xf86Msg(from, "%sutomatically enabling devices\n", xf86Info.autoEnableDevices ? "A" : "Not a"); + if (xf86IsOptionSet(FlagOptions, FLAG_AUTO_ADD_GPU)) { + xf86GetOptValBool(FlagOptions, FLAG_AUTO_ADD_GPU, + &xf86Info.autoAddGPU); + from = X_CONFIG; + } + else { + from = X_DEFAULT; + } + xf86Msg(from, "%sutomatically adding GPU devices\n", + xf86Info.autoAddGPU ? "A" : "Not a"); /* * Set things up based on the config file information. Some of these * settings may be overridden later when the command line options are diff --git a/xserver/hw/xfree86/common/xf86Configure.c b/xserver/hw/xfree86/common/xf86Configure.c index d466118d5..de74b5fd1 100644 --- a/xserver/hw/xfree86/common/xf86Configure.c +++ b/xserver/hw/xfree86/common/xf86Configure.c @@ -301,9 +301,8 @@ configureDeviceSection(int screennum) if (!ptr->dev_comment) break; p_e = ptr->dev_comment + strlen(ptr->dev_comment); - snprintf(p_e, len - (ptr->dev_comment - p_e), - "%s%-20s%s%s%s", prefix, optname, middle, - opttype, suffix); + sprintf(p_e, "%s%-20s%s%s%s", prefix, optname, middle, + opttype, suffix); free(optname); } } @@ -545,41 +544,16 @@ DoConfigure(void) free(vlist); - for (i = 0; i < xf86NumDrivers; i++) { - xorgHWFlags flags; - - if (!xf86DriverList[i]->driverFunc - || !xf86DriverList[i]->driverFunc(NULL, - GET_REQUIRED_HW_INTERFACES, - &flags) - || NEED_IO_ENABLED(flags)) { - xorgHWAccess = TRUE; - break; - } - } - /* Enable full I/O access */ - if (xorgHWAccess) { - if (!xf86EnableIO()) - /* oops, we have failed */ - xorgHWAccess = FALSE; - } + xorgHWAccess = xf86EnableIO(); /* Create XF86Config file structure */ xf86config = calloc(1, sizeof(XF86ConfigRec)); /* Call all of the probe functions, reporting the results. */ for (CurrentDriver = 0; CurrentDriver < xf86NumDrivers; CurrentDriver++) { - xorgHWFlags flags; Bool found_screen; DriverRec *const drv = xf86DriverList[CurrentDriver]; - if (!xorgHWAccess) { - if (!drv->driverFunc - || !drv->driverFunc(NULL, GET_REQUIRED_HW_INTERFACES, &flags) - || NEED_IO_ENABLED(flags)) - continue; - } - found_screen = xf86CallDriverProbe(drv, TRUE); if (found_screen && drv->Identify) { (*drv->Identify) (0); diff --git a/xserver/hw/xfree86/common/xf86Cursor.c b/xserver/hw/xfree86/common/xf86Cursor.c index 3716434f0..65a9e8264 100644 --- a/xserver/hw/xfree86/common/xf86Cursor.c +++ b/xserver/hw/xfree86/common/xf86Cursor.c @@ -66,7 +66,7 @@ static Bool xf86CursorOffScreen(ScreenPtr *pScreen, int *x, int *y); static void xf86CrossScreen(ScreenPtr pScreen, Bool entering); static void xf86WarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y); -static void xf86PointerMoved(int scrnIndex, int x, int y); +static void xf86PointerMoved(ScrnInfoPtr pScrn, int x, int y); static miPointerScreenFuncRec xf86PointerScreenFuncs = { xf86CursorOffScreen, @@ -133,16 +133,15 @@ xf86InitViewport(ScrnInfoPtr pScr) void xf86SetViewport(ScreenPtr pScreen, int x, int y) { - ScrnInfoPtr pScr = XF86SCRNINFO(pScreen); + ScrnInfoPtr pScr = xf86ScreenToScrn(pScreen); - (*pScr->PointerMoved) (pScreen->myNum, x, y); + (*pScr->PointerMoved) (pScr, x, y); } static void -xf86PointerMoved(int scrnIndex, int x, int y) +xf86PointerMoved(ScrnInfoPtr pScr, int x, int y) { Bool frameChanged = FALSE; - ScrnInfoPtr pScr = xf86Screens[scrnIndex]; /* * check wether (x,y) belongs to the visual part of the screen @@ -173,7 +172,7 @@ xf86PointerMoved(int scrnIndex, int x, int y) } if (frameChanged && pScr->AdjustFrame != NULL) - pScr->AdjustFrame(pScr->scrnIndex, pScr->frameX0, pScr->frameY0, 0); + pScr->AdjustFrame(pScr, pScr->frameX0, pScr->frameY0); } /* @@ -184,7 +183,8 @@ xf86PointerMoved(int scrnIndex, int x, int y) void xf86LockZoom(ScreenPtr pScreen, Bool lock) { - XF86SCRNINFO(pScreen)->zoomLocked = lock; + ScrnInfoPtr pScr = xf86ScreenToScrn(pScreen); + pScr->zoomLocked = lock; } /* @@ -196,10 +196,10 @@ xf86LockZoom(ScreenPtr pScreen, Bool lock) Bool xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode) { - ScrnInfoPtr pScr = XF86SCRNINFO(pScreen); + ScrnInfoPtr pScr = xf86ScreenToScrn(pScreen); ScreenPtr pCursorScreen; Bool Switched; - int px, py, was_blocked; + int px, py; DeviceIntPtr dev, it; if (!pScr->vtSema || !mode || !pScr->SwitchMode) @@ -228,8 +228,8 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode) if (pScreen == pCursorScreen) miPointerGetPosition(dev, &px, &py); - was_blocked = xf86BlockSIGIO(); - Switched = (*pScr->SwitchMode) (pScr->scrnIndex, mode, 0); + OsBlockSIGIO(); + Switched = (*pScr->SwitchMode) (pScr, mode); if (Switched) { pScr->currentMode = mode; @@ -267,10 +267,10 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode) pScr->frameY1 = pScr->virtualY - 1; } } - xf86UnblockSIGIO(was_blocked); + OsReleaseSIGIO(); if (pScr->AdjustFrame) - (*pScr->AdjustFrame) (pScr->scrnIndex, pScr->frameX0, pScr->frameY0, 0); + (*pScr->AdjustFrame) (pScr, pScr->frameX0, pScr->frameY0); /* The original code centered the frame around the cursor if possible. * Since this is hard to achieve with multiple cursors, we do the following: @@ -316,7 +316,7 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode) void xf86ZoomViewport(ScreenPtr pScreen, int zoom) { - ScrnInfoPtr pScr = XF86SCRNINFO(pScreen); + ScrnInfoPtr pScr = xf86ScreenToScrn(pScreen); DisplayModePtr mode; if (pScr->zoomLocked || !(mode = pScr->currentMode)) @@ -469,13 +469,11 @@ xf86CrossScreen(ScreenPtr pScreen, Bool entering) static void xf86WarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) { - int sigstate; - - sigstate = xf86BlockSIGIO(); + OsBlockSIGIO(); miPointerWarpCursor(pDev, pScreen, x, y); xf86Info.currentScreen = pScreen; - xf86UnblockSIGIO(sigstate); + OsReleaseSIGIO(); } void * diff --git a/xserver/hw/xfree86/common/xf86DGA.c b/xserver/hw/xfree86/common/xf86DGA.c index 316978cfa..6a05ce536 100644 --- a/xserver/hw/xfree86/common/xf86DGA.c +++ b/xserver/hw/xfree86/common/xf86DGA.c @@ -1,4 +1,6 @@ /* + * Copyright (c) 1995 Jon Tombs + * Copyright (c) 1995, 1996, 1999 XFree86 Inc * Copyright (c) 1998-2002 by The XFree86 Project, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -27,10 +29,20 @@ * Written by Mark Vojkovich */ +/* + * This is quite literally just two files glued together: + * hw/xfree86/common/xf86DGA.c is the first part, and + * hw/xfree86/dixmods/extmod/xf86dga2.c is the second part. One day, if + * someone actually cares about DGA, it'd be nice to clean this up. But trust + * me, I am not that person. + */ + #ifdef HAVE_XORG_CONFIG_H #include #endif +#include +#include #include "xf86.h" #include "xf86str.h" #include "xf86Priv.h" @@ -48,15 +60,30 @@ #include "exevents.h" #include "eventstr.h" #include "eventconvert.h" +#include "xf86Extensions.h" #include "mi.h" +#include "misc.h" +#include "dixstruct.h" +#include "dixevents.h" +#include "extnsionst.h" +#include "cursorstr.h" +#include "scrnintstr.h" +#include "swaprep.h" +#include "dgaproc.h" +#include "protocol-versions.h" + +#include + +#define DGA_PROTOCOL_OLD_SUPPORT 1 + static DevPrivateKeyRec DGAScreenKeyRec; #define DGAScreenKeyRegistered dixPrivateKeyRegistered(&DGAScreenKeyRec) static Bool mieq_installed; -static Bool DGACloseScreen(int i, ScreenPtr pScreen); +static Bool DGACloseScreen(ScreenPtr pScreen); static void DGADestroyColormap(ColormapPtr pmap); static void DGAInstallColormap(ColormapPtr pmap); static void DGAUninstallColormap(ColormapPtr pmap); @@ -66,7 +93,9 @@ static void DGAHandleEvent(int screen_num, InternalEvent *event, static void DGACopyModeInfo(DGAModePtr mode, XDGAModePtr xmode); -int *XDGAEventBase = NULL; +static unsigned char DGAReqCode = 0; +static int DGAErrorBase; +static int DGAEventBase; #define DGA_GET_SCREEN_PRIV(pScreen) ((DGAScreenPtr) \ dixLookupPrivate(&(pScreen)->devPrivates, &DGAScreenKeyRec)) @@ -100,7 +129,7 @@ typedef struct { Bool DGAInit(ScreenPtr pScreen, DGAFunctionPtr funcs, DGAModePtr modes, int num) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); DGAScreenPtr pScreenPriv; int i; @@ -235,7 +264,7 @@ FreeMarkedVisuals(ScreenPtr pScreen) } static Bool -DGACloseScreen(int i, ScreenPtr pScreen) +DGACloseScreen(ScreenPtr pScreen) { DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen); @@ -256,7 +285,7 @@ DGACloseScreen(int i, ScreenPtr pScreen) free(pScreenPriv); - return ((*pScreen->CloseScreen) (i, pScreen)); + return ((*pScreen->CloseScreen) (pScreen)); } static void @@ -323,11 +352,10 @@ DGAUninstallColormap(ColormapPtr pmap) } int -xf86SetDGAMode(int index, int num, DGADevicePtr devRet) +xf86SetDGAMode(ScrnInfoPtr pScrn, int num, DGADevicePtr devRet) { - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); DGAScreenPtr pScreenPriv; - ScrnInfoPtr pScrn; DGADevicePtr device; PixmapPtr pPix = NULL; DGAModePtr pMode = NULL; @@ -338,7 +366,6 @@ xf86SetDGAMode(int index, int num, DGADevicePtr devRet) pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen); if (!pScreenPriv) return BadValue; - pScrn = pScreenPriv->pScrn; if (!num) { if (pScreenPriv->current) { @@ -359,7 +386,7 @@ xf86SetDGAMode(int index, int num, DGADevicePtr devRet) pScreenPriv->savedColormap = NULL; } pScreenPriv->dgaColormap = NULL; - (*pScrn->EnableDisableFBAccess) (index, TRUE); + (*pScrn->EnableDisableFBAccess) (pScrn, TRUE); FreeMarkedVisuals(pScreen); } @@ -385,7 +412,7 @@ xf86SetDGAMode(int index, int num, DGADevicePtr devRet) Bool oldVTSema = pScrn->vtSema; pScrn->vtSema = FALSE; /* kludge until we rewrite VT switching */ - (*pScrn->EnableDisableFBAccess) (index, FALSE); + (*pScrn->EnableDisableFBAccess) (pScrn, FALSE); pScrn->vtSema = oldVTSema; } @@ -523,17 +550,26 @@ DGAChangePixmapMode(int index, int *x, int *y, int mode) } Bool -DGAAvailable(int index) +DGAScreenAvailable(ScreenPtr pScreen) { if (!DGAScreenKeyRegistered) return FALSE; - if (DGA_GET_SCREEN_PRIV(screenInfo.screens[index])) + if (DGA_GET_SCREEN_PRIV(pScreen)) return TRUE; - return FALSE; } +Bool +DGAAvailable(int index) +{ + ScreenPtr pScreen; + + assert(index < MAXSCREENS); + pScreen = screenInfo.screens[index]; + return DGAScreenAvailable(pScreen); +} + Bool DGAActive(int index) { @@ -564,7 +600,7 @@ DGAShutdown(void) for (i = 0; i < screenInfo.numScreens; i++) { pScrn = xf86Screens[i]; - (void) (*pScrn->SetDGAMode) (pScrn->scrnIndex, 0, NULL); + (void) (*pScrn->SetDGAMode) (pScrn, 0, NULL); } } @@ -579,7 +615,7 @@ DGASetMode(int index, int num, XDGAModePtr mode, PixmapPtr *pPix) /* We rely on the extension to check that DGA is available */ - ret = (*pScrn->SetDGAMode) (index, num, &device); + ret = (*pScrn->SetDGAMode) (pScrn, num, &device); if ((ret == Success) && num) { DGACopyModeInfo(device.mode, mode); *pPix = device.pPix; @@ -893,15 +929,16 @@ DGAStealKeyEvent(DeviceIntPtr dev, int index, int key_code, int is_down) if (!pScreenPriv || !pScreenPriv->grabKeyboard) /* no direct mode */ return FALSE; - memset(&event, 0, sizeof(event)); - event.header = ET_Internal; - event.type = ET_DGAEvent; - event.length = sizeof(event); - event.time = GetTimeInMillis(); - event.subtype = (is_down ? ET_KeyPress : ET_KeyRelease); - event.detail = key_code; - event.dx = 0; - event.dy = 0; + event = (DGAEvent) { + .header = ET_Internal, + .type = ET_DGAEvent, + .length = sizeof(event), + .time = GetTimeInMillis(), + .subtype = (is_down ? ET_KeyPress : ET_KeyRelease), + .detail = key_code, + .dx = 0, + .dy = 0 + }; mieqEnqueue(dev, (InternalEvent *) &event); return TRUE; @@ -921,15 +958,16 @@ DGAStealMotionEvent(DeviceIntPtr dev, int index, int dx, int dy) if (!pScreenPriv || !pScreenPriv->grabMouse) /* no direct mode */ return FALSE; - memset(&event, 0, sizeof(event)); - event.header = ET_Internal; - event.type = ET_DGAEvent; - event.length = sizeof(event); - event.time = GetTimeInMillis(); - event.subtype = ET_Motion; - event.detail = 0; - event.dx = dx; - event.dy = dy; + event = (DGAEvent) { + .header = ET_Internal, + .type = ET_DGAEvent, + .length = sizeof(event), + .time = GetTimeInMillis(), + .subtype = ET_Motion, + .detail = 0, + .dx = dx, + .dy = dy + }; mieqEnqueue(dev, (InternalEvent *) &event); return TRUE; } @@ -948,15 +986,16 @@ DGAStealButtonEvent(DeviceIntPtr dev, int index, int button, int is_down) if (!pScreenPriv || !pScreenPriv->grabMouse) return FALSE; - memset(&event, 0, sizeof(event)); - event.header = ET_Internal; - event.type = ET_DGAEvent; - event.length = sizeof(event); - event.time = GetTimeInMillis(); - event.subtype = (is_down ? ET_ButtonPress : ET_ButtonRelease); - event.detail = button; - event.dx = 0; - event.dy = 0; + event = (DGAEvent) { + .header = ET_Internal, + .type = ET_DGAEvent, + .length = sizeof(event), + .time = GetTimeInMillis(), + .subtype = (is_down ? ET_ButtonPress : ET_ButtonRelease), + .detail = button, + .dx = 0, + .dy = 0 + }; mieqEnqueue(dev, (InternalEvent *) &event); return TRUE; @@ -981,33 +1020,35 @@ DGAProcessKeyboardEvent(ScreenPtr pScreen, DGAEvent * event, DeviceIntPtr keybd) KeyClassPtr keyc = keybd->key; DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen); DeviceIntPtr pointer = GetMaster(keybd, POINTER_OR_FLOAT); - DeviceEvent ev; - - memset(&ev, 0, sizeof(ev)); - ev.header = ET_Internal; - ev.length = sizeof(ev); - ev.detail.key = event->detail; - ev.type = event->subtype; - ev.root_x = 0; - ev.root_y = 0; - ev.corestate = XkbStateFieldFromRec(&keyc->xkbInfo->state); + DeviceEvent ev = { + .header = ET_Internal, + .length = sizeof(ev), + .detail.key = event->detail, + .type = event->subtype, + .root_x = 0, + .root_y = 0, + .corestate = XkbStateFieldFromRec(&keyc->xkbInfo->state) + }; ev.corestate |= pointer->button->state; UpdateDeviceState(keybd, &ev); + if (!IsMaster(keybd)) + return; + /* * Deliver the DGA event */ if (pScreenPriv->client) { - dgaEvent de; - - de.u.u.type = *XDGAEventBase + GetCoreType(ev.type); + dgaEvent de = { + .u.event.time = event->time, + .u.event.dx = event->dx, + .u.event.dy = event->dy, + .u.event.screen = pScreen->myNum, + .u.event.state = ev.corestate + }; + de.u.u.type = DGAEventBase + GetCoreType(ev.type); de.u.u.detail = event->detail; - de.u.event.time = event->time; - de.u.event.dx = event->dx; - de.u.event.dy = event->dy; - de.u.event.screen = pScreen->myNum; - de.u.event.state = ev.corestate; /* If the DGA client has selected input, then deliver based on the usual filter */ TryClientEvents(pScreenPriv->client, keybd, (xEvent *) &de, 1, @@ -1032,35 +1073,37 @@ DGAProcessPointerEvent(ScreenPtr pScreen, DGAEvent * event, DeviceIntPtr mouse) { ButtonClassPtr butc = mouse->button; DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen); - DeviceEvent ev; DeviceIntPtr master = GetMaster(mouse, MASTER_KEYBOARD); + DeviceEvent ev = { + .header = ET_Internal, + .length = sizeof(ev), + .detail.key = event->detail, + .type = event->subtype, + .corestate = butc ? butc->state : 0 + }; - memset(&ev, 0, sizeof(ev)); - ev.header = ET_Internal; - ev.length = sizeof(ev); - ev.type = event->subtype; - ev.corestate = butc ? butc->state : 0; if (master && master->key) ev.corestate |= XkbStateFieldFromRec(&master->key->xkbInfo->state); UpdateDeviceState(mouse, &ev); + if (!IsMaster(mouse)) + return; + /* * Deliver the DGA event */ if (pScreenPriv->client) { - dgaEvent de; - int coreEquiv; - - coreEquiv = GetCoreType(ev.type); - - de.u.u.type = *XDGAEventBase + coreEquiv; + int coreEquiv = GetCoreType(ev.type); + dgaEvent de = { + .u.event.time = event->time, + .u.event.dx = event->dx, + .u.event.dy = event->dy, + .u.event.screen = pScreen->myNum, + .u.event.state = ev.corestate + }; + de.u.u.type = DGAEventBase + coreEquiv; de.u.u.detail = event->detail; - de.u.event.time = event->time; - de.u.event.dx = event->dx; - de.u.event.dy = event->dy; - de.u.event.screen = pScreen->myNum; - de.u.event.state = ev.corestate; /* If the DGA client has selected input, then deliver based on the usual filter */ TryClientEvents(pScreenPriv->client, mouse, (xEvent *) &de, 1, @@ -1146,17 +1189,14 @@ DGAHandleEvent(int screen_num, InternalEvent *ev, DeviceIntPtr device) DGAScreenPtr pScreenPriv; /* no DGA */ - if (!DGAScreenKeyRegistered || XDGAEventBase == 0) - return; + if (!DGAScreenKeyRegistered || noXFree86DGAExtension) + return; pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen); /* DGA not initialized on this screen */ if (!pScreenPriv) return; - if (!IsMaster(device)) - return; - switch (event->subtype) { case KeyPress: case KeyRelease: @@ -1171,3 +1211,989 @@ DGAHandleEvent(int screen_num, InternalEvent *ev, DeviceIntPtr device) break; } } + +static void XDGAResetProc(ExtensionEntry * extEntry); + +static void DGAClientStateChange(CallbackListPtr *, pointer, pointer); + +static DevPrivateKeyRec DGAScreenPrivateKeyRec; + +#define DGAScreenPrivateKey (&DGAScreenPrivateKeyRec) +#define DGAScreenPrivateKeyRegistered (DGAScreenPrivateKeyRec.initialized) +static DevPrivateKeyRec DGAClientPrivateKeyRec; + +#define DGAClientPrivateKey (&DGAClientPrivateKeyRec) +static int DGACallbackRefCount = 0; + +/* This holds the client's version information */ +typedef struct { + int major; + int minor; +} DGAPrivRec, *DGAPrivPtr; + +#define DGA_GETCLIENT(idx) ((ClientPtr) \ + dixLookupPrivate(&screenInfo.screens[idx]->devPrivates, DGAScreenPrivateKey)) +#define DGA_SETCLIENT(idx,p) \ + dixSetPrivate(&screenInfo.screens[idx]->devPrivates, DGAScreenPrivateKey, p) + +#define DGA_GETPRIV(c) ((DGAPrivPtr) \ + dixLookupPrivate(&(c)->devPrivates, DGAClientPrivateKey)) +#define DGA_SETPRIV(c,p) \ + dixSetPrivate(&(c)->devPrivates, DGAClientPrivateKey, p) + +static void +XDGAResetProc(ExtensionEntry * extEntry) +{ + DeleteCallback(&ClientStateCallback, DGAClientStateChange, NULL); + DGACallbackRefCount = 0; +} + +static int +ProcXDGAQueryVersion(ClientPtr client) +{ + xXDGAQueryVersionReply rep; + + REQUEST_SIZE_MATCH(xXDGAQueryVersionReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + rep.majorVersion = SERVER_XDGA_MAJOR_VERSION; + rep.minorVersion = SERVER_XDGA_MINOR_VERSION; + + WriteToClient(client, sizeof(xXDGAQueryVersionReply), (char *) &rep); + return Success; +} + +static int +ProcXDGAOpenFramebuffer(ClientPtr client) +{ + REQUEST(xXDGAOpenFramebufferReq); + xXDGAOpenFramebufferReply rep; + char *deviceName; + int nameSize; + + if (stuff->screen >= screenInfo.numScreens) + return BadValue; + + if (!DGAAvailable(stuff->screen)) + return DGAErrorBase + XF86DGANoDirectVideoMode; + + REQUEST_SIZE_MATCH(xXDGAOpenFramebufferReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + + if (!DGAOpenFramebuffer(stuff->screen, &deviceName, + (unsigned char **) (&rep.mem1), + (int *) &rep.size, (int *) &rep.offset, + (int *) &rep.extra)) { + return BadAlloc; + } + + nameSize = deviceName ? (strlen(deviceName) + 1) : 0; + rep.length = bytes_to_int32(nameSize); + + WriteToClient(client, sizeof(xXDGAOpenFramebufferReply), (char *) &rep); + if (rep.length) + WriteToClient(client, nameSize, deviceName); + + return Success; +} + +static int +ProcXDGACloseFramebuffer(ClientPtr client) +{ + REQUEST(xXDGACloseFramebufferReq); + + if (stuff->screen >= screenInfo.numScreens) + return BadValue; + + if (!DGAAvailable(stuff->screen)) + return DGAErrorBase + XF86DGANoDirectVideoMode; + + REQUEST_SIZE_MATCH(xXDGACloseFramebufferReq); + + DGACloseFramebuffer(stuff->screen); + + return Success; +} + +static int +ProcXDGAQueryModes(ClientPtr client) +{ + int i, num, size; + + REQUEST(xXDGAQueryModesReq); + xXDGAQueryModesReply rep; + xXDGAModeInfo info; + XDGAModePtr mode; + + if (stuff->screen >= screenInfo.numScreens) + return BadValue; + + REQUEST_SIZE_MATCH(xXDGAQueryModesReq); + rep.type = X_Reply; + rep.length = 0; + rep.number = 0; + rep.sequenceNumber = client->sequence; + + if (!DGAAvailable(stuff->screen)) { + rep.number = 0; + rep.length = 0; + WriteToClient(client, sz_xXDGAQueryModesReply, (char *) &rep); + return Success; + } + + if (!(num = DGAGetModes(stuff->screen))) { + WriteToClient(client, sz_xXDGAQueryModesReply, (char *) &rep); + return Success; + } + + if (!(mode = (XDGAModePtr) malloc(num * sizeof(XDGAModeRec)))) + return BadAlloc; + + for (i = 0; i < num; i++) + DGAGetModeInfo(stuff->screen, mode + i, i + 1); + + size = num * sz_xXDGAModeInfo; + for (i = 0; i < num; i++) + size += pad_to_int32(strlen(mode[i].name) + 1); /* plus NULL */ + + rep.number = num; + rep.length = bytes_to_int32(size); + + WriteToClient(client, sz_xXDGAQueryModesReply, (char *) &rep); + + for (i = 0; i < num; i++) { + size = strlen(mode[i].name) + 1; + + info.byte_order = mode[i].byteOrder; + info.depth = mode[i].depth; + info.num = mode[i].num; + info.bpp = mode[i].bitsPerPixel; + info.name_size = (size + 3) & ~3L; + info.vsync_num = mode[i].VSync_num; + info.vsync_den = mode[i].VSync_den; + info.flags = mode[i].flags; + info.image_width = mode[i].imageWidth; + info.image_height = mode[i].imageHeight; + info.pixmap_width = mode[i].pixmapWidth; + info.pixmap_height = mode[i].pixmapHeight; + info.bytes_per_scanline = mode[i].bytesPerScanline; + info.red_mask = mode[i].red_mask; + info.green_mask = mode[i].green_mask; + info.blue_mask = mode[i].blue_mask; + info.visual_class = mode[i].visualClass; + info.viewport_width = mode[i].viewportWidth; + info.viewport_height = mode[i].viewportHeight; + info.viewport_xstep = mode[i].xViewportStep; + info.viewport_ystep = mode[i].yViewportStep; + info.viewport_xmax = mode[i].maxViewportX; + info.viewport_ymax = mode[i].maxViewportY; + info.viewport_flags = mode[i].viewportFlags; + info.reserved1 = mode[i].reserved1; + info.reserved2 = mode[i].reserved2; + + WriteToClient(client, sz_xXDGAModeInfo, (char *) (&info)); + WriteToClient(client, size, mode[i].name); + } + + free(mode); + + return Success; +} + +static void +DGAClientStateChange(CallbackListPtr *pcbl, pointer nulldata, pointer calldata) +{ + NewClientInfoRec *pci = (NewClientInfoRec *) calldata; + ClientPtr client = NULL; + int i; + + for (i = 0; i < screenInfo.numScreens; i++) { + if (DGA_GETCLIENT(i) == pci->client) { + client = pci->client; + break; + } + } + + if (client && + ((client->clientState == ClientStateGone) || + (client->clientState == ClientStateRetained))) { + XDGAModeRec mode; + PixmapPtr pPix; + + DGA_SETCLIENT(i, NULL); + DGASelectInput(i, NULL, 0); + DGASetMode(i, 0, &mode, &pPix); + + if (--DGACallbackRefCount == 0) + DeleteCallback(&ClientStateCallback, DGAClientStateChange, NULL); + } +} + +static int +ProcXDGASetMode(ClientPtr client) +{ + REQUEST(xXDGASetModeReq); + xXDGASetModeReply rep; + XDGAModeRec mode; + xXDGAModeInfo info; + PixmapPtr pPix; + ClientPtr owner; + int size; + + if (stuff->screen >= screenInfo.numScreens) + return BadValue; + owner = DGA_GETCLIENT(stuff->screen); + + REQUEST_SIZE_MATCH(xXDGASetModeReq); + rep.type = X_Reply; + rep.length = 0; + rep.offset = 0; + rep.flags = 0; + rep.sequenceNumber = client->sequence; + + if (!DGAAvailable(stuff->screen)) + return DGAErrorBase + XF86DGANoDirectVideoMode; + + if (owner && owner != client) + return DGAErrorBase + XF86DGANoDirectVideoMode; + + if (!stuff->mode) { + if (owner) { + if (--DGACallbackRefCount == 0) + DeleteCallback(&ClientStateCallback, DGAClientStateChange, + NULL); + } + DGA_SETCLIENT(stuff->screen, NULL); + DGASelectInput(stuff->screen, NULL, 0); + DGASetMode(stuff->screen, 0, &mode, &pPix); + WriteToClient(client, sz_xXDGASetModeReply, (char *) &rep); + return Success; + } + + if (Success != DGASetMode(stuff->screen, stuff->mode, &mode, &pPix)) + return BadValue; + + if (!owner) { + if (DGACallbackRefCount++ == 0) + AddCallback(&ClientStateCallback, DGAClientStateChange, NULL); + } + + DGA_SETCLIENT(stuff->screen, client); + + if (pPix) { + if (AddResource(stuff->pid, RT_PIXMAP, (pointer) (pPix))) { + pPix->drawable.id = (int) stuff->pid; + rep.flags = DGA_PIXMAP_AVAILABLE; + } + } + + size = strlen(mode.name) + 1; + + info.byte_order = mode.byteOrder; + info.depth = mode.depth; + info.num = mode.num; + info.bpp = mode.bitsPerPixel; + info.name_size = (size + 3) & ~3L; + info.vsync_num = mode.VSync_num; + info.vsync_den = mode.VSync_den; + info.flags = mode.flags; + info.image_width = mode.imageWidth; + info.image_height = mode.imageHeight; + info.pixmap_width = mode.pixmapWidth; + info.pixmap_height = mode.pixmapHeight; + info.bytes_per_scanline = mode.bytesPerScanline; + info.red_mask = mode.red_mask; + info.green_mask = mode.green_mask; + info.blue_mask = mode.blue_mask; + info.visual_class = mode.visualClass; + info.viewport_width = mode.viewportWidth; + info.viewport_height = mode.viewportHeight; + info.viewport_xstep = mode.xViewportStep; + info.viewport_ystep = mode.yViewportStep; + info.viewport_xmax = mode.maxViewportX; + info.viewport_ymax = mode.maxViewportY; + info.viewport_flags = mode.viewportFlags; + info.reserved1 = mode.reserved1; + info.reserved2 = mode.reserved2; + + rep.length = bytes_to_int32(sz_xXDGAModeInfo + info.name_size); + + WriteToClient(client, sz_xXDGASetModeReply, (char *) &rep); + WriteToClient(client, sz_xXDGAModeInfo, (char *) (&info)); + WriteToClient(client, size, mode.name); + + return Success; +} + +static int +ProcXDGASetViewport(ClientPtr client) +{ + REQUEST(xXDGASetViewportReq); + + if (stuff->screen >= screenInfo.numScreens) + return BadValue; + + if (DGA_GETCLIENT(stuff->screen) != client) + return DGAErrorBase + XF86DGADirectNotActivated; + + REQUEST_SIZE_MATCH(xXDGASetViewportReq); + + DGASetViewport(stuff->screen, stuff->x, stuff->y, stuff->flags); + + return Success; +} + +static int +ProcXDGAInstallColormap(ClientPtr client) +{ + ColormapPtr cmap; + int rc; + + REQUEST(xXDGAInstallColormapReq); + + if (stuff->screen >= screenInfo.numScreens) + return BadValue; + + if (DGA_GETCLIENT(stuff->screen) != client) + return DGAErrorBase + XF86DGADirectNotActivated; + + REQUEST_SIZE_MATCH(xXDGAInstallColormapReq); + + rc = dixLookupResourceByType((pointer *) &cmap, stuff->cmap, RT_COLORMAP, + client, DixInstallAccess); + if (rc != Success) + return rc; + DGAInstallCmap(cmap); + return Success; +} + +static int +ProcXDGASelectInput(ClientPtr client) +{ + REQUEST(xXDGASelectInputReq); + + if (stuff->screen >= screenInfo.numScreens) + return BadValue; + + if (DGA_GETCLIENT(stuff->screen) != client) + return DGAErrorBase + XF86DGADirectNotActivated; + + REQUEST_SIZE_MATCH(xXDGASelectInputReq); + + if (DGA_GETCLIENT(stuff->screen) == client) + DGASelectInput(stuff->screen, client, stuff->mask); + + return Success; +} + +static int +ProcXDGAFillRectangle(ClientPtr client) +{ + REQUEST(xXDGAFillRectangleReq); + + if (stuff->screen >= screenInfo.numScreens) + return BadValue; + + if (DGA_GETCLIENT(stuff->screen) != client) + return DGAErrorBase + XF86DGADirectNotActivated; + + REQUEST_SIZE_MATCH(xXDGAFillRectangleReq); + + if (Success != DGAFillRect(stuff->screen, stuff->x, stuff->y, + stuff->width, stuff->height, stuff->color)) + return BadMatch; + + return Success; +} + +static int +ProcXDGACopyArea(ClientPtr client) +{ + REQUEST(xXDGACopyAreaReq); + + if (stuff->screen >= screenInfo.numScreens) + return BadValue; + + if (DGA_GETCLIENT(stuff->screen) != client) + return DGAErrorBase + XF86DGADirectNotActivated; + + REQUEST_SIZE_MATCH(xXDGACopyAreaReq); + + if (Success != DGABlitRect(stuff->screen, stuff->srcx, stuff->srcy, + stuff->width, stuff->height, stuff->dstx, + stuff->dsty)) + return BadMatch; + + return Success; +} + +static int +ProcXDGACopyTransparentArea(ClientPtr client) +{ + REQUEST(xXDGACopyTransparentAreaReq); + + if (stuff->screen >= screenInfo.numScreens) + return BadValue; + + if (DGA_GETCLIENT(stuff->screen) != client) + return DGAErrorBase + XF86DGADirectNotActivated; + + REQUEST_SIZE_MATCH(xXDGACopyTransparentAreaReq); + + if (Success != DGABlitTransRect(stuff->screen, stuff->srcx, stuff->srcy, + stuff->width, stuff->height, stuff->dstx, + stuff->dsty, stuff->key)) + return BadMatch; + + return Success; +} + +static int +ProcXDGAGetViewportStatus(ClientPtr client) +{ + REQUEST(xXDGAGetViewportStatusReq); + xXDGAGetViewportStatusReply rep; + + if (stuff->screen >= screenInfo.numScreens) + return BadValue; + + if (DGA_GETCLIENT(stuff->screen) != client) + return DGAErrorBase + XF86DGADirectNotActivated; + + REQUEST_SIZE_MATCH(xXDGAGetViewportStatusReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + + rep.status = DGAGetViewportStatus(stuff->screen); + + WriteToClient(client, sizeof(xXDGAGetViewportStatusReply), (char *) &rep); + return Success; +} + +static int +ProcXDGASync(ClientPtr client) +{ + REQUEST(xXDGASyncReq); + xXDGASyncReply rep; + + if (stuff->screen >= screenInfo.numScreens) + return BadValue; + + if (DGA_GETCLIENT(stuff->screen) != client) + return DGAErrorBase + XF86DGADirectNotActivated; + + REQUEST_SIZE_MATCH(xXDGASyncReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + + DGASync(stuff->screen); + + WriteToClient(client, sizeof(xXDGASyncReply), (char *) &rep); + return Success; +} + +static int +ProcXDGASetClientVersion(ClientPtr client) +{ + REQUEST(xXDGASetClientVersionReq); + + DGAPrivPtr pPriv; + + REQUEST_SIZE_MATCH(xXDGASetClientVersionReq); + if ((pPriv = DGA_GETPRIV(client)) == NULL) { + pPriv = malloc(sizeof(DGAPrivRec)); + /* XXX Need to look into freeing this */ + if (!pPriv) + return BadAlloc; + DGA_SETPRIV(client, pPriv); + } + pPriv->major = stuff->major; + pPriv->minor = stuff->minor; + + return Success; +} + +static int +ProcXDGAChangePixmapMode(ClientPtr client) +{ + REQUEST(xXDGAChangePixmapModeReq); + xXDGAChangePixmapModeReply rep; + int x, y; + + if (stuff->screen >= screenInfo.numScreens) + return BadValue; + + if (DGA_GETCLIENT(stuff->screen) != client) + return DGAErrorBase + XF86DGADirectNotActivated; + + REQUEST_SIZE_MATCH(xXDGAChangePixmapModeReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + + x = stuff->x; + y = stuff->y; + + if (!DGAChangePixmapMode(stuff->screen, &x, &y, stuff->flags)) + return BadMatch; + + rep.x = x; + rep.y = y; + WriteToClient(client, sizeof(xXDGAChangePixmapModeReply), (char *) &rep); + + return Success; +} + +static int +ProcXDGACreateColormap(ClientPtr client) +{ + REQUEST(xXDGACreateColormapReq); + int result; + + if (stuff->screen >= screenInfo.numScreens) + return BadValue; + + if (DGA_GETCLIENT(stuff->screen) != client) + return DGAErrorBase + XF86DGADirectNotActivated; + + REQUEST_SIZE_MATCH(xXDGACreateColormapReq); + + if (!stuff->mode) + return BadValue; + + result = DGACreateColormap(stuff->screen, client, stuff->id, + stuff->mode, stuff->alloc); + if (result != Success) + return result; + + return Success; +} + +/* + * + * Support for the old DGA protocol, used to live in xf86dga.c + * + */ + +#ifdef DGA_PROTOCOL_OLD_SUPPORT + +static int +ProcXF86DGAGetVideoLL(ClientPtr client) +{ + REQUEST(xXF86DGAGetVideoLLReq); + xXF86DGAGetVideoLLReply rep; + XDGAModeRec mode; + int num, offset, flags; + char *name; + + if (stuff->screen >= screenInfo.numScreens) + return BadValue; + + REQUEST_SIZE_MATCH(xXF86DGAGetVideoLLReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + + if (!DGAAvailable(stuff->screen)) + return DGAErrorBase + XF86DGANoDirectVideoMode; + + if (!(num = DGAGetOldDGAMode(stuff->screen))) + return DGAErrorBase + XF86DGANoDirectVideoMode; + + /* get the parameters for the mode that best matches */ + DGAGetModeInfo(stuff->screen, &mode, num); + + if (!DGAOpenFramebuffer(stuff->screen, &name, + (unsigned char **) (&rep.offset), + (int *) (&rep.bank_size), &offset, &flags)) + return BadAlloc; + + rep.offset += mode.offset; + rep.width = mode.bytesPerScanline / (mode.bitsPerPixel >> 3); + rep.ram_size = rep.bank_size >> 10; + + WriteToClient(client, SIZEOF(xXF86DGAGetVideoLLReply), (char *) &rep); + return Success; +} + +static int +ProcXF86DGADirectVideo(ClientPtr client) +{ + int num; + PixmapPtr pix; + XDGAModeRec mode; + ClientPtr owner; + + REQUEST(xXF86DGADirectVideoReq); + + if (stuff->screen >= screenInfo.numScreens) + return BadValue; + REQUEST_SIZE_MATCH(xXF86DGADirectVideoReq); + + if (!DGAAvailable(stuff->screen)) + return DGAErrorBase + XF86DGANoDirectVideoMode; + + owner = DGA_GETCLIENT(stuff->screen); + + if (owner && owner != client) + return DGAErrorBase + XF86DGANoDirectVideoMode; + + if (stuff->enable & XF86DGADirectGraphics) { + if (!(num = DGAGetOldDGAMode(stuff->screen))) + return DGAErrorBase + XF86DGANoDirectVideoMode; + } + else + num = 0; + + if (Success != DGASetMode(stuff->screen, num, &mode, &pix)) + return DGAErrorBase + XF86DGAScreenNotActive; + + DGASetInputMode(stuff->screen, + (stuff->enable & XF86DGADirectKeyb) != 0, + (stuff->enable & XF86DGADirectMouse) != 0); + + /* We need to track the client and attach the teardown callback */ + if (stuff->enable & + (XF86DGADirectGraphics | XF86DGADirectKeyb | XF86DGADirectMouse)) { + if (!owner) { + if (DGACallbackRefCount++ == 0) + AddCallback(&ClientStateCallback, DGAClientStateChange, NULL); + } + + DGA_SETCLIENT(stuff->screen, client); + } + else { + if (owner) { + if (--DGACallbackRefCount == 0) + DeleteCallback(&ClientStateCallback, DGAClientStateChange, + NULL); + } + + DGA_SETCLIENT(stuff->screen, NULL); + } + + return Success; +} + +static int +ProcXF86DGAGetViewPortSize(ClientPtr client) +{ + int num; + XDGAModeRec mode; + + REQUEST(xXF86DGAGetViewPortSizeReq); + xXF86DGAGetViewPortSizeReply rep; + + if (stuff->screen >= screenInfo.numScreens) + return BadValue; + + REQUEST_SIZE_MATCH(xXF86DGAGetViewPortSizeReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + + if (!DGAAvailable(stuff->screen)) + return DGAErrorBase + XF86DGANoDirectVideoMode; + + if (!(num = DGAGetOldDGAMode(stuff->screen))) + return DGAErrorBase + XF86DGANoDirectVideoMode; + + DGAGetModeInfo(stuff->screen, &mode, num); + + rep.width = mode.viewportWidth; + rep.height = mode.viewportHeight; + + WriteToClient(client, SIZEOF(xXF86DGAGetViewPortSizeReply), (char *) &rep); + return Success; +} + +static int +ProcXF86DGASetViewPort(ClientPtr client) +{ + REQUEST(xXF86DGASetViewPortReq); + + if (stuff->screen >= screenInfo.numScreens) + return BadValue; + + if (DGA_GETCLIENT(stuff->screen) != client) + return DGAErrorBase + XF86DGADirectNotActivated; + + REQUEST_SIZE_MATCH(xXF86DGASetViewPortReq); + + if (!DGAAvailable(stuff->screen)) + return DGAErrorBase + XF86DGANoDirectVideoMode; + + if (!DGAActive(stuff->screen)) + return DGAErrorBase + XF86DGADirectNotActivated; + + if (DGASetViewport(stuff->screen, stuff->x, stuff->y, DGA_FLIP_RETRACE) + != Success) + return DGAErrorBase + XF86DGADirectNotActivated; + + return Success; +} + +static int +ProcXF86DGAGetVidPage(ClientPtr client) +{ + REQUEST(xXF86DGAGetVidPageReq); + xXF86DGAGetVidPageReply rep; + + if (stuff->screen >= screenInfo.numScreens) + return BadValue; + + REQUEST_SIZE_MATCH(xXF86DGAGetVidPageReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + rep.vpage = 0; /* silently fail */ + + WriteToClient(client, SIZEOF(xXF86DGAGetVidPageReply), (char *) &rep); + return Success; +} + +static int +ProcXF86DGASetVidPage(ClientPtr client) +{ + REQUEST(xXF86DGASetVidPageReq); + + if (stuff->screen >= screenInfo.numScreens) + return BadValue; + + REQUEST_SIZE_MATCH(xXF86DGASetVidPageReq); + + /* silently fail */ + + return Success; +} + +static int +ProcXF86DGAInstallColormap(ClientPtr client) +{ + ColormapPtr pcmp; + int rc; + + REQUEST(xXF86DGAInstallColormapReq); + + if (stuff->screen >= screenInfo.numScreens) + return BadValue; + + if (DGA_GETCLIENT(stuff->screen) != client) + return DGAErrorBase + XF86DGADirectNotActivated; + + REQUEST_SIZE_MATCH(xXF86DGAInstallColormapReq); + + if (!DGAActive(stuff->screen)) + return DGAErrorBase + XF86DGADirectNotActivated; + + rc = dixLookupResourceByType((pointer *) &pcmp, stuff->id, RT_COLORMAP, + client, DixInstallAccess); + if (rc == Success) { + DGAInstallCmap(pcmp); + return Success; + } + else { + return rc; + } +} + +static int +ProcXF86DGAQueryDirectVideo(ClientPtr client) +{ + REQUEST(xXF86DGAQueryDirectVideoReq); + xXF86DGAQueryDirectVideoReply rep; + + if (stuff->screen >= screenInfo.numScreens) + return BadValue; + + REQUEST_SIZE_MATCH(xXF86DGAQueryDirectVideoReq); + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + rep.flags = 0; + + if (DGAAvailable(stuff->screen)) + rep.flags = XF86DGADirectPresent; + + WriteToClient(client, SIZEOF(xXF86DGAQueryDirectVideoReply), (char *) &rep); + return Success; +} + +static int +ProcXF86DGAViewPortChanged(ClientPtr client) +{ + REQUEST(xXF86DGAViewPortChangedReq); + xXF86DGAViewPortChangedReply rep; + + if (stuff->screen >= screenInfo.numScreens) + return BadValue; + + if (DGA_GETCLIENT(stuff->screen) != client) + return DGAErrorBase + XF86DGADirectNotActivated; + + REQUEST_SIZE_MATCH(xXF86DGAViewPortChangedReq); + + if (!DGAActive(stuff->screen)) + return DGAErrorBase + XF86DGADirectNotActivated; + + rep.type = X_Reply; + rep.length = 0; + rep.sequenceNumber = client->sequence; + rep.result = 1; + + WriteToClient(client, SIZEOF(xXF86DGAViewPortChangedReply), (char *) &rep); + return Success; +} + +#endif /* DGA_PROTOCOL_OLD_SUPPORT */ + +static int +SProcXDGADispatch(ClientPtr client) +{ + return DGAErrorBase + XF86DGAClientNotLocal; +} + +#if 0 +#define DGA_REQ_DEBUG +#endif + +#ifdef DGA_REQ_DEBUG +static char *dgaMinor[] = { + "QueryVersion", + "GetVideoLL", + "DirectVideo", + "GetViewPortSize", + "SetViewPort", + "GetVidPage", + "SetVidPage", + "InstallColormap", + "QueryDirectVideo", + "ViewPortChanged", + "10", + "11", + "QueryModes", + "SetMode", + "SetViewport", + "InstallColormap", + "SelectInput", + "FillRectangle", + "CopyArea", + "CopyTransparentArea", + "GetViewportStatus", + "Sync", + "OpenFramebuffer", + "CloseFramebuffer", + "SetClientVersion", + "ChangePixmapMode", + "CreateColormap", +}; +#endif + +static int +ProcXDGADispatch(ClientPtr client) +{ + REQUEST(xReq); + + if (!client->local) + return DGAErrorBase + XF86DGAClientNotLocal; + +#ifdef DGA_REQ_DEBUG + if (stuff->data <= X_XDGACreateColormap) + fprintf(stderr, " DGA %s\n", dgaMinor[stuff->data]); +#endif + + switch (stuff->data) { + /* + * DGA2 Protocol + */ + case X_XDGAQueryVersion: + return ProcXDGAQueryVersion(client); + case X_XDGAQueryModes: + return ProcXDGAQueryModes(client); + case X_XDGASetMode: + return ProcXDGASetMode(client); + case X_XDGAOpenFramebuffer: + return ProcXDGAOpenFramebuffer(client); + case X_XDGACloseFramebuffer: + return ProcXDGACloseFramebuffer(client); + case X_XDGASetViewport: + return ProcXDGASetViewport(client); + case X_XDGAInstallColormap: + return ProcXDGAInstallColormap(client); + case X_XDGASelectInput: + return ProcXDGASelectInput(client); + case X_XDGAFillRectangle: + return ProcXDGAFillRectangle(client); + case X_XDGACopyArea: + return ProcXDGACopyArea(client); + case X_XDGACopyTransparentArea: + return ProcXDGACopyTransparentArea(client); + case X_XDGAGetViewportStatus: + return ProcXDGAGetViewportStatus(client); + case X_XDGASync: + return ProcXDGASync(client); + case X_XDGASetClientVersion: + return ProcXDGASetClientVersion(client); + case X_XDGAChangePixmapMode: + return ProcXDGAChangePixmapMode(client); + case X_XDGACreateColormap: + return ProcXDGACreateColormap(client); + /* + * Old DGA Protocol + */ +#ifdef DGA_PROTOCOL_OLD_SUPPORT + case X_XF86DGAGetVideoLL: + return ProcXF86DGAGetVideoLL(client); + case X_XF86DGADirectVideo: + return ProcXF86DGADirectVideo(client); + case X_XF86DGAGetViewPortSize: + return ProcXF86DGAGetViewPortSize(client); + case X_XF86DGASetViewPort: + return ProcXF86DGASetViewPort(client); + case X_XF86DGAGetVidPage: + return ProcXF86DGAGetVidPage(client); + case X_XF86DGASetVidPage: + return ProcXF86DGASetVidPage(client); + case X_XF86DGAInstallColormap: + return ProcXF86DGAInstallColormap(client); + case X_XF86DGAQueryDirectVideo: + return ProcXF86DGAQueryDirectVideo(client); + case X_XF86DGAViewPortChanged: + return ProcXF86DGAViewPortChanged(client); +#endif /* DGA_PROTOCOL_OLD_SUPPORT */ + default: + return BadRequest; + } +} + +void +XFree86DGAExtensionInit(void) +{ + ExtensionEntry *extEntry; + + if (!dixRegisterPrivateKey(&DGAClientPrivateKeyRec, PRIVATE_CLIENT, 0)) + return; + + if (!dixRegisterPrivateKey(&DGAScreenPrivateKeyRec, PRIVATE_SCREEN, 0)) + return; + + if ((extEntry = AddExtension(XF86DGANAME, + XF86DGANumberEvents, + XF86DGANumberErrors, + ProcXDGADispatch, + SProcXDGADispatch, + XDGAResetProc, StandardMinorOpcode))) { + int i; + + DGAReqCode = (unsigned char) extEntry->base; + DGAErrorBase = extEntry->errorBase; + DGAEventBase = extEntry->eventBase; + for (i = KeyPress; i <= MotionNotify; i++) + SetCriticalEvent(DGAEventBase + i); + } +} diff --git a/xserver/hw/xfree86/common/xf86DPMS.c b/xserver/hw/xfree86/common/xf86DPMS.c index 75f034239..3f1e142c7 100644 --- a/xserver/hw/xfree86/common/xf86DPMS.c +++ b/xserver/hw/xfree86/common/xf86DPMS.c @@ -49,7 +49,7 @@ #ifdef DPMSExtension static DevPrivateKeyRec DPMSKeyRec; static DevPrivateKey DPMSKey; -static Bool DPMSClose(int i, ScreenPtr pScreen); +static Bool DPMSClose(ScreenPtr pScreen); static int DPMSCount = 0; #endif @@ -57,7 +57,7 @@ Bool xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags) { #ifdef DPMSExtension - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); DPMSPtr pDPMS; pointer DPMSOpt; MessageType enabled_from; @@ -99,10 +99,10 @@ xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags) #ifdef DPMSExtension static Bool -DPMSClose(int i, ScreenPtr pScreen) +DPMSClose(ScreenPtr pScreen) { DPMSPtr pDPMS; - + ScrnInfoPtr pScrn; /* This shouldn't happen */ if (DPMSKey == NULL) return FALSE; @@ -114,20 +114,33 @@ DPMSClose(int i, ScreenPtr pScreen) return FALSE; pScreen->CloseScreen = pDPMS->CloseScreen; - + pScrn = xf86ScreenToScrn(pScreen); /* * Turn on DPMS when shutting down. If this function can be used * depends on the order the driver wraps things. If this is called * after the driver has shut down everything the driver will have * to deal with this internally. */ - if (xf86Screens[i]->vtSema && xf86Screens[i]->DPMSSet) { - xf86Screens[i]->DPMSSet(xf86Screens[i], DPMSModeOn, 0); + if (pScrn->vtSema && pScrn->DPMSSet) { + pScrn->DPMSSet(pScrn, DPMSModeOn, 0); } if (--DPMSCount == 0) DPMSKey = NULL; - return pScreen->CloseScreen(i, pScreen); + return pScreen->CloseScreen(pScreen); +} + +static void +DPMSSetScreen(ScrnInfoPtr pScrn, int level) +{ + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); + DPMSPtr pDPMS = dixLookupPrivate(&pScreen->devPrivates, DPMSKey); + + if (pDPMS && pScrn->DPMSSet && pDPMS->Enabled && pScrn->vtSema) { + xf86VGAarbiterLock(pScrn); + pScrn->DPMSSet(pScrn, level, 0); + xf86VGAarbiterUnlock(pScrn); + } } /* @@ -139,8 +152,6 @@ int DPMSSet(ClientPtr client, int level) { int rc, i; - DPMSPtr pDPMS; - ScrnInfoPtr pScrn; DPMSPowerLevel = level; @@ -155,17 +166,23 @@ DPMSSet(ClientPtr client, int level) /* For each screen, set the DPMS level */ for (i = 0; i < xf86NumScreens; i++) { - pScrn = xf86Screens[i]; - pDPMS = dixLookupPrivate(&screenInfo.screens[i]->devPrivates, DPMSKey); - if (pDPMS && pScrn->DPMSSet && pDPMS->Enabled && pScrn->vtSema) { - xf86VGAarbiterLock(pScrn); - pScrn->DPMSSet(pScrn, level, 0); - xf86VGAarbiterUnlock(pScrn); - } + DPMSSetScreen(xf86Screens[i], level); + } + for (i = 0; i < xf86NumGPUScreens; i++) { + DPMSSetScreen(xf86GPUScreens[i], level); } return Success; } +static Bool +DPMSSupportedOnScreen(ScrnInfoPtr pScrn) +{ + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); + DPMSPtr pDPMS = dixLookupPrivate(&pScreen->devPrivates, DPMSKey); + + return pDPMS && pScrn->DPMSSet; +} + /* * DPMSSupported -- * Return TRUE if any screen supports DPMS. @@ -174,8 +191,6 @@ Bool DPMSSupported(void) { int i; - DPMSPtr pDPMS; - ScrnInfoPtr pScrn; if (DPMSKey == NULL) { return FALSE; @@ -183,9 +198,11 @@ DPMSSupported(void) /* For each screen, check if DPMS is supported */ for (i = 0; i < xf86NumScreens; i++) { - pScrn = xf86Screens[i]; - pDPMS = dixLookupPrivate(&screenInfo.screens[i]->devPrivates, DPMSKey); - if (pDPMS && pScrn->DPMSSet) + if (DPMSSupportedOnScreen(xf86Screens[i])) + return TRUE; + } + for (i = 0; i < xf86NumGPUScreens; i++) { + if (DPMSSupportedOnScreen(xf86GPUScreens[i])) return TRUE; } return FALSE; diff --git a/xserver/hw/xfree86/common/xf86Events.c b/xserver/hw/xfree86/common/xf86Events.c index 058057e92..d92174edf 100644 --- a/xserver/hw/xfree86/common/xf86Events.c +++ b/xserver/hw/xfree86/common/xf86Events.c @@ -180,6 +180,7 @@ xf86ProcessActionEvent(ActionEvent action, void *arg) switch (action) { case ACTION_TERMINATE: if (!xf86Info.dontZap) { + xf86Msg(X_INFO, "Server zapped. Shutting down.\n"); #ifdef XFreeXDGA DGAShutdown(); #endif @@ -254,7 +255,7 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask) while (pInfo) { if (pInfo->read_input && pInfo->fd >= 0 && (FD_ISSET(pInfo->fd, &devicesWithInput) != 0)) { - int sigstate = xf86BlockSIGIO(); + OsBlockSIGIO(); /* * Remove the descriptior from the set because more than one @@ -263,7 +264,7 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask) FD_CLR(pInfo->fd, &devicesWithInput); pInfo->read_input(pInfo); - xf86UnblockSIGIO(sigstate); + OsReleaseSIGIO(); } pInfo = pInfo->next; } @@ -271,9 +272,9 @@ xf86Wakeup(pointer blockData, int err, pointer pReadmask) } if (err >= 0) { /* we don't want the handlers called if select() */ - IHPtr ih; /* returned with an error condition, do we? */ + IHPtr ih, ih_tmp; /* returned with an error condition, do we? */ - for (ih = InputHandlers; ih; ih = ih->next) { + nt_list_for_each_entry_safe(ih, ih_tmp, InputHandlers, next) { if (ih->enabled && ih->fd >= 0 && ih->ihproc && (FD_ISSET(ih->fd, ((fd_set *) pReadmask)) != 0)) { ih->ihproc(ih->fd, ih->data); @@ -376,7 +377,7 @@ static void xf86ReleaseKeys(DeviceIntPtr pDev) { KeyClassPtr keyc; - int i, sigstate; + int i; if (!pDev || !pDev->key) return; @@ -397,9 +398,9 @@ xf86ReleaseKeys(DeviceIntPtr pDev) for (i = keyc->xkbInfo->desc->min_key_code; i < keyc->xkbInfo->desc->max_key_code; i++) { if (key_is_down(pDev, i, KEY_POSTED)) { - sigstate = xf86BlockSIGIO(); + OsBlockSIGIO(); QueueKeyboardEvents(pDev, KeyRelease, i, NULL); - xf86UnblockSIGIO(sigstate); + OsReleaseSIGIO(); } } } @@ -438,7 +439,7 @@ xf86VTSwitch(void) for (i = 0; i < xf86NumScreens; i++) { if (!(dispatchException & DE_TERMINATE)) if (xf86Screens[i]->EnableDisableFBAccess) - (*xf86Screens[i]->EnableDisableFBAccess) (i, FALSE); + (*xf86Screens[i]->EnableDisableFBAccess) (xf86Screens[i], FALSE); } /* @@ -449,15 +450,19 @@ xf86VTSwitch(void) xf86DisableInputHandler(ih); for (pInfo = xf86InputDevs; pInfo; pInfo = pInfo->next) { if (pInfo->dev) { + if (!pInfo->dev->enabled) + pInfo->flags |= XI86_DEVICE_DISABLED; xf86ReleaseKeys(pInfo->dev); ProcessInputEvents(); DisableDevice(pInfo->dev, TRUE); } } - prevSIGIO = xf86BlockSIGIO(); + OsBlockSIGIO(); for (i = 0; i < xf86NumScreens; i++) - xf86Screens[i]->LeaveVT(i, 0); + xf86Screens[i]->LeaveVT(xf86Screens[i]); + for (i = 0; i < xf86NumGPUScreens; i++) + xf86GPUScreens[i]->LeaveVT(xf86GPUScreens[i]); xf86AccessLeave(); /* We need this here, otherwise */ @@ -469,27 +474,32 @@ xf86VTSwitch(void) DebugF("xf86VTSwitch: Leave failed\n"); xf86AccessEnter(); for (i = 0; i < xf86NumScreens; i++) { - if (!xf86Screens[i]->EnterVT(i, 0)) + if (!xf86Screens[i]->EnterVT(xf86Screens[i])) FatalError("EnterVT failed for screen %d\n", i); } + for (i = 0; i < xf86NumGPUScreens; i++) { + if (!xf86GPUScreens[i]->EnterVT(xf86GPUScreens[i])) + FatalError("EnterVT failed for gpu screen %d\n", i); + } if (!(dispatchException & DE_TERMINATE)) { for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->EnableDisableFBAccess) - (*xf86Screens[i]->EnableDisableFBAccess) (i, TRUE); + (*xf86Screens[i]->EnableDisableFBAccess) (xf86Screens[i], TRUE); } } dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset); pInfo = xf86InputDevs; while (pInfo) { - if (pInfo->dev) + if (pInfo->dev && (pInfo->flags & XI86_DEVICE_DISABLED) == 0) EnableDevice(pInfo->dev, TRUE); + pInfo->flags &= ~XI86_DEVICE_DISABLED; pInfo = pInfo->next; } for (ih = InputHandlers; ih; ih = ih->next) xf86EnableInputHandler(ih); - xf86UnblockSIGIO(prevSIGIO); + OsReleaseSIGIO(); } else { @@ -524,12 +534,17 @@ xf86VTSwitch(void) xf86AccessEnter(); for (i = 0; i < xf86NumScreens; i++) { xf86Screens[i]->vtSema = TRUE; - if (!xf86Screens[i]->EnterVT(i, 0)) + if (!xf86Screens[i]->EnterVT(xf86Screens[i])) FatalError("EnterVT failed for screen %d\n", i); } + for (i = 0; i < xf86NumGPUScreens; i++) { + xf86GPUScreens[i]->vtSema = TRUE; + if (!xf86GPUScreens[i]->EnterVT(xf86GPUScreens[i])) + FatalError("EnterVT failed for gpu screen %d\n", i); + } for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->EnableDisableFBAccess) - (*xf86Screens[i]->EnableDisableFBAccess) (i, TRUE); + (*xf86Screens[i]->EnableDisableFBAccess) (xf86Screens[i], TRUE); } /* Turn screen saver off when switching back */ @@ -537,15 +552,16 @@ xf86VTSwitch(void) pInfo = xf86InputDevs; while (pInfo) { - if (pInfo->dev) + if (pInfo->dev && (pInfo->flags & XI86_DEVICE_DISABLED) == 0) EnableDevice(pInfo->dev, TRUE); + pInfo->flags &= ~XI86_DEVICE_DISABLED; pInfo = pInfo->next; } for (ih = InputHandlers; ih; ih = ih->next) xf86EnableInputHandler(ih); - xf86UnblockSIGIO(prevSIGIO); + OsReleaseSIGIO(); } } @@ -603,14 +619,16 @@ InputHandlerProc xf86SetConsoleHandler(InputHandlerProc proc, pointer data) { static IHPtr handler = NULL; - IHPtr old_handler = handler; + InputHandlerProc old_proc = NULL; - if (old_handler) - xf86RemoveGeneralHandler(old_handler); + if (handler) { + old_proc = handler->ihproc; + xf86RemoveGeneralHandler(handler); + } handler = xf86AddGeneralHandler(xf86Info.consoleFd, proc, data); - return (old_handler) ? old_handler->ihproc : NULL; + return old_proc; } static void diff --git a/xserver/hw/xfree86/common/xf86Extensions.c b/xserver/hw/xfree86/common/xf86Extensions.c new file mode 100644 index 000000000..f9e791607 --- /dev/null +++ b/xserver/hw/xfree86/common/xf86Extensions.c @@ -0,0 +1,142 @@ +/* + * Copyright © 2011 Daniel Stone + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Author: Daniel Stone + */ + +#ifdef HAVE_XORG_CONFIG_H +#include +#endif + +#include "extension.h" +#include "globals.h" + +#include "xf86.h" +#include "xf86Config.h" +#include "xf86Module.h" +#include "xf86Extensions.h" +#include "xf86Opt.h" +#include "optionstr.h" + +#ifdef XSELINUX +#include "xselinux.h" +#endif + +#ifdef XFreeXDGA +#include +#endif + +#ifdef XF86VIDMODE +#include +#include "vidmodeproc.h" +#endif + +/* + * DDX-specific extensions. + */ +static const ExtensionModule extensionModules[] = { +#ifdef XF86VIDMODE + { + XFree86VidModeExtensionInit, + XF86VIDMODENAME, + &noXFree86VidModeExtension + }, +#endif +#ifdef XFreeXDGA + { + XFree86DGAExtensionInit, + XF86DGANAME, + &noXFree86DGAExtension + }, +#endif +#ifdef XF86DRI + { + XFree86DRIExtensionInit, + "XFree86-DRI", + &noXFree86DRIExtension + }, +#endif +#ifdef DRI2 + { + DRI2ExtensionInit, + DRI2_NAME, + &noDRI2Extension + } +#endif +}; + +static void +load_extension_config(void) +{ + XF86ConfModulePtr mod_con = xf86configptr->conf_modules; + XF86LoadPtr modp; + int i; + + /* Only the best. */ + if (!mod_con) + return; + + nt_list_for_each_entry(modp, mod_con->mod_load_lst, list.next) { + InputOption *opt; + + if (strcasecmp(modp->load_name, "extmod") != 0) + continue; + + /* extmod options are of the form "omit " */ + nt_list_for_each_entry(opt, modp->load_opt, list.next) { + const char *key = input_option_get_key(opt); + if (strncasecmp(key, "omit", 4) != 0 || strlen(key) < 5) + continue; + if (EnableDisableExtension(key + 4, FALSE)) + xf86MarkOptionUsed(opt); + } + +#ifdef XSELINUX + if ((opt = xf86FindOption(modp->load_opt, + "SELinux mode disabled"))) { + xf86MarkOptionUsed(opt); + selinuxEnforcingState = SELINUX_MODE_DISABLED; + } + if ((opt = xf86FindOption(modp->load_opt, + "SELinux mode permissive"))) { + xf86MarkOptionUsed(opt); + selinuxEnforcingState = SELINUX_MODE_PERMISSIVE; + } + if ((opt = xf86FindOption(modp->load_opt, + "SELinux mode enforcing"))) { + xf86MarkOptionUsed(opt); + selinuxEnforcingState = SELINUX_MODE_ENFORCING; + } +#endif + } +} + +void +xf86ExtensionInit(void) +{ + int i; + + load_extension_config(); + + for (i = 0; i < ARRAY_SIZE(extensionModules); i++) + LoadExtension(&extensionModules[i], TRUE); +} diff --git a/xserver/hw/xfree86/common/xf86Extensions.h b/xserver/hw/xfree86/common/xf86Extensions.h new file mode 100644 index 000000000..cad86c881 --- /dev/null +++ b/xserver/hw/xfree86/common/xf86Extensions.h @@ -0,0 +1,55 @@ +/* + * Copyright © 2011 Daniel Stone + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Author: Daniel Stone + */ + +#ifndef XF86EXTENSIONS_H +#define XF86EXTENSIONS_H + +#include "extnsionst.h" + +#ifdef XF86DRI +extern _X_EXPORT Bool noXFree86DRIExtension; +extern void XFree86DRIExtensionInit(void); +#endif + +#ifdef DRI2 +#include +extern _X_EXPORT Bool noDRI2Extension; +extern void DRI2ExtensionInit(void); +#endif + +#ifdef XF86VIDMODE +#include +extern _X_EXPORT Bool noXFree86VidModeExtension; +extern void XFree86VidModeExtensionInit(void); +#endif + +#ifdef XFreeXDGA +#include +extern _X_EXPORT Bool noXFree86DGAExtension; +extern void XFree86DGAExtensionInit(void); +extern void XFree86DGARegister(void); +#endif + +#endif diff --git a/xserver/hw/xfree86/common/xf86Globals.c b/xserver/hw/xfree86/common/xf86Globals.c index 0071004eb..7df7a80c4 100644 --- a/xserver/hw/xfree86/common/xf86Globals.c +++ b/xserver/hw/xfree86/common/xf86Globals.c @@ -51,6 +51,7 @@ DevPrivateKeyRec xf86CreateRootWindowKeyRec; DevPrivateKeyRec xf86ScreenKeyRec; ScrnInfoPtr *xf86Screens = NULL; /* List of ScrnInfos */ +ScrnInfoPtr *xf86GPUScreens = NULL; /* List of ScrnInfos */ const unsigned char byte_reversed[256] = { 0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0, @@ -125,11 +126,16 @@ xf86InfoRec xf86Info = { #if defined(CONFIG_HAL) || defined(CONFIG_UDEV) || defined(CONFIG_WSCONS) .forceInputDevices = FALSE, .autoAddDevices = TRUE, - .autoEnableDevices = TRUE + .autoEnableDevices = TRUE, #else .forceInputDevices = TRUE, .autoAddDevices = FALSE, - .autoEnableDevices = FALSE + .autoEnableDevices = FALSE, +#endif +#if defined(CONFIG_UDEV_KMS) + .autoAddGPU = TRUE, +#else + .autoAddGPU = FALSE, #endif }; @@ -153,6 +159,7 @@ int xf86NumDrivers = 0; InputDriverPtr *xf86InputDriverList = NULL; int xf86NumInputDrivers = 0; int xf86NumScreens = 0; +int xf86NumGPUScreens = 0; const char *xf86VisualNames[] = { "StaticGray", diff --git a/xserver/hw/xfree86/common/xf86Helper.c b/xserver/hw/xfree86/common/xf86Helper.c index 8c948cf6f..721159d0b 100644 --- a/xserver/hw/xfree86/common/xf86Helper.c +++ b/xserver/hw/xfree86/common/xf86Helper.c @@ -167,29 +167,43 @@ ScrnInfoPtr xf86AllocateScreen(DriverPtr drv, int flags) { int i; + ScrnInfoPtr pScrn; - if (xf86Screens == NULL) - xf86NumScreens = 0; + if (flags & XF86_ALLOCATE_GPU_SCREEN) { + if (xf86GPUScreens == NULL) + xf86NumGPUScreens = 0; + i = xf86NumGPUScreens++; + xf86GPUScreens = xnfrealloc(xf86GPUScreens, xf86NumGPUScreens * sizeof(ScrnInfoPtr)); + xf86GPUScreens[i] = xnfcalloc(sizeof(ScrnInfoRec), 1); + pScrn = xf86GPUScreens[i]; + pScrn->scrnIndex = i + GPU_SCREEN_OFFSET; /* Changes when a screen is removed */ + pScrn->is_gpu = TRUE; + } else { + if (xf86Screens == NULL) + xf86NumScreens = 0; - i = xf86NumScreens++; - xf86Screens = xnfrealloc(xf86Screens, xf86NumScreens * sizeof(ScrnInfoPtr)); - xf86Screens[i] = xnfcalloc(sizeof(ScrnInfoRec), 1); - xf86Screens[i]->scrnIndex = i; /* Changes when a screen is removed */ - xf86Screens[i]->origIndex = i; /* This never changes */ - xf86Screens[i]->privates = xnfcalloc(sizeof(DevUnion), - xf86ScrnInfoPrivateCount); + i = xf86NumScreens++; + xf86Screens = xnfrealloc(xf86Screens, xf86NumScreens * sizeof(ScrnInfoPtr)); + xf86Screens[i] = xnfcalloc(sizeof(ScrnInfoRec), 1); + pScrn = xf86Screens[i]; + + pScrn->scrnIndex = i; /* Changes when a screen is removed */ + } + + pScrn->origIndex = pScrn->scrnIndex; /* This never changes */ + pScrn->privates = xnfcalloc(sizeof(DevUnion), xf86ScrnInfoPrivateCount); /* * EnableDisableFBAccess now gets initialized in InitOutput() - * xf86Screens[i]->EnableDisableFBAccess = xf86EnableDisableFBAccess; + * pScrn->EnableDisableFBAccess = xf86EnableDisableFBAccess; */ - xf86Screens[i]->drv = drv; + pScrn->drv = drv; drv->refCount++; - xf86Screens[i]->module = DuplicateModule(drv->module, NULL); + pScrn->module = DuplicateModule(drv->module, NULL); - xf86Screens[i]->DriverFunc = drv->driverFunc; + pScrn->DriverFunc = drv->driverFunc; - return xf86Screens[i]; + return pScrn; } /* @@ -198,24 +212,29 @@ xf86AllocateScreen(DriverPtr drv, int flags) */ void -xf86DeleteScreen(int scrnIndex, int flags) +xf86DeleteScreen(ScrnInfoPtr pScrn) { - ScrnInfoPtr pScrn; int i; + int scrnIndex; + Bool is_gpu = FALSE; + if (pScrn->is_gpu) { + /* First check if the screen is valid */ + if (xf86NumGPUScreens == 0 || xf86GPUScreens == NULL) + return; + is_gpu = TRUE; + } else { + /* First check if the screen is valid */ + if (xf86NumScreens == 0 || xf86Screens == NULL) + return; + } - /* First check if the screen is valid */ - if (xf86NumScreens == 0 || xf86Screens == NULL) - return; - - if (scrnIndex > xf86NumScreens - 1) - return; - - if (!(pScrn = xf86Screens[scrnIndex])) + if (!pScrn) return; + scrnIndex = pScrn->scrnIndex; /* If a FreeScreen function is defined, call it here */ if (pScrn->FreeScreen != NULL) - pScrn->FreeScreen(scrnIndex, 0); + pScrn->FreeScreen(pScrn); while (pScrn->modes) xf86DeleteMode(&pScrn->modes, pScrn->modes); @@ -233,18 +252,29 @@ xf86DeleteScreen(int scrnIndex, int flags) free(pScrn->privates); - xf86ClearEntityListForScreen(scrnIndex); + xf86ClearEntityListForScreen(pScrn); free(pScrn); /* Move the other entries down, updating their scrnIndex fields */ - xf86NumScreens--; + if (is_gpu) { + xf86NumGPUScreens--; + scrnIndex -= GPU_SCREEN_OFFSET; + for (i = scrnIndex; i < xf86NumGPUScreens; i++) { + xf86GPUScreens[i] = xf86GPUScreens[i + 1]; + xf86GPUScreens[i]->scrnIndex = i + GPU_SCREEN_OFFSET; + /* Also need to take care of the screen layout settings */ + } + } + else { + xf86NumScreens--; - for (i = scrnIndex; i < xf86NumScreens; i++) { - xf86Screens[i] = xf86Screens[i + 1]; - xf86Screens[i]->scrnIndex = i; - /* Also need to take care of the screen layout settings */ + for (i = scrnIndex; i < xf86NumScreens; i++) { + xf86Screens[i] = xf86Screens[i + 1]; + xf86Screens[i]->scrnIndex = i; + /* Also need to take care of the screen layout settings */ + } } } @@ -268,6 +298,14 @@ xf86AllocateScrnInfoPrivateIndex(void) memset(&nprivs[idx], 0, sizeof(DevUnion)); pScr->privates = nprivs; } + for (i = 0; i < xf86NumGPUScreens; i++) { + pScr = xf86GPUScreens[i]; + nprivs = xnfrealloc(pScr->privates, + xf86ScrnInfoPrivateCount * sizeof(DevUnion)); + /* Zero the new private */ + memset(&nprivs[idx], 0, sizeof(DevUnion)); + pScr->privates = nprivs; + } return idx; } @@ -1027,9 +1065,8 @@ xf86SetBlackWhitePixels(ScreenPtr pScreen) * private data, and therefore don't need to access pScrnInfo->vtSema. */ void -xf86EnableDisableFBAccess(int scrnIndex, Bool enable) +xf86EnableDisableFBAccess(ScrnInfoPtr pScrnInfo, Bool enable) { - ScrnInfoPtr pScrnInfo = xf86Screens[scrnIndex]; ScreenPtr pScreen = pScrnInfo->pScreen; PixmapPtr pspix; @@ -1061,6 +1098,11 @@ xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format, xf86Screens[scrnIndex]->name) LogHdrMessageVerb(type, verb, format, args, "%s(%d): ", xf86Screens[scrnIndex]->name, scrnIndex); + else if (scrnIndex >= GPU_SCREEN_OFFSET && + scrnIndex < GPU_SCREEN_OFFSET + xf86NumGPUScreens && + xf86GPUScreens[scrnIndex - GPU_SCREEN_OFFSET]->name) + LogHdrMessageVerb(type, verb, format, args, "%s(G%d): ", + xf86GPUScreens[scrnIndex - GPU_SCREEN_OFFSET]->name, scrnIndex - GPU_SCREEN_OFFSET); else LogVMessageVerb(type, verb, format, args); } @@ -1577,7 +1619,7 @@ xf86SetBackingStore(ScreenPtr pScreen) { Bool useBS = FALSE; MessageType from = X_DEFAULT; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); OptionInfoPtr options; options = xnfalloc(sizeof(BSOptions)); @@ -1618,7 +1660,7 @@ xf86SetSilkenMouse(ScreenPtr pScreen) { Bool useSM = TRUE; MessageType from = X_DEFAULT; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); OptionInfoPtr options; options = xnfalloc(sizeof(SMOptions)); @@ -1651,10 +1693,9 @@ xf86SetSilkenMouse(ScreenPtr pScreen) /* Wrote this function for the PM2 Xv driver, preliminary. */ pointer -xf86FindXvOptions(int scrnIndex, int adaptor_index, char *port_name, +xf86FindXvOptions(ScrnInfoPtr pScrn, int adaptor_index, char *port_name, char **adaptor_name, pointer *adaptor_options) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; confXvAdaptorPtr adaptor; int i; @@ -1726,9 +1767,8 @@ xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, } Bool -xf86IsScreenPrimary(int scrnIndex) +xf86IsScreenPrimary(ScrnInfoPtr pScrn) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; int i; for (i = 0; i < pScrn->numEntities; i++) { @@ -1834,3 +1874,33 @@ xf86MotionHistoryAllocate(InputInfoPtr pInfo) { AllocateMotionHistory(pInfo->dev); } + +ScrnInfoPtr +xf86ScreenToScrn(ScreenPtr pScreen) +{ + if (pScreen->isGPU) { + assert(pScreen->myNum - GPU_SCREEN_OFFSET < xf86NumGPUScreens); + return xf86GPUScreens[pScreen->myNum - GPU_SCREEN_OFFSET]; + } else { + assert(pScreen->myNum < xf86NumScreens); + return xf86Screens[pScreen->myNum]; + } +} + +ScreenPtr +xf86ScrnToScreen(ScrnInfoPtr pScrn) +{ + if (pScrn->is_gpu) { + assert(pScrn->scrnIndex - GPU_SCREEN_OFFSET < screenInfo.numGPUScreens); + return screenInfo.gpuscreens[pScrn->scrnIndex - GPU_SCREEN_OFFSET]; + } else { + assert(pScrn->scrnIndex < screenInfo.numScreens); + return screenInfo.screens[pScrn->scrnIndex]; + } +} + +void +xf86UpdateDesktopDimensions(void) +{ + update_desktop_dimensions(); +} diff --git a/xserver/hw/xfree86/common/xf86Init.c b/xserver/hw/xfree86/common/xf86Init.c index 7c32bf5d9..11c52731d 100644 --- a/xserver/hw/xfree86/common/xf86Init.c +++ b/xserver/hw/xfree86/common/xf86Init.c @@ -398,17 +398,21 @@ InstallSignalHandlers(void) void InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) { - int i, j, k, scr_index, was_blocked = 0; + int i, j, k, scr_index; char **modulelist; pointer *optionlist; Pix24Flags screenpix24, pix24; MessageType pix24From = X_DEFAULT; Bool pix24Fail = FALSE; Bool autoconfig = FALSE; + Bool sigio_blocked = FALSE; + Bool want_hw_access = FALSE; GDevPtr configured_device; xf86Initialising = TRUE; + config_pre_init(); + if (serverGeneration == 1) { if ((xf86ServerName = strrchr(argv[0], '/')) != 0) xf86ServerName++; @@ -473,6 +477,8 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) xf86OSPMClose = xf86OSPMOpen(); #endif + xf86ExtensionInit(); + /* Load all modules specified explicitly in the config file */ if ((modulelist = xf86ModulelistFromConfig(&optionlist))) { xf86LoadModules(modulelist, optionlist); @@ -529,23 +535,21 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) */ for (i = 0; i < xf86NumDrivers; i++) { + xorgHWFlags flags = HW_IO; + if (xf86DriverList[i]->Identify != NULL) xf86DriverList[i]->Identify(0); - if (!xorgHWAccess || !xorgHWOpenConsole) { - xorgHWFlags flags; + if (xf86DriverList[i]->driverFunc) + xf86DriverList[i]->driverFunc(NULL, + GET_REQUIRED_HW_INTERFACES, + &flags); - if (!xf86DriverList[i]->driverFunc - || !xf86DriverList[i]->driverFunc(NULL, - GET_REQUIRED_HW_INTERFACES, - &flags)) - flags = HW_IO; + if (NEED_IO_ENABLED(flags)) + want_hw_access = TRUE; - if (NEED_IO_ENABLED(flags)) - xorgHWAccess = TRUE; - if (!(flags & HW_SKIP_CONSOLE)) - xorgHWOpenConsole = TRUE; - } + if (!(flags & HW_SKIP_CONSOLE)) + xorgHWOpenConsole = TRUE; } if (xorgHWOpenConsole) @@ -553,6 +557,10 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) else xf86Info.dontVTSwitch = TRUE; + /* Enable full I/O access */ + if (want_hw_access) + xorgHWAccess = xf86EnableIO(); + if (xf86BusConfig() == FALSE) return; @@ -593,7 +601,19 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) } for (i = 0; i < xf86NumScreens; i++) if (!xf86Screens[i]->configured) - xf86DeleteScreen(i--, 0); + xf86DeleteScreen(xf86Screens[i--]); + + for (i = 0; i < xf86NumGPUScreens; i++) { + xf86VGAarbiterScrnInit(xf86GPUScreens[i]); + xf86VGAarbiterLock(xf86GPUScreens[i]); + if (xf86GPUScreens[i]->PreInit && + xf86GPUScreens[i]->PreInit(xf86GPUScreens[i], 0)) + xf86GPUScreens[i]->configured = TRUE; + xf86VGAarbiterUnlock(xf86GPUScreens[i]); + } + for (i = 0; i < xf86NumGPUScreens; i++) + if (!xf86GPUScreens[i]->configured) + xf86DeleteScreen(xf86GPUScreens[i--]); /* * If no screens left, return now. @@ -808,7 +828,8 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) ioctl(xf86Info.consoleFd, VT_RELDISP, VT_ACKACQ); #endif xf86AccessEnter(); - was_blocked = xf86BlockSIGIO(); + OsBlockSIGIO(); + sigio_blocked = TRUE; } } @@ -820,6 +841,36 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) !dixRegisterPrivateKey(&xf86CreateRootWindowKeyRec, PRIVATE_SCREEN, 0)) FatalError("Cannot register DDX private keys"); + for (i = 0; i < xf86NumGPUScreens; i++) { + ScrnInfoPtr pScrn = xf86GPUScreens[i]; + xf86VGAarbiterLock(pScrn); + + /* + * Almost everything uses these defaults, and many of those that + * don't, will wrap them. + */ + pScrn->EnableDisableFBAccess = xf86EnableDisableFBAccess; +#ifdef XFreeXDGA + pScrn->SetDGAMode = xf86SetDGAMode; +#endif + pScrn->DPMSSet = NULL; + pScrn->LoadPalette = NULL; + pScrn->SetOverscan = NULL; + pScrn->DriverFunc = NULL; + pScrn->pScreen = NULL; + scr_index = AddGPUScreen(pScrn->ScreenInit, argc, argv); + xf86VGAarbiterUnlock(pScrn); + if (scr_index == i) { + dixSetPrivate(&screenInfo.gpuscreens[scr_index]->devPrivates, + xf86ScreenKey, xf86GPUScreens[i]); + pScrn->pScreen = screenInfo.gpuscreens[scr_index]; + /* The driver should set this, but make sure it is set anyway */ + pScrn->vtSema = TRUE; + } else { + FatalError("AddScreen/ScreenInit failed for gpu driver %d %d\n", i, scr_index); + } + } + for (i = 0; i < xf86NumScreens; i++) { xf86VGAarbiterLock(xf86Screens[i]); /* @@ -880,8 +931,12 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) #endif } + for (i = 0; i < xf86NumGPUScreens; i++) + AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen); + xf86VGAarbiterWrapFunctions(); - xf86UnblockSIGIO(was_blocked); + if (sigio_blocked) + OsReleaseSIGIO(); xf86InitOrigins(); @@ -977,7 +1032,6 @@ OsVendorInit(void) xf86DropPriv(display); } #endif - xf86UnblockSIGIO(0); beenHere = TRUE; } @@ -1036,7 +1090,7 @@ AbortDDX(enum ExitCode error) { int i; - xf86BlockSIGIO(); + OsBlockSIGIO(); /* * try to restore the original video state @@ -1054,7 +1108,7 @@ AbortDDX(enum ExitCode error) * screen explicitely. */ xf86VGAarbiterLock(xf86Screens[i]); - (xf86Screens[i]->LeaveVT) (i, 0); + (xf86Screens[i]->LeaveVT) (xf86Screens[i]); xf86VGAarbiterUnlock(xf86Screens[i]); } } @@ -1069,19 +1123,19 @@ AbortDDX(enum ExitCode error) } void -OsVendorFatalError(void) +OsVendorFatalError(const char *f, va_list args) { #ifdef VENDORSUPPORT - ErrorF("\nPlease refer to your Operating System Vendor support pages\n" - "at %s for support on this crash.\n", VENDORSUPPORT); + ErrorFSigSafe("\nPlease refer to your Operating System Vendor support " + "pages\nat %s for support on this crash.\n", VENDORSUPPORT); #else - ErrorF("\nPlease consult the " XVENDORNAME " support \n" - "\t at " __VENDORDWEBSUPPORT__ "\n for help. \n"); + ErrorFSigSafe("\nPlease consult the " XVENDORNAME " support \n\t at " + __VENDORDWEBSUPPORT__ "\n for help. \n"); #endif if (xf86LogFile && xf86LogFileWasOpened) - ErrorF("Please also check the log file at \"%s\" for additional " - "information.\n", xf86LogFile); - ErrorF("\n"); + ErrorFSigSafe("Please also check the log file at \"%s\" for additional " + "information.\n", xf86LogFile); + ErrorFSigSafe("\n"); } int @@ -1177,7 +1231,7 @@ ddxProcessArgument(int argc, char **argv, int i) #ifdef X_PRIVSEP /* Cannot drop privs when -xf86config is used with unsafe path */ if (!xf86PathIsSafe(xf86ConfigFile)) - xf86KeepPriv = TRUE; + xf86KeepPriv = TRUE; #endif return 2; } @@ -1394,7 +1448,7 @@ ddxProcessArgument(int argc, char **argv, int i) } #ifdef X_PRIVSEP if (!strcmp(argv[i], "-keepPriv")) { - if (getuid() != 0 && geteuid() == 0) { + if (getuid() != 0) { ErrorF("The '-keepPriv' option can only be used by root.\n"); exit(1); } @@ -1507,8 +1561,7 @@ ddxUseMsg(void) ("-novtswitch don't automatically switch VT at reset & exit\n"); ErrorF("-sharevts share VTs with another X server\n"); #ifdef X_PRIVSEP - ErrorF("-keepPriv " - "don't revoque privileges when running as root\n"); + ErrorF("-keepPriv don't revoque privs when running as root\n"); #endif /* OS-specific usage */ xf86UseMsg(); @@ -1618,3 +1671,10 @@ xf86GetBppFromDepth(ScrnInfoPtr pScrn, int depth) else return 0; } + +#ifdef DDXBEFORERESET +void +ddxBeforeReset(void) +{ +} +#endif diff --git a/xserver/hw/xfree86/common/xf86Mode.c b/xserver/hw/xfree86/common/xf86Mode.c index ab4d595c7..d80dec892 100644 --- a/xserver/hw/xfree86/common/xf86Mode.c +++ b/xserver/hw/xfree86/common/xf86Mode.c @@ -950,7 +950,7 @@ xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode, mode->SynthClock /= 2; } - status = (*scrp->ValidMode) (scrp->scrnIndex, mode, FALSE, + status = (*scrp->ValidMode) (scrp, mode, FALSE, MODECHECK_INITIAL); if (status != MODE_OK) return status; @@ -1840,7 +1840,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, scrp->virtualX = newVirtX; scrp->virtualY = newVirtY; scrp->displayWidth = newLinePitch; - p->status = (scrp->ValidMode) (scrp->scrnIndex, p, FALSE, + p->status = (scrp->ValidMode) (scrp, p, FALSE, MODECHECK_FINAL); if (p->status != MODE_OK) { diff --git a/xserver/hw/xfree86/common/xf86Module.h b/xserver/hw/xfree86/common/xf86Module.h index 894b93f59..1393427f8 100644 --- a/xserver/hw/xfree86/common/xf86Module.h +++ b/xserver/hw/xfree86/common/xf86Module.h @@ -42,6 +42,7 @@ #define _XF86MODULE_H #include "misc.h" +#include "extension.h" #ifndef NULL #define NULL ((void *)0) #endif @@ -55,9 +56,6 @@ typedef enum { #define DEFAULT_LIST ((char *)-1) -/* This indicates a special module that doesn't have the usual entry point */ -#define EXTERN_MODULE ((pointer)-1) - /* Built-in ABI classes. These definitions must not be changed. */ #define ABI_CLASS_NONE NULL #define ABI_CLASS_ANSIC "X.Org ANSI C Emulation" @@ -82,9 +80,9 @@ typedef enum { * mask is 0xFFFF0000. */ #define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4) -#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(12, 0) -#define ABI_XINPUT_VERSION SET_ABI_VERSION(16, 0) -#define ABI_EXTENSION_VERSION SET_ABI_VERSION(6, 0) +#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(14, 1) +#define ABI_XINPUT_VERSION SET_ABI_VERSION(19, 1) +#define ABI_EXTENSION_VERSION SET_ABI_VERSION(7, 0) #define ABI_FONT_VERSION SET_ABI_VERSION(0, 6) #define MODINFOSTRING1 0xef23fdc5 @@ -171,18 +169,6 @@ typedef struct { #define INITARGS void -typedef void (*InitExtension) (INITARGS); - -typedef struct { - InitExtension initFunc; - const char *name; - Bool *disablePtr; - InitExtension setupFunc; - const char **initDependencies; -} ExtensionModule; - -extern _X_EXPORT ExtensionModule *ExtensionModuleList; - /* Prototypes for Loader functions that are exported to modules */ extern _X_EXPORT pointer LoadSubModule(pointer, const char *, const char **, const char **, pointer, @@ -193,7 +179,6 @@ extern _X_EXPORT pointer LoaderSymbol(const char *); extern _X_EXPORT char **LoaderListDirs(const char **, const char **); extern _X_EXPORT void LoaderFreeDirList(char **); extern _X_EXPORT void LoaderErrorMsg(const char *, const char *, int, int); -extern _X_EXPORT void LoadExtension(ExtensionModule *, Bool); extern _X_EXPORT void LoaderGetOS(const char **name, int *major, int *minor, int *teeny); extern _X_EXPORT Bool LoaderShouldIgnoreABI(void); diff --git a/xserver/hw/xfree86/common/xf86Opt.h b/xserver/hw/xfree86/common/xf86Opt.h index 0d808de14..c3ba2d75c 100644 --- a/xserver/hw/xfree86/common/xf86Opt.h +++ b/xserver/hw/xfree86/common/xf86Opt.h @@ -85,7 +85,7 @@ extern _X_EXPORT int xf86CheckIntOption(XF86OptionPtr optlist, const char *name, extern _X_EXPORT double xf86CheckRealOption(XF86OptionPtr optlist, const char *name, double deflt); extern _X_EXPORT char *xf86CheckStrOption(XF86OptionPtr optlist, - const char *name, char *deflt); + const char *name, const char *deflt); extern _X_EXPORT int xf86CheckBoolOption(XF86OptionPtr list, const char *name, int deflt); extern _X_EXPORT double xf86CheckPercentOption(XF86OptionPtr list, diff --git a/xserver/hw/xfree86/common/xf86Option.c b/xserver/hw/xfree86/common/xf86Option.c index 7cc744029..40c9d15f4 100644 --- a/xserver/hw/xfree86/common/xf86Option.c +++ b/xserver/hw/xfree86/common/xf86Option.c @@ -276,7 +276,7 @@ xf86CheckRealOption(XF86OptionPtr optlist, const char *name, double deflt) } char * -xf86CheckStrOption(XF86OptionPtr optlist, const char *name, char *deflt) +xf86CheckStrOption(XF86OptionPtr optlist, const char *name, const char *deflt) { return LookupStrOption(optlist, name, deflt, FALSE); } @@ -515,7 +515,7 @@ ParseOptionValue(int scrnIndex, XF86OptionPtr options, OptionInfoPtr p, if (*s == '\0') { if (markUsed) { xf86DrvMsg(scrnIndex, X_WARNING, - "Option \"%s\" requires an string value\n", + "Option \"%s\" requires a string value\n", p->name); } p->found = FALSE; diff --git a/xserver/hw/xfree86/common/xf86PM.c b/xserver/hw/xfree86/common/xf86PM.c index f69fffa0e..15257cb81 100644 --- a/xserver/hw/xfree86/common/xf86PM.c +++ b/xserver/hw/xfree86/common/xf86PM.c @@ -92,8 +92,6 @@ eventName(pmEvent event, const char **str) } } -static int sigio_blocked_for_suspend; - static void suspend(pmEvent event, Bool undo) { @@ -102,19 +100,19 @@ suspend(pmEvent event, Bool undo) for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->EnableDisableFBAccess) - (*xf86Screens[i]->EnableDisableFBAccess) (i, FALSE); + (*xf86Screens[i]->EnableDisableFBAccess) (xf86Screens[i], FALSE); } pInfo = xf86InputDevs; while (pInfo) { DisableDevice(pInfo->dev, TRUE); pInfo = pInfo->next; } - sigio_blocked_for_suspend = xf86BlockSIGIO(); + OsBlockSIGIO(); for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->PMEvent) - xf86Screens[i]->PMEvent(i, event, undo); + xf86Screens[i]->PMEvent(xf86Screens[i], event, undo); else { - xf86Screens[i]->LeaveVT(i, 0); + xf86Screens[i]->LeaveVT(xf86Screens[i]); xf86Screens[i]->vtSema = FALSE; } } @@ -131,16 +129,16 @@ resume(pmEvent event, Bool undo) xf86AccessEnter(); for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->PMEvent) - xf86Screens[i]->PMEvent(i, event, undo); + xf86Screens[i]->PMEvent(xf86Screens[i], event, undo); else { xf86Screens[i]->vtSema = TRUE; - xf86Screens[i]->EnterVT(i, 0); + xf86Screens[i]->EnterVT(xf86Screens[i]); } } - xf86UnblockSIGIO(sigio_blocked_for_suspend); + OsReleaseSIGIO(); for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->EnableDisableFBAccess) - (*xf86Screens[i]->EnableDisableFBAccess) (i, TRUE); + (*xf86Screens[i]->EnableDisableFBAccess) (xf86Screens[i], TRUE); } dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset); pInfo = xf86InputDevs; @@ -153,7 +151,7 @@ resume(pmEvent event, Bool undo) static void DoApmEvent(pmEvent event, Bool undo) { - int i, was_blocked; + int i; switch (event) { #if 0 @@ -184,13 +182,13 @@ DoApmEvent(pmEvent event, Bool undo) } break; default: - was_blocked = xf86BlockSIGIO(); + OsBlockSIGIO(); for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->PMEvent) { - xf86Screens[i]->PMEvent(i, event, undo); + xf86Screens[i]->PMEvent(xf86Screens[i], event, undo); } } - xf86UnblockSIGIO(was_blocked); + OsReleaseSIGIO(); break; } } diff --git a/xserver/hw/xfree86/common/xf86Priv.h b/xserver/hw/xfree86/common/xf86Priv.h index 8d9cb5539..58cfe0a1a 100644 --- a/xserver/hw/xfree86/common/xf86Priv.h +++ b/xserver/hw/xfree86/common/xf86Priv.h @@ -91,10 +91,11 @@ extern _X_EXPORT int xf86NumScreens; extern _X_EXPORT const char *xf86VisualNames[]; extern _X_EXPORT int xf86Verbose; /* verbosity level */ extern _X_EXPORT int xf86LogVerbose; /* log file verbosity level */ -extern _X_EXPORT Bool xorgHWAccess; extern _X_EXPORT RootWinPropPtr *xf86RegisteredPropertiesTable; +extern ScrnInfoPtr *xf86GPUScreens; /* List of pointers to ScrnInfoRecs */ +extern int xf86NumGPUScreens; #ifndef DEFAULT_VERBOSE #define DEFAULT_VERBOSE 0 #endif @@ -114,8 +115,9 @@ extern _X_EXPORT void xf86BusProbe(void); extern _X_EXPORT void xf86AccessEnter(void); extern _X_EXPORT void xf86AccessLeave(void); extern _X_EXPORT void xf86PostProbe(void); -extern _X_EXPORT void xf86ClearEntityListForScreen(int scrnIndex); +extern _X_EXPORT void xf86ClearEntityListForScreen(ScrnInfoPtr pScrn); extern _X_EXPORT void xf86AddDevToEntity(int entityIndex, GDevPtr dev); +extern _X_EXPORT void xf86RemoveDevFromEntity(int entityIndex, GDevPtr dev); /* xf86Config.c */ diff --git a/xserver/hw/xfree86/common/xf86Privstr.h b/xserver/hw/xfree86/common/xf86Privstr.h index e78cd407d..e20be03a9 100644 --- a/xserver/hw/xfree86/common/xf86Privstr.h +++ b/xserver/hw/xfree86/common/xf86Privstr.h @@ -110,6 +110,8 @@ typedef struct { Bool dri2; MessageType dri2From; + + Bool autoAddGPU; } xf86InfoRec, *xf86InfoPtr; #ifdef DPMSExtension diff --git a/xserver/hw/xfree86/common/xf86RandR.c b/xserver/hw/xfree86/common/xf86RandR.c index abd894dff..5606bee4b 100644 --- a/xserver/hw/xfree86/common/xf86RandR.c +++ b/xserver/hw/xfree86/common/xf86RandR.c @@ -66,7 +66,7 @@ static Bool xf86RandRGetInfo(ScreenPtr pScreen, Rotation * rotations) { RRScreenSizePtr pSize; - ScrnInfoPtr scrp = XF86SCRNINFO(pScreen); + ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); DisplayModePtr mode; int refresh0 = 60; @@ -147,7 +147,7 @@ xf86RandRSetMode(ScreenPtr pScreen, DisplayModePtr mode, Bool useVirtual, int mmWidth, int mmHeight) { - ScrnInfoPtr scrp = XF86SCRNINFO(pScreen); + ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); int oldWidth = pScreen->width; int oldHeight = pScreen->height; @@ -159,7 +159,7 @@ xf86RandRSetMode(ScreenPtr pScreen, Bool ret = TRUE; if (pRoot && scrp->vtSema) - (*scrp->EnableDisableFBAccess) (pScreen->myNum, FALSE); + (*scrp->EnableDisableFBAccess) (scrp, FALSE); if (useVirtual) { scrp->virtualX = randrp->virtualX; scrp->virtualY = randrp->virtualY; @@ -220,7 +220,7 @@ xf86RandRSetMode(ScreenPtr pScreen, xf86SetViewport(pScreen, pScreen->width, pScreen->height); xf86SetViewport(pScreen, 0, 0); if (pRoot && scrp->vtSema) - (*scrp->EnableDisableFBAccess) (pScreen->myNum, TRUE); + (*scrp->EnableDisableFBAccess) (scrp, TRUE); return ret; } @@ -228,7 +228,7 @@ static Bool xf86RandRSetConfig(ScreenPtr pScreen, Rotation rotation, int rate, RRScreenSizePtr pSize) { - ScrnInfoPtr scrp = XF86SCRNINFO(pScreen); + ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); DisplayModePtr mode; int pos[MAXDEVICES][2]; @@ -344,7 +344,7 @@ xf86RandRCreateScreenResources(ScreenPtr pScreen) XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); #if 0 - ScrnInfoPtr scrp = XF86SCRNINFO(pScreen); + ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); DisplayModePtr mode; #endif @@ -365,9 +365,9 @@ xf86RandRCreateScreenResources(ScreenPtr pScreen) * Reset size back to original */ static Bool -xf86RandRCloseScreen(int index, ScreenPtr pScreen) +xf86RandRCloseScreen(ScreenPtr pScreen) { - ScrnInfoPtr scrp = XF86SCRNINFO(pScreen); + ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); scrp->virtualX = pScreen->width = randrp->virtualX; @@ -376,7 +376,7 @@ xf86RandRCloseScreen(int index, ScreenPtr pScreen) pScreen->CloseScreen = randrp->CloseScreen; free(randrp); dixSetPrivate(&pScreen->devPrivates, xf86RandRKey, NULL); - return (*pScreen->CloseScreen) (index, pScreen); + return (*pScreen->CloseScreen) (pScreen); } Rotation @@ -417,8 +417,9 @@ xf86RandRSetNewVirtualAndDimensions(ScreenPtr pScreen, /* This is only for during server start */ if (resetMode) { + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); return (xf86RandRSetMode(pScreen, - XF86SCRNINFO(pScreen)->currentMode, + pScrn->currentMode, TRUE, pScreen->mmWidth, pScreen->mmHeight)); } @@ -430,7 +431,7 @@ xf86RandRInit(ScreenPtr pScreen) { rrScrPrivPtr rp; XF86RandRInfoPtr randrp; - ScrnInfoPtr scrp = XF86SCRNINFO(pScreen); + ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); #ifdef PANORAMIX /* XXX disable RandR when using Xinerama */ diff --git a/xserver/hw/xfree86/common/xf86VGAarbiter.c b/xserver/hw/xfree86/common/xf86VGAarbiter.c index 7c9e6ba02..225fff06e 100644 --- a/xserver/hw/xfree86/common/xf86VGAarbiter.c +++ b/xserver/hw/xfree86/common/xf86VGAarbiter.c @@ -106,7 +106,7 @@ xf86VGAarbiterAllowDRI(ScreenPtr pScreen) { int vga_count; int rsrc_decodes; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); if (vga_no_arb) return TRUE; @@ -173,7 +173,7 @@ xf86VGAarbiterWrapFunctions(void) for (i = 0; i < xf86NumScreens; i++) { pScreen = xf86Screens[i]->pScreen; ps = GetPictureScreenIfSet(pScreen); - pScrn = xf86Screens[pScreen->myNum]; + pScrn = xf86ScreenToScrn(pScreen); PointPriv = dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey); if (!dixRegisterPrivateKey @@ -221,10 +221,10 @@ xf86VGAarbiterWrapFunctions(void) /* Screen funcs */ static Bool -VGAarbiterCloseScreen(int i, ScreenPtr pScreen) +VGAarbiterCloseScreen(ScreenPtr pScreen) { Bool val; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr) dixLookupPrivate(&pScreen->devPrivates, VGAarbiterScreenKey); @@ -258,34 +258,30 @@ VGAarbiterCloseScreen(int i, ScreenPtr pScreen) UNWRAP_SPRITE; free((pointer) pScreenPriv); - xf86VGAarbiterLock(xf86Screens[i]); - val = (*pScreen->CloseScreen) (i, pScreen); - xf86VGAarbiterUnlock(xf86Screens[i]); + xf86VGAarbiterLock(xf86ScreenToScrn(pScreen)); + val = (*pScreen->CloseScreen) (pScreen); + xf86VGAarbiterUnlock(xf86ScreenToScrn(pScreen)); return val; } static void -VGAarbiterBlockHandler(int i, - pointer blockData, pointer pTimeout, pointer pReadmask) +VGAarbiterBlockHandler(ScreenPtr pScreen, + pointer pTimeout, pointer pReadmask) { - ScreenPtr pScreen = screenInfo.screens[i]; - SCREEN_PROLOG(BlockHandler); VGAGet(pScreen); - pScreen->BlockHandler(i, blockData, pTimeout, pReadmask); + pScreen->BlockHandler(pScreen, pTimeout, pReadmask); VGAPut(); SCREEN_EPILOG(BlockHandler, VGAarbiterBlockHandler); } static void -VGAarbiterWakeupHandler(int i, pointer blockData, unsigned long result, +VGAarbiterWakeupHandler(ScreenPtr pScreen, unsigned long result, pointer pReadmask) { - ScreenPtr pScreen = screenInfo.screens[i]; - SCREEN_PROLOG(WakeupHandler); VGAGet(pScreen); - pScreen->WakeupHandler(i, blockData, result, pReadmask); + pScreen->WakeupHandler(pScreen, result, pReadmask); VGAPut(); SCREEN_EPILOG(WakeupHandler, VGAarbiterWakeupHandler); } @@ -298,9 +294,7 @@ VGAarbiterGetImage(DrawablePtr pDrawable, ScreenPtr pScreen = pDrawable->pScreen; SCREEN_PROLOG(GetImage); -// if (xf86Screens[pScreen->myNum]->vtSema) { VGAGet(pScreen); -// } (*pScreen->GetImage) (pDrawable, sx, sy, w, h, format, planemask, pdstLine); VGAPut(); SCREEN_EPILOG(GetImage, VGAarbiterGetImage); @@ -468,46 +462,45 @@ VGAarbiterSetCursorPosition(DeviceIntPtr pDev, } static void -VGAarbiterAdjustFrame(int index, int x, int y, int flags) +VGAarbiterAdjustFrame(ScrnInfoPtr pScrn, int x, int y) { - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr) dixLookupPrivate(&pScreen->devPrivates, VGAarbiterScreenKey); VGAGet(pScreen); - (*pScreenPriv->AdjustFrame) (index, x, y, flags); + (*pScreenPriv->AdjustFrame) (pScrn, x, y); VGAPut(); } static Bool -VGAarbiterSwitchMode(int index, DisplayModePtr mode, int flags) +VGAarbiterSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode) { Bool val; - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr) dixLookupPrivate(&pScreen->devPrivates, VGAarbiterScreenKey); VGAGet(pScreen); - val = (*pScreenPriv->SwitchMode) (index, mode, flags); + val = (*pScreenPriv->SwitchMode) (pScrn, mode); VGAPut(); return val; } static Bool -VGAarbiterEnterVT(int index, int flags) +VGAarbiterEnterVT(ScrnInfoPtr pScrn) { Bool val; - ScrnInfoPtr pScrn = xf86Screens[index]; - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr) dixLookupPrivate(&pScreen->devPrivates, VGAarbiterScreenKey); VGAGet(pScreen); pScrn->EnterVT = pScreenPriv->EnterVT; - val = (*pScrn->EnterVT) (index, flags); + val = (*pScrn->EnterVT) (pScrn); pScreenPriv->EnterVT = pScrn->EnterVT; pScrn->EnterVT = VGAarbiterEnterVT; VGAPut(); @@ -515,32 +508,31 @@ VGAarbiterEnterVT(int index, int flags) } static void -VGAarbiterLeaveVT(int index, int flags) +VGAarbiterLeaveVT(ScrnInfoPtr pScrn) { - ScrnInfoPtr pScrn = xf86Screens[index]; - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr) dixLookupPrivate(&pScreen->devPrivates, VGAarbiterScreenKey); VGAGet(pScreen); pScrn->LeaveVT = pScreenPriv->LeaveVT; - (*pScreenPriv->LeaveVT) (index, flags); + (*pScreenPriv->LeaveVT) (pScrn); pScreenPriv->LeaveVT = pScrn->LeaveVT; pScrn->LeaveVT = VGAarbiterLeaveVT; VGAPut(); } static void -VGAarbiterFreeScreen(int index, int flags) +VGAarbiterFreeScreen(ScrnInfoPtr pScrn) { - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr) dixLookupPrivate(&pScreen->devPrivates, VGAarbiterScreenKey); VGAGet(pScreen); - (*pScreenPriv->FreeScreen) (index, flags); + (*pScreenPriv->FreeScreen) (pScrn); VGAPut(); } diff --git a/xserver/hw/xfree86/common/xf86VGAarbiterPriv.h b/xserver/hw/xfree86/common/xf86VGAarbiterPriv.h index 2513ce65d..ba6edfcc3 100644 --- a/xserver/hw/xfree86/common/xf86VGAarbiterPriv.h +++ b/xserver/hw/xfree86/common/xf86VGAarbiterPriv.h @@ -95,7 +95,7 @@ static inline void VGAGet(ScreenPtr pScreen) { - pci_device_vgaarb_set_target(xf86Screens[pScreen->myNum]->vgaDev); + pci_device_vgaarb_set_target(xf86ScreenToScrn(pScreen)->vgaDev); pci_device_vgaarb_lock(); } @@ -125,11 +125,11 @@ typedef struct _VGAarbiterScreen { UnrealizeCursorProcPtr UnrealizeCursor; RecolorCursorProcPtr RecolorCursor; SetCursorPositionProcPtr SetCursorPosition; - void (*AdjustFrame) (int, int, int, int); - Bool (*SwitchMode) (int, DisplayModePtr, int); - Bool (*EnterVT) (int, int); - void (*LeaveVT) (int, int); - void (*FreeScreen) (int, int); + void (*AdjustFrame) (ScrnInfoPtr, int, int); + Bool (*SwitchMode) (ScrnInfoPtr, DisplayModePtr); + Bool (*EnterVT) (ScrnInfoPtr); + void (*LeaveVT) (ScrnInfoPtr); + void (*FreeScreen) (ScrnInfoPtr); miPointerSpriteFuncPtr miSprite; CompositeProcPtr Composite; GlyphsProcPtr Glyphs; @@ -142,11 +142,11 @@ typedef struct _VGAarbiterGC { } VGAarbiterGCRec, *VGAarbiterGCPtr; /* Screen funcs */ -static void VGAarbiterBlockHandler(int i, pointer blockData, pointer pTimeout, +static void VGAarbiterBlockHandler(ScreenPtr pScreen, pointer pTimeout, pointer pReadmask); -static void VGAarbiterWakeupHandler(int i, pointer blockData, +static void VGAarbiterWakeupHandler(ScreenPtr pScreen, unsigned long result, pointer pReadmask); -static Bool VGAarbiterCloseScreen(int i, ScreenPtr pScreen); +static Bool VGAarbiterCloseScreen(ScreenPtr pScreen); static void VGAarbiterGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h, unsigned int format, unsigned long planemask, char *pdstLine); @@ -176,11 +176,11 @@ static Bool VGAarbiterDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, static Bool VGAarbiterSetCursorPosition(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y, Bool generateEvent); -static void VGAarbiterAdjustFrame(int index, int x, int y, int flags); -static Bool VGAarbiterSwitchMode(int index, DisplayModePtr mode, int flags); -static Bool VGAarbiterEnterVT(int index, int flags); -static void VGAarbiterLeaveVT(int index, int flags); -static void VGAarbiterFreeScreen(int index, int flags); +static void VGAarbiterAdjustFrame(ScrnInfoPtr pScrn, int x, int y); +static Bool VGAarbiterSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode); +static Bool VGAarbiterEnterVT(ScrnInfoPtr pScrn); +static void VGAarbiterLeaveVT(ScrnInfoPtr pScrn); +static void VGAarbiterFreeScreen(ScrnInfoPtr pScrn); /* GC funcs */ static void VGAarbiterValidateGC(GCPtr pGC, unsigned long changes, diff --git a/xserver/hw/xfree86/common/xf86VidMode.c b/xserver/hw/xfree86/common/xf86VidMode.c index 13ffe061c..a7d1c25bf 100644 --- a/xserver/hw/xfree86/common/xf86VidMode.c +++ b/xserver/hw/xfree86/common/xf86VidMode.c @@ -50,7 +50,7 @@ static DevPrivateKeyRec VidModeKeyRec; static DevPrivateKey VidModeKey; static int VidModeCount = 0; -static Bool VidModeClose(int i, ScreenPtr pScreen); +static Bool VidModeClose(ScreenPtr pScreen); #define VMPTR(p) ((VidModePtr)dixLookupPrivate(&(p)->devPrivates, VidModeKey)) @@ -93,7 +93,7 @@ VidModeExtensionInit(ScreenPtr pScreen) #ifdef XF86VIDMODE static Bool -VidModeClose(int i, ScreenPtr pScreen) +VidModeClose(ScreenPtr pScreen) { VidModePtr pVidMode = VMPTR(pScreen); @@ -108,7 +108,7 @@ VidModeClose(int i, ScreenPtr pScreen) dixSetPrivate(&pScreen->devPrivates, VidModeKey, NULL); VidModeKey = NULL; } - return pScreen->CloseScreen(i, pScreen); + return pScreen->CloseScreen(pScreen); } Bool @@ -303,7 +303,7 @@ VidModeSetViewPort(int scrnIndex, int x, int y) pScrn->virtualY - pScrn->currentMode->VDisplay); pScrn->frameY1 = pScrn->frameY0 + pScrn->currentMode->VDisplay - 1; if (pScrn->AdjustFrame != NULL) - (pScrn->AdjustFrame) (scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); + (pScrn->AdjustFrame) (pScrn, pScrn->frameX0, pScrn->frameY0); return TRUE; } diff --git a/xserver/hw/xfree86/common/xf86Xinput.c b/xserver/hw/xfree86/common/xf86Xinput.c index bee407bf9..3433d2670 100644 --- a/xserver/hw/xfree86/common/xf86Xinput.c +++ b/xserver/hw/xfree86/common/xf86Xinput.c @@ -1,6 +1,6 @@ /* * Copyright 1995-1999 by Frederic Lepied, France. - * + * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that @@ -9,8 +9,8 @@ * advertising or publicity pertaining to distribution of the software without * specific, written prior permission. Frederic Lepied makes no * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * + * is provided "as is" without express or implied warranty. + * * FREDERIC LEPIED DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO * EVENT SHALL FREDERIC LEPIED BE LIABLE FOR ANY SPECIAL, INDIRECT OR @@ -305,7 +305,7 @@ ApplyTransformationMatrix(DeviceIntPtr dev) /*********************************************************************** * * xf86ProcessCommonOptions -- - * + * * Process global options. * *********************************************************************** @@ -1021,7 +1021,7 @@ DeleteInputDeviceRequest(DeviceIntPtr pDev) OsReleaseSignals(); } -/* +/* * convenient functions to post events */ @@ -1345,7 +1345,7 @@ xf86FirstLocalDevice(void) return xf86InputDevs; } -/* +/* * Cx - raw data from touch screen * to_max - scaled highest dimension * (remember, this is of rows - 1 because of 0 origin) @@ -1419,7 +1419,7 @@ xf86InitValuatorDefaults(DeviceIntPtr dev, int axnum) * Device will be moved to the off_devices list, but it will still be there * until you really clean up after it. * Notifies the client about an inactive device. - * + * * @param panic True if device is unrecoverable and needs to be removed. */ void @@ -1437,7 +1437,7 @@ xf86DisableDevice(DeviceIntPtr dev, Bool panic) /** * Reactivate a device. Call this function from the driver if you just found * out that the read error wasn't quite that bad after all. - * Device will be re-activated, and an event sent to the client. + * Device will be re-activated, and an event sent to the client. */ void xf86EnableDevice(DeviceIntPtr dev) diff --git a/xserver/hw/xfree86/common/xf86Xinput.h b/xserver/hw/xfree86/common/xf86Xinput.h index 3731a34d5..35c38a554 100644 --- a/xserver/hw/xfree86/common/xf86Xinput.h +++ b/xserver/hw/xfree86/common/xf86Xinput.h @@ -61,18 +61,21 @@ #define XI86_ALWAYS_CORE 0x04 /* device always controls the pointer */ /* the device sends Xinput and core pointer events */ #define XI86_SEND_CORE_EVENTS XI86_ALWAYS_CORE +/* 0x08 is reserved for legacy XI86_SEND_DRAG_EVENTS, do not use for now */ +/* server-internal only */ +#define XI86_DEVICE_DISABLED 0x10 /* device was disabled before vt switch */ /* This holds the input driver entry and module information. */ typedef struct _InputDriverRec { int driverVersion; - char *driverName; + const char *driverName; void (*Identify) (int flags); int (*PreInit) (struct _InputDriverRec * drv, struct _InputInfoRec * pInfo, int flags); void (*UnInit) (struct _InputDriverRec * drv, struct _InputInfoRec * pInfo, int flags); pointer module; - char **default_options; + const char **default_options; } InputDriverRec, *InputDriverPtr; /* This is to input devices what the ScrnInfoRec is to screens. */ @@ -95,7 +98,7 @@ typedef struct _InputInfoRec { int fd; DeviceIntPtr dev; pointer private; - char *type_name; + const char *type_name; InputDriverPtr drv; pointer module; XF86OptionPtr options; diff --git a/xserver/hw/xfree86/common/xf86cmap.c b/xserver/hw/xfree86/common/xf86cmap.c index cdc8459af..85f35f8db 100644 --- a/xserver/hw/xfree86/common/xf86cmap.c +++ b/xserver/hw/xfree86/common/xf86cmap.c @@ -66,7 +66,7 @@ #define LOAD_PALETTE(pmap) \ ((pmap == GetInstalledmiColormap(pmap->pScreen)) && \ ((pScreenPriv->flags & CMAP_LOAD_EVEN_IF_OFFSCREEN) || \ - xf86Screens[pmap->pScreen->myNum]->vtSema || pScreenPriv->isDGAmode)) + xf86ScreenToScrn(pmap->pScreen)->vtSema || pScreenPriv->isDGAmode)) typedef struct _CMapLink { ColormapPtr cmap; @@ -80,9 +80,9 @@ typedef struct { DestroyColormapProcPtr DestroyColormap; InstallColormapProcPtr InstallColormap; StoreColorsProcPtr StoreColors; - Bool (*EnterVT) (int, int); - Bool (*SwitchMode) (int, DisplayModePtr, int); - int (*SetDGAMode) (int, int, DGADevicePtr); + Bool (*EnterVT) (ScrnInfoPtr); + Bool (*SwitchMode) (ScrnInfoPtr, DisplayModePtr); + int (*SetDGAMode) (ScrnInfoPtr, int, DGADevicePtr); xf86ChangeGammaProc *ChangeGamma; int maxColors; int sigRGBbits; @@ -111,17 +111,17 @@ static DevPrivateKeyRec CMapColormapKeyRec; static void CMapInstallColormap(ColormapPtr); static void CMapStoreColors(ColormapPtr, int, xColorItem *); -static Bool CMapCloseScreen(int, ScreenPtr); +static Bool CMapCloseScreen(ScreenPtr); static Bool CMapCreateColormap(ColormapPtr); static void CMapDestroyColormap(ColormapPtr); -static Bool CMapEnterVT(int, int); -static Bool CMapSwitchMode(int, DisplayModePtr, int); +static Bool CMapEnterVT(ScrnInfoPtr); +static Bool CMapSwitchMode(ScrnInfoPtr, DisplayModePtr); #ifdef XFreeXDGA -static int CMapSetDGAMode(int, int, DGADevicePtr); +static int CMapSetDGAMode(ScrnInfoPtr, int, DGADevicePtr); #endif -static int CMapChangeGamma(int, Gamma); +static int CMapChangeGamma(ScrnInfoPtr, Gamma); static void ComputeGamma(CMapScreenPtr); static Bool CMapAllocateColormapPrivate(ColormapPtr); @@ -151,7 +151,7 @@ xf86HandleColormaps(ScreenPtr pScreen, xf86LoadPaletteProc * loadPalette, xf86SetOverscanProc * setOverscan, unsigned int flags) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); ColormapPtr pDefMap = NULL; CMapScreenPtr pScreenPriv; LOCO *gamma; @@ -241,11 +241,11 @@ xf86HandleColormaps(ScreenPtr pScreen, /**** Screen functions ****/ static Bool -CMapCloseScreen(int i, ScreenPtr pScreen) +CMapCloseScreen(ScreenPtr pScreen) { CMapUnwrapScreen(pScreen); - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } static Bool @@ -462,16 +462,15 @@ CMapInstallColormap(ColormapPtr pmap) /**** ScrnInfoRec functions ****/ static Bool -CMapEnterVT(int index, int flags) +CMapEnterVT(ScrnInfoPtr pScrn) { - ScrnInfoPtr pScrn = xf86Screens[index]; - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); Bool ret; CMapScreenPtr pScreenPriv = (CMapScreenPtr) dixLookupPrivate(&pScreen->devPrivates, CMapScreenKey); pScrn->EnterVT = pScreenPriv->EnterVT; - ret = (*pScreenPriv->EnterVT) (index, flags); + ret = (*pScreenPriv->EnterVT) (pScrn); pScreenPriv->EnterVT = pScrn->EnterVT; pScrn->EnterVT = CMapEnterVT; if (ret) { @@ -483,13 +482,13 @@ CMapEnterVT(int index, int flags) } static Bool -CMapSwitchMode(int index, DisplayModePtr mode, int flags) +CMapSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode) { - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); CMapScreenPtr pScreenPriv = (CMapScreenPtr) dixLookupPrivate(&pScreen->devPrivates, CMapScreenKey); - if ((*pScreenPriv->SwitchMode) (index, mode, flags)) { + if ((*pScreenPriv->SwitchMode) (pScrn, mode)) { if (GetInstalledmiColormap(pScreen)) CMapReinstallMap(GetInstalledmiColormap(pScreen)); return TRUE; @@ -499,19 +498,19 @@ CMapSwitchMode(int index, DisplayModePtr mode, int flags) #ifdef XFreeXDGA static int -CMapSetDGAMode(int index, int num, DGADevicePtr dev) +CMapSetDGAMode(ScrnInfoPtr pScrn, int num, DGADevicePtr dev) { - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); CMapScreenPtr pScreenPriv = (CMapScreenPtr) dixLookupPrivate(&pScreen->devPrivates, CMapScreenKey); int ret; - ret = (*pScreenPriv->SetDGAMode) (index, num, dev); + ret = (*pScreenPriv->SetDGAMode) (pScrn, num, dev); - pScreenPriv->isDGAmode = DGAActive(index); + pScreenPriv->isDGAmode = DGAActive(pScrn->scrnIndex); if (!pScreenPriv->isDGAmode && GetInstalledmiColormap(pScreen) - && xf86Screens[pScreen->myNum]->vtSema) + && xf86ScreenToScrn(pScreen)->vtSema) CMapReinstallMap(GetInstalledmiColormap(pScreen)); return ret; @@ -528,7 +527,7 @@ CMapReinstallMap(ColormapPtr pmap) CMapScreenKey); CMapColormapPtr cmapPriv = (CMapColormapPtr) dixLookupPrivate(&pmap->devPrivates, CMapColormapKey); - ScrnInfoPtr pScrn = xf86Screens[pmap->pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pmap->pScreen); int i = cmapPriv->numColors; int *indices = pScreenPriv->PreAllocIndices; @@ -560,7 +559,7 @@ CMapRefreshColors(ColormapPtr pmap, int defs, int *indices) CMapColormapPtr pColPriv = (CMapColormapPtr) dixLookupPrivate(&pmap->devPrivates, CMapColormapKey); VisualPtr pVisual = pmap->pVisual; - ScrnInfoPtr pScrn = xf86Screens[pmap->pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pmap->pScreen); int numColors, i; LOCO *gamma, *colors; EntryPtr entry; @@ -609,7 +608,7 @@ CMapRefreshColors(ColormapPtr pmap, int defs, int *indices) case GrayScale: for (i = 0; i < defs; i++) { index = indices[i]; - entry = (EntryPtr) & pmap->red[index]; + entry = (EntryPtr) &pmap->red[index]; if (entry->fShared) { colors[index].red = @@ -692,7 +691,7 @@ CMapSetOverscan(ColormapPtr pmap, int defs, int *indices) CMapScreenKey); CMapColormapPtr pColPriv = (CMapColormapPtr) dixLookupPrivate(&pmap->devPrivates, CMapColormapKey); - ScrnInfoPtr pScrn = xf86Screens[pmap->pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pmap->pScreen); VisualPtr pVisual = pmap->pVisual; int i; LOCO *colors; @@ -833,7 +832,7 @@ CMapUnwrapScreen(ScreenPtr pScreen) { CMapScreenPtr pScreenPriv = (CMapScreenPtr) dixLookupPrivate(&pScreen->devPrivates, CMapScreenKey); - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); pScreen->CloseScreen = pScreenPriv->CloseScreen; pScreen->CreateColormap = pScreenPriv->CreateColormap; @@ -908,11 +907,10 @@ ComputeGamma(CMapScreenPtr priv) } int -CMapChangeGamma(int index, Gamma gamma) +CMapChangeGamma(ScrnInfoPtr pScrn, Gamma gamma) { int ret = Success; - ScrnInfoPtr pScrn = xf86Screens[index]; - ScreenPtr pScreen = pScrn->pScreen; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); CMapColormapPtr pColPriv; CMapScreenPtr pScreenPriv; CMapLinkPtr pLink; @@ -979,7 +977,7 @@ CMapChangeGamma(int index, Gamma gamma) pScrn->ChangeGamma = pScreenPriv->ChangeGamma; if (pScrn->ChangeGamma) - ret = pScrn->ChangeGamma(index, gamma); + ret = pScrn->ChangeGamma(pScrn, gamma); pScrn->ChangeGamma = CMapChangeGamma; return ret; @@ -1008,7 +1006,7 @@ xf86ChangeGammaRamp(ScreenPtr pScreen, unsigned short *red, unsigned short *green, unsigned short *blue) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); CMapColormapPtr pColPriv; CMapScreenPtr pScreenPriv; CMapLinkPtr pLink; @@ -1085,7 +1083,7 @@ xf86ChangeGammaRamp(ScreenPtr pScreen, int xf86GetGammaRampSize(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); CMapScreenPtr pScreenPriv; if (xf86_crtc_supports_gamma(pScrn)) { @@ -1112,7 +1110,7 @@ xf86GetGammaRamp(ScreenPtr pScreen, unsigned short *red, unsigned short *green, unsigned short *blue) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); CMapScreenPtr pScreenPriv; LOCO *entry; int shift, sigbits; @@ -1172,10 +1170,10 @@ xf86GetGammaRamp(ScreenPtr pScreen, int xf86ChangeGamma(ScreenPtr pScreen, Gamma gamma) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); if (pScrn->ChangeGamma) - return (*pScrn->ChangeGamma) (pScreen->myNum, gamma); + return (*pScrn->ChangeGamma) (pScrn, gamma); return BadImplementation; } diff --git a/xserver/hw/xfree86/common/xf86fbBus.c b/xserver/hw/xfree86/common/xf86fbBus.c index 1d50e5102..0f07352a8 100644 --- a/xserver/hw/xfree86/common/xf86fbBus.c +++ b/xserver/hw/xfree86/common/xf86fbBus.c @@ -54,6 +54,10 @@ xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active) EntityPtr p; int num; +#ifdef XSERVER_PLATFORM_BUS + if (platformSlotClaimed) + return -1; +#endif #ifdef XSERVER_LIBPCIACCESS if (pciSlotClaimed) return -1; diff --git a/xserver/hw/xfree86/common/xf86fbman.c b/xserver/hw/xfree86/common/xf86fbman.c index 3c29bf531..c2e7bab9f 100644 --- a/xserver/hw/xfree86/common/xf86fbman.c +++ b/xserver/hw/xfree86/common/xf86fbman.c @@ -1149,7 +1149,7 @@ static FBManagerFuncs xf86FBManFuncs = { }; static Bool -xf86FBCloseScreen(int i, ScreenPtr pScreen) +xf86FBCloseScreen(ScreenPtr pScreen) { FBLinkPtr pLink, tmp; FBLinearLinkPtr pLinearLink, tmp2; @@ -1180,13 +1180,13 @@ xf86FBCloseScreen(int i, ScreenPtr pScreen) free(offman); dixSetPrivate(&pScreen->devPrivates, xf86FBScreenKey, NULL); - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } Bool xf86InitFBManager(ScreenPtr pScreen, BoxPtr FullBox) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); RegionRec ScreenRegion; RegionRec FullRegion; BoxRec ScreenBox; @@ -1223,7 +1223,7 @@ xf86InitFBManager(ScreenPtr pScreen, BoxPtr FullBox) Bool xf86InitFBManagerArea(ScreenPtr pScreen, int PixelArea, int Verbosity) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xRectangle Rect[3]; RegionPtr pRegion, pScreenRegion; int nRect; diff --git a/xserver/hw/xfree86/common/xf86pciBus.c b/xserver/hw/xfree86/common/xf86pciBus.c index e52f1da84..258988a84 100644 --- a/xserver/hw/xfree86/common/xf86pciBus.c +++ b/xserver/hw/xfree86/common/xf86pciBus.c @@ -52,7 +52,7 @@ #define PCI_VENDOR_GENERIC 0x00FF /* Bus-specific globals */ -Bool pciSlotClaimed = FALSE; +int pciSlotClaimed = 0; #define PCIINFOCLASSES(c) \ ( (((c) & 0x00ff0000) == (PCI_CLASS_PREHISTORIC << 16)) \ @@ -110,7 +110,7 @@ xf86PciProbe(void) xf86PciVideoInfo[num - 1] = info; pci_device_probe(info); - if (pci_device_is_boot_vga(info)) { + if (primaryBus.type == BUS_NONE && pci_device_is_boot_vga(info)) { primaryBus.type = BUS_PCI; primaryBus.id.pci = info; } @@ -223,7 +223,7 @@ xf86ClaimPciSlot(struct pci_device *d, DriverPtr drvp, p->inUse = FALSE; if (dev) xf86AddDevToEntity(num, dev); - pciSlotClaimed = TRUE; + pciSlotClaimed++; return num; } @@ -235,7 +235,7 @@ xf86ClaimPciSlot(struct pci_device *d, DriverPtr drvp, * Unclaim PCI slot, e.g. if probing failed, so that a different driver can claim. */ void -xf86UnclaimPciSlot(struct pci_device *d) +xf86UnclaimPciSlot(struct pci_device *d, GDevPtr dev) { int i; @@ -244,6 +244,8 @@ xf86UnclaimPciSlot(struct pci_device *d) if ((p->bus.type == BUS_PCI) && (p->bus.id.pci == d)) { /* Probably the slot should be deallocated? */ + xf86RemoveDevFromEntity(i, dev); + pciSlotClaimed--; p->bus.type = BUS_NONE; return; } @@ -350,7 +352,15 @@ xf86ComparePciBusString(const char *busID, int bus, int device, int func) Bool xf86IsPrimaryPci(struct pci_device *pPci) { - return ((primaryBus.type == BUS_PCI) && (pPci == primaryBus.id.pci)); + if (primaryBus.type == BUS_PCI) + return pPci == primaryBus.id.pci; +#ifdef XSERVER_PLATFORM_BUS + if (primaryBus.type == BUS_PLATFORM) + if (primaryBus.id.plat->pdev) + if (MATCH_PCI_DEVICES(primaryBus.id.plat->pdev, pPci)) + return TRUE; +#endif + return FALSE; } /* @@ -365,7 +375,15 @@ xf86GetPciInfoForEntity(int entityIndex) return NULL; p = xf86Entities[entityIndex]; - return (p->bus.type == BUS_PCI) ? p->bus.id.pci : NULL; + switch (p->bus.type) { + case BUS_PCI: + return p->bus.id.pci; + case BUS_PLATFORM: + return p->bus.id.plat->pdev; + default: + break; + } + return NULL; } /* @@ -398,6 +416,13 @@ xf86CheckPciSlot(const struct pci_device *d) if ((p->bus.type == BUS_PCI) && (p->bus.id.pci == d)) { return FALSE; } +#ifdef XSERVER_PLATFORM_BUS + if ((p->bus.type == BUS_PLATFORM) && (p->bus.id.plat->pdev)) { + struct pci_device *ud = p->bus.id.plat->pdev; + if (MATCH_PCI_DEVICES(ud, d)) + return FALSE; + } +#endif } return TRUE; } @@ -537,7 +562,7 @@ xf86PciProbeDev(DriverPtr drvp) foundScreen = TRUE; } else - xf86UnclaimPciSlot(pPci); + xf86UnclaimPciSlot(pPci, devList[i]); } break; @@ -1063,8 +1088,8 @@ xf86ConfigActivePciEntity(ScrnInfoPtr pScrn, int entityIndex, return TRUE; } -static int -videoPtrToDriverList(struct pci_device *dev, +int +xf86VideoPtrToDriverList(struct pci_device *dev, char *returnList[], int returnListMax) { int i; @@ -1122,14 +1147,62 @@ videoPtrToDriverList(struct pci_device *dev, driverList[0] = "i128"; break; case 0x8086: - if ((dev->device_id == 0x00d1) || (dev->device_id == 0x7800)) { - driverList[0] = "i740"; - } - else if (dev->device_id == 0x8108) { - break; /* "hooray" for poulsbo */ - } - else { - driverList[0] = "intel"; + switch (dev->device_id) + { + /* Intel i740 */ + case 0x00d1: + case 0x7800: + driverList[0] = "i740"; + break; + /* GMA500/Poulsbo */ + case 0x8108: + case 0x8109: + /* Try psb driver on Poulsbo - if available */ + driverList[0] = "psb"; + driverList[1] = "psb_drv"; + break; + /* GMA600/Oaktrail */ + case 0x4100: + case 0x4101: + case 0x4102: + case 0x4103: + case 0x4104: + case 0x4105: + case 0x4106: + case 0x4107: + /* Atom E620/Oaktrail */ + case 0x4108: + /* Medfield */ + case 0x0130: + case 0x0131: + case 0x0132: + case 0x0133: + case 0x0134: + case 0x0135: + case 0x0136: + case 0x0137: + /* GMA 3600/CDV */ + case 0x0be0: + case 0x0be1: + case 0x0be2: + case 0x0be3: + case 0x0be4: + case 0x0be5: + case 0x0be6: + case 0x0be7: + case 0x0be8: + case 0x0be9: + case 0x0bea: + case 0x0beb: + case 0x0bec: + case 0x0bed: + case 0x0bee: + case 0x0bef: + /* Use fbdev/vesa driver on Oaktrail, Medfield, CDV */ + break; + default: + driverList[0] = "intel"; + break; } break; case 0x102b: @@ -1247,8 +1320,8 @@ xchomp(char *line) * don't export their PCI ID's properly. If distros don't end up using this * feature it can and should be removed because the symbol-based resolution * scheme should be the primary one */ -static void -matchDriverFromFiles(char **matches, uint16_t match_vendor, uint16_t match_chip) +void +xf86MatchDriverFromFiles(char **matches, uint16_t match_vendor, uint16_t match_chip) { DIR *idsdir; FILE *fp; @@ -1377,7 +1450,7 @@ xf86PciMatchDriver(char *matches[], int nmatches) pci_iterator_destroy(iter); #ifdef __linux__ if (info) - matchDriverFromFiles(matches, info->vendor_id, info->device_id); + xf86MatchDriverFromFiles(matches, info->vendor_id, info->device_id); #endif for (i = 0; (i < nmatches) && (matches[i]); i++) { @@ -1385,7 +1458,7 @@ xf86PciMatchDriver(char *matches[], int nmatches) } if ((info != NULL) && (i < nmatches)) { - i += videoPtrToDriverList(info, &(matches[i]), nmatches - i); + i += xf86VideoPtrToDriverList(info, &(matches[i]), nmatches - i); } return i; diff --git a/xserver/hw/xfree86/common/xf86pciBus.h b/xserver/hw/xfree86/common/xf86pciBus.h index 56ec6e9e7..4972c3688 100644 --- a/xserver/hw/xfree86/common/xf86pciBus.h +++ b/xserver/hw/xfree86/common/xf86pciBus.h @@ -42,4 +42,14 @@ Bool xf86PciConfigure(void *busData, struct pci_device *pDev); void xf86PciConfigureNewDev(void *busData, struct pci_device *pVideo, GDevRec * GDev, int *chipset); +#define MATCH_PCI_DEVICES(x, y) (((x)->domain == (y)->domain) && \ + ((x)->bus == (y)->bus) && \ + ((x)->func == (y)->func) && \ + ((x)->dev == (y)->dev)) + +void +xf86MatchDriverFromFiles(char **matches, uint16_t match_vendor, uint16_t match_chip); +int +xf86VideoPtrToDriverList(struct pci_device *dev, + char *returnList[], int returnListMax); #endif /* _XF86_PCI_BUS_H */ diff --git a/xserver/hw/xfree86/common/xf86platformBus.c b/xserver/hw/xfree86/common/xf86platformBus.c new file mode 100644 index 000000000..58663336a --- /dev/null +++ b/xserver/hw/xfree86/common/xf86platformBus.c @@ -0,0 +1,501 @@ +/* + * Copyright © 2012 Red Hat. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Author: Dave Airlie + */ + +/* + * This file contains the interfaces to the bus-specific code + */ + +#ifdef HAVE_XORG_CONFIG_H +#include +#endif + +#ifdef XSERVER_PLATFORM_BUS +#include + +#include +#include +#include +#include "os.h" +#include "hotplug.h" + +#include "xf86.h" +#include "xf86_OSproc.h" +#include "xf86Priv.h" +#include "xf86str.h" +#include "xf86Bus.h" +#include "Pci.h" +#include "xf86platformBus.h" + +int platformSlotClaimed; + +int xf86_num_platform_devices; + +static struct xf86_platform_device *xf86_platform_devices; + +int +xf86_add_platform_device(struct OdevAttributes *attribs) +{ + xf86_platform_devices = xnfrealloc(xf86_platform_devices, + (sizeof(struct xf86_platform_device) + * (xf86_num_platform_devices + 1))); + + xf86_platform_devices[xf86_num_platform_devices].attribs = attribs; + xf86_platform_devices[xf86_num_platform_devices].pdev = NULL; + + xf86_num_platform_devices++; + return 0; +} + +int +xf86_remove_platform_device(int dev_index) +{ + int j; + + config_odev_free_attribute_list(xf86_platform_devices[dev_index].attribs); + + for (j = dev_index; j < xf86_num_platform_devices - 1; j++) + memcpy(&xf86_platform_devices[j], &xf86_platform_devices[j + 1], sizeof(struct xf86_platform_device)); + xf86_num_platform_devices--; + return 0; +} + +Bool +xf86_add_platform_device_attrib(int index, int attrib_id, char *attrib_name) +{ + struct xf86_platform_device *device = &xf86_platform_devices[index]; + + return config_odev_add_attribute(device->attribs, attrib_id, attrib_name); +} + +char * +xf86_get_platform_attrib(int index, int attrib_id) +{ + struct xf86_platform_device *device = &xf86_platform_devices[index]; + struct OdevAttribute *oa; + + xorg_list_for_each_entry(oa, &device->attribs->list, member) { + if (oa->attrib_id == attrib_id) + return oa->attrib_name; + } + return NULL; +} + +char * +xf86_get_platform_device_attrib(struct xf86_platform_device *device, int attrib_id) +{ + struct OdevAttribute *oa; + + xorg_list_for_each_entry(oa, &device->attribs->list, member) { + if (oa->attrib_id == attrib_id) + return oa->attrib_name; + } + return NULL; +} + + +/* + * xf86IsPrimaryPlatform() -- return TRUE if primary device + * is a platform device and it matches this one. + */ + +static Bool +xf86IsPrimaryPlatform(struct xf86_platform_device *plat) +{ + return ((primaryBus.type == BUS_PLATFORM) && (plat == primaryBus.id.plat)); +} + +static void +platform_find_pci_info(struct xf86_platform_device *pd, char *busid) +{ + struct pci_slot_match devmatch; + struct pci_device *info; + struct pci_device_iterator *iter; + int ret; + + ret = sscanf(busid, "pci:%04x:%02x:%02x.%u", + &devmatch.domain, &devmatch.bus, &devmatch.dev, + &devmatch.func); + if (ret != 4) + return; + + iter = pci_slot_match_iterator_create(&devmatch); + info = pci_device_next(iter); + if (info) { + pd->pdev = info; + pci_device_probe(info); + if (pci_device_is_boot_vga(info)) { + primaryBus.type = BUS_PLATFORM; + primaryBus.id.plat = pd; + } + } + pci_iterator_destroy(iter); + +} + +static Bool +xf86_check_platform_slot(const struct xf86_platform_device *pd) +{ + int i; + + for (i = 0; i < xf86NumEntities; i++) { + const EntityPtr u = xf86Entities[i]; + + if (pd->pdev && u->bus.type == BUS_PCI) + return !MATCH_PCI_DEVICES(pd->pdev, u->bus.id.pci); + if ((u->bus.type == BUS_PLATFORM) && (pd == u->bus.id.plat)) { + return FALSE; + } + } + return TRUE; +} + +/** + * @return The numbers of found devices that match with the current system + * drivers. + */ +int +xf86PlatformMatchDriver(char *matches[], int nmatches) +{ + int i, j = 0; + struct pci_device *info = NULL; + int pass = 0; + + for (pass = 0; pass < 2; pass++) { + for (i = 0; i < xf86_num_platform_devices; i++) { + + if (xf86IsPrimaryPlatform(&xf86_platform_devices[i]) && (pass == 1)) + continue; + else if (!xf86IsPrimaryPlatform(&xf86_platform_devices[i]) && (pass == 0)) + continue; + + info = xf86_platform_devices[i].pdev; +#ifdef __linux__ + if (info) + xf86MatchDriverFromFiles(matches, info->vendor_id, info->device_id); +#endif + + for (j = 0; (j < nmatches) && (matches[j]); j++) { + /* find end of matches list */ + } + + if ((info != NULL) && (j < nmatches)) { + j += xf86VideoPtrToDriverList(info, &(matches[j]), nmatches - j); + } + } + } + return j; +} + +int +xf86platformProbe(void) +{ + int i; + Bool pci = TRUE; + + config_odev_probe(xf86PlatformDeviceProbe); + + if (!xf86scanpci()) { + pci = FALSE; + } + + for (i = 0; i < xf86_num_platform_devices; i++) { + char *busid = xf86_get_platform_attrib(i, ODEV_ATTRIB_BUSID); + + if (pci && (strncmp(busid, "pci:", 4) == 0)) { + platform_find_pci_info(&xf86_platform_devices[i], busid); + } + } + return 0; +} + +static int +xf86ClaimPlatformSlot(struct xf86_platform_device * d, DriverPtr drvp, + int chipset, GDevPtr dev, Bool active) +{ + EntityPtr p = NULL; + int num; + + if (xf86_check_platform_slot(d)) { + num = xf86AllocateEntity(); + p = xf86Entities[num]; + p->driver = drvp; + p->chipset = chipset; + p->bus.type = BUS_PLATFORM; + p->bus.id.plat = d; + p->active = active; + p->inUse = FALSE; + if (dev) + xf86AddDevToEntity(num, dev); + + platformSlotClaimed++; + return num; + } + else + return -1; +} + +static int +xf86UnclaimPlatformSlot(struct xf86_platform_device *d, GDevPtr dev) +{ + int i; + + for (i = 0; i < xf86NumEntities; i++) { + const EntityPtr p = xf86Entities[i]; + + if ((p->bus.type == BUS_PLATFORM) && (p->bus.id.plat == d)) { + if (dev) + xf86RemoveDevFromEntity(i, dev); + platformSlotClaimed--; + p->bus.type = BUS_NONE; + return 0; + } + } + return 0; +} + + +#define END_OF_MATCHES(m) \ + (((m).vendor_id == 0) && ((m).device_id == 0) && ((m).subvendor_id == 0)) + +static Bool doPlatformProbe(struct xf86_platform_device *dev, DriverPtr drvp, + GDevPtr gdev, int flags, intptr_t match_data) +{ + Bool foundScreen = FALSE; + int entity; + + if (gdev->screen == 0 && !xf86_check_platform_slot(dev)) + return FALSE; + + entity = xf86ClaimPlatformSlot(dev, drvp, 0, + gdev, gdev->active); + + if ((entity == -1) && (gdev->screen > 0)) { + unsigned nent; + + for (nent = 0; nent < xf86NumEntities; nent++) { + EntityPtr pEnt = xf86Entities[nent]; + + if (pEnt->bus.type != BUS_PLATFORM) + continue; + if (pEnt->bus.id.plat == dev) { + entity = nent; + xf86AddDevToEntity(nent, gdev); + break; + } + } + } + if (entity != -1) { + if (drvp->platformProbe(drvp, entity, flags, dev, match_data)) + foundScreen = TRUE; + else + xf86UnclaimPlatformSlot(dev, gdev); + } + return foundScreen; +} + +static Bool +probeSingleDevice(struct xf86_platform_device *dev, DriverPtr drvp, GDevPtr gdev, int flags) +{ + int k; + Bool foundScreen = FALSE; + struct pci_device *pPci; + const struct pci_id_match *const devices = drvp->supported_devices; + + if (dev->pdev && devices) { + int device_id = dev->pdev->device_id; + pPci = dev->pdev; + for (k = 0; !END_OF_MATCHES(devices[k]); k++) { + if (PCI_ID_COMPARE(devices[k].vendor_id, pPci->vendor_id) + && PCI_ID_COMPARE(devices[k].device_id, device_id) + && ((devices[k].device_class_mask & pPci->device_class) + == devices[k].device_class)) { + foundScreen = doPlatformProbe(dev, drvp, gdev, flags, devices[k].match_data); + if (foundScreen) + break; + } + } + } + else if (dev->pdev && !devices) + return FALSE; + else + foundScreen = doPlatformProbe(dev, drvp, gdev, flags, 0); + return foundScreen; +} + +int +xf86platformProbeDev(DriverPtr drvp) +{ + Bool foundScreen = FALSE; + GDevPtr *devList; + const unsigned numDevs = xf86MatchDevice(drvp->driverName, &devList); + int i, j; + + /* find the main device or any device specificed in xorg.conf */ + for (i = 0; i < numDevs; i++) { + for (j = 0; j < xf86_num_platform_devices; j++) { + if (devList[i]->busID && *devList[i]->busID) { + if (xf86PlatformDeviceCheckBusID(&xf86_platform_devices[j], devList[i]->busID)) + break; + } + else { + /* for non-seat0 servers assume first device is the master */ + if (ServerIsNotSeat0()) + break; + if (xf86_platform_devices[j].pdev) { + if (xf86IsPrimaryPlatform(&xf86_platform_devices[j])) + break; + } + } + } + + if (j == xf86_num_platform_devices) + continue; + + foundScreen = probeSingleDevice(&xf86_platform_devices[j], drvp, devList[i], 0); + if (!foundScreen) + continue; + } + + /* if autoaddgpu devices is enabled then go find a few more and add them as GPU screens */ + if (xf86Info.autoAddGPU && numDevs) { + for (j = 0; j < xf86_num_platform_devices; j++) { + probeSingleDevice(&xf86_platform_devices[j], drvp, devList[0], PLATFORM_PROBE_GPU_SCREEN); + } + } + + return foundScreen; +} + +int +xf86platformAddDevice(int index) +{ + int i, old_screens, scr_index; + DriverPtr drvp = NULL; + int entity; + screenLayoutPtr layout; + static char *hotplug_driver_name = "modesetting"; + + /* force load the driver for now */ + xf86LoadOneModule(hotplug_driver_name, NULL); + + for (i = 0; i < xf86NumDrivers; i++) { + if (!xf86DriverList[i]) + continue; + + if (!strcmp(xf86DriverList[i]->driverName, hotplug_driver_name)) { + drvp = xf86DriverList[i]; + break; + } + } + if (i == xf86NumDrivers) + return -1; + + old_screens = xf86NumGPUScreens; + entity = xf86ClaimPlatformSlot(&xf86_platform_devices[index], + drvp, 0, 0, 0); + if (!drvp->platformProbe(drvp, entity, PLATFORM_PROBE_GPU_SCREEN, &xf86_platform_devices[index], 0)) { + xf86UnclaimPlatformSlot(&xf86_platform_devices[index], NULL); + } + if (old_screens == xf86NumGPUScreens) + return -1; + i = old_screens; + + for (layout = xf86ConfigLayout.screens; layout->screen != NULL; + layout++) { + xf86GPUScreens[i]->confScreen = layout->screen; + break; + } + + if (xf86GPUScreens[i]->PreInit && + xf86GPUScreens[i]->PreInit(xf86GPUScreens[i], 0)) + xf86GPUScreens[i]->configured = TRUE; + + if (!xf86GPUScreens[i]->configured) { + ErrorF("hotplugged device %d didn't configure\n", i); + xf86DeleteScreen(xf86GPUScreens[i]); + return -1; + } + + scr_index = AddGPUScreen(xf86GPUScreens[i]->ScreenInit, 0, NULL); + if (scr_index == -1) { + xf86DeleteScreen(xf86GPUScreens[i]); + xf86UnclaimPlatformSlot(&xf86_platform_devices[index], NULL); + xf86NumGPUScreens = old_screens; + return -1; + } + dixSetPrivate(&xf86GPUScreens[i]->pScreen->devPrivates, + xf86ScreenKey, xf86GPUScreens[i]); + + CreateScratchPixmapsForScreen(xf86GPUScreens[i]->pScreen); + + /* attach unbound to 0 protocol screen */ + AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen); + + return 0; +} + +void +xf86platformRemoveDevice(int index) +{ + EntityPtr entity; + int ent_num, i, j; + Bool found; + + for (ent_num = 0; ent_num < xf86NumEntities; ent_num++) { + entity = xf86Entities[ent_num]; + if (entity->bus.type == BUS_PLATFORM && + entity->bus.id.plat == &xf86_platform_devices[index]) + break; + } + if (ent_num == xf86NumEntities) + goto out; + + found = FALSE; + for (i = 0; i < xf86NumGPUScreens; i++) { + for (j = 0; j < xf86GPUScreens[i]->numEntities; j++) + if (xf86GPUScreens[i]->entityList[j] == ent_num) { + found = TRUE; + break; + } + if (found) + break; + } + if (!found) { + ErrorF("failed to find screen to remove\n"); + goto out; + } + + xf86GPUScreens[i]->pScreen->CloseScreen(xf86GPUScreens[i]->pScreen); + + RemoveGPUScreen(xf86GPUScreens[i]->pScreen); + xf86DeleteScreen(xf86GPUScreens[i]); + + xf86UnclaimPlatformSlot(&xf86_platform_devices[index], NULL); + + xf86_remove_platform_device(index); + + out: + return; +} +#endif diff --git a/xserver/hw/xfree86/common/xf86platformBus.h b/xserver/hw/xfree86/common/xf86platformBus.h new file mode 100644 index 000000000..49afc247b --- /dev/null +++ b/xserver/hw/xfree86/common/xf86platformBus.h @@ -0,0 +1,64 @@ +/* + * Copyright © 2012 Red Hat. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Author: Dave Airlie + */ +#ifndef XF86_PLATFORM_BUS_H +#define XF86_PLATFORM_BUS_H + +#include "hotplug.h" + +struct xf86_platform_device { + struct OdevAttributes *attribs; + /* for PCI devices */ + struct pci_device *pdev; +}; + +#ifdef XSERVER_PLATFORM_BUS +int xf86platformProbe(void); +int xf86platformProbeDev(DriverPtr drvp); + +extern int xf86_num_platform_devices; + +extern char * +xf86_get_platform_attrib(int index, int attrib_id); +extern int +xf86_add_platform_device(struct OdevAttributes *attribs); +extern int +xf86_remove_platform_device(int dev_index); +extern Bool +xf86_add_platform_device_attrib(int index, int attrib_id, char *attrib_str); + +extern int +xf86platformAddDevice(int index); +extern void +xf86platformRemoveDevice(int index); + +extern _X_EXPORT char * +xf86_get_platform_device_attrib(struct xf86_platform_device *device, int attrib_id); +extern _X_EXPORT Bool +xf86PlatformDeviceCheckBusID(struct xf86_platform_device *device, const char *busid); + +extern _X_EXPORT int +xf86PlatformMatchDriver(char *matches[], int nmatches); +#endif + +#endif diff --git a/xserver/hw/xfree86/common/xf86sbusBus.c b/xserver/hw/xfree86/common/xf86sbusBus.c index 27d24f8e1..b6a6b94b3 100644 --- a/xserver/hw/xfree86/common/xf86sbusBus.c +++ b/xserver/hw/xfree86/common/xf86sbusBus.c @@ -667,7 +667,7 @@ xf86SbusCmapLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, } static Bool -xf86SbusCmapCloseScreen(int i, ScreenPtr pScreen) +xf86SbusCmapCloseScreen(ScreenPtr pScreen) { sbusCmapPtr cmap; struct fbcmap fbcmap; @@ -683,7 +683,7 @@ xf86SbusCmapCloseScreen(int i, ScreenPtr pScreen) } pScreen->CloseScreen = cmap->CloseScreen; free(cmap); - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } Bool diff --git a/xserver/hw/xfree86/common/xf86str.h b/xserver/hw/xfree86/common/xf86str.h index 6294845bc..4c2d147a2 100644 --- a/xserver/hw/xfree86/common/xf86str.h +++ b/xserver/hw/xfree86/common/xf86str.h @@ -311,6 +311,7 @@ struct _SymTabRec; struct _PciChipsets; struct pci_device; +struct xf86_platform_device; typedef struct _DriverRec { int driverVersion; @@ -325,8 +326,15 @@ typedef struct _DriverRec { const struct pci_id_match *supported_devices; Bool (*PciProbe) (struct _DriverRec * drv, int entity_num, struct pci_device * dev, intptr_t match_data); + Bool (*platformProbe) (struct _DriverRec * drv, int entity_num, int flags, + struct xf86_platform_device * dev, intptr_t match_data); } DriverRec, *DriverPtr; +/* + * platform probe flags + */ +#define PLATFORM_PROBE_GPU_SCREEN 1 + /* * AddDriver flags */ @@ -339,10 +347,11 @@ typedef struct _DriverRec { */ /* Tolerate prior #include */ -#if defined(linux) && defined(_INPUT_H) +#if defined(linux) #undef BUS_NONE #undef BUS_PCI #undef BUS_SBUS +#undef BUS_PLATFORM #undef BUS_last #endif @@ -350,6 +359,7 @@ typedef enum { BUS_NONE, BUS_PCI, BUS_SBUS, + BUS_PLATFORM, BUS_last /* Keep last */ } BusType; @@ -362,6 +372,7 @@ typedef struct _bus { union { struct pci_device *pci; SbusBusId sbus; + struct xf86_platform_device *plat; } id; } BusRec, *BusPtr; @@ -630,18 +641,18 @@ typedef struct { typedef Bool xf86ProbeProc(DriverPtr, int); typedef Bool xf86PreInitProc(ScrnInfoPtr, int); -typedef Bool xf86ScreenInitProc(int, ScreenPtr, int, char **); -typedef Bool xf86SwitchModeProc(int, DisplayModePtr, int); -typedef void xf86AdjustFrameProc(int, int, int, int); -typedef Bool xf86EnterVTProc(int, int); -typedef void xf86LeaveVTProc(int, int); -typedef void xf86FreeScreenProc(int, int); -typedef ModeStatus xf86ValidModeProc(int, DisplayModePtr, Bool, int); -typedef void xf86EnableDisableFBAccessProc(int, Bool); -typedef int xf86SetDGAModeProc(int, int, DGADevicePtr); -typedef int xf86ChangeGammaProc(int, Gamma); -typedef void xf86PointerMovedProc(int, int, int); -typedef Bool xf86PMEventProc(int, pmEvent, Bool); +typedef Bool xf86ScreenInitProc(ScreenPtr, int, char **); +typedef Bool xf86SwitchModeProc(ScrnInfoPtr, DisplayModePtr); +typedef void xf86AdjustFrameProc(ScrnInfoPtr, int, int); +typedef Bool xf86EnterVTProc(ScrnInfoPtr); +typedef void xf86LeaveVTProc(ScrnInfoPtr); +typedef void xf86FreeScreenProc(ScrnInfoPtr); +typedef ModeStatus xf86ValidModeProc(ScrnInfoPtr, DisplayModePtr, Bool, int); +typedef void xf86EnableDisableFBAccessProc(ScrnInfoPtr, Bool); +typedef int xf86SetDGAModeProc(ScrnInfoPtr, int, DGADevicePtr); +typedef int xf86ChangeGammaProc(ScrnInfoPtr, Gamma); +typedef void xf86PointerMovedProc(ScrnInfoPtr, int, int); +typedef Bool xf86PMEventProc(ScrnInfoPtr, pmEvent, Bool); typedef void xf86DPMSSetProc(ScrnInfoPtr, int, int); typedef void xf86LoadPaletteProc(ScrnInfoPtr, int, int *, LOCO *, VisualPtr); typedef void xf86SetOverscanProc(ScrnInfoPtr, int); @@ -802,6 +813,8 @@ typedef struct _ScrnInfoRec { */ funcPointer reservedFuncs[NUM_RESERVED_FUNCS]; + Bool is_gpu; + uint32_t capabilities; } ScrnInfoRec; typedef struct { diff --git a/xserver/hw/xfree86/dixmods/extmod/xf86vmode.c b/xserver/hw/xfree86/common/xf86vmode.c similarity index 92% rename from xserver/hw/xfree86/dixmods/extmod/xf86vmode.c rename to xserver/hw/xfree86/common/xf86vmode.c index 68c4b583f..cad0e6a21 100644 --- a/xserver/hw/xfree86/dixmods/extmod/xf86vmode.c +++ b/xserver/hw/xfree86/common/xf86vmode.c @@ -39,6 +39,7 @@ from Kaleb S. KEITHLEY #include "misc.h" #include "dixstruct.h" #include "extnsionst.h" +#include "xf86Extensions.h" #include "scrnintstr.h" #include "servermd.h" #include @@ -240,7 +241,6 @@ static void SendXF86VidModeNotify(ScreenPtr pScreen, int state, Bool forced) { XF86VidModeScreenPrivatePtr pPriv; - XF86VidModeEventPtr pEv; unsigned long mask; xXF86VidModeNotifyEvent ev; int kind; @@ -253,17 +253,21 @@ SendXF86VidModeNotify(ScreenPtr pScreen, int state, Bool forced) return; kind = XF86VidModeModeChange; for (pEv = pPriv->events; pEv; pEv = pEv->next) { - if (!(pEv->mask & mask)) - continue; - ev.type = XF86VidModeNotify + XF86VidModeEventBase; - ev.state = state; - ev.timestamp = currentTime.milliseconds; - ev.root = pScreen->root->drawable.id; - ev.kind = kind; - ev.forced = forced; - WriteEventsToClient(pEv->client, 1, (xEvent *) &ev); -}} static void + if (pEv->mask & mask) { + XF86VidModeEventPtr pEv = { + .type = XF86VidModeNotify + XF86VidModeEventBase, + .state = state, + .timestamp = currentTime.milliseconds, + .root = pScreen->root->drawable.id, + .kind = kind, + .forced = forced + }; + WriteEventsToClient(pEv->client, 1, (xEvent *) &ev); + } + } +} +static void SXF86VidModeNotifyEvent(xXF86VidModeNotifyEvent * from, xXF86VidModeNotifyEvent * to) { @@ -280,23 +284,25 @@ SXF86VidModeNotifyEvent(xXF86VidModeNotifyEvent * from, static int ProcXF86VidModeQueryVersion(ClientPtr client) { - xXF86VidModeQueryVersionReply rep; + xXF86VidModeQueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .majorVersion = SERVER_XF86VIDMODE_MAJOR_VERSION, + .minorVersion = SERVER_XF86VIDMODE_MINOR_VERSION + }; DEBUG_P("XF86VidModeQueryVersion"); REQUEST_SIZE_MATCH(xXF86VidModeQueryVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = SERVER_XF86VIDMODE_MAJOR_VERSION; - rep.minorVersion = SERVER_XF86VIDMODE_MINOR_VERSION; + if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swaps(&rep.majorVersion); swaps(&rep.minorVersion); } - WriteToClient(client, sizeof(xXF86VidModeQueryVersionReply), (char *) &rep); + WriteToClient(client, sizeof(xXF86VidModeQueryVersionReply), &rep); return Success; } @@ -304,8 +310,10 @@ static int ProcXF86VidModeGetModeLine(ClientPtr client) { REQUEST(xXF86VidModeGetModeLineReq); - xXF86VidModeGetModeLineReply rep; - xXF86OldVidModeGetModeLineReply oldrep; + xXF86VidModeGetModeLineReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence + }; pointer mode; int dotClock; int ver; @@ -314,7 +322,7 @@ ProcXF86VidModeGetModeLine(ClientPtr client) ver = ClientMajorVersion(client); REQUEST_SIZE_MATCH(xXF86VidModeGetModeLineReq); - rep.type = X_Reply; + if (ver < 2) { rep.length = bytes_to_int32(SIZEOF(xXF86OldVidModeGetModeLineReply) - SIZEOF(xGenericReply)); @@ -323,7 +331,6 @@ ProcXF86VidModeGetModeLine(ClientPtr client) rep.length = bytes_to_int32(SIZEOF(xXF86VidModeGetModeLineReply) - SIZEOF(xGenericReply)); } - rep.sequenceNumber = client->sequence; if (stuff->screen >= screenInfo.numScreens) return BadValue; @@ -377,26 +384,26 @@ ProcXF86VidModeGetModeLine(ClientPtr client) swapl(&rep.privsize); } if (ver < 2) { - oldrep.type = rep.type; - oldrep.sequenceNumber = rep.sequenceNumber; - oldrep.length = rep.length; - oldrep.dotclock = rep.dotclock; - oldrep.hdisplay = rep.hdisplay; - oldrep.hsyncstart = rep.hsyncstart; - oldrep.hsyncend = rep.hsyncend; - oldrep.htotal = rep.htotal; - oldrep.vdisplay = rep.vdisplay; - oldrep.vsyncstart = rep.vsyncstart; - oldrep.vsyncend = rep.vsyncend; - oldrep.vtotal = rep.vtotal; - oldrep.flags = rep.flags; - oldrep.privsize = rep.privsize; - WriteToClient(client, sizeof(xXF86OldVidModeGetModeLineReply), - (char *) &oldrep); + xXF86OldVidModeGetModeLineReply oldrep = { + .type = rep.type, + .sequenceNumber = rep.sequenceNumber, + .length = rep.length, + .dotclock = rep.dotclock, + .hdisplay = rep.hdisplay, + .hsyncstart = rep.hsyncstart, + .hsyncend = rep.hsyncend, + .htotal = rep.htotal, + .vdisplay = rep.vdisplay, + .vsyncstart = rep.vsyncstart, + .vsyncend = rep.vsyncend, + .vtotal = rep.vtotal, + .flags = rep.flags, + .privsize = rep.privsize + }; + WriteToClient(client, sizeof(xXF86OldVidModeGetModeLineReply), &oldrep); } else { - WriteToClient(client, sizeof(xXF86VidModeGetModeLineReply), - (char *) &rep); + WriteToClient(client, sizeof(xXF86VidModeGetModeLineReply), &rep); } return Success; } @@ -406,8 +413,6 @@ ProcXF86VidModeGetAllModeLines(ClientPtr client) { REQUEST(xXF86VidModeGetAllModeLinesReq); xXF86VidModeGetAllModeLinesReply rep; - xXF86VidModeModeInfo mdinf; - xXF86OldVidModeModeInfo oldmdinf; pointer mode; int modecount, dotClock; int ver; @@ -428,37 +433,40 @@ ProcXF86VidModeGetAllModeLines(ClientPtr client) if (!VidModeGetFirstModeline(stuff->screen, &mode, &dotClock)) return BadValue; - rep.type = X_Reply; - rep.length = SIZEOF(xXF86VidModeGetAllModeLinesReply) - - SIZEOF(xGenericReply); + rep = (xXF86VidModeGetAllModeLinesReply) { + .type = X_Reply, + .length = SIZEOF(xXF86VidModeGetAllModeLinesReply) - + SIZEOF(xGenericReply), + .sequenceNumber = client->sequence, + .modecount = modecount + }; if (ver < 2) rep.length += modecount * sizeof(xXF86OldVidModeModeInfo); else rep.length += modecount * sizeof(xXF86VidModeModeInfo); rep.length >>= 2; - rep.sequenceNumber = client->sequence; - rep.modecount = modecount; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.modecount); } - WriteToClient(client, sizeof(xXF86VidModeGetAllModeLinesReply), - (char *) &rep); + WriteToClient(client, sizeof(xXF86VidModeGetAllModeLinesReply), &rep); do { - mdinf.dotclock = dotClock; - mdinf.hdisplay = VidModeGetModeValue(mode, VIDMODE_H_DISPLAY); - mdinf.hsyncstart = VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART); - mdinf.hsyncend = VidModeGetModeValue(mode, VIDMODE_H_SYNCEND); - mdinf.htotal = VidModeGetModeValue(mode, VIDMODE_H_TOTAL); - mdinf.hskew = VidModeGetModeValue(mode, VIDMODE_H_SKEW); - mdinf.vdisplay = VidModeGetModeValue(mode, VIDMODE_V_DISPLAY); - mdinf.vsyncstart = VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART); - mdinf.vsyncend = VidModeGetModeValue(mode, VIDMODE_V_SYNCEND); - mdinf.vtotal = VidModeGetModeValue(mode, VIDMODE_V_TOTAL); - mdinf.flags = VidModeGetModeValue(mode, VIDMODE_FLAGS); - mdinf.privsize = 0; + xXF86VidModeModeInfo mdinf = { + .dotclock = dotClock, + .hdisplay = VidModeGetModeValue(mode, VIDMODE_H_DISPLAY), + .hsyncstart = VidModeGetModeValue(mode, VIDMODE_H_SYNCSTART), + .hsyncend = VidModeGetModeValue(mode, VIDMODE_H_SYNCEND), + .htotal = VidModeGetModeValue(mode, VIDMODE_H_TOTAL), + .hskew = VidModeGetModeValue(mode, VIDMODE_H_SKEW), + .vdisplay = VidModeGetModeValue(mode, VIDMODE_V_DISPLAY), + .vsyncstart = VidModeGetModeValue(mode, VIDMODE_V_SYNCSTART), + .vsyncend = VidModeGetModeValue(mode, VIDMODE_V_SYNCEND), + .vtotal = VidModeGetModeValue(mode, VIDMODE_V_TOTAL), + .flags = VidModeGetModeValue(mode, VIDMODE_FLAGS), + .privsize = 0 + }; if (client->swapped) { swapl(&mdinf.dotclock); swaps(&mdinf.hdisplay); @@ -474,23 +482,23 @@ ProcXF86VidModeGetAllModeLines(ClientPtr client) swapl(&mdinf.privsize); } if (ver < 2) { - oldmdinf.dotclock = mdinf.dotclock; - oldmdinf.hdisplay = mdinf.hdisplay; - oldmdinf.hsyncstart = mdinf.hsyncstart; - oldmdinf.hsyncend = mdinf.hsyncend; - oldmdinf.htotal = mdinf.htotal; - oldmdinf.vdisplay = mdinf.vdisplay; - oldmdinf.vsyncstart = mdinf.vsyncstart; - oldmdinf.vsyncend = mdinf.vsyncend; - oldmdinf.vtotal = mdinf.vtotal; - oldmdinf.flags = mdinf.flags; - oldmdinf.privsize = mdinf.privsize; - WriteToClient(client, sizeof(xXF86OldVidModeModeInfo), - (char *) &oldmdinf); + xXF86OldVidModeModeInfo oldmdinf = { + .dotclock = mdinf.dotclock, + .hdisplay = mdinf.hdisplay, + .hsyncstart = mdinf.hsyncstart, + .hsyncend = mdinf.hsyncend, + .htotal = mdinf.htotal, + .vdisplay = mdinf.vdisplay, + .vsyncstart = mdinf.vsyncstart, + .vsyncend = mdinf.vsyncend, + .vtotal = mdinf.vtotal, + .flags = mdinf.flags, + .privsize = mdinf.privsize + }; + WriteToClient(client, sizeof(xXF86OldVidModeModeInfo), &oldmdinf); } else { - WriteToClient(client, sizeof(xXF86VidModeModeInfo), - (char *) &mdinf); + WriteToClient(client, sizeof(xXF86VidModeModeInfo), &mdinf); } } while (VidModeGetNextModeline(stuff->screen, &mode, &dotClock)); @@ -1030,18 +1038,19 @@ ProcXF86VidModeValidateModeLine(ClientPtr client) status_reply: free(modetmp); - rep.type = X_Reply; - rep.length = bytes_to_int32(SIZEOF(xXF86VidModeValidateModeLineReply) - - SIZEOF(xGenericReply)); - rep.sequenceNumber = client->sequence; - rep.status = status; + rep = (xXF86VidModeValidateModeLineReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(SIZEOF(xXF86VidModeValidateModeLineReply) + - SIZEOF(xGenericReply)), + .status = status + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.status); } - WriteToClient(client, sizeof(xXF86VidModeValidateModeLineReply), - (char *) &rep); + WriteToClient(client, sizeof(xXF86VidModeValidateModeLineReply), &rep); if (xf86GetVerbosity() > DEFAULT_XF86VIDMODE_VERBOSITY) ErrorF("ValidateModeLine - Succeeded (status = %d)\n", status); return Success; @@ -1190,7 +1199,10 @@ static int ProcXF86VidModeGetMonitor(ClientPtr client) { REQUEST(xXF86VidModeGetMonitorReq); - xXF86VidModeGetMonitorReply rep; + xXF86VidModeGetMonitorReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence + }; CARD32 *hsyncdata, *vsyncdata; int i, nHsync, nVrefresh; pointer monitor; @@ -1208,7 +1220,6 @@ ProcXF86VidModeGetMonitor(ClientPtr client) nHsync = VidModeGetMonitorValue(monitor, VIDMODE_MON_NHSYNC, 0).i; nVrefresh = VidModeGetMonitorValue(monitor, VIDMODE_MON_NVREFRESH, 0).i; - rep.type = X_Reply; if ((char *) (VidModeGetMonitorValue(monitor, VIDMODE_MON_VENDOR, 0)).ptr) rep.vendorLength = strlen((char *) (VidModeGetMonitorValue(monitor, VIDMODE_MON_VENDOR, @@ -1227,7 +1238,6 @@ ProcXF86VidModeGetMonitor(ClientPtr client) nVrefresh) * sizeof(CARD32) + pad_to_int32(rep.vendorLength) + pad_to_int32(rep.modelLength)); - rep.sequenceNumber = client->sequence; rep.nhsync = nHsync; rep.nvsync = nVrefresh; hsyncdata = malloc(nHsync * sizeof(CARD32)); @@ -1262,20 +1272,16 @@ ProcXF86VidModeGetMonitor(ClientPtr client) swaps(&rep.sequenceNumber); swapl(&rep.length); } - WriteToClient(client, SIZEOF(xXF86VidModeGetMonitorReply), (char *) &rep); + WriteToClient(client, SIZEOF(xXF86VidModeGetMonitorReply), &rep); client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, nHsync * sizeof(CARD32), hsyncdata); WriteSwappedDataToClient(client, nVrefresh * sizeof(CARD32), vsyncdata); if (rep.vendorLength) WriteToClient(client, rep.vendorLength, - (char - *) (VidModeGetMonitorValue(monitor, VIDMODE_MON_VENDOR, - 0)).ptr); + (VidModeGetMonitorValue(monitor, VIDMODE_MON_VENDOR, 0)).ptr); if (rep.modelLength) WriteToClient(client, rep.modelLength, - (char - *) (VidModeGetMonitorValue(monitor, VIDMODE_MON_MODEL, - 0)).ptr); + (VidModeGetMonitorValue(monitor, VIDMODE_MON_MODEL, 0)).ptr); free(hsyncdata); free(vsyncdata); @@ -1297,13 +1303,15 @@ ProcXF86VidModeGetViewPort(ClientPtr client) if (stuff->screen >= screenInfo.numScreens) return BadValue; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - VidModeGetViewPort(stuff->screen, &x, &y); - rep.x = x; - rep.y = y; + + rep = (xXF86VidModeGetViewPortReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .x = x, + .y = y + }; if (client->swapped) { swaps(&rep.sequenceNumber); @@ -1311,7 +1319,7 @@ ProcXF86VidModeGetViewPort(ClientPtr client) swapl(&rep.x); swapl(&rep.y); } - WriteToClient(client, SIZEOF(xXF86VidModeGetViewPortReply), (char *) &rep); + WriteToClient(client, SIZEOF(xXF86VidModeGetViewPortReply), &rep); return Success; } @@ -1353,16 +1361,18 @@ ProcXF86VidModeGetDotClocks(ClientPtr client) numClocks = VidModeGetNumOfClocks(stuff->screen, &ClockProg); - rep.type = X_Reply; - rep.length = bytes_to_int32(SIZEOF(xXF86VidModeGetDotClocksReply) - - SIZEOF(xGenericReply) + numClocks); - rep.sequenceNumber = client->sequence; - rep.clocks = numClocks; - rep.maxclocks = MAXCLOCKS; - rep.flags = 0; + rep = (xXF86VidModeGetDotClocksReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(SIZEOF(xXF86VidModeGetDotClocksReply) + - SIZEOF(xGenericReply) + numClocks), + .clocks = numClocks, + .maxclocks = MAXCLOCKS, + .flags = 0 + }; if (!ClockProg) { - Clocks = malloc(numClocks * sizeof(int)); + Clocks = calloc(numClocks, sizeof(int)); if (!Clocks) return BadValue; if (!VidModeGetClocks(stuff->screen, Clocks)) { @@ -1380,7 +1390,7 @@ ProcXF86VidModeGetDotClocks(ClientPtr client) swapl(&rep.maxclocks); swapl(&rep.flags); } - WriteToClient(client, sizeof(xXF86VidModeGetDotClocksReply), (char *) &rep); + WriteToClient(client, sizeof(xXF86VidModeGetDotClocksReply), &rep); if (!ClockProg) { for (n = 0; n < numClocks; n++) { dotclock = *Clocks++; @@ -1388,7 +1398,7 @@ ProcXF86VidModeGetDotClocks(ClientPtr client) WriteSwappedDataToClient(client, 4, (char *) &dotclock); } else { - WriteToClient(client, 4, (char *) &dotclock); + WriteToClient(client, 4, &dotclock); } } } @@ -1431,14 +1441,16 @@ ProcXF86VidModeGetGamma(ClientPtr client) if (stuff->screen >= screenInfo.numScreens) return BadValue; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; if (!VidModeGetGamma(stuff->screen, &red, &green, &blue)) return BadValue; - rep.red = (CARD32) (red * 10000.); - rep.green = (CARD32) (green * 10000.); - rep.blue = (CARD32) (blue * 10000.); + rep = (xXF86VidModeGetGammaReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .red = (CARD32) (red * 10000.), + .green = (CARD32) (green * 10000.), + .blue = (CARD32) (blue * 10000.) + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); @@ -1446,7 +1458,7 @@ ProcXF86VidModeGetGamma(ClientPtr client) swapl(&rep.green); swapl(&rep.blue); } - WriteToClient(client, sizeof(xXF86VidModeGetGammaReply), (char *) &rep); + WriteToClient(client, sizeof(xXF86VidModeGetGammaReply), &rep); return Success; } @@ -1489,14 +1501,14 @@ ProcXF86VidModeGetGammaRamp(ClientPtr client) REQUEST(xXF86VidModeGetGammaRampReq); + REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampReq); + if (stuff->screen >= screenInfo.numScreens) return BadValue; if (stuff->size != VidModeGetGammaRampSize(stuff->screen)) return BadValue; - REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampReq); - length = (stuff->size + 1) & ~1; if (stuff->size) { @@ -1510,20 +1522,22 @@ ProcXF86VidModeGetGammaRamp(ClientPtr client) return BadValue; } } - rep.type = X_Reply; - rep.length = (length >> 1) * 3; - rep.sequenceNumber = client->sequence; - rep.size = stuff->size; + rep = (xXF86VidModeGetGammaRampReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = (length >> 1) * 3, + .size = stuff->size + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swaps(&rep.size); SwapShorts((short *) ramp, length * 3); } - WriteToClient(client, sizeof(xXF86VidModeGetGammaRampReply), (char *) &rep); + WriteToClient(client, sizeof(xXF86VidModeGetGammaRampReply), &rep); if (stuff->size) { - WriteToClient(client, ramplen, (char *) ramp); + WriteToClient(client, ramplen, ramp); free(ramp); } @@ -1537,22 +1551,23 @@ ProcXF86VidModeGetGammaRampSize(ClientPtr client) REQUEST(xXF86VidModeGetGammaRampSizeReq); + REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampSizeReq); + if (stuff->screen >= screenInfo.numScreens) return BadValue; - REQUEST_SIZE_MATCH(xXF86VidModeGetGammaRampSizeReq); - - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.size = VidModeGetGammaRampSize(stuff->screen); + rep = (xXF86VidModeGetGammaRampSizeReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .size = VidModeGetGammaRampSize(stuff->screen) + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swaps(&rep.size); } - WriteToClient(client, sizeof(xXF86VidModeGetGammaRampSizeReply), - (char *) &rep); + WriteToClient(client, sizeof(xXF86VidModeGetGammaRampSizeReply), &rep); return Success; } @@ -1560,21 +1575,22 @@ ProcXF86VidModeGetGammaRampSize(ClientPtr client) static int ProcXF86VidModeGetPermissions(ClientPtr client) { - xXF86VidModeGetPermissionsReply rep; + xXF86VidModeGetPermissionsReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .permissions = XF86VM_READ_PERMISSION + }; REQUEST(xXF86VidModeGetPermissionsReq); + REQUEST_SIZE_MATCH(xXF86VidModeGetPermissionsReq); + if (stuff->screen >= screenInfo.numScreens) return BadValue; - REQUEST_SIZE_MATCH(xXF86VidModeGetPermissionsReq); - - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.permissions = XF86VM_READ_PERMISSION; if (xf86GetVidModeEnabled() && - (xf86GetVidModeAllowNonLocal() || LocalClient(client))) { + (xf86GetVidModeAllowNonLocal() || client->local)) { rep.permissions |= XF86VM_WRITE_PERMISSION; } if (client->swapped) { @@ -1582,8 +1598,7 @@ ProcXF86VidModeGetPermissions(ClientPtr client) swapl(&rep.length); swapl(&rep.permissions); } - WriteToClient(client, sizeof(xXF86VidModeGetPermissionsReply), - (char *) &rep); + WriteToClient(client, sizeof(xXF86VidModeGetPermissionsReply), &rep); return Success; } @@ -1644,7 +1659,7 @@ ProcXF86VidModeDispatch(ClientPtr client) default: if (!xf86GetVidModeEnabled()) return VidModeErrorBase + XF86VidModeExtensionDisabled; - if (xf86GetVidModeAllowNonLocal() || LocalClient(client)) { + if (xf86GetVidModeAllowNonLocal() || client->local) { switch (stuff->data) { case X_XF86VidModeAddModeLine: return ProcXF86VidModeAddModeLine(client); @@ -2068,7 +2083,7 @@ SProcXF86VidModeDispatch(ClientPtr client) default: if (!xf86GetVidModeEnabled()) return VidModeErrorBase + XF86VidModeExtensionDisabled; - if (xf86GetVidModeAllowNonLocal() || LocalClient(client)) { + if (xf86GetVidModeAllowNonLocal() || client->local) { switch (stuff->data) { case X_XF86VidModeAddModeLine: return SProcXF86VidModeAddModeLine(client); diff --git a/xserver/hw/xfree86/common/xf86xv.c b/xserver/hw/xfree86/common/xf86xv.c index 88e2f314b..92d0f6da2 100644 --- a/xserver/hw/xfree86/common/xf86xv.c +++ b/xserver/hw/xfree86/common/xf86xv.c @@ -51,13 +51,12 @@ #include #include #include "xvdix.h" -#include "xvmodproc.h" #include "xf86xvpriv.h" /* XvScreenRec fields */ -static Bool xf86XVCloseScreen(int, ScreenPtr); +static Bool xf86XVCloseScreen(ScreenPtr); static int xf86XVQueryAdaptors(ScreenPtr, XvAdaptorPtr *, int *); /* XvAdaptorRec fields */ @@ -101,9 +100,9 @@ static void xf86XVClipNotify(WindowPtr pWin, int dx, int dy); /* ScrnInfoRec functions */ -static Bool xf86XVEnterVT(int, int); -static void xf86XVLeaveVT(int, int); -static void xf86XVAdjustFrame(int index, int x, int y, int flags); +static Bool xf86XVEnterVT(ScrnInfoPtr); +static void xf86XVLeaveVT(ScrnInfoPtr); +static void xf86XVAdjustFrame(ScrnInfoPtr, int x, int y); static void xf86XVModeSet(ScrnInfoPtr pScrn); /* misc */ @@ -118,10 +117,6 @@ DevPrivateKey XF86XvScreenKey; static unsigned long PortResource = 0; -DevPrivateKey (*XvGetScreenKeyProc) (void) = NULL; -unsigned long (*XvGetRTPortProc) (void) = NULL; -int (*XvScreenInitProc) (ScreenPtr) = NULL; - #define GET_XV_SCREEN(pScreen) \ ((XvScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, XF86XvScreenKey)) @@ -239,19 +234,18 @@ xf86XVScreenInit(ScreenPtr pScreen, XF86VideoAdaptorPtr * adaptors, int num) XF86XVScreenPtr ScreenPriv; XvScreenPtr pxvs; - if (num <= 0 || - !XvGetScreenKeyProc || !XvGetRTPortProc || !XvScreenInitProc) + if (num <= 0 || noXvExtension) return FALSE; - if (Success != (*XvScreenInitProc) (pScreen)) + if (Success != XvScreenInit(pScreen)) return FALSE; if (!dixRegisterPrivateKey(&XF86XVWindowKeyRec, PRIVATE_WINDOW, 0)) return FALSE; - XF86XvScreenKey = (*XvGetScreenKeyProc) (); + XF86XvScreenKey = XvGetScreenKey(); - PortResource = (*XvGetRTPortProc) (); + PortResource = XvGetRTPort(); pxvs = GET_XV_SCREEN(pScreen); @@ -272,7 +266,7 @@ xf86XVScreenInit(ScreenPtr pScreen, XF86VideoAdaptorPtr * adaptors, int num) if (!ScreenPriv) return FALSE; - pScrn = xf86Screens[pScreen->myNum]; + pScrn = xf86ScreenToScrn(pScreen); ScreenPriv->DestroyWindow = pScreen->DestroyWindow; ScreenPriv->WindowExposures = pScreen->WindowExposures; @@ -357,7 +351,7 @@ static Bool xf86XVInitAdaptors(ScreenPtr pScreen, XF86VideoAdaptorPtr * infoPtr, int number) { XvScreenPtr pxvs = GET_XV_SCREEN(pScreen); - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); XF86VideoAdaptorPtr adaptorPtr; XvAdaptorPtr pAdaptor, pa; XvAdaptorRecPrivatePtr adaptorPriv; @@ -1067,7 +1061,7 @@ xf86XVReputOrStopPort(XvPortRecPrivatePtr pPriv, WindowPtr pWin, Bool visible) static void xf86XVReputOrStopAllPorts(ScrnInfoPtr pScrn, Bool onlyChanged) { - ScreenPtr pScreen = pScrn->pScreen; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); XvScreenPtr pxvs = GET_XV_SCREEN(pScreen); XvAdaptorPtr pa; int c, i; @@ -1151,7 +1145,7 @@ xf86XVPostValidateTree(WindowPtr pWin, WindowPtr pLayerWin, VTKind kind) pScreen = pLayerWin->drawable.pScreen; ScreenPriv = GET_XF86XV_SCREEN(pScreen); - pScrn = xf86Screens[pScreen->myNum]; + pScrn = xf86ScreenToScrn(pScreen); xf86XVReputOrStopAllPorts(pScrn, TRUE); @@ -1256,9 +1250,9 @@ xf86XVClipNotify(WindowPtr pWin, int dx, int dy) /**** Required XvScreenRec fields ****/ static Bool -xf86XVCloseScreen(int i, ScreenPtr pScreen) +xf86XVCloseScreen(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); XvScreenPtr pxvs = GET_XV_SCREEN(pScreen); XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen); XvAdaptorPtr pa; @@ -1300,15 +1294,14 @@ xf86XVQueryAdaptors(ScreenPtr pScreen, /**** ScrnInfoRec fields ****/ static Bool -xf86XVEnterVT(int index, int flags) +xf86XVEnterVT(ScrnInfoPtr pScrn) { - ScrnInfoPtr pScrn = xf86Screens[index]; - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen); Bool ret; pScrn->EnterVT = ScreenPriv->EnterVT; - ret = (*ScreenPriv->EnterVT) (index, flags); + ret = (*ScreenPriv->EnterVT) (pScrn); ScreenPriv->EnterVT = pScrn->EnterVT; pScrn->EnterVT = xf86XVEnterVT; @@ -1319,10 +1312,9 @@ xf86XVEnterVT(int index, int flags) } static void -xf86XVLeaveVT(int index, int flags) +xf86XVLeaveVT(ScrnInfoPtr pScrn) { - ScrnInfoPtr pScrn = xf86Screens[index]; - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); XvScreenPtr pxvs = GET_XV_SCREEN(pScreen); XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen); XvAdaptorPtr pAdaptor; @@ -1354,21 +1346,20 @@ xf86XVLeaveVT(int index, int flags) } pScrn->LeaveVT = ScreenPriv->LeaveVT; - (*ScreenPriv->LeaveVT) (index, flags); + (*ScreenPriv->LeaveVT) (pScrn); ScreenPriv->LeaveVT = pScrn->LeaveVT; pScrn->LeaveVT = xf86XVLeaveVT; } static void -xf86XVAdjustFrame(int index, int x, int y, int flags) +xf86XVAdjustFrame(ScrnInfoPtr pScrn, int x, int y) { - ScrnInfoPtr pScrn = xf86Screens[index]; - ScreenPtr pScreen = pScrn->pScreen; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen); if (ScreenPriv->AdjustFrame) { pScrn->AdjustFrame = ScreenPriv->AdjustFrame; - (*pScrn->AdjustFrame) (index, x, y, flags); + (*pScrn->AdjustFrame) (pScrn, x, y); pScrn->AdjustFrame = xf86XVAdjustFrame; } @@ -1378,7 +1369,7 @@ xf86XVAdjustFrame(int index, int x, int y, int flags) static void xf86XVModeSet(ScrnInfoPtr pScrn) { - ScreenPtr pScreen = pScrn->pScreen; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); XF86XVScreenPtr ScreenPriv; /* Can be called before pScrn->pScreen is set */ @@ -1900,7 +1891,7 @@ xf86XVFillKeyHelperDrawable(DrawablePtr pDraw, CARD32 key, RegionPtr fillboxes) xRectangle *rects; GCPtr gc; - if (!xf86Screens[pScreen->myNum]->vtSema) + if (!xf86ScreenToScrn(pScreen)->vtSema) return; gc = GetScratchGC(pDraw->depth, pScreen); diff --git a/xserver/hw/xfree86/common/xf86xv.h b/xserver/hw/xfree86/common/xf86xv.h index 2db00a83f..091efcaa9 100644 --- a/xserver/hw/xfree86/common/xf86xv.h +++ b/xserver/hw/xfree86/common/xf86xv.h @@ -263,8 +263,4 @@ extern _X_EXPORT void xf86XVCopyPacked(const void *src, void *dst, int srcPitch, int dstPitch, int h, int w); -extern _X_EXPORT DevPrivateKey (*XvGetScreenKeyProc) (void); -extern _X_EXPORT unsigned long (*XvGetRTPortProc) (void); -extern _X_EXPORT int (*XvScreenInitProc) (ScreenPtr); - #endif /* _XF86XV_H_ */ diff --git a/xserver/hw/xfree86/common/xf86xvmc.c b/xserver/hw/xfree86/common/xf86xvmc.c index e58465289..78a32bfe1 100644 --- a/xserver/hw/xfree86/common/xf86xvmc.c +++ b/xserver/hw/xfree86/common/xf86xvmc.c @@ -40,13 +40,9 @@ #include "resource.h" #include "dixstruct.h" -#include "xvmodproc.h" - #include "xf86xvpriv.h" #include "xf86xvmc.h" -XvMCScreenInitProcPtr XvMCScreenInitProc = NULL; - typedef struct { CloseScreenProcPtr CloseScreen; int num_adaptors; @@ -66,7 +62,7 @@ xf86XvMCCreateContext(XvPortPtr pPort, XvMCContextPtr pContext, int *num_priv, CARD32 **priv) { xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pContext->pScreen); - ScrnInfoPtr pScrn = xf86Screens[pContext->pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pContext->pScreen); pContext->port_priv = (XvPortRecPrivatePtr) (pPort->devPriv.ptr); @@ -80,7 +76,7 @@ static void xf86XvMCDestroyContext(XvMCContextPtr pContext) { xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pContext->pScreen); - ScrnInfoPtr pScrn = xf86Screens[pContext->pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pContext->pScreen); (*pScreenPriv->adaptors[pContext->adapt_num]->DestroyContext) (pScrn, pContext); @@ -91,7 +87,7 @@ xf86XvMCCreateSurface(XvMCSurfacePtr pSurface, int *num_priv, CARD32 **priv) { XvMCContextPtr pContext = pSurface->context; xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pContext->pScreen); - ScrnInfoPtr pScrn = xf86Screens[pContext->pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pContext->pScreen); return (*pScreenPriv->adaptors[pContext->adapt_num]->CreateSurface) (pScrn, pSurface, @@ -104,7 +100,7 @@ xf86XvMCDestroySurface(XvMCSurfacePtr pSurface) { XvMCContextPtr pContext = pSurface->context; xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pContext->pScreen); - ScrnInfoPtr pScrn = xf86Screens[pContext->pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pContext->pScreen); (*pScreenPriv->adaptors[pContext->adapt_num]->DestroySurface) (pScrn, pSurface); @@ -116,7 +112,7 @@ xf86XvMCCreateSubpicture(XvMCSubpicturePtr pSubpicture, { XvMCContextPtr pContext = pSubpicture->context; xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pContext->pScreen); - ScrnInfoPtr pScrn = xf86Screens[pContext->pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pContext->pScreen); return (*pScreenPriv->adaptors[pContext->adapt_num]-> CreateSubpicture) (pScrn, pSubpicture, num_priv, priv); @@ -127,14 +123,14 @@ xf86XvMCDestroySubpicture(XvMCSubpicturePtr pSubpicture) { XvMCContextPtr pContext = pSubpicture->context; xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pContext->pScreen); - ScrnInfoPtr pScrn = xf86Screens[pContext->pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pContext->pScreen); (*pScreenPriv->adaptors[pContext->adapt_num]->DestroySubpicture) (pScrn, pSubpicture); } static Bool -xf86XvMCCloseScreen(int i, ScreenPtr pScreen) +xf86XvMCCloseScreen(ScreenPtr pScreen) { xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pScreen); @@ -143,7 +139,7 @@ xf86XvMCCloseScreen(int i, ScreenPtr pScreen) free(pScreenPriv->dixinfo); free(pScreenPriv); - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } Bool @@ -156,7 +152,7 @@ xf86XvMCScreenInit(ScreenPtr pScreen, XF86XvScreenKey); int i, j; - if (!XvMCScreenInitProc) + if (noXvExtension) return FALSE; if (!(pAdapt = malloc(sizeof(XvMCAdaptorRec) * num_adaptors))) @@ -205,7 +201,7 @@ xf86XvMCScreenInit(ScreenPtr pScreen, adaptors++; } - if (Success != (*XvMCScreenInitProc) (pScreen, num_adaptors, pAdapt)) + if (Success != XvMCScreenInit(pScreen, num_adaptors, pAdapt)) return FALSE; return TRUE; diff --git a/xserver/hw/xfree86/common/xf86xvmc.h b/xserver/hw/xfree86/common/xf86xvmc.h index ff32379fe..2478fe344 100644 --- a/xserver/hw/xfree86/common/xf86xvmc.h +++ b/xserver/hw/xfree86/common/xf86xvmc.h @@ -138,7 +138,4 @@ extern _X_EXPORT Bool xf86XvMCScreenInit(ScreenPtr pScreen, extern _X_EXPORT XF86MCAdaptorPtr xf86XvMCCreateAdaptorRec(void); extern _X_EXPORT void xf86XvMCDestroyAdaptorRec(XF86MCAdaptorPtr adaptor); -typedef int (*XvMCScreenInitProcPtr) (ScreenPtr, int, XvMCAdaptorPtr); -extern _X_EXPORT XvMCScreenInitProcPtr XvMCScreenInitProc; - #endif /* _XF86XVMC_H */ diff --git a/xserver/hw/xfree86/common/xf86xvpriv.h b/xserver/hw/xfree86/common/xf86xvpriv.h index 289ca5843..e95f959a8 100644 --- a/xserver/hw/xfree86/common/xf86xvpriv.h +++ b/xserver/hw/xfree86/common/xf86xvpriv.h @@ -41,9 +41,9 @@ typedef struct { ClipNotifyProcPtr ClipNotify; WindowExposuresProcPtr WindowExposures; PostValidateTreeProcPtr PostValidateTree; - void (*AdjustFrame) (int, int, int, int); - Bool (*EnterVT) (int, int); - void (*LeaveVT) (int, int); + void (*AdjustFrame) (ScrnInfoPtr, int, int); + Bool (*EnterVT) (ScrnInfoPtr); + void (*LeaveVT) (ScrnInfoPtr); xf86ModeSetProc *ModeSet; } XF86XVScreenRec, *XF86XVScreenPtr; diff --git a/xserver/hw/xfree86/ddc/Makefile.in b/xserver/hw/xfree86/ddc/Makefile.in index 0c9b9f6ea..e24c3701b 100644 --- a/xserver/hw/xfree86/ddc/Makefile.in +++ b/xserver/hw/xfree86/ddc/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -212,13 +212,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -240,6 +236,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -264,6 +261,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -279,7 +277,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -378,6 +375,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -487,7 +485,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -512,9 +510,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/xfree86/ddc/ddc.c b/xserver/hw/xfree86/ddc/ddc.c index a1281d735..28c969646 100644 --- a/xserver/hw/xfree86/ddc/ddc.c +++ b/xserver/hw/xfree86/ddc/ddc.c @@ -258,10 +258,9 @@ EDIDRead_DDC1(ScrnInfoPtr pScrn, DDC1SetSpeedProc DDCSpeed, * @return NULL if no monitor attached or failure to interpret the EDID. */ xf86MonPtr -xf86DoEDID_DDC1(int scrnIndex, DDC1SetSpeedProc DDC1SetSpeed, +xf86DoEDID_DDC1(ScrnInfoPtr pScrn, DDC1SetSpeedProc DDC1SetSpeed, unsigned int (*DDC1Read) (ScrnInfoPtr)) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; unsigned char *EDID_block = NULL; xf86MonPtr tmp = NULL; @@ -285,7 +284,7 @@ xf86DoEDID_DDC1(int scrnIndex, DDC1SetSpeedProc DDC1SetSpeed, OsReleaseSignals(); if (EDID_block) { - tmp = xf86InterpretEDID(scrnIndex, EDID_block); + tmp = xf86InterpretEDID(pScrn->scrnIndex, EDID_block); } #ifdef DEBUG else @@ -323,7 +322,7 @@ DDC2MakeDevice(I2CBusPtr pBus, int address, char *name) } static I2CDevPtr -DDC2Init(int scrnIndex, I2CBusPtr pBus) +DDC2Init(I2CBusPtr pBus) { I2CDevPtr dev = NULL; @@ -403,9 +402,8 @@ DDC2Read(I2CDevPtr dev, int block, unsigned char *R_Buffer) * @return NULL if no monitor attached or failure to interpret the EDID. */ xf86MonPtr -xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, Bool complete) +xf86DoEEDID(ScrnInfoPtr pScrn, I2CBusPtr pBus, Bool complete) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; unsigned char *EDID_block = NULL; xf86MonPtr tmp = NULL; I2CDevPtr dev = NULL; @@ -427,7 +425,7 @@ xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, Bool complete) if (noddc || noddc2) return NULL; - if (!(dev = DDC2Init(scrnIndex, pBus))) + if (!(dev = DDC2Init(pBus))) return NULL; EDID_block = calloc(1, EDID1_LEN); @@ -444,7 +442,7 @@ xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, Bool complete) DDC2Read(dev, i + 1, EDID_block + (EDID1_LEN * (1 + i))); } - tmp = xf86InterpretEEDID(scrnIndex, EDID_block); + tmp = xf86InterpretEEDID(pScrn->scrnIndex, EDID_block); } if (tmp && complete) @@ -465,9 +463,9 @@ xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, Bool complete) * @return NULL if no monitor attached or failure to interpret the EDID. */ xf86MonPtr -xf86DoEDID_DDC2(int scrnIndex, I2CBusPtr pBus) +xf86DoEDID_DDC2(ScrnInfoPtr pScrn, I2CBusPtr pBus) { - return xf86DoEEDID(scrnIndex, pBus, FALSE); + return xf86DoEEDID(pScrn, pBus, FALSE); } /* XXX write me */ @@ -489,9 +487,8 @@ DDC2ReadDisplayID(void) * @return NULL if no monitor attached or failure to interpret the DisplayID. */ xf86MonPtr -xf86DoDisplayID(int scrnIndex, I2CBusPtr pBus) +xf86DoDisplayID(ScrnInfoPtr pScrn, I2CBusPtr pBus) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; unsigned char *did = NULL; xf86MonPtr tmp = NULL; I2CDevPtr dev = NULL; @@ -513,7 +510,7 @@ xf86DoDisplayID(int scrnIndex, I2CBusPtr pBus) if (noddc || noddc2) return NULL; - if (!(dev = DDC2Init(scrnIndex, pBus))) + if (!(dev = DDC2Init(pBus))) return NULL; if ((did = DDC2ReadDisplayID())) { @@ -521,7 +518,7 @@ xf86DoDisplayID(int scrnIndex, I2CBusPtr pBus) if (!tmp) return NULL; - tmp->scrnIndex = scrnIndex; + tmp->scrnIndex = pScrn->scrnIndex; tmp->flags |= MONITOR_DISPLAYID; tmp->rawData = did; } diff --git a/xserver/hw/xfree86/ddc/xf86DDC.h b/xserver/hw/xfree86/ddc/xf86DDC.h index 2071d530d..c63da8bff 100644 --- a/xserver/hw/xfree86/ddc/xf86DDC.h +++ b/xserver/hw/xfree86/ddc/xf86DDC.h @@ -24,15 +24,15 @@ typedef enum { typedef void (*DDC1SetSpeedProc) (ScrnInfoPtr, xf86ddcSpeed); -extern _X_EXPORT xf86MonPtr xf86DoEDID_DDC1(int scrnIndex, +extern _X_EXPORT xf86MonPtr xf86DoEDID_DDC1(ScrnInfoPtr pScrn, DDC1SetSpeedProc DDC1SetSpeed, unsigned int (*DDC1Read) (ScrnInfoPtr) ); -extern _X_EXPORT xf86MonPtr xf86DoEDID_DDC2(int scrnIndex, I2CBusPtr pBus); +extern _X_EXPORT xf86MonPtr xf86DoEDID_DDC2(ScrnInfoPtr pScrn, I2CBusPtr pBus); -extern _X_EXPORT xf86MonPtr xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, Bool); +extern _X_EXPORT xf86MonPtr xf86DoEEDID(ScrnInfoPtr pScrn, I2CBusPtr pBus, Bool); extern _X_EXPORT xf86MonPtr xf86PrintEDID(xf86MonPtr monPtr); @@ -50,7 +50,7 @@ extern _X_EXPORT DisplayModePtr xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC); extern _X_EXPORT Bool xf86MonitorIsHDMI(xf86MonPtr mon); -extern _X_EXPORT xf86MonPtr xf86DoDisplayID(int scrnIndex, I2CBusPtr pBus); +extern _X_EXPORT xf86MonPtr xf86DoDisplayID(ScrnInfoPtr pScrn, I2CBusPtr pBus); extern _X_EXPORT void xf86DisplayIDMonitorSet(int scrnIndex, MonPtr mon, xf86MonPtr DDC); diff --git a/xserver/hw/xfree86/dixmods/Makefile.am b/xserver/hw/xfree86/dixmods/Makefile.am index a5be3ae00..f161db60a 100644 --- a/xserver/hw/xfree86/dixmods/Makefile.am +++ b/xserver/hw/xfree86/dixmods/Makefile.am @@ -1,67 +1,50 @@ noinst_LTLIBRARIES = libdixmods.la libxorgxkb.la -SUBDIRS = extmod - if GLX GLXMODS = libglx.la endif -if DBE -DBEMOD = libdbe.la -endif - -if RECORD -RECORDMOD = librecord.la -endif - module_LTLIBRARIES = libfb.la \ libwfb.la \ libshadow.la extsmoduledir = $(moduledir)/extensions -extsmodule_LTLIBRARIES = $(RECORDMOD) \ - $(DBEMOD) \ - $(GLXMODS) +extsmodule_LTLIBRARIES = $(GLXMODS) AM_CFLAGS = @XORG_CFLAGS@ @DIX_CFLAGS@ INCLUDES = @XORG_INCS@ \ - -I$(top_srcdir)/dbe \ -I$(top_srcdir)/hw/xfree86/loader \ -I$(top_srcdir)/miext/shadow \ -I$(top_srcdir)/glx -libdbe_la_LDFLAGS = -module -avoid-version -libdbe_la_LIBADD = $(top_builddir)/dbe/libdbe.la -libdbe_la_SOURCES = dbemodule.c - -libfb_la_LDFLAGS = -module -avoid-version +libfb_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) libfb_la_LIBADD = $(top_builddir)/fb/libfb.la libfb_la_SOURCES = $(top_builddir)/fb/fbcmap_mi.c fbmodule.c libfb_la_CFLAGS = $(AM_CFLAGS) -libwfb_la_LDFLAGS = -module -avoid-version +libwfb_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) libwfb_la_LIBADD = $(top_builddir)/fb/libwfb.la libwfb_la_SOURCES = $(top_builddir)/fb/fbcmap_mi.c fbmodule.c libwfb_la_CFLAGS = $(AM_CFLAGS) -DFB_ACCESS_WRAPPER -libglx_la_LDFLAGS = -module -avoid-version +libglx_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) +libglx_la_LIBADD = $(top_builddir)/glx/libglx.la $(GLX_SYS_LIBS) if AIGLX_DRI_LOADER -GLXDRI_LIBRARY = $(top_builddir)/glx/libglxdri.la +libglx_la_LIBADD += $(top_builddir)/glx/libglxdri.la +if NO_UNDEFINED +libglx_la_LIBADD += ../dri/libdri.la ../dri2/libdri2.la +endif endif -libglx_la_LIBADD = \ - $(top_builddir)/glx/libglx.la \ - $(GLXDRI_LIBRARY) libglx_la_SOURCES = glxmodule.c -librecord_la_LDFLAGS = -module -avoid-version -librecord_la_LIBADD = $(top_builddir)/record/librecord.la -librecord_la_SOURCES = recordmod.c - -libshadow_la_LDFLAGS = -module -avoid-version +libshadow_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) libshadow_la_LIBADD = $(top_builddir)/miext/shadow/libshadow.la +if NO_UNDEFINED +libshadow_la_LIBADD += libfb.la +endif libshadow_la_SOURCES = shmodule.c libdixmods_la_SOURCES = $(top_srcdir)/mi/miinitext.c -libdixmods_la_CFLAGS = -DXFree86LOADER $(AM_CFLAGS) +libdixmods_la_CFLAGS = $(AM_CFLAGS) libxorgxkb_la_SOURCES = xkbVT.c xkbPrivate.c xkbKillSrv.c diff --git a/xserver/hw/xfree86/dixmods/Makefile.in b/xserver/hw/xfree86/dixmods/Makefile.in index 9ab9e8e7c..af6235138 100644 --- a/xserver/hw/xfree86/dixmods/Makefile.in +++ b/xserver/hw/xfree86/dixmods/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -50,6 +50,9 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +@AIGLX_DRI_LOADER_TRUE@am__append_1 = $(top_builddir)/glx/libglxdri.la +@AIGLX_DRI_LOADER_TRUE@@NO_UNDEFINED_TRUE@am__append_2 = ../dri/libdri.la ../dri2/libdri2.la +@NO_UNDEFINED_TRUE@am__append_3 = libfb.la subdir = hw/xfree86/dixmods DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp @@ -103,20 +106,13 @@ am__installdirs = "$(DESTDIR)$(extsmoduledir)" \ "$(DESTDIR)$(moduledir)" LTLIBRARIES = $(extsmodule_LTLIBRARIES) $(module_LTLIBRARIES) \ $(noinst_LTLIBRARIES) -libdbe_la_DEPENDENCIES = $(top_builddir)/dbe/libdbe.la -am_libdbe_la_OBJECTS = dbemodule.lo -libdbe_la_OBJECTS = $(am_libdbe_la_OBJECTS) +libdixmods_la_LIBADD = +am_libdixmods_la_OBJECTS = libdixmods_la-miinitext.lo +libdixmods_la_OBJECTS = $(am_libdixmods_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = -libdbe_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(libdbe_la_LDFLAGS) $(LDFLAGS) -o $@ -@DBE_TRUE@am_libdbe_la_rpath = -rpath $(extsmoduledir) -libdixmods_la_LIBADD = -am_libdixmods_la_OBJECTS = libdixmods_la-miinitext.lo -libdixmods_la_OBJECTS = $(am_libdixmods_la_OBJECTS) libdixmods_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libdixmods_la_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ @@ -126,22 +122,17 @@ libfb_la_OBJECTS = $(am_libfb_la_OBJECTS) libfb_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libfb_la_CFLAGS) \ $(CFLAGS) $(libfb_la_LDFLAGS) $(LDFLAGS) -o $@ +am__DEPENDENCIES_1 = libglx_la_DEPENDENCIES = $(top_builddir)/glx/libglx.la \ - $(GLXDRI_LIBRARY) + $(am__DEPENDENCIES_1) $(am__append_1) $(am__append_2) am_libglx_la_OBJECTS = glxmodule.lo libglx_la_OBJECTS = $(am_libglx_la_OBJECTS) libglx_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libglx_la_LDFLAGS) $(LDFLAGS) -o $@ @GLX_TRUE@am_libglx_la_rpath = -rpath $(extsmoduledir) -librecord_la_DEPENDENCIES = $(top_builddir)/record/librecord.la -am_librecord_la_OBJECTS = recordmod.lo -librecord_la_OBJECTS = $(am_librecord_la_OBJECTS) -librecord_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(librecord_la_LDFLAGS) $(LDFLAGS) -o $@ -@RECORD_TRUE@am_librecord_la_rpath = -rpath $(extsmoduledir) -libshadow_la_DEPENDENCIES = $(top_builddir)/miext/shadow/libshadow.la +libshadow_la_DEPENDENCIES = $(top_builddir)/miext/shadow/libshadow.la \ + $(am__append_3) am_libshadow_la_OBJECTS = shmodule.lo libshadow_la_OBJECTS = $(am_libshadow_la_OBJECTS) libshadow_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ @@ -190,60 +181,20 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(libdbe_la_SOURCES) $(libdixmods_la_SOURCES) \ - $(libfb_la_SOURCES) $(libglx_la_SOURCES) \ - $(librecord_la_SOURCES) $(libshadow_la_SOURCES) \ +SOURCES = $(libdixmods_la_SOURCES) $(libfb_la_SOURCES) \ + $(libglx_la_SOURCES) $(libshadow_la_SOURCES) \ $(libwfb_la_SOURCES) $(libxorgxkb_la_SOURCES) -DIST_SOURCES = $(libdbe_la_SOURCES) $(libdixmods_la_SOURCES) \ - $(libfb_la_SOURCES) $(libglx_la_SOURCES) \ - $(librecord_la_SOURCES) $(libshadow_la_SOURCES) \ +DIST_SOURCES = $(libdixmods_la_SOURCES) $(libfb_la_SOURCES) \ + $(libglx_la_SOURCES) $(libshadow_la_SOURCES) \ $(libwfb_la_SOURCES) $(libxorgxkb_la_SOURCES) -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac -RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ - distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ - distdir ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -am__relativize = \ - dir0=`pwd`; \ - sed_first='s,^\([^/]*\)/.*$$,\1,'; \ - sed_rest='s,^[^/]*/*,,'; \ - sed_last='s,^.*/\([^/]*\)$$,\1,'; \ - sed_butlast='s,/*[^/]*$$,,'; \ - while test -n "$$dir1"; do \ - first=`echo "$$dir1" | sed -e "$$sed_first"`; \ - if test "$$first" != "."; then \ - if test "$$first" = ".."; then \ - dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ - dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ - else \ - first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ - if test "$$first2" = "$$first"; then \ - dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ - else \ - dir2="../$$dir2"; \ - fi; \ - dir0="$$dir0"/"$$first"; \ - fi; \ - fi; \ - dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ - done; \ - reldir="$$dir2" ACLOCAL = @ACLOCAL@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ @@ -301,13 +252,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -329,6 +276,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -353,6 +301,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -368,7 +317,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -467,6 +415,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -567,58 +516,43 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libdixmods.la libxorgxkb.la -SUBDIRS = extmod @GLX_TRUE@GLXMODS = libglx.la -@DBE_TRUE@DBEMOD = libdbe.la -@RECORD_TRUE@RECORDMOD = librecord.la module_LTLIBRARIES = libfb.la \ libwfb.la \ libshadow.la extsmoduledir = $(moduledir)/extensions -extsmodule_LTLIBRARIES = $(RECORDMOD) \ - $(DBEMOD) \ - $(GLXMODS) - +extsmodule_LTLIBRARIES = $(GLXMODS) AM_CFLAGS = @XORG_CFLAGS@ @DIX_CFLAGS@ INCLUDES = @XORG_INCS@ \ - -I$(top_srcdir)/dbe \ -I$(top_srcdir)/hw/xfree86/loader \ -I$(top_srcdir)/miext/shadow \ -I$(top_srcdir)/glx -libdbe_la_LDFLAGS = -module -avoid-version -libdbe_la_LIBADD = $(top_builddir)/dbe/libdbe.la -libdbe_la_SOURCES = dbemodule.c -libfb_la_LDFLAGS = -module -avoid-version +libfb_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) libfb_la_LIBADD = $(top_builddir)/fb/libfb.la libfb_la_SOURCES = $(top_builddir)/fb/fbcmap_mi.c fbmodule.c libfb_la_CFLAGS = $(AM_CFLAGS) -libwfb_la_LDFLAGS = -module -avoid-version +libwfb_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) libwfb_la_LIBADD = $(top_builddir)/fb/libwfb.la libwfb_la_SOURCES = $(top_builddir)/fb/fbcmap_mi.c fbmodule.c libwfb_la_CFLAGS = $(AM_CFLAGS) -DFB_ACCESS_WRAPPER -libglx_la_LDFLAGS = -module -avoid-version -@AIGLX_DRI_LOADER_TRUE@GLXDRI_LIBRARY = $(top_builddir)/glx/libglxdri.la -libglx_la_LIBADD = \ - $(top_builddir)/glx/libglx.la \ - $(GLXDRI_LIBRARY) - +libglx_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) +libglx_la_LIBADD = $(top_builddir)/glx/libglx.la $(GLX_SYS_LIBS) \ + $(am__append_1) $(am__append_2) libglx_la_SOURCES = glxmodule.c -librecord_la_LDFLAGS = -module -avoid-version -librecord_la_LIBADD = $(top_builddir)/record/librecord.la -librecord_la_SOURCES = recordmod.c -libshadow_la_LDFLAGS = -module -avoid-version -libshadow_la_LIBADD = $(top_builddir)/miext/shadow/libshadow.la +libshadow_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) +libshadow_la_LIBADD = $(top_builddir)/miext/shadow/libshadow.la \ + $(am__append_3) libshadow_la_SOURCES = shmodule.c libdixmods_la_SOURCES = $(top_srcdir)/mi/miinitext.c -libdixmods_la_CFLAGS = -DXFree86LOADER $(AM_CFLAGS) +libdixmods_la_CFLAGS = $(AM_CFLAGS) libxorgxkb_la_SOURCES = xkbVT.c xkbPrivate.c xkbKillSrv.c -all: all-recursive +all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -643,9 +577,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-extsmoduleLTLIBRARIES: $(extsmodule_LTLIBRARIES) @@ -727,16 +661,12 @@ clean-noinstLTLIBRARIES: echo rm -f $${locs}; \ rm -f $${locs}; \ } -libdbe.la: $(libdbe_la_OBJECTS) $(libdbe_la_DEPENDENCIES) $(EXTRA_libdbe_la_DEPENDENCIES) - $(AM_V_CCLD)$(libdbe_la_LINK) $(am_libdbe_la_rpath) $(libdbe_la_OBJECTS) $(libdbe_la_LIBADD) $(LIBS) libdixmods.la: $(libdixmods_la_OBJECTS) $(libdixmods_la_DEPENDENCIES) $(EXTRA_libdixmods_la_DEPENDENCIES) $(AM_V_CCLD)$(libdixmods_la_LINK) $(libdixmods_la_OBJECTS) $(libdixmods_la_LIBADD) $(LIBS) libfb.la: $(libfb_la_OBJECTS) $(libfb_la_DEPENDENCIES) $(EXTRA_libfb_la_DEPENDENCIES) $(AM_V_CCLD)$(libfb_la_LINK) -rpath $(moduledir) $(libfb_la_OBJECTS) $(libfb_la_LIBADD) $(LIBS) libglx.la: $(libglx_la_OBJECTS) $(libglx_la_DEPENDENCIES) $(EXTRA_libglx_la_DEPENDENCIES) $(AM_V_CCLD)$(libglx_la_LINK) $(am_libglx_la_rpath) $(libglx_la_OBJECTS) $(libglx_la_LIBADD) $(LIBS) -librecord.la: $(librecord_la_OBJECTS) $(librecord_la_DEPENDENCIES) $(EXTRA_librecord_la_DEPENDENCIES) - $(AM_V_CCLD)$(librecord_la_LINK) $(am_librecord_la_rpath) $(librecord_la_OBJECTS) $(librecord_la_LIBADD) $(LIBS) libshadow.la: $(libshadow_la_OBJECTS) $(libshadow_la_DEPENDENCIES) $(EXTRA_libshadow_la_DEPENDENCIES) $(AM_V_CCLD)$(libshadow_la_LINK) -rpath $(moduledir) $(libshadow_la_OBJECTS) $(libshadow_la_LIBADD) $(LIBS) libwfb.la: $(libwfb_la_OBJECTS) $(libwfb_la_DEPENDENCIES) $(EXTRA_libwfb_la_DEPENDENCIES) @@ -750,14 +680,12 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbemodule.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/glxmodule.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdixmods_la-miinitext.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbcmap_mi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libfb_la-fbmodule.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbcmap_mi.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libwfb_la-fbmodule.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recordmod.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shmodule.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xkbKillSrv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xkbPrivate.Plo@am__quote@ @@ -825,53 +753,6 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs -# This directory's subdirectories are mostly independent; you can cd -# into them and run 'make' without going through this Makefile. -# To change the values of 'make' variables: instead of editing Makefiles, -# (1) if the variable is set in 'config.status', edit 'config.status' -# (which will cause the Makefiles to be regenerated when you run 'make'); -# (2) otherwise, pass the desired values on the 'make' command line. -$(RECURSIVE_TARGETS) $(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - target=`echo $@ | sed s/-recursive//`; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - for subdir in $$list; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - dot_seen=yes; \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done; \ - if test "$$dot_seen" = "no"; then \ - $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ - fi; test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done -cscopelist-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) cscopelist); \ - done - ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -882,23 +763,10 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) mkid -fID $$unique tags: TAGS -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ - if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ - include_option=--etags-include; \ - empty_fix=.; \ - else \ - include_option=--include; \ - empty_fix=; \ - fi; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - test ! -f $$subdir/TAGS || \ - set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ - fi; \ - done; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ @@ -917,7 +785,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ fi; \ fi ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ @@ -934,7 +802,7 @@ GTAGS: && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" -cscopelist: cscopelist-recursive $(HEADERS) $(SOURCES) $(LISP) +cscopelist: $(HEADERS) $(SOURCES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ @@ -981,48 +849,22 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ - $(am__make_dryrun) \ - || test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ - $(am__relativize); \ - new_distdir=$$reldir; \ - dir1=$$subdir; dir2="$(top_distdir)"; \ - $(am__relativize); \ - new_top_distdir=$$reldir; \ - echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ - echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ - ($(am__cd) $$subdir && \ - $(MAKE) $(AM_MAKEFLAGS) \ - top_distdir="$$new_top_distdir" \ - distdir="$$new_distdir" \ - am__remove_distdir=: \ - am__skip_length_check=: \ - am__skip_mode_fix=: \ - distdir) \ - || exit 1; \ - fi; \ - done check-am: all-am -check: check-recursive +check: check-am all-am: Makefile $(LTLIBRARIES) -installdirs: installdirs-recursive -installdirs-am: +installdirs: for dir in "$(DESTDIR)$(extsmoduledir)" "$(DESTDIR)$(moduledir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done -install: install-recursive -install-exec: install-exec-recursive -install-data: install-data-recursive -uninstall: uninstall-recursive +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am -installcheck: installcheck-recursive +installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ @@ -1044,88 +886,85 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -clean: clean-recursive +clean: clean-am clean-am: clean-extsmoduleLTLIBRARIES clean-generic clean-libtool \ clean-moduleLTLIBRARIES clean-noinstLTLIBRARIES mostlyclean-am -distclean: distclean-recursive +distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags -dvi: dvi-recursive +dvi: dvi-am dvi-am: -html: html-recursive +html: html-am html-am: -info: info-recursive +info: info-am info-am: install-data-am: install-extsmoduleLTLIBRARIES \ install-moduleLTLIBRARIES -install-dvi: install-dvi-recursive +install-dvi: install-dvi-am install-dvi-am: install-exec-am: -install-html: install-html-recursive +install-html: install-html-am install-html-am: -install-info: install-info-recursive +install-info: install-info-am install-info-am: install-man: -install-pdf: install-pdf-recursive +install-pdf: install-pdf-am install-pdf-am: -install-ps: install-ps-recursive +install-ps: install-ps-am install-ps-am: installcheck-am: -maintainer-clean: maintainer-clean-recursive +maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic -mostlyclean: mostlyclean-recursive +mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool -pdf: pdf-recursive +pdf: pdf-am pdf-am: -ps: ps-recursive +ps: ps-am ps-am: uninstall-am: uninstall-extsmoduleLTLIBRARIES \ uninstall-moduleLTLIBRARIES -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) \ - cscopelist-recursive ctags-recursive install-am install-strip \ - tags-recursive +.MAKE: install-am install-strip -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am check check-am clean clean-extsmoduleLTLIBRARIES \ - clean-generic clean-libtool clean-moduleLTLIBRARIES \ - clean-noinstLTLIBRARIES cscopelist cscopelist-recursive ctags \ - ctags-recursive distclean distclean-compile distclean-generic \ +.PHONY: CTAGS GTAGS all all-am check check-am clean \ + clean-extsmoduleLTLIBRARIES clean-generic clean-libtool \ + clean-moduleLTLIBRARIES clean-noinstLTLIBRARIES cscopelist \ + ctags distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ @@ -1133,11 +972,11 @@ uninstall-am: uninstall-extsmoduleLTLIBRARIES \ install-html-am install-info install-info-am install-man \ install-moduleLTLIBRARIES install-pdf install-pdf-am \ install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs installdirs-am maintainer-clean \ + installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags tags-recursive uninstall uninstall-am \ - uninstall-extsmoduleLTLIBRARIES uninstall-moduleLTLIBRARIES + tags uninstall uninstall-am uninstall-extsmoduleLTLIBRARIES \ + uninstall-moduleLTLIBRARIES # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/xserver/hw/xfree86/dixmods/dbemodule.c b/xserver/hw/xfree86/dixmods/dbemodule.c deleted file mode 100644 index 5541eacab..000000000 --- a/xserver/hw/xfree86/dixmods/dbemodule.c +++ /dev/null @@ -1,45 +0,0 @@ -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86Module.h" -#include "globals.h" - -static MODULESETUPPROTO(dbeSetup); - -extern void DbeExtensionInit(INITARGS); - -static ExtensionModule dbeExt = { - DbeExtensionInit, - "DOUBLE-BUFFER", - &noDbeExtension, - NULL, - NULL -}; - -static XF86ModuleVersionInfo VersRec = { - "dbe", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 1, 0, 0, - ABI_CLASS_EXTENSION, - ABI_EXTENSION_VERSION, - MOD_CLASS_EXTENSION, - {0, 0, 0, 0} -}; - -/* - * Data for the loader - */ -_X_EXPORT XF86ModuleData dbeModuleData = { &VersRec, dbeSetup, NULL }; - -static pointer -dbeSetup(pointer module, pointer opts, int *errmaj, int *errmin) -{ - LoadExtension(&dbeExt, FALSE); - - /* Need a non-NULL return value to indicate success */ - return (pointer) 1; -} diff --git a/xserver/hw/xfree86/dixmods/extmod/Makefile.am b/xserver/hw/xfree86/dixmods/extmod/Makefile.am deleted file mode 100644 index 87c28a421..000000000 --- a/xserver/hw/xfree86/dixmods/extmod/Makefile.am +++ /dev/null @@ -1,30 +0,0 @@ -sdk_HEADERS = dgaproc.h - -extsmoduledir = $(moduledir)/extensions -extsmodule_LTLIBRARIES = libextmod.la - -if DGA -DGA_SRCS = xf86dga2.c dgaproc.h -endif - -if XV -XV_SRCS = xvmod.c xvmodproc.h -endif - -if XF86VIDMODE -XF86VMODE_SRCS = xf86vmode.c -endif - -AM_CFLAGS = @DIX_CFLAGS@ @XORG_CFLAGS@ -INCLUDES = @XORG_INCS@ \ - -I$(top_srcdir)/dbe \ - -I$(top_srcdir)/hw/xfree86/loader \ - -I$(top_srcdir)/miext/shadow - -libextmod_la_LDFLAGS = -module -avoid-version -libextmod_la_SOURCES = modinit.c \ - modinit.h \ - $(DGA_SRCS) \ - $(XF86VMODE_SRCS) \ - $(XV_SRCS) -libextmod_la_LIBADD = $(top_builddir)/Xext/libXextmodule.la diff --git a/xserver/hw/xfree86/dixmods/extmod/Makefile.in b/xserver/hw/xfree86/dixmods/extmod/Makefile.in deleted file mode 100644 index decbf09f1..000000000 --- a/xserver/hw/xfree86/dixmods/extmod/Makefile.in +++ /dev/null @@ -1,863 +0,0 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2012 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - - -VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ - esac; \ - test $$am__dry = yes; \ - } -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = hw/xfree86/dixmods/extmod -DIST_COMMON = $(sdk_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(top_srcdir)/depcomp -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/xorg-tls.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ - $(top_builddir)/include/xorg-server.h \ - $(top_builddir)/include/dix-config.h \ - $(top_builddir)/include/xorg-config.h \ - $(top_builddir)/include/xkb-config.h \ - $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ - $(top_builddir)/include/version-config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(extsmoduledir)" "$(DESTDIR)$(sdkdir)" -LTLIBRARIES = $(extsmodule_LTLIBRARIES) -libextmod_la_DEPENDENCIES = $(top_builddir)/Xext/libXextmodule.la -am__libextmod_la_SOURCES_DIST = modinit.c modinit.h xf86dga2.c \ - dgaproc.h xf86vmode.c xvmod.c xvmodproc.h -@DGA_TRUE@am__objects_1 = xf86dga2.lo -@XF86VIDMODE_TRUE@am__objects_2 = xf86vmode.lo -@XV_TRUE@am__objects_3 = xvmod.lo -am_libextmod_la_OBJECTS = modinit.lo $(am__objects_1) $(am__objects_2) \ - $(am__objects_3) -libextmod_la_OBJECTS = $(am_libextmod_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -libextmod_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(libextmod_la_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(libextmod_la_SOURCES) -DIST_SOURCES = $(am__libextmod_la_SOURCES_DIST) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -HEADERS = $(sdk_HEADERS) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ -ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ -APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ -APP_MAN_DIR = @APP_MAN_DIR@ -APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BASE_CFLAGS = @BASE_CFLAGS@ -BASE_FONT_PATH = @BASE_FONT_PATH@ -BUILD_DATE = @BUILD_DATE@ -BUILD_TIME = @BUILD_TIME@ -BUNDLE_ID_PREFIX = @BUNDLE_ID_PREFIX@ -CC = @CC@ -CCAS = @CCAS@ -CCASDEPMODE = @CCASDEPMODE@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CHANGELOG_CMD = @CHANGELOG_CMD@ -COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CWARNFLAGS = @CWARNFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_LIBS = @DBUS_LIBS@ -DEFAULT_LIBRARY_PATH = @DEFAULT_LIBRARY_PATH@ -DEFAULT_LOGDIR = @DEFAULT_LOGDIR@ -DEFAULT_LOGPREFIX = @DEFAULT_LOGPREFIX@ -DEFAULT_MODULE_PATH = @DEFAULT_MODULE_PATH@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DGA_CFLAGS = @DGA_CFLAGS@ -DGA_LIBS = @DGA_LIBS@ -DIX_CFLAGS = @DIX_CFLAGS@ -DIX_LIB = @DIX_LIB@ -DLLTOOL = @DLLTOOL@ -DLOPEN_LIBS = @DLOPEN_LIBS@ -DMXEXAMPLES_DEP_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@ -DMXEXAMPLES_DEP_LIBS = @DMXEXAMPLES_DEP_LIBS@ -DMXMODULES_CFLAGS = @DMXMODULES_CFLAGS@ -DMXMODULES_LIBS = @DMXMODULES_LIBS@ -DMXXIEXAMPLES_DEP_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@ -DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@ -DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@ -DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ -DOXYGEN = @DOXYGEN@ -DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ -DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ -DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ -DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ -DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DTRACE = @DTRACE@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FILE_MAN_DIR = @FILE_MAN_DIR@ -FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ -FONT100DPIDIR = @FONT100DPIDIR@ -FONT75DPIDIR = @FONT75DPIDIR@ -FONTMISCDIR = @FONTMISCDIR@ -FONTOTFDIR = @FONTOTFDIR@ -FONTROOTDIR = @FONTROOTDIR@ -FONTTTFDIR = @FONTTTFDIR@ -FONTTYPE1DIR = @FONTTYPE1DIR@ -FOP = @FOP@ -GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ -GLX_DEFINES = @GLX_DEFINES@ -GLX_TLS = @GLX_TLS@ -GL_CFLAGS = @GL_CFLAGS@ -GL_LIBS = @GL_LIBS@ -GREP = @GREP@ -HAL_CFLAGS = @HAL_CFLAGS@ -HAL_LIBS = @HAL_LIBS@ -INSTALL = @INSTALL@ -INSTALL_CMD = @INSTALL_CMD@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ -KDRIVE_INCS = @KDRIVE_INCS@ -KDRIVE_LIBS = @KDRIVE_LIBS@ -KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ -KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ -KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ -KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ -KHRONOS_OPENGL_REGISTRY_LIBS = @KHRONOS_OPENGL_REGISTRY_LIBS@ -KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBDRM_CFLAGS = @LIBDRM_CFLAGS@ -LIBDRM_LIBS = @LIBDRM_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBSHA1_CFLAGS = @LIBSHA1_CFLAGS@ -LIBSHA1_LIBS = @LIBSHA1_LIBS@ -LIBTOOL = @LIBTOOL@ -LIB_MAN_DIR = @LIB_MAN_DIR@ -LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAIN_LIB = @MAIN_LIB@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MAN_SUBSTS = @MAN_SUBSTS@ -MISC_MAN_DIR = @MISC_MAN_DIR@ -MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJC = @OBJC@ -OBJCCLD = @OBJCCLD@ -OBJCDEPMODE = @OBJCDEPMODE@ -OBJCFLAGS = @OBJCFLAGS@ -OBJCLINK = @OBJCLINK@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ -OS_LIB = @OS_LIB@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ -PCIACCESS_LIBS = @PCIACCESS_LIBS@ -PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@ -PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ -PIXMAN_LIBS = @PIXMAN_LIBS@ -PKG_CONFIG = @PKG_CONFIG@ -PROJECTROOT = @PROJECTROOT@ -RANLIB = @RANLIB@ -RAWCPP = @RAWCPP@ -RAWCPPFLAGS = @RAWCPPFLAGS@ -RELEASE_DATE = @RELEASE_DATE@ -SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ -SED = @SED@ -SELINUX_CFLAGS = @SELINUX_CFLAGS@ -SELINUX_LIBS = @SELINUX_LIBS@ -SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@ -SET_MAKE = @SET_MAKE@ -SHA1_CFLAGS = @SHA1_CFLAGS@ -SHA1_LIBS = @SHA1_LIBS@ -SHELL = @SHELL@ -SOLARIS_ASM_CFLAGS = @SOLARIS_ASM_CFLAGS@ -SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ -STRICT_CFLAGS = @STRICT_CFLAGS@ -STRIP = @STRIP@ -STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ -SYSCONFDIR = @SYSCONFDIR@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ -UDEV_CFLAGS = @UDEV_CFLAGS@ -UDEV_LIBS = @UDEV_LIBS@ -UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ -VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ -VERSION = @VERSION@ -WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ -WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ -WINDRES = @WINDRES@ -X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ -X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ -XDMCP_CFLAGS = @XDMCP_CFLAGS@ -XDMCP_LIBS = @XDMCP_LIBS@ -XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ -XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@ -XDMX_CFLAGS = @XDMX_CFLAGS@ -XDMX_LIBS = @XDMX_LIBS@ -XDMX_SYS_LIBS = @XDMX_SYS_LIBS@ -XEPHYR_CFLAGS = @XEPHYR_CFLAGS@ -XEPHYR_INCS = @XEPHYR_INCS@ -XEPHYR_LIBS = @XEPHYR_LIBS@ -XF86CONFIGDIR = @XF86CONFIGDIR@ -XF86CONFIGFILE = @XF86CONFIGFILE@ -XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@ -XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@ -XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@ -XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@ -XKB_COMPILED_DIR = @XKB_COMPILED_DIR@ -XKB_DFLT_LAYOUT = @XKB_DFLT_LAYOUT@ -XKB_DFLT_MODEL = @XKB_DFLT_MODEL@ -XKB_DFLT_OPTIONS = @XKB_DFLT_OPTIONS@ -XKB_DFLT_RULES = @XKB_DFLT_RULES@ -XKB_DFLT_VARIANT = @XKB_DFLT_VARIANT@ -XKM_OUTPUT_DIR = @XKM_OUTPUT_DIR@ -XLIB_CFLAGS = @XLIB_CFLAGS@ -XLIB_LIBS = @XLIB_LIBS@ -XMLTO = @XMLTO@ -XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@ -XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ -XNEST_LIBS = @XNEST_LIBS@ -XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ -XORG_CFLAGS = @XORG_CFLAGS@ -XORG_INCS = @XORG_INCS@ -XORG_LIBS = @XORG_LIBS@ -XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ -XORG_MAN_PAGE = @XORG_MAN_PAGE@ -XORG_MODULES_CFLAGS = @XORG_MODULES_CFLAGS@ -XORG_MODULES_LIBS = @XORG_MODULES_LIBS@ -XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ -XORG_SGML_PATH = @XORG_SGML_PATH@ -XORG_SYS_LIBS = @XORG_SYS_LIBS@ -XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ -XPBPROXY_LIBS = @XPBPROXY_LIBS@ -XQUARTZ_LIBS = @XQUARTZ_LIBS@ -XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@ -XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ -XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ -XSERVERCFLAGS_CFLAGS = @XSERVERCFLAGS_CFLAGS@ -XSERVERCFLAGS_LIBS = @XSERVERCFLAGS_LIBS@ -XSERVERLIBS_CFLAGS = @XSERVERLIBS_CFLAGS@ -XSERVERLIBS_LIBS = @XSERVERLIBS_LIBS@ -XSERVER_LIBS = @XSERVER_LIBS@ -XSERVER_SYS_LIBS = @XSERVER_SYS_LIBS@ -XSLTPROC = @XSLTPROC@ -XSL_STYLESHEET = @XSL_STYLESHEET@ -XTSTEXAMPLES_DEP_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@ -XTSTEXAMPLES_DEP_LIBS = @XTSTEXAMPLES_DEP_LIBS@ -XVFB_LIBS = @XVFB_LIBS@ -XVFB_SYS_LIBS = @XVFB_SYS_LIBS@ -XWINMODULES_CFLAGS = @XWINMODULES_CFLAGS@ -XWINMODULES_LIBS = @XWINMODULES_LIBS@ -XWIN_LIBS = @XWIN_LIBS@ -XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ -XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ -abi_ansic = @abi_ansic@ -abi_extension = @abi_extension@ -abi_videodrv = @abi_videodrv@ -abi_xinput = @abi_xinput@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -driverdir = @driverdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -extdir = @extdir@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -logdir = @logdir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -moduledir = @moduledir@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sdkdir = @sdkdir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -symbol_visibility = @symbol_visibility@ -sysconfdir = @sysconfdir@ -sysconfigdir = @sysconfigdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -sdk_HEADERS = dgaproc.h -extsmoduledir = $(moduledir)/extensions -extsmodule_LTLIBRARIES = libextmod.la -@DGA_TRUE@DGA_SRCS = xf86dga2.c dgaproc.h -@XV_TRUE@XV_SRCS = xvmod.c xvmodproc.h -@XF86VIDMODE_TRUE@XF86VMODE_SRCS = xf86vmode.c -AM_CFLAGS = @DIX_CFLAGS@ @XORG_CFLAGS@ -INCLUDES = @XORG_INCS@ \ - -I$(top_srcdir)/dbe \ - -I$(top_srcdir)/hw/xfree86/loader \ - -I$(top_srcdir)/miext/shadow - -libextmod_la_LDFLAGS = -module -avoid-version -libextmod_la_SOURCES = modinit.c \ - modinit.h \ - $(DGA_SRCS) \ - $(XF86VMODE_SRCS) \ - $(XV_SRCS) - -libextmod_la_LIBADD = $(top_builddir)/Xext/libXextmodule.la -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign hw/xfree86/dixmods/extmod/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign hw/xfree86/dixmods/extmod/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-extsmoduleLTLIBRARIES: $(extsmodule_LTLIBRARIES) - @$(NORMAL_INSTALL) - @list='$(extsmodule_LTLIBRARIES)'; test -n "$(extsmoduledir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(extsmoduledir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(extsmoduledir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(extsmoduledir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(extsmoduledir)"; \ - } - -uninstall-extsmoduleLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(extsmodule_LTLIBRARIES)'; test -n "$(extsmoduledir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(extsmoduledir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(extsmoduledir)/$$f"; \ - done - -clean-extsmoduleLTLIBRARIES: - -test -z "$(extsmodule_LTLIBRARIES)" || rm -f $(extsmodule_LTLIBRARIES) - @list='$(extsmodule_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } -libextmod.la: $(libextmod_la_OBJECTS) $(libextmod_la_DEPENDENCIES) $(EXTRA_libextmod_la_DEPENDENCIES) - $(AM_V_CCLD)$(libextmod_la_LINK) -rpath $(extsmoduledir) $(libextmod_la_OBJECTS) $(libextmod_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modinit.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86dga2.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86vmode.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xvmod.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -install-sdkHEADERS: $(sdk_HEADERS) - @$(NORMAL_INSTALL) - @list='$(sdk_HEADERS)'; test -n "$(sdkdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(sdkdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(sdkdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(sdkdir)'"; \ - $(INSTALL_HEADER) $$files "$(DESTDIR)$(sdkdir)" || exit $$?; \ - done - -uninstall-sdkHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(sdk_HEADERS)'; test -n "$(sdkdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(sdkdir)'; $(am__uninstall_files_from_dir) - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -cscopelist: $(HEADERS) $(SOURCES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) $(HEADERS) -installdirs: - for dir in "$(DESTDIR)$(extsmoduledir)" "$(DESTDIR)$(sdkdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-extsmoduleLTLIBRARIES clean-generic clean-libtool \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-extsmoduleLTLIBRARIES install-sdkHEADERS - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-extsmoduleLTLIBRARIES uninstall-sdkHEADERS - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean \ - clean-extsmoduleLTLIBRARIES clean-generic clean-libtool \ - cscopelist ctags distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-extsmoduleLTLIBRARIES install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-sdkHEADERS install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-extsmoduleLTLIBRARIES \ - uninstall-sdkHEADERS - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/xserver/hw/xfree86/dixmods/extmod/modinit.c b/xserver/hw/xfree86/dixmods/extmod/modinit.c deleted file mode 100644 index ca15ee0e7..000000000 --- a/xserver/hw/xfree86/dixmods/extmod/modinit.c +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Copyright (c) 1997 Matthieu Herrb - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Matthieu Herrb not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Matthieu Herrb makes no - * representations about the suitability of this software for any purpose. - * It is provided "as is" without express or implied warranty. - * - * MATTHIEU HERRB DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL MATTHIEU HERRB BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86Module.h" -#include "xf86Opt.h" - -#include - -#include "modinit.h" -#include "globals.h" - -static MODULESETUPPROTO(extmodSetup); - -/* - * Array describing extensions to be initialized - */ -static ExtensionModule extensionModules[] = { -#ifdef XSELINUX - { - SELinuxExtensionInit, - SELINUX_EXTENSION_NAME, - &noSELinuxExtension, - NULL, - NULL}, -#endif -#ifdef SCREENSAVER - { - ScreenSaverExtensionInit, - ScreenSaverName, - &noScreenSaverExtension, - NULL, - NULL}, -#endif -#ifdef XF86VIDMODE - { - XFree86VidModeExtensionInit, - XF86VIDMODENAME, - &noXFree86VidModeExtension, - NULL, - NULL}, -#endif -#ifdef XFreeXDGA - { - XFree86DGAExtensionInit, - XF86DGANAME, - &noXFree86DGAExtension, - XFree86DGARegister, - NULL}, -#endif -#ifdef DPMSExtension - { - DPMSExtensionInit, - DPMSExtensionName, - &noDPMSExtension, - NULL, - NULL}, -#endif -#ifdef XV - { - XvExtensionInit, - XvName, - &noXvExtension, - XvRegister, - NULL}, - { - XvMCExtensionInit, - XvMCName, - &noXvExtension, - NULL, - NULL}, -#endif -#ifdef RES - { - ResExtensionInit, - XRES_NAME, - &noResExtension, - NULL, - NULL}, -#endif - { /* DON'T delete this entry ! */ - NULL, - NULL, - NULL, - NULL, - NULL} -}; - -static XF86ModuleVersionInfo VersRec = { - "extmod", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 1, 0, 0, - ABI_CLASS_EXTENSION, - ABI_EXTENSION_VERSION, - MOD_CLASS_EXTENSION, - {0, 0, 0, 0} -}; - -/* - * Data for the loader - */ -_X_EXPORT XF86ModuleData extmodModuleData = { &VersRec, extmodSetup, NULL }; - -static pointer -extmodSetup(pointer module, pointer opts, int *errmaj, int *errmin) -{ - int i; - - /* XXX the option stuff here is largely a sample/test case */ - - for (i = 0; extensionModules[i].name != NULL; i++) { - if (opts) { - char *s; - - if (asprintf(&s, "omit%s", extensionModules[i].name) != -1) { - pointer o; - - o = xf86FindOption(opts, s); - free(s); - if (o) { - xf86MarkOptionUsed(o); - continue; - } - } - } - -#ifdef XSELINUX - if (!strcmp(SELINUX_EXTENSION_NAME, extensionModules[i].name)) { - pointer o; - - selinuxEnforcingState = SELINUX_MODE_DEFAULT; - - if ((o = xf86FindOption(opts, "SELinux mode disabled"))) { - xf86MarkOptionUsed(o); - selinuxEnforcingState = SELINUX_MODE_DISABLED; - } - if ((o = xf86FindOption(opts, "SELinux mode permissive"))) { - xf86MarkOptionUsed(o); - selinuxEnforcingState = SELINUX_MODE_PERMISSIVE; - } - if ((o = xf86FindOption(opts, "SELinux mode enforcing"))) { - xf86MarkOptionUsed(o); - selinuxEnforcingState = SELINUX_MODE_ENFORCING; - } - } -#endif - - LoadExtension(&extensionModules[i], FALSE); - } - /* Need a non-NULL return */ - return (pointer) 1; -} diff --git a/xserver/hw/xfree86/dixmods/extmod/modinit.h b/xserver/hw/xfree86/dixmods/extmod/modinit.h index 9753fe0fd..4c9b6e3cc 100644 --- a/xserver/hw/xfree86/dixmods/extmod/modinit.h +++ b/xserver/hw/xfree86/dixmods/extmod/modinit.h @@ -3,91 +3,78 @@ #include #endif -#ifndef INITARGS -#define INITARGS void -#endif - #include #ifdef XTEST -extern void XTestExtensionInit(INITARGS); - +extern void XTestExtensionInit(void); #include #endif #if 1 -extern void XTestExtension1Init(INITARGS); +extern void XTestExtension1Init(void); #endif #if 1 -extern void XCMiscExtensionInit(INITARGS); +extern void XCMiscExtensionInit(void); #endif #ifdef SCREENSAVER -extern void ScreenSaverExtensionInit(INITARGS); - +extern void ScreenSaverExtensionInit(void); #include #endif #ifdef XF86VIDMODE -extern void XFree86VidModeExtensionInit(INITARGS); - +extern void XFree86VidModeExtensionInit(void); #include #endif #ifdef XFreeXDGA -extern void XFree86DGAExtensionInit(INITARGS); -extern void XFree86DGARegister(INITARGS); - +extern void XFree86DGAExtensionInit(void); +extern void XFree86DGARegister(void); #include #endif #ifdef DPMSExtension -extern void DPMSExtensionInit(INITARGS); - +extern void DPMSExtensionInit(void); #include #endif #ifdef XV -extern void XvExtensionInit(INITARGS); -extern void XvMCExtensionInit(INITARGS); -extern void XvRegister(INITARGS); - +extern void XvExtensionInit(void); +extern void XvMCExtensionInit(void); +extern void XvRegister(void); #include #include #endif #ifdef RES -extern void ResExtensionInit(INITARGS); - +extern void ResExtensionInit(void); #include #endif #ifdef SHM -extern void ShmExtensionInit(INITARGS); - #include +extern void ShmExtensionInit(void); extern void ShmRegisterFuncs(ScreenPtr pScreen, ShmFuncsPtr funcs); #endif #ifdef XSELINUX -extern void SELinuxExtensionInit(INITARGS); - +extern void SELinuxExtensionInit(void); #include "xselinux.h" #endif #ifdef XEVIE -extern void XevieExtensionInit(INITARGS); +extern void XevieExtensionInit(void); #endif #if 1 -extern void SecurityExtensionInit(INITARGS); +extern void SecurityExtensionInit(void); #endif #if 1 -extern void PanoramiXExtensionInit(int argc, char *argv[]); +extern void PanoramiXExtensionInit(void); #endif #if 1 -extern void XkbExtensionInit(INITARGS); +extern void XkbExtensionInit(void); #endif diff --git a/xserver/hw/xfree86/dixmods/extmod/xf86dga2.c b/xserver/hw/xfree86/dixmods/extmod/xf86dga2.c deleted file mode 100644 index 6b33941ef..000000000 --- a/xserver/hw/xfree86/dixmods/extmod/xf86dga2.c +++ /dev/null @@ -1,1029 +0,0 @@ -/* - * Copyright (c) 1995 Jon Tombs - * Copyright (c) 1995, 1996, 1999 XFree86 Inc - * Copyright (c) 1999 - The XFree86 Project Inc. - * - * Written by Mark Vojkovich - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include -#include -#include "misc.h" -#include "dixstruct.h" -#include "dixevents.h" -#include "pixmapstr.h" -#include "extnsionst.h" -#include "colormapst.h" -#include "cursorstr.h" -#include "scrnintstr.h" -#include "servermd.h" -#include -#include "swaprep.h" -#include "dgaproc.h" -#include "protocol-versions.h" - -#include - -#include "modinit.h" - -#define DGA_PROTOCOL_OLD_SUPPORT 1 - -static void XDGAResetProc(ExtensionEntry * extEntry); - -static void DGAClientStateChange(CallbackListPtr *, pointer, pointer); - -unsigned char DGAReqCode = 0; -int DGAErrorBase; -int DGAEventBase; - -static DevPrivateKeyRec DGAScreenPrivateKeyRec; - -#define DGAScreenPrivateKey (&DGAScreenPrivateKeyRec) -#define DGAScreenPrivateKeyRegistered (DGAScreenPrivateKeyRec.initialized) -static DevPrivateKeyRec DGAClientPrivateKeyRec; - -#define DGAClientPrivateKey (&DGAClientPrivateKeyRec) -static int DGACallbackRefCount = 0; - -/* This holds the client's version information */ -typedef struct { - int major; - int minor; -} DGAPrivRec, *DGAPrivPtr; - -#define DGA_GETCLIENT(idx) ((ClientPtr) \ - dixLookupPrivate(&screenInfo.screens[idx]->devPrivates, DGAScreenPrivateKey)) -#define DGA_SETCLIENT(idx,p) \ - dixSetPrivate(&screenInfo.screens[idx]->devPrivates, DGAScreenPrivateKey, p) - -#define DGA_GETPRIV(c) ((DGAPrivPtr) \ - dixLookupPrivate(&(c)->devPrivates, DGAClientPrivateKey)) -#define DGA_SETPRIV(c,p) \ - dixSetPrivate(&(c)->devPrivates, DGAClientPrivateKey, p) - -static void -XDGAResetProc(ExtensionEntry * extEntry) -{ - DeleteCallback(&ClientStateCallback, DGAClientStateChange, NULL); - DGACallbackRefCount = 0; -} - -static int -ProcXDGAQueryVersion(ClientPtr client) -{ - xXDGAQueryVersionReply rep; - - REQUEST_SIZE_MATCH(xXDGAQueryVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = SERVER_XDGA_MAJOR_VERSION; - rep.minorVersion = SERVER_XDGA_MINOR_VERSION; - - WriteToClient(client, sizeof(xXDGAQueryVersionReply), (char *) &rep); - return Success; -} - -static int -ProcXDGAOpenFramebuffer(ClientPtr client) -{ - REQUEST(xXDGAOpenFramebufferReq); - xXDGAOpenFramebufferReply rep; - char *deviceName; - int nameSize; - - if (stuff->screen >= screenInfo.numScreens) - return BadValue; - - if (!DGAAvailable(stuff->screen)) - return DGAErrorBase + XF86DGANoDirectVideoMode; - - REQUEST_SIZE_MATCH(xXDGAOpenFramebufferReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - - if (!DGAOpenFramebuffer(stuff->screen, &deviceName, - (unsigned char **) (&rep.mem1), - (int *) &rep.size, (int *) &rep.offset, - (int *) &rep.extra)) { - return BadAlloc; - } - - nameSize = deviceName ? (strlen(deviceName) + 1) : 0; - rep.length = bytes_to_int32(nameSize); - - WriteToClient(client, sizeof(xXDGAOpenFramebufferReply), (char *) &rep); - if (rep.length) - WriteToClient(client, nameSize, deviceName); - - return Success; -} - -static int -ProcXDGACloseFramebuffer(ClientPtr client) -{ - REQUEST(xXDGACloseFramebufferReq); - - if (stuff->screen >= screenInfo.numScreens) - return BadValue; - - if (!DGAAvailable(stuff->screen)) - return DGAErrorBase + XF86DGANoDirectVideoMode; - - REQUEST_SIZE_MATCH(xXDGACloseFramebufferReq); - - DGACloseFramebuffer(stuff->screen); - - return Success; -} - -static int -ProcXDGAQueryModes(ClientPtr client) -{ - int i, num, size; - - REQUEST(xXDGAQueryModesReq); - xXDGAQueryModesReply rep; - xXDGAModeInfo info; - XDGAModePtr mode; - - if (stuff->screen >= screenInfo.numScreens) - return BadValue; - - REQUEST_SIZE_MATCH(xXDGAQueryModesReq); - rep.type = X_Reply; - rep.length = 0; - rep.number = 0; - rep.sequenceNumber = client->sequence; - - if (!DGAAvailable(stuff->screen)) { - rep.number = 0; - rep.length = 0; - WriteToClient(client, sz_xXDGAQueryModesReply, (char *) &rep); - return Success; - } - - if (!(num = DGAGetModes(stuff->screen))) { - WriteToClient(client, sz_xXDGAQueryModesReply, (char *) &rep); - return Success; - } - - if (!(mode = (XDGAModePtr) malloc(num * sizeof(XDGAModeRec)))) - return BadAlloc; - - for (i = 0; i < num; i++) - DGAGetModeInfo(stuff->screen, mode + i, i + 1); - - size = num * sz_xXDGAModeInfo; - for (i = 0; i < num; i++) - size += pad_to_int32(strlen(mode[i].name) + 1); /* plus NULL */ - - rep.number = num; - rep.length = bytes_to_int32(size); - - WriteToClient(client, sz_xXDGAQueryModesReply, (char *) &rep); - - for (i = 0; i < num; i++) { - size = strlen(mode[i].name) + 1; - - info.byte_order = mode[i].byteOrder; - info.depth = mode[i].depth; - info.num = mode[i].num; - info.bpp = mode[i].bitsPerPixel; - info.name_size = (size + 3) & ~3L; - info.vsync_num = mode[i].VSync_num; - info.vsync_den = mode[i].VSync_den; - info.flags = mode[i].flags; - info.image_width = mode[i].imageWidth; - info.image_height = mode[i].imageHeight; - info.pixmap_width = mode[i].pixmapWidth; - info.pixmap_height = mode[i].pixmapHeight; - info.bytes_per_scanline = mode[i].bytesPerScanline; - info.red_mask = mode[i].red_mask; - info.green_mask = mode[i].green_mask; - info.blue_mask = mode[i].blue_mask; - info.visual_class = mode[i].visualClass; - info.viewport_width = mode[i].viewportWidth; - info.viewport_height = mode[i].viewportHeight; - info.viewport_xstep = mode[i].xViewportStep; - info.viewport_ystep = mode[i].yViewportStep; - info.viewport_xmax = mode[i].maxViewportX; - info.viewport_ymax = mode[i].maxViewportY; - info.viewport_flags = mode[i].viewportFlags; - info.reserved1 = mode[i].reserved1; - info.reserved2 = mode[i].reserved2; - - WriteToClient(client, sz_xXDGAModeInfo, (char *) (&info)); - WriteToClient(client, size, mode[i].name); - } - - free(mode); - - return Success; -} - -static void -DGAClientStateChange(CallbackListPtr *pcbl, pointer nulldata, pointer calldata) -{ - NewClientInfoRec *pci = (NewClientInfoRec *) calldata; - ClientPtr client = NULL; - int i; - - for (i = 0; i < screenInfo.numScreens; i++) { - if (DGA_GETCLIENT(i) == pci->client) { - client = pci->client; - break; - } - } - - if (client && - ((client->clientState == ClientStateGone) || - (client->clientState == ClientStateRetained))) { - XDGAModeRec mode; - PixmapPtr pPix; - - DGA_SETCLIENT(i, NULL); - DGASelectInput(i, NULL, 0); - DGASetMode(i, 0, &mode, &pPix); - - if (--DGACallbackRefCount == 0) - DeleteCallback(&ClientStateCallback, DGAClientStateChange, NULL); - } -} - -static int -ProcXDGASetMode(ClientPtr client) -{ - REQUEST(xXDGASetModeReq); - xXDGASetModeReply rep; - XDGAModeRec mode; - xXDGAModeInfo info; - PixmapPtr pPix; - ClientPtr owner; - int size; - - if (stuff->screen >= screenInfo.numScreens) - return BadValue; - owner = DGA_GETCLIENT(stuff->screen); - - REQUEST_SIZE_MATCH(xXDGASetModeReq); - rep.type = X_Reply; - rep.length = 0; - rep.offset = 0; - rep.flags = 0; - rep.sequenceNumber = client->sequence; - - if (!DGAAvailable(stuff->screen)) - return DGAErrorBase + XF86DGANoDirectVideoMode; - - if (owner && owner != client) - return DGAErrorBase + XF86DGANoDirectVideoMode; - - if (!stuff->mode) { - if (owner) { - if (--DGACallbackRefCount == 0) - DeleteCallback(&ClientStateCallback, DGAClientStateChange, - NULL); - } - DGA_SETCLIENT(stuff->screen, NULL); - DGASelectInput(stuff->screen, NULL, 0); - DGASetMode(stuff->screen, 0, &mode, &pPix); - WriteToClient(client, sz_xXDGASetModeReply, (char *) &rep); - return Success; - } - - if (Success != DGASetMode(stuff->screen, stuff->mode, &mode, &pPix)) - return BadValue; - - if (!owner) { - if (DGACallbackRefCount++ == 0) - AddCallback(&ClientStateCallback, DGAClientStateChange, NULL); - } - - DGA_SETCLIENT(stuff->screen, client); - - if (pPix) { - if (AddResource(stuff->pid, RT_PIXMAP, (pointer) (pPix))) { - pPix->drawable.id = (int) stuff->pid; - rep.flags = DGA_PIXMAP_AVAILABLE; - } - } - - size = strlen(mode.name) + 1; - - info.byte_order = mode.byteOrder; - info.depth = mode.depth; - info.num = mode.num; - info.bpp = mode.bitsPerPixel; - info.name_size = (size + 3) & ~3L; - info.vsync_num = mode.VSync_num; - info.vsync_den = mode.VSync_den; - info.flags = mode.flags; - info.image_width = mode.imageWidth; - info.image_height = mode.imageHeight; - info.pixmap_width = mode.pixmapWidth; - info.pixmap_height = mode.pixmapHeight; - info.bytes_per_scanline = mode.bytesPerScanline; - info.red_mask = mode.red_mask; - info.green_mask = mode.green_mask; - info.blue_mask = mode.blue_mask; - info.visual_class = mode.visualClass; - info.viewport_width = mode.viewportWidth; - info.viewport_height = mode.viewportHeight; - info.viewport_xstep = mode.xViewportStep; - info.viewport_ystep = mode.yViewportStep; - info.viewport_xmax = mode.maxViewportX; - info.viewport_ymax = mode.maxViewportY; - info.viewport_flags = mode.viewportFlags; - info.reserved1 = mode.reserved1; - info.reserved2 = mode.reserved2; - - rep.length = bytes_to_int32(sz_xXDGAModeInfo + info.name_size); - - WriteToClient(client, sz_xXDGASetModeReply, (char *) &rep); - WriteToClient(client, sz_xXDGAModeInfo, (char *) (&info)); - WriteToClient(client, size, mode.name); - - return Success; -} - -static int -ProcXDGASetViewport(ClientPtr client) -{ - REQUEST(xXDGASetViewportReq); - - if (stuff->screen >= screenInfo.numScreens) - return BadValue; - - if (DGA_GETCLIENT(stuff->screen) != client) - return DGAErrorBase + XF86DGADirectNotActivated; - - REQUEST_SIZE_MATCH(xXDGASetViewportReq); - - DGASetViewport(stuff->screen, stuff->x, stuff->y, stuff->flags); - - return Success; -} - -static int -ProcXDGAInstallColormap(ClientPtr client) -{ - ColormapPtr cmap; - int rc; - - REQUEST(xXDGAInstallColormapReq); - - if (stuff->screen >= screenInfo.numScreens) - return BadValue; - - if (DGA_GETCLIENT(stuff->screen) != client) - return DGAErrorBase + XF86DGADirectNotActivated; - - REQUEST_SIZE_MATCH(xXDGAInstallColormapReq); - - rc = dixLookupResourceByType((pointer *) &cmap, stuff->cmap, RT_COLORMAP, - client, DixInstallAccess); - if (rc != Success) - return rc; - DGAInstallCmap(cmap); - return Success; -} - -static int -ProcXDGASelectInput(ClientPtr client) -{ - REQUEST(xXDGASelectInputReq); - - if (stuff->screen >= screenInfo.numScreens) - return BadValue; - - if (DGA_GETCLIENT(stuff->screen) != client) - return DGAErrorBase + XF86DGADirectNotActivated; - - REQUEST_SIZE_MATCH(xXDGASelectInputReq); - - if (DGA_GETCLIENT(stuff->screen) == client) - DGASelectInput(stuff->screen, client, stuff->mask); - - return Success; -} - -static int -ProcXDGAFillRectangle(ClientPtr client) -{ - REQUEST(xXDGAFillRectangleReq); - - if (stuff->screen >= screenInfo.numScreens) - return BadValue; - - if (DGA_GETCLIENT(stuff->screen) != client) - return DGAErrorBase + XF86DGADirectNotActivated; - - REQUEST_SIZE_MATCH(xXDGAFillRectangleReq); - - if (Success != DGAFillRect(stuff->screen, stuff->x, stuff->y, - stuff->width, stuff->height, stuff->color)) - return BadMatch; - - return Success; -} - -static int -ProcXDGACopyArea(ClientPtr client) -{ - REQUEST(xXDGACopyAreaReq); - - if (stuff->screen >= screenInfo.numScreens) - return BadValue; - - if (DGA_GETCLIENT(stuff->screen) != client) - return DGAErrorBase + XF86DGADirectNotActivated; - - REQUEST_SIZE_MATCH(xXDGACopyAreaReq); - - if (Success != DGABlitRect(stuff->screen, stuff->srcx, stuff->srcy, - stuff->width, stuff->height, stuff->dstx, - stuff->dsty)) - return BadMatch; - - return Success; -} - -static int -ProcXDGACopyTransparentArea(ClientPtr client) -{ - REQUEST(xXDGACopyTransparentAreaReq); - - if (stuff->screen >= screenInfo.numScreens) - return BadValue; - - if (DGA_GETCLIENT(stuff->screen) != client) - return DGAErrorBase + XF86DGADirectNotActivated; - - REQUEST_SIZE_MATCH(xXDGACopyTransparentAreaReq); - - if (Success != DGABlitTransRect(stuff->screen, stuff->srcx, stuff->srcy, - stuff->width, stuff->height, stuff->dstx, - stuff->dsty, stuff->key)) - return BadMatch; - - return Success; -} - -static int -ProcXDGAGetViewportStatus(ClientPtr client) -{ - REQUEST(xXDGAGetViewportStatusReq); - xXDGAGetViewportStatusReply rep; - - if (stuff->screen >= screenInfo.numScreens) - return BadValue; - - if (DGA_GETCLIENT(stuff->screen) != client) - return DGAErrorBase + XF86DGADirectNotActivated; - - REQUEST_SIZE_MATCH(xXDGAGetViewportStatusReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - - rep.status = DGAGetViewportStatus(stuff->screen); - - WriteToClient(client, sizeof(xXDGAGetViewportStatusReply), (char *) &rep); - return Success; -} - -static int -ProcXDGASync(ClientPtr client) -{ - REQUEST(xXDGASyncReq); - xXDGASyncReply rep; - - if (stuff->screen >= screenInfo.numScreens) - return BadValue; - - if (DGA_GETCLIENT(stuff->screen) != client) - return DGAErrorBase + XF86DGADirectNotActivated; - - REQUEST_SIZE_MATCH(xXDGASyncReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - - DGASync(stuff->screen); - - WriteToClient(client, sizeof(xXDGASyncReply), (char *) &rep); - return Success; -} - -static int -ProcXDGASetClientVersion(ClientPtr client) -{ - REQUEST(xXDGASetClientVersionReq); - - DGAPrivPtr pPriv; - - REQUEST_SIZE_MATCH(xXDGASetClientVersionReq); - if ((pPriv = DGA_GETPRIV(client)) == NULL) { - pPriv = malloc(sizeof(DGAPrivRec)); - /* XXX Need to look into freeing this */ - if (!pPriv) - return BadAlloc; - DGA_SETPRIV(client, pPriv); - } - pPriv->major = stuff->major; - pPriv->minor = stuff->minor; - - return Success; -} - -static int -ProcXDGAChangePixmapMode(ClientPtr client) -{ - REQUEST(xXDGAChangePixmapModeReq); - xXDGAChangePixmapModeReply rep; - int x, y; - - if (stuff->screen >= screenInfo.numScreens) - return BadValue; - - if (DGA_GETCLIENT(stuff->screen) != client) - return DGAErrorBase + XF86DGADirectNotActivated; - - REQUEST_SIZE_MATCH(xXDGAChangePixmapModeReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - - x = stuff->x; - y = stuff->y; - - if (!DGAChangePixmapMode(stuff->screen, &x, &y, stuff->flags)) - return BadMatch; - - rep.x = x; - rep.y = y; - WriteToClient(client, sizeof(xXDGAChangePixmapModeReply), (char *) &rep); - - return Success; -} - -static int -ProcXDGACreateColormap(ClientPtr client) -{ - REQUEST(xXDGACreateColormapReq); - int result; - - if (stuff->screen >= screenInfo.numScreens) - return BadValue; - - if (DGA_GETCLIENT(stuff->screen) != client) - return DGAErrorBase + XF86DGADirectNotActivated; - - REQUEST_SIZE_MATCH(xXDGACreateColormapReq); - - if (!stuff->mode) - return BadValue; - - result = DGACreateColormap(stuff->screen, client, stuff->id, - stuff->mode, stuff->alloc); - if (result != Success) - return result; - - return Success; -} - -/* - * - * Support for the old DGA protocol, used to live in xf86dga.c - * - */ - -#ifdef DGA_PROTOCOL_OLD_SUPPORT - -static int -ProcXF86DGAGetVideoLL(ClientPtr client) -{ - REQUEST(xXF86DGAGetVideoLLReq); - xXF86DGAGetVideoLLReply rep; - XDGAModeRec mode; - int num, offset, flags; - char *name; - - if (stuff->screen >= screenInfo.numScreens) - return BadValue; - - REQUEST_SIZE_MATCH(xXF86DGAGetVideoLLReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - - if (!DGAAvailable(stuff->screen)) - return DGAErrorBase + XF86DGANoDirectVideoMode; - - if (!(num = DGAGetOldDGAMode(stuff->screen))) - return DGAErrorBase + XF86DGANoDirectVideoMode; - - /* get the parameters for the mode that best matches */ - DGAGetModeInfo(stuff->screen, &mode, num); - - if (!DGAOpenFramebuffer(stuff->screen, &name, - (unsigned char **) (&rep.offset), - (int *) (&rep.bank_size), &offset, &flags)) - return BadAlloc; - - rep.offset += mode.offset; - rep.width = mode.bytesPerScanline / (mode.bitsPerPixel >> 3); - rep.ram_size = rep.bank_size >> 10; - - WriteToClient(client, SIZEOF(xXF86DGAGetVideoLLReply), (char *) &rep); - return Success; -} - -static int -ProcXF86DGADirectVideo(ClientPtr client) -{ - int num; - PixmapPtr pix; - XDGAModeRec mode; - ClientPtr owner; - - REQUEST(xXF86DGADirectVideoReq); - - if (stuff->screen >= screenInfo.numScreens) - return BadValue; - REQUEST_SIZE_MATCH(xXF86DGADirectVideoReq); - - if (!DGAAvailable(stuff->screen)) - return DGAErrorBase + XF86DGANoDirectVideoMode; - - owner = DGA_GETCLIENT(stuff->screen); - - if (owner && owner != client) - return DGAErrorBase + XF86DGANoDirectVideoMode; - - if (stuff->enable & XF86DGADirectGraphics) { - if (!(num = DGAGetOldDGAMode(stuff->screen))) - return DGAErrorBase + XF86DGANoDirectVideoMode; - } - else - num = 0; - - if (Success != DGASetMode(stuff->screen, num, &mode, &pix)) - return DGAErrorBase + XF86DGAScreenNotActive; - - DGASetInputMode(stuff->screen, - (stuff->enable & XF86DGADirectKeyb) != 0, - (stuff->enable & XF86DGADirectMouse) != 0); - - /* We need to track the client and attach the teardown callback */ - if (stuff->enable & - (XF86DGADirectGraphics | XF86DGADirectKeyb | XF86DGADirectMouse)) { - if (!owner) { - if (DGACallbackRefCount++ == 0) - AddCallback(&ClientStateCallback, DGAClientStateChange, NULL); - } - - DGA_SETCLIENT(stuff->screen, client); - } - else { - if (owner) { - if (--DGACallbackRefCount == 0) - DeleteCallback(&ClientStateCallback, DGAClientStateChange, - NULL); - } - - DGA_SETCLIENT(stuff->screen, NULL); - } - - return Success; -} - -static int -ProcXF86DGAGetViewPortSize(ClientPtr client) -{ - int num; - XDGAModeRec mode; - - REQUEST(xXF86DGAGetViewPortSizeReq); - xXF86DGAGetViewPortSizeReply rep; - - if (stuff->screen >= screenInfo.numScreens) - return BadValue; - - REQUEST_SIZE_MATCH(xXF86DGAGetViewPortSizeReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - - if (!DGAAvailable(stuff->screen)) - return DGAErrorBase + XF86DGANoDirectVideoMode; - - if (!(num = DGAGetOldDGAMode(stuff->screen))) - return DGAErrorBase + XF86DGANoDirectVideoMode; - - DGAGetModeInfo(stuff->screen, &mode, num); - - rep.width = mode.viewportWidth; - rep.height = mode.viewportHeight; - - WriteToClient(client, SIZEOF(xXF86DGAGetViewPortSizeReply), (char *) &rep); - return Success; -} - -static int -ProcXF86DGASetViewPort(ClientPtr client) -{ - REQUEST(xXF86DGASetViewPortReq); - - if (stuff->screen >= screenInfo.numScreens) - return BadValue; - - if (DGA_GETCLIENT(stuff->screen) != client) - return DGAErrorBase + XF86DGADirectNotActivated; - - REQUEST_SIZE_MATCH(xXF86DGASetViewPortReq); - - if (!DGAAvailable(stuff->screen)) - return DGAErrorBase + XF86DGANoDirectVideoMode; - - if (!DGAActive(stuff->screen)) - return DGAErrorBase + XF86DGADirectNotActivated; - - if (DGASetViewport(stuff->screen, stuff->x, stuff->y, DGA_FLIP_RETRACE) - != Success) - return DGAErrorBase + XF86DGADirectNotActivated; - - return Success; -} - -static int -ProcXF86DGAGetVidPage(ClientPtr client) -{ - REQUEST(xXF86DGAGetVidPageReq); - xXF86DGAGetVidPageReply rep; - - if (stuff->screen >= screenInfo.numScreens) - return BadValue; - - REQUEST_SIZE_MATCH(xXF86DGAGetVidPageReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.vpage = 0; /* silently fail */ - - WriteToClient(client, SIZEOF(xXF86DGAGetVidPageReply), (char *) &rep); - return Success; -} - -static int -ProcXF86DGASetVidPage(ClientPtr client) -{ - REQUEST(xXF86DGASetVidPageReq); - - if (stuff->screen >= screenInfo.numScreens) - return BadValue; - - REQUEST_SIZE_MATCH(xXF86DGASetVidPageReq); - - /* silently fail */ - - return Success; -} - -static int -ProcXF86DGAInstallColormap(ClientPtr client) -{ - ColormapPtr pcmp; - int rc; - - REQUEST(xXF86DGAInstallColormapReq); - - if (stuff->screen >= screenInfo.numScreens) - return BadValue; - - if (DGA_GETCLIENT(stuff->screen) != client) - return DGAErrorBase + XF86DGADirectNotActivated; - - REQUEST_SIZE_MATCH(xXF86DGAInstallColormapReq); - - if (!DGAActive(stuff->screen)) - return DGAErrorBase + XF86DGADirectNotActivated; - - rc = dixLookupResourceByType((pointer *) &pcmp, stuff->id, RT_COLORMAP, - client, DixInstallAccess); - if (rc == Success) { - DGAInstallCmap(pcmp); - return Success; - } - else { - return rc; - } -} - -static int -ProcXF86DGAQueryDirectVideo(ClientPtr client) -{ - REQUEST(xXF86DGAQueryDirectVideoReq); - xXF86DGAQueryDirectVideoReply rep; - - if (stuff->screen >= screenInfo.numScreens) - return BadValue; - - REQUEST_SIZE_MATCH(xXF86DGAQueryDirectVideoReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.flags = 0; - - if (DGAAvailable(stuff->screen)) - rep.flags = XF86DGADirectPresent; - - WriteToClient(client, SIZEOF(xXF86DGAQueryDirectVideoReply), (char *) &rep); - return Success; -} - -static int -ProcXF86DGAViewPortChanged(ClientPtr client) -{ - REQUEST(xXF86DGAViewPortChangedReq); - xXF86DGAViewPortChangedReply rep; - - if (stuff->screen >= screenInfo.numScreens) - return BadValue; - - if (DGA_GETCLIENT(stuff->screen) != client) - return DGAErrorBase + XF86DGADirectNotActivated; - - REQUEST_SIZE_MATCH(xXF86DGAViewPortChangedReq); - - if (!DGAActive(stuff->screen)) - return DGAErrorBase + XF86DGADirectNotActivated; - - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.result = 1; - - WriteToClient(client, SIZEOF(xXF86DGAViewPortChangedReply), (char *) &rep); - return Success; -} - -#endif /* DGA_PROTOCOL_OLD_SUPPORT */ - -static int -SProcXDGADispatch(ClientPtr client) -{ - return DGAErrorBase + XF86DGAClientNotLocal; -} - -#if 0 -#define DGA_REQ_DEBUG -#endif - -#ifdef DGA_REQ_DEBUG -static char *dgaMinor[] = { - "QueryVersion", - "GetVideoLL", - "DirectVideo", - "GetViewPortSize", - "SetViewPort", - "GetVidPage", - "SetVidPage", - "InstallColormap", - "QueryDirectVideo", - "ViewPortChanged", - "10", - "11", - "QueryModes", - "SetMode", - "SetViewport", - "InstallColormap", - "SelectInput", - "FillRectangle", - "CopyArea", - "CopyTransparentArea", - "GetViewportStatus", - "Sync", - "OpenFramebuffer", - "CloseFramebuffer", - "SetClientVersion", - "ChangePixmapMode", - "CreateColormap", -}; -#endif - -static int -ProcXDGADispatch(ClientPtr client) -{ - REQUEST(xReq); - - if (!LocalClient(client)) - return DGAErrorBase + XF86DGAClientNotLocal; - -#ifdef DGA_REQ_DEBUG - if (stuff->data <= X_XDGACreateColormap) - fprintf(stderr, " DGA %s\n", dgaMinor[stuff->data]); -#endif - - switch (stuff->data) { - /* - * DGA2 Protocol - */ - case X_XDGAQueryVersion: - return ProcXDGAQueryVersion(client); - case X_XDGAQueryModes: - return ProcXDGAQueryModes(client); - case X_XDGASetMode: - return ProcXDGASetMode(client); - case X_XDGAOpenFramebuffer: - return ProcXDGAOpenFramebuffer(client); - case X_XDGACloseFramebuffer: - return ProcXDGACloseFramebuffer(client); - case X_XDGASetViewport: - return ProcXDGASetViewport(client); - case X_XDGAInstallColormap: - return ProcXDGAInstallColormap(client); - case X_XDGASelectInput: - return ProcXDGASelectInput(client); - case X_XDGAFillRectangle: - return ProcXDGAFillRectangle(client); - case X_XDGACopyArea: - return ProcXDGACopyArea(client); - case X_XDGACopyTransparentArea: - return ProcXDGACopyTransparentArea(client); - case X_XDGAGetViewportStatus: - return ProcXDGAGetViewportStatus(client); - case X_XDGASync: - return ProcXDGASync(client); - case X_XDGASetClientVersion: - return ProcXDGASetClientVersion(client); - case X_XDGAChangePixmapMode: - return ProcXDGAChangePixmapMode(client); - case X_XDGACreateColormap: - return ProcXDGACreateColormap(client); - /* - * Old DGA Protocol - */ -#ifdef DGA_PROTOCOL_OLD_SUPPORT - case X_XF86DGAGetVideoLL: - return ProcXF86DGAGetVideoLL(client); - case X_XF86DGADirectVideo: - return ProcXF86DGADirectVideo(client); - case X_XF86DGAGetViewPortSize: - return ProcXF86DGAGetViewPortSize(client); - case X_XF86DGASetViewPort: - return ProcXF86DGASetViewPort(client); - case X_XF86DGAGetVidPage: - return ProcXF86DGAGetVidPage(client); - case X_XF86DGASetVidPage: - return ProcXF86DGASetVidPage(client); - case X_XF86DGAInstallColormap: - return ProcXF86DGAInstallColormap(client); - case X_XF86DGAQueryDirectVideo: - return ProcXF86DGAQueryDirectVideo(client); - case X_XF86DGAViewPortChanged: - return ProcXF86DGAViewPortChanged(client); -#endif /* DGA_PROTOCOL_OLD_SUPPORT */ - default: - return BadRequest; - } -} - -void -XFree86DGARegister(INITARGS) -{ - XDGAEventBase = &DGAEventBase; -} - -void -XFree86DGAExtensionInit(INITARGS) -{ - ExtensionEntry *extEntry; - - if (!dixRegisterPrivateKey(&DGAClientPrivateKeyRec, PRIVATE_CLIENT, 0)) - return; - - if (!dixRegisterPrivateKey(&DGAScreenPrivateKeyRec, PRIVATE_SCREEN, 0)) - return; - - if ((extEntry = AddExtension(XF86DGANAME, - XF86DGANumberEvents, - XF86DGANumberErrors, - ProcXDGADispatch, - SProcXDGADispatch, - XDGAResetProc, StandardMinorOpcode))) { - int i; - - DGAReqCode = (unsigned char) extEntry->base; - DGAErrorBase = extEntry->errorBase; - DGAEventBase = extEntry->eventBase; - for (i = KeyPress; i <= MotionNotify; i++) - SetCriticalEvent(DGAEventBase + i); - } -} diff --git a/xserver/hw/xfree86/dixmods/extmod/xvmod.c b/xserver/hw/xfree86/dixmods/extmod/xvmod.c deleted file mode 100644 index 97616c705..000000000 --- a/xserver/hw/xfree86/dixmods/extmod/xvmod.c +++ /dev/null @@ -1,22 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include -#include "misc.h" -#include "scrnintstr.h" -#include "gc.h" -#include -#include -#include "xvdix.h" -#include "xvmodproc.h" - -void -XvRegister(void) -{ - XvScreenInitProc = XvScreenInit; - XvGetScreenKeyProc = XvGetScreenKey; - XvGetRTPortProc = XvGetRTPort; - XvMCScreenInitProc = XvMCScreenInit; -} diff --git a/xserver/hw/xfree86/dixmods/extmod/xvmodproc.h b/xserver/hw/xfree86/dixmods/extmod/xvmodproc.h deleted file mode 100644 index be51e559d..000000000 --- a/xserver/hw/xfree86/dixmods/extmod/xvmodproc.h +++ /dev/null @@ -1,13 +0,0 @@ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "xvmcext.h" - -extern DevPrivateKey (*XvGetScreenKeyProc) (void); -extern unsigned long (*XvGetRTPortProc) (void); -extern int (*XvScreenInitProc) (ScreenPtr); -extern int (*XvMCScreenInitProc) (ScreenPtr, int, XvMCAdaptorPtr); - -extern void XvRegister(void); diff --git a/xserver/hw/xfree86/dixmods/glxmodule.c b/xserver/hw/xfree86/dixmods/glxmodule.c index e72f3821a..e6bb73673 100644 --- a/xserver/hw/xfree86/dixmods/glxmodule.c +++ b/xserver/hw/xfree86/dixmods/glxmodule.c @@ -42,17 +42,15 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "micmap.h" #include "globals.h" #include "glxserver.h" +#include "extinit.h" +#include "glx_extinit.h" static MODULESETUPPROTO(glxSetup); -static const char *initdeps[] = { "DOUBLE-BUFFER", "COMPOSITE", NULL }; - -static ExtensionModule GLXExt = { +static const ExtensionModule GLXExt = { GlxExtensionInit, "GLX", - &noGlxExtension, - NULL, - initdeps + &noGlxExtension }; static XF86ModuleVersionInfo VersRec = { @@ -84,11 +82,6 @@ glxSetup(pointer module, pointer opts, int *errmaj, int *errmin) setupDone = TRUE; - provider = LoaderSymbol("__glXDRISWRastProvider"); - if (provider == NULL) - return NULL; - GlxPushProvider(provider); - xf86Msg(xf86Info.aiglxFrom, "AIGLX %s\n", xf86Info.aiglx ? "enabled" : "disabled"); if (xf86Info.aiglx) { diff --git a/xserver/hw/xfree86/dixmods/recordmod.c b/xserver/hw/xfree86/dixmods/recordmod.c deleted file mode 100644 index b75cc3fdb..000000000 --- a/xserver/hw/xfree86/dixmods/recordmod.c +++ /dev/null @@ -1,43 +0,0 @@ -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86Module.h" - -extern Bool noTestExtensions; - -static MODULESETUPPROTO(recordSetup); - -extern void RecordExtensionInit(INITARGS); - -static ExtensionModule recordExt = { - RecordExtensionInit, - "RECORD", - &noTestExtensions, - NULL, - NULL -}; - -static XF86ModuleVersionInfo VersRec = { - "record", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 1, 13, 0, - ABI_CLASS_EXTENSION, - ABI_EXTENSION_VERSION, - MOD_CLASS_EXTENSION, - {0, 0, 0, 0} -}; - -_X_EXPORT XF86ModuleData recordModuleData = { &VersRec, recordSetup, NULL }; - -static pointer -recordSetup(pointer module, pointer opts, int *errmaj, int *errmin) -{ - LoadExtension(&recordExt, FALSE); - - /* Need a non-NULL return value to indicate success */ - return (pointer) 1; -} diff --git a/xserver/hw/xfree86/doc/Makefile.in b/xserver/hw/xfree86/doc/Makefile.in index 63fd5b49c..2492b18ec 100644 --- a/xserver/hw/xfree86/doc/Makefile.in +++ b/xserver/hw/xfree86/doc/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -170,13 +170,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -198,6 +194,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -222,6 +219,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -237,7 +235,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -336,6 +333,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -470,7 +468,7 @@ EXTRA_DIST = \ all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/devbook.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/devbook.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -496,9 +494,9 @@ $(top_srcdir)/devbook.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/xfree86/doc/README.modes b/xserver/hw/xfree86/doc/README.modes index 894e21313..ea228e592 100644 --- a/xserver/hw/xfree86/doc/README.modes +++ b/xserver/hw/xfree86/doc/README.modes @@ -133,11 +133,10 @@ this function computes an initial configuration for the server. It tries to enable as much hardware as possible using some fairly simple heuristics. The 'canGrow' parameter indicates that the frame buffer does not have a fixed -size (fixed size frame buffers are required by XAA). When the frame buffer -has a fixed size, the configuration selects a 'reasonablely large' frame -buffer so that common reconfiguration options are possible. For resizable -frame buffers, the frame buffer is set to the smallest size that encloses -the desired configuration. +size. When the frame buffer has a fixed size, the configuration selects a +'reasonablely large' frame buffer so that common reconfiguration options are +possible. For resizable frame buffers, the frame buffer is set to the smallest +size that encloses the desired configuration. 3.2 ScreenInit functions diff --git a/xserver/hw/xfree86/doc/ddxDesign.xml b/xserver/hw/xfree86/doc/ddxDesign.xml index 6a087322f..7c2c20ff3 100644 --- a/xserver/hw/xfree86/doc/ddxDesign.xml +++ b/xserver/hw/xfree86/doc/ddxDesign.xml @@ -330,8 +330,8 @@ that. This is a significant difference compared with the old design. The entry points for drawing operations are already taken care of by -the framebuffer code (including, XAA). Extensions and enhancements to -framebuffer code are outside the scope of this document. +the framebuffer code. Extensions and enhancements to framebuffer code +are outside the scope of this document. @@ -1306,7 +1306,7 @@ Here is what InitOutput() does:
- Bool ChipScreenInit(int index, ScreenPtr pScreen, + Bool ChipScreenInit(ScreenPtr pScreen, int argc, char **argv);
@@ -1442,7 +1442,7 @@ Here is what InitOutput() does:
- Bool ChipSwitchMode(int index, DisplayModePtr mode, int flags); + Bool ChipSwitchMode(int index, DisplayModePtr mode);
Initialises the new mode for the screen identified by @@ -1464,7 +1464,7 @@ Here is what InitOutput() does:
- void ChipAdjustFrame(int index, int x, int y, int flags); + void ChipAdjustFrame(int index, int x, int y);
Changes the viewport for the screen identified by @@ -1572,7 +1572,7 @@ Here is what InitOutput() does:
- Bool ChipEnterVT(int index, int flags); + Bool ChipEnterVT(ScrnInfoPtr pScrn);
This function should initialise the current video mode and @@ -1589,7 +1589,7 @@ Here is what InitOutput() does:
- void ChipLeaveVT(int index, int flags); + void ChipLeaveVT(ScrnInfoPtr pScrn);
This function should restore the saved video state. If @@ -1691,7 +1691,7 @@ but their presence is optional.
- ModeStatus ChipValidMode(int index, DisplayModePtr mode, + ModeStatus ChipValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool verbose, int flags);
@@ -1739,7 +1739,7 @@ MODECHECK_FINAL are intended for checks that may involve more than one mode.
- void ChipFreeScreen(int scrnindex, int flags); + void ChipFreeScreen(ScrnInfoPtr pScrn);
Free any driver-allocated data that may have been allocated up to @@ -2003,10 +2003,9 @@ also include the video card's saved state. -Per-screen data for other modules that the driver uses (for example, -the XAA module) that is reset for each server generation is hooked into -the ScrnInfoRec through it's privates -field. +Per-screen data for other modules that the driver uses that is reset for each +server generation is hooked into the ScrnInfoRec +through its privates field. @@ -2824,12 +2823,12 @@ Several functions are provided to simplify resource registration:
- Bool xf86IsScreenPrimary(int scrnIndex); + Bool xf86IsScreenPrimary(ScrnInfoPtr pScrn);
This function returns TRUE if the primary entity is registered with the screen referenced by - scrnIndex. + pScrn.
@@ -3561,13 +3560,6 @@ The following include files are typically required by video drivers:
- - All drivers implementing backing store need this: - - "mibstore.h" - - - All drivers using the mi colourmap code need this: @@ -3614,14 +3606,6 @@ The following include files are typically required by video drivers: - - If a driver uses XAA, it needs these: - - "xaa.h" - "xaalocal.h" - - - If a driver uses the fb manager, it needs this: @@ -3840,31 +3824,6 @@ manager is allowed to manage. This is typically a box with a width of can be fit within the total video memory, however, the driver can reserve areas at the extremities by passing a smaller area to the manager. - - -xf86InitFBManager() must be called before XAA is -initialized since XAA uses the manager for it's pixmap cache. - - - -An alternative function is provided to allow the driver to initialize -the framebuffer manager with a Region rather than a box. - - - Bool xf86InitFBManagerRegion(ScreenPtr pScreen, - RegionPtr FullRegion); - - -xf86InitFBManagerRegion(), unlike -xf86InitFBManager(), does not remove the area used for -the visible screen so that area should not be included in the region -passed to the function. xf86InitFBManagerRegion() is -useful when non-contiguous areas are available to be managed, and is -required when multiple framebuffers are stored in video memory (as in -the case where an overlay of a different depth is stored as a second -framebuffer in offscreen memory). - - @@ -5363,15 +5322,6 @@ XFree86 common layer. way by modules loaded directly by the XFree86 common layer. However, it may be used for application-specific parameter passing in other situations. - - - - When loading external modules (modules that don't - have the standard entry point, for example a - special shared library) the options parameter can be - set to EXTERN_MODULE to tell the - loader not to reject the module when it doesn't find - the standard entry point. @@ -5982,7 +5932,6 @@ typedef struct { InitExtension initFunc; char * name; Bool *disablePtr; - InitExtension setupFunc; } ExtensionModule; @@ -8135,13 +8084,6 @@ visible symbols. - - All drivers implementing backing store need this: - - "mibstore.h" - - - All drivers using the mi colourmap code need this: @@ -8910,12 +8852,6 @@ ZZZPreInit(ScrnInfoPtr pScrn, int flags) ZZZFreeRec(pScrn); return FALSE; - /* Load XAA if needed */ - if (!pZzz->noAccel || pZzz->hwCursor) - if (!xf86LoadSubModule(pScrn, "xaa")) { - ZZZFreeRec(pScrn); - return FALSE; - } /* Done */ return TRUE; @@ -9033,10 +8969,10 @@ ZZZModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) static Bool -ZZZScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) +ZZZScreenInit(ScreenPtr pScreen, int argc, char **argv) { /* Get the ScrnInfoRec */ - pScrn = xf86Screens[pScreen->myNum]; + pScrn = xf86ScreenToScrn(pScreen); /* * If using the vgahw module, its data structures and related @@ -9051,7 +8987,7 @@ ZZZScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) /* Set the viewport if supported */ - ZZZAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); + ZZZAdjustFrame(pScrn, pScrn->frameX0, pScrn->frameY0); /* * Setup the screen's visuals, and initialise the framebuffer @@ -9152,12 +9088,6 @@ ZZZScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pScrn->displayWidth, pBankInfo)) return FALSE; - /* - * If backing store is to be supported (as is usually the case), - * initialise it. - */ - miInitializeBackingStore(pScreen); - /* * Set initial black & white colourmap indices. */ @@ -9220,9 +9150,9 @@ ZZZScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) static Bool -ZZZSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) +ZZZSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode) { - return ZZZModeInit(xf86Screens[scrnIndex], mode); + return ZZZModeInit(pScrn, mode); } @@ -9237,7 +9167,7 @@ ZZZSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) static void -ZZZAdjustFrame(int scrnIndex, int x, int y, int flags) +ZZZAdjustFrame(ScrnInfoPtr pScrn, int x, int y) { /* Adjust the viewport */ } @@ -9258,16 +9188,14 @@ ZZZAdjustFrame(int scrnIndex, int x, int y, int flags) static Bool -ZZZEnterVT(int scrnIndex, int flags) +ZZZEnterVT(ScrnInfoPtr pScrn) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; return ZZZModeInit(pScrn, pScrn->currentMode); } static void -ZZZLeaveVT(int scrnIndex, int flags) +ZZZLeaveVT(ScrnInfoPtr pScrn) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; ZZZRestore(pScrn); } @@ -9288,16 +9216,16 @@ ZZZLeaveVT(int scrnIndex, int flags) static Bool -ZZZCloseScreen(int scrnIndex, ScreenPtr pScreen) +ZZZCloseScreen(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); if (pScrn->vtSema) { ZZZRestore(pScrn); ZZZUnmapMem(pScrn); } pScrn->vtSema = FALSE; pScreen->CloseScreen = ZZZPTR(pScrn)->CloseScreen; - return (*pScreen->CloseScreen)(scrnIndex, pScreen); + return (*pScreen->CloseScreen)(pScreen); } @@ -9342,13 +9270,13 @@ ZZZSaveScreen(ScreenPtr pScreen, int mode) static void -ZZZFreeScreen(int scrnIndex, int flags) +ZZZFreeScreen(ScrnInfoPtr pScrn) { /* * If the vgahw module is used vgaHWFreeHWRec() would be called * here. */ - ZZZFreeRec(xf86Screens[scrnIndex]); + ZZZFreeRec(pScrn); } diff --git a/xserver/hw/xfree86/doc/exa-driver.txt b/xserver/hw/xfree86/doc/exa-driver.txt index 048307ee7..da39d3f91 100644 --- a/xserver/hw/xfree86/doc/exa-driver.txt +++ b/xserver/hw/xfree86/doc/exa-driver.txt @@ -8,15 +8,10 @@ from system memory, and Porter-Duff compositing and transform operations. Configuration ------------- -A new config file option, AccelMethod, should be added to your driver, to allow -the user to select between the EXA and XAA acceleration APIs. - Some drivers implement a per-instance useEXA flag to track whether EXA is -active or not. It can be helpful to also conditionalize XAA support with an -ifdef so that it can easily be turned off/removed in the future. +active or not. -Setting the flag and checking for AccelMethod can be done in the driver's -Options parsing routine. +Setting the flag can be done in the driver's Options parsing routine. Loading EXA ------------ diff --git a/xserver/hw/xfree86/dri/Makefile.am b/xserver/hw/xfree86/dri/Makefile.am index a7b491c6e..ced04ff38 100644 --- a/xserver/hw/xfree86/dri/Makefile.am +++ b/xserver/hw/xfree86/dri/Makefile.am @@ -1,23 +1,18 @@ -libdri_la_LTLIBRARIES = libdri.la -libdri_la_CFLAGS = -I$(top_srcdir)/hw/xfree86/common \ - -I$(top_srcdir)/hw/xfree86/os-support \ - -I$(top_srcdir)/hw/xfree86/modes \ - -I$(top_srcdir)/hw/xfree86/ddc \ - -I$(top_srcdir)/hw/xfree86/i2c \ - -I$(top_srcdir)/hw/xfree86/parser \ - -I$(top_srcdir)/hw/xfree86/ramdac \ - -I$(top_srcdir)/hw/xfree86/os-support/bus \ - -I$(top_srcdir)/glx \ - -DHAVE_XORG_CONFIG_H \ - @DIX_CFLAGS@ @XORG_CFLAGS@ @DRIPROTO_CFLAGS@ \ - @LIBDRM_CFLAGS@ \ - @DRI_CFLAGS@ -libdri_la_LDFLAGS = -module -avoid-version @LIBDRM_LIBS@ -libdri_ladir = $(moduledir)/extensions +noinst_LTLIBRARIES = libdri.la +AM_CFLAGS = -I$(top_srcdir)/hw/xfree86/common \ + -I$(top_srcdir)/hw/xfree86/os-support \ + -I$(top_srcdir)/hw/xfree86/modes \ + -I$(top_srcdir)/hw/xfree86/ddc \ + -I$(top_srcdir)/hw/xfree86/i2c \ + -I$(top_srcdir)/hw/xfree86/parser \ + -I$(top_srcdir)/hw/xfree86/ramdac \ + -I$(top_srcdir)/hw/xfree86/os-support/bus \ + -I$(top_srcdir)/glx \ + -DHAVE_XORG_CONFIG_H \ + @DIX_CFLAGS@ @XORG_CFLAGS@ libdri_la_SOURCES = \ dri.c \ dri.h \ - drimodule.c \ dristruct.h \ sarea.h \ xf86dri.c diff --git a/xserver/hw/xfree86/dri/Makefile.in b/xserver/hw/xfree86/dri/Makefile.in index 475e9046c..af91aec6a 100644 --- a/xserver/hw/xfree86/dri/Makefile.in +++ b/xserver/hw/xfree86/dri/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -73,46 +73,14 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(libdri_ladir)" "$(DESTDIR)$(sdkdir)" -LTLIBRARIES = $(libdri_la_LTLIBRARIES) +LTLIBRARIES = $(noinst_LTLIBRARIES) libdri_la_LIBADD = -am_libdri_la_OBJECTS = libdri_la-dri.lo libdri_la-drimodule.lo \ - libdri_la-xf86dri.lo +am_libdri_la_OBJECTS = dri.lo xf86dri.lo libdri_la_OBJECTS = $(am_libdri_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = -libdri_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libdri_la_CFLAGS) \ - $(CFLAGS) $(libdri_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -154,6 +122,34 @@ am__can_run_installinfo = \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(sdkdir)" HEADERS = $(sdk_HEADERS) ETAGS = etags CTAGS = ctags @@ -215,13 +211,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -243,6 +235,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -267,6 +260,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -282,7 +276,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -381,6 +374,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -480,27 +474,22 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -libdri_la_LTLIBRARIES = libdri.la -libdri_la_CFLAGS = -I$(top_srcdir)/hw/xfree86/common \ - -I$(top_srcdir)/hw/xfree86/os-support \ - -I$(top_srcdir)/hw/xfree86/modes \ - -I$(top_srcdir)/hw/xfree86/ddc \ - -I$(top_srcdir)/hw/xfree86/i2c \ - -I$(top_srcdir)/hw/xfree86/parser \ - -I$(top_srcdir)/hw/xfree86/ramdac \ - -I$(top_srcdir)/hw/xfree86/os-support/bus \ - -I$(top_srcdir)/glx \ - -DHAVE_XORG_CONFIG_H \ - @DIX_CFLAGS@ @XORG_CFLAGS@ @DRIPROTO_CFLAGS@ \ - @LIBDRM_CFLAGS@ \ - @DRI_CFLAGS@ +noinst_LTLIBRARIES = libdri.la +AM_CFLAGS = -I$(top_srcdir)/hw/xfree86/common \ + -I$(top_srcdir)/hw/xfree86/os-support \ + -I$(top_srcdir)/hw/xfree86/modes \ + -I$(top_srcdir)/hw/xfree86/ddc \ + -I$(top_srcdir)/hw/xfree86/i2c \ + -I$(top_srcdir)/hw/xfree86/parser \ + -I$(top_srcdir)/hw/xfree86/ramdac \ + -I$(top_srcdir)/hw/xfree86/os-support/bus \ + -I$(top_srcdir)/glx \ + -DHAVE_XORG_CONFIG_H \ + @DIX_CFLAGS@ @XORG_CFLAGS@ -libdri_la_LDFLAGS = -module -avoid-version @LIBDRM_LIBS@ -libdri_ladir = $(moduledir)/extensions libdri_la_SOURCES = \ dri.c \ dri.h \ - drimodule.c \ dristruct.h \ sarea.h \ xf86dri.c @@ -510,7 +499,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -535,38 +524,15 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): -install-libdri_laLTLIBRARIES: $(libdri_la_LTLIBRARIES) - @$(NORMAL_INSTALL) - @list='$(libdri_la_LTLIBRARIES)'; test -n "$(libdri_ladir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(libdri_ladir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libdri_ladir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdri_ladir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdri_ladir)"; \ - } -uninstall-libdri_laLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(libdri_la_LTLIBRARIES)'; test -n "$(libdri_ladir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdri_ladir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdri_ladir)/$$f"; \ - done - -clean-libdri_laLTLIBRARIES: - -test -z "$(libdri_la_LTLIBRARIES)" || rm -f $(libdri_la_LTLIBRARIES) - @list='$(libdri_la_LTLIBRARIES)'; \ +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ @@ -575,7 +541,7 @@ clean-libdri_laLTLIBRARIES: rm -f $${locs}; \ } libdri.la: $(libdri_la_OBJECTS) $(libdri_la_DEPENDENCIES) $(EXTRA_libdri_la_DEPENDENCIES) - $(AM_V_CCLD)$(libdri_la_LINK) -rpath $(libdri_ladir) $(libdri_la_OBJECTS) $(libdri_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(libdri_la_OBJECTS) $(libdri_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -583,9 +549,8 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdri_la-dri.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdri_la-drimodule.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdri_la-xf86dri.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dri.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86dri.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -608,27 +573,6 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< -libdri_la-dri.lo: dri.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdri_la_CFLAGS) $(CFLAGS) -MT libdri_la-dri.lo -MD -MP -MF $(DEPDIR)/libdri_la-dri.Tpo -c -o libdri_la-dri.lo `test -f 'dri.c' || echo '$(srcdir)/'`dri.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdri_la-dri.Tpo $(DEPDIR)/libdri_la-dri.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dri.c' object='libdri_la-dri.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdri_la_CFLAGS) $(CFLAGS) -c -o libdri_la-dri.lo `test -f 'dri.c' || echo '$(srcdir)/'`dri.c - -libdri_la-drimodule.lo: drimodule.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdri_la_CFLAGS) $(CFLAGS) -MT libdri_la-drimodule.lo -MD -MP -MF $(DEPDIR)/libdri_la-drimodule.Tpo -c -o libdri_la-drimodule.lo `test -f 'drimodule.c' || echo '$(srcdir)/'`drimodule.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdri_la-drimodule.Tpo $(DEPDIR)/libdri_la-drimodule.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='drimodule.c' object='libdri_la-drimodule.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdri_la_CFLAGS) $(CFLAGS) -c -o libdri_la-drimodule.lo `test -f 'drimodule.c' || echo '$(srcdir)/'`drimodule.c - -libdri_la-xf86dri.lo: xf86dri.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdri_la_CFLAGS) $(CFLAGS) -MT libdri_la-xf86dri.lo -MD -MP -MF $(DEPDIR)/libdri_la-xf86dri.Tpo -c -o libdri_la-xf86dri.lo `test -f 'xf86dri.c' || echo '$(srcdir)/'`xf86dri.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdri_la-xf86dri.Tpo $(DEPDIR)/libdri_la-xf86dri.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xf86dri.c' object='libdri_la-xf86dri.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdri_la_CFLAGS) $(CFLAGS) -c -o libdri_la-xf86dri.lo `test -f 'xf86dri.c' || echo '$(srcdir)/'`xf86dri.c - mostlyclean-libtool: -rm -f *.lo @@ -756,7 +700,7 @@ check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: - for dir in "$(DESTDIR)$(libdri_ladir)" "$(DESTDIR)$(sdkdir)"; do \ + for dir in "$(DESTDIR)$(sdkdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -791,7 +735,7 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libdri_laLTLIBRARIES clean-libtool \ +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am @@ -812,7 +756,7 @@ info: info-am info-am: -install-data-am: install-libdri_laLTLIBRARIES install-sdkHEADERS +install-data-am: install-sdkHEADERS install-dvi: install-dvi-am @@ -858,25 +802,23 @@ ps: ps-am ps-am: -uninstall-am: uninstall-libdri_laLTLIBRARIES uninstall-sdkHEADERS +uninstall-am: uninstall-sdkHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libdri_laLTLIBRARIES clean-libtool cscopelist ctags \ + clean-libtool clean-noinstLTLIBRARIES cscopelist ctags \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ - install-info-am install-libdri_laLTLIBRARIES install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-sdkHEADERS install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-libdri_laLTLIBRARIES \ - uninstall-sdkHEADERS + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-sdkHEADERS install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-sdkHEADERS # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/xserver/hw/xfree86/dri/dri.c b/xserver/hw/xfree86/dri/dri.c index 13b3fd884..6af9fb9c5 100644 --- a/xserver/hw/xfree86/dri/dri.c +++ b/xserver/hw/xfree86/dri/dri.c @@ -51,6 +51,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "misc.h" #include "dixstruct.h" #include "extnsionst.h" +#include "extinit.h" #include "colormapst.h" #include "cursorstr.h" #include "scrnintstr.h" @@ -68,6 +69,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "xf86_OSproc.h" #include "inputstr.h" #include "xf86VGAarbiter.h" +#include "xf86Extensions.h" static int DRIEntPrivIndex = -1; static DevPrivateKeyRec DRIScreenPrivKeyRec; @@ -315,9 +317,10 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD) int reserved_count; int i; DRIEntPrivPtr pDRIEntPriv; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); DRIContextFlags flags = 0; DRIContextPrivPtr pDRIContextPriv; + static Bool drm_server_inited; /* If the DRI extension is disabled, do not initialize the DRI */ if (noXFree86DRIExtension) { @@ -343,6 +346,10 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD) return FALSE; } #endif + if (drm_server_inited == FALSE) { + drmSetServerInfo(&DRIDRMServerInfo); + drm_server_inited = TRUE; + } if (!DRIOpenDRMMaster(pScrn, pDRIInfo->SAREASize, pDRIInfo->busIdString, pDRIInfo->drmDriverName)) @@ -597,7 +604,7 @@ DRIFinishScreenInit(ScreenPtr pScreen) pScreen->ClipNotify = pDRIInfo->wrap.ClipNotify; } if (pDRIInfo->wrap.AdjustFrame) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); pDRIPriv->wrap.AdjustFrame = pScrn->AdjustFrame; pScrn->AdjustFrame = pDRIInfo->wrap.AdjustFrame; @@ -616,7 +623,7 @@ DRICloseScreen(ScreenPtr pScreen) DRIInfoPtr pDRIInfo; drm_context_t *reserved; int reserved_count; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); DRIEntPrivPtr pDRIEntPriv = DRI_ENT_PRIV(pScrn); Bool closeMaster; @@ -654,7 +661,7 @@ DRICloseScreen(ScreenPtr pScreen) pDRIPriv->wrap.ClipNotify = NULL; } if (pDRIInfo->wrap.AdjustFrame) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); pScrn->AdjustFrame = pDRIPriv->wrap.AdjustFrame; pDRIPriv->wrap.AdjustFrame = NULL; @@ -1593,7 +1600,7 @@ DRIWakeupHandler(pointer wakeupData, int result, pointer pReadmask) DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); if (pDRIPriv && pDRIPriv->pDriverInfo->wrap.WakeupHandler) - (*pDRIPriv->pDriverInfo->wrap.WakeupHandler) (i, wakeupData, + (*pDRIPriv->pDriverInfo->wrap.WakeupHandler) (pScreen, result, pReadmask); } } @@ -1608,16 +1615,15 @@ DRIBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadmask) DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); if (pDRIPriv && pDRIPriv->pDriverInfo->wrap.BlockHandler) - (*pDRIPriv->pDriverInfo->wrap.BlockHandler) (i, blockData, + (*pDRIPriv->pDriverInfo->wrap.BlockHandler) (pScreen, pTimeout, pReadmask); } } void -DRIDoWakeupHandler(int screenNum, pointer wakeupData, +DRIDoWakeupHandler(ScreenPtr pScreen, unsigned long result, pointer pReadmask) { - ScreenPtr pScreen = screenInfo.screens[screenNum]; DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); DRILock(pScreen, 0); @@ -1633,10 +1639,9 @@ DRIDoWakeupHandler(int screenNum, pointer wakeupData, } void -DRIDoBlockHandler(int screenNum, pointer blockData, +DRIDoBlockHandler(ScreenPtr pScreen, pointer pTimeout, pointer pReadmask) { - ScreenPtr pScreen = screenInfo.screens[screenNum]; DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) { @@ -2282,15 +2287,14 @@ _DRIAdjustFrame(ScrnInfoPtr pScrn, DRIScreenPrivPtr pDRIPriv, int x, int y) } void -DRIAdjustFrame(int scrnIndex, int x, int y, int flags) +DRIAdjustFrame(ScrnInfoPtr pScrn, int x, int y) { - ScreenPtr pScreen = screenInfo.screens[scrnIndex]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; int px, py; if (!pDRIPriv || !pDRIPriv->pSAREA) { - DRIDrvMsg(scrnIndex, X_ERROR, "[DRI] No SAREA (%p %p)\n", + DRIDrvMsg(pScrn->scrnIndex, X_ERROR, "[DRI] No SAREA (%p %p)\n", pDRIPriv, pDRIPriv ? pDRIPriv->pSAREA : NULL); return; } @@ -2322,7 +2326,7 @@ DRIAdjustFrame(int scrnIndex, int x, int y, int flags) /* unwrap */ pScrn->AdjustFrame = pDRIPriv->wrap.AdjustFrame; /* call lower layers */ - (*pScrn->AdjustFrame) (scrnIndex, x, y, flags); + (*pScrn->AdjustFrame) (pScrn, x, y); /* rewrap */ pDRIPriv->wrap.AdjustFrame = pScrn->AdjustFrame; pScrn->AdjustFrame = DRIAdjustFrame; diff --git a/xserver/hw/xfree86/dri/dri.h b/xserver/hw/xfree86/dri/dri.h index 53458bb4a..3606100b8 100644 --- a/xserver/hw/xfree86/dri/dri.h +++ b/xserver/hw/xfree86/dri/dri.h @@ -73,7 +73,7 @@ typedef int DRIWindowRequests; #define DRI_ALL_WINDOWS 2 typedef void (*ClipNotifyPtr) (WindowPtr, int, int); -typedef void (*AdjustFramePtr) (int scrnIndex, int x, int y, int flags); +typedef void (*AdjustFramePtr) (ScrnInfoPtr pScrn, int x, int y); /* * These functions can be wrapped by the DRI. Each of these have @@ -197,7 +197,7 @@ extern _X_EXPORT Bool DRIScreenInit(ScreenPtr pScreen, extern _X_EXPORT void DRICloseScreen(ScreenPtr pScreen); -extern _X_EXPORT Bool DRIExtensionInit(void); +extern Bool DRIExtensionInit(void); extern _X_EXPORT void DRIReset(void); @@ -271,13 +271,11 @@ extern _X_EXPORT void DRIWakeupHandler(pointer wakeupData, extern _X_EXPORT void DRIBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadmask); -extern _X_EXPORT void DRIDoWakeupHandler(int screenNum, - pointer wakeupData, +extern _X_EXPORT void DRIDoWakeupHandler(ScreenPtr pScreen, unsigned long result, pointer pReadmask); -extern _X_EXPORT void DRIDoBlockHandler(int screenNum, - pointer blockData, +extern _X_EXPORT void DRIDoBlockHandler(ScreenPtr pScreen, pointer pTimeout, pointer pReadmask); extern _X_EXPORT void DRISwapContext(int drmFD, void *oldctx, void *newctx); @@ -334,7 +332,7 @@ extern _X_EXPORT drm_context_t DRIGetContext(ScreenPtr pScreen); extern _X_EXPORT void DRIQueryVersion(int *majorVersion, int *minorVersion, int *patchVersion); -extern _X_EXPORT void DRIAdjustFrame(int scrnIndex, int x, int y, int flags); +extern _X_EXPORT void DRIAdjustFrame(ScrnInfoPtr pScrn, int x, int y); extern _X_EXPORT void DRIMoveBuffersHelper(ScreenPtr pScreen, int dx, @@ -343,9 +341,11 @@ extern _X_EXPORT void DRIMoveBuffersHelper(ScreenPtr pScreen, extern _X_EXPORT char *DRICreatePCIBusID(const struct pci_device *PciInfo); +#if 0 extern _X_EXPORT int drmInstallSIGIOHandler(int fd, void (*f) (int, void *, void *)); extern _X_EXPORT int drmRemoveSIGIOHandler(int fd); +#endif extern _X_EXPORT int DRIMasterFD(ScrnInfoPtr pScrn); extern _X_EXPORT void *DRIMasterSareaPointer(ScrnInfoPtr pScrn); diff --git a/xserver/hw/xfree86/dri/drimodule.c b/xserver/hw/xfree86/dri/drimodule.c deleted file mode 100644 index 83eca4eb9..000000000 --- a/xserver/hw/xfree86/dri/drimodule.c +++ /dev/null @@ -1,93 +0,0 @@ -/************************************************************************** - -Copyright 1999 Precision Insight, Inc., Cedar Park, Texas. -All Rights Reserved. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sub license, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR -ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Authors: - * Kevin E. Martin - * Rickard E. Faith - * - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86Module.h" -#include "globals.h" - -#include "xf86drm.h" -static MODULESETUPPROTO(driSetup); - -drmServerInfo DRIDRMServerInfo; - -static XF86ModuleVersionInfo VersRec = { - "dri", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 1, 0, 0, - ABI_CLASS_EXTENSION, - ABI_EXTENSION_VERSION, - MOD_CLASS_NONE, - {0, 0, 0, 0} -}; - -extern void XFree86DRIExtensionInit(INITARGS); - -#define _XF86DRI_SERVER_ -#include - -static ExtensionModule XF86DRIExt = { - XFree86DRIExtensionInit, - XF86DRINAME, - &noXFree86DRIExtension, - NULL, - NULL -}; - -_X_EXPORT XF86ModuleData driModuleData = { &VersRec, driSetup, NULL }; - -static pointer -driSetup(pointer module, pointer opts, int *errmaj, int *errmin) -{ - static Bool setupDone = FALSE; - - if (!setupDone) { - setupDone = TRUE; - LoadExtension(&XF86DRIExt, FALSE); - } - else { - if (errmaj) - *errmaj = LDR_ONCEONLY; - } - - drmSetServerInfo(&DRIDRMServerInfo); - - /* Need a non-NULL return value to indicate success */ - return (pointer) 1; -} diff --git a/xserver/hw/xfree86/dri/xf86dri.c b/xserver/hw/xfree86/dri/xf86dri.c index 72ce8690d..086e833ed 100644 --- a/xserver/hw/xfree86/dri/xf86dri.c +++ b/xserver/hw/xfree86/dri/xf86dri.c @@ -47,6 +47,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "misc.h" #include "dixstruct.h" #include "extnsionst.h" +#include "extinit.h" #include "colormapst.h" #include "cursorstr.h" #include "scrnintstr.h" @@ -60,17 +61,17 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "dristruct.h" #include "xf86drm.h" #include "protocol-versions.h" +#include "xf86Extensions.h" static int DRIErrorBase; -static void XF86DRIResetProc(ExtensionEntry * extEntry); +static void XF86DRIResetProc(ExtensionEntry *extEntry); static unsigned char DRIReqCode = 0; -extern void XFree86DRIExtensionInit(void); - - /*ARGSUSED*/ static void -XF86DRIResetProc(ExtensionEntry * extEntry) +/*ARGSUSED*/ +static void +XF86DRIResetProc(ExtensionEntry *extEntry) { DRIReset(); } @@ -78,15 +79,16 @@ XF86DRIResetProc(ExtensionEntry * extEntry) static int ProcXF86DRIQueryVersion(register ClientPtr client) { - xXF86DRIQueryVersionReply rep; + xXF86DRIQueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .majorVersion = SERVER_XF86DRI_MAJOR_VERSION, + .minorVersion = SERVER_XF86DRI_MINOR_VERSION, + .patchVersion = SERVER_XF86DRI_PATCH_VERSION + }; REQUEST_SIZE_MATCH(xXF86DRIQueryVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = SERVER_XF86DRI_MAJOR_VERSION; - rep.minorVersion = SERVER_XF86DRI_MINOR_VERSION; - rep.patchVersion = SERVER_XF86DRI_PATCH_VERSION; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); @@ -94,7 +96,7 @@ ProcXF86DRIQueryVersion(register ClientPtr client) swaps(&rep.minorVersion); swapl(&rep.patchVersion); } - WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), (char *) &rep); + WriteToClient(client, sizeof(xXF86DRIQueryVersionReply), &rep); return Success; } @@ -111,18 +113,20 @@ ProcXF86DRIQueryDirectRenderingCapable(register ClientPtr client) return BadValue; } - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - if (!DRIQueryDirectRenderingCapable(screenInfo.screens[stuff->screen], &isCapable)) { return BadValue; } - rep.isCapable = isCapable; - if (!LocalClient(client) || client->swapped) - rep.isCapable = 0; + if (!client->local || client->swapped) + isCapable = 0; + + rep = (xXF86DRIQueryDirectRenderingCapableReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .isCapable = isCapable + }; if (client->swapped) { swaps(&rep.sequenceNumber); @@ -131,7 +135,7 @@ ProcXF86DRIQueryDirectRenderingCapable(register ClientPtr client) WriteToClient(client, sizeof(xXF86DRIQueryDirectRenderingCapableReply), - (char *) &rep); + &rep); return Success; } @@ -141,6 +145,7 @@ ProcXF86DRIOpenConnection(register ClientPtr client) xXF86DRIOpenConnectionReply rep; drm_handle_t hSAREA; char *busIdString; + CARD32 busIdStringLength = 0; REQUEST(xXF86DRIOpenConnectionReq); REQUEST_SIZE_MATCH(xXF86DRIOpenConnectionReq); @@ -154,33 +159,40 @@ ProcXF86DRIOpenConnection(register ClientPtr client) return BadValue; } - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.busIdStringLength = 0; if (busIdString) - rep.busIdStringLength = strlen(busIdString); - rep.length = - bytes_to_int32(SIZEOF(xXF86DRIOpenConnectionReply) - - SIZEOF(xGenericReply) + - pad_to_int32(rep.busIdStringLength)); + busIdStringLength = strlen(busIdString); - rep.hSAREALow = (CARD32) (hSAREA & 0xffffffff); + rep = (xXF86DRIOpenConnectionReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(SIZEOF(xXF86DRIOpenConnectionReply) - + SIZEOF(xGenericReply) + + pad_to_int32(busIdStringLength)), + .busIdStringLength = busIdStringLength, + + .hSAREALow = (CARD32) (hSAREA & 0xffffffff), #if defined(LONG64) && !defined(__linux__) - rep.hSAREAHigh = (CARD32) (hSAREA >> 32); + .hSAREAHigh = (CARD32) (hSAREA >> 32), #else - rep.hSAREAHigh = 0; + .hSAREAHigh = 0 #endif + }; - WriteToClient(client, sizeof(xXF86DRIOpenConnectionReply), (char *) &rep); - if (rep.busIdStringLength) - WriteToClient(client, rep.busIdStringLength, busIdString); + WriteToClient(client, sizeof(xXF86DRIOpenConnectionReply), &rep); + if (busIdStringLength) + WriteToClient(client, busIdStringLength, busIdString); return Success; } static int ProcXF86DRIAuthConnection(register ClientPtr client) { - xXF86DRIAuthConnectionReply rep; + xXF86DRIAuthConnectionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .authenticated = 1 + }; REQUEST(xXF86DRIAuthConnectionReq); REQUEST_SIZE_MATCH(xXF86DRIAuthConnectionReq); @@ -189,16 +201,11 @@ ProcXF86DRIAuthConnection(register ClientPtr client) return BadValue; } - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.authenticated = 1; - if (!DRIAuthConnection(screenInfo.screens[stuff->screen], stuff->magic)) { ErrorF("Failed to authenticate %lu\n", (unsigned long) stuff->magic); rep.authenticated = 0; } - WriteToClient(client, sizeof(xXF86DRIAuthConnectionReply), (char *) &rep); + WriteToClient(client, sizeof(xXF86DRIAuthConnectionReply), &rep); return Success; } @@ -220,7 +227,11 @@ ProcXF86DRICloseConnection(register ClientPtr client) static int ProcXF86DRIGetClientDriverName(register ClientPtr client) { - xXF86DRIGetClientDriverNameReply rep; + xXF86DRIGetClientDriverNameReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .clientDriverNameLength = 0 + }; char *clientDriverName; REQUEST(xXF86DRIGetClientDriverNameReq); @@ -236,17 +247,13 @@ ProcXF86DRIGetClientDriverName(register ClientPtr client) (int *) &rep.ddxDriverPatchVersion, &clientDriverName); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.clientDriverNameLength = 0; if (clientDriverName) rep.clientDriverNameLength = strlen(clientDriverName); rep.length = bytes_to_int32(SIZEOF(xXF86DRIGetClientDriverNameReply) - SIZEOF(xGenericReply) + pad_to_int32(rep.clientDriverNameLength)); - WriteToClient(client, - sizeof(xXF86DRIGetClientDriverNameReply), (char *) &rep); + WriteToClient(client, sizeof(xXF86DRIGetClientDriverNameReply), &rep); if (rep.clientDriverNameLength) WriteToClient(client, rep.clientDriverNameLength, clientDriverName); return Success; @@ -255,7 +262,11 @@ ProcXF86DRIGetClientDriverName(register ClientPtr client) static int ProcXF86DRICreateContext(register ClientPtr client) { - xXF86DRICreateContextReply rep; + xXF86DRICreateContextReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; ScreenPtr pScreen; REQUEST(xXF86DRICreateContextReq); @@ -265,19 +276,15 @@ ProcXF86DRICreateContext(register ClientPtr client) return BadValue; } - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - pScreen = screenInfo.screens[stuff->screen]; if (!DRICreateContext(pScreen, NULL, - stuff->context, (drm_context_t *) & rep.hHWContext)) { + stuff->context, (drm_context_t *) &rep.hHWContext)) { return BadValue; } - WriteToClient(client, sizeof(xXF86DRICreateContextReply), (char *) &rep); + WriteToClient(client, sizeof(xXF86DRICreateContextReply), &rep); return Success; } @@ -301,7 +308,11 @@ ProcXF86DRIDestroyContext(register ClientPtr client) static int ProcXF86DRICreateDrawable(ClientPtr client) { - xXF86DRICreateDrawableReply rep; + xXF86DRICreateDrawableReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; DrawablePtr pDrawable; int rc; @@ -312,21 +323,17 @@ ProcXF86DRICreateDrawable(ClientPtr client) return BadValue; } - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0, DixReadAccess); if (rc != Success) return rc; if (!DRICreateDrawable(screenInfo.screens[stuff->screen], client, - pDrawable, (drm_drawable_t *) & rep.hHWDrawable)) { + pDrawable, (drm_drawable_t *) &rep.hHWDrawable)) { return BadValue; } - WriteToClient(client, sizeof(xXF86DRICreateDrawableReply), (char *) &rep); + WriteToClient(client, sizeof(xXF86DRICreateDrawableReply), &rep); return Success; } @@ -360,7 +367,11 @@ ProcXF86DRIDestroyDrawable(register ClientPtr client) static int ProcXF86DRIGetDrawableInfo(register ClientPtr client) { - xXF86DRIGetDrawableInfoReply rep; + xXF86DRIGetDrawableInfoReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; DrawablePtr pDrawable; int X, Y, W, H; drm_clip_rect_t *pClipRects, *pClippedRects; @@ -374,10 +385,6 @@ ProcXF86DRIGetDrawableInfo(register ClientPtr client) return BadValue; } - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0, DixReadAccess); if (rc != Success) @@ -444,19 +451,19 @@ ProcXF86DRIGetDrawableInfo(register ClientPtr client) rep.length = bytes_to_int32(rep.length); - WriteToClient(client, sizeof(xXF86DRIGetDrawableInfoReply), (char *) &rep); + WriteToClient(client, sizeof(xXF86DRIGetDrawableInfoReply), &rep); if (rep.numClipRects) { WriteToClient(client, sizeof(drm_clip_rect_t) * rep.numClipRects, - (char *) pClippedRects); + pClippedRects); free(pClippedRects); } if (rep.numBackClipRects) { WriteToClient(client, sizeof(drm_clip_rect_t) * rep.numBackClipRects, - (char *) pBackClipRects); + pBackClipRects); } return Success; @@ -465,7 +472,11 @@ ProcXF86DRIGetDrawableInfo(register ClientPtr client) static int ProcXF86DRIGetDeviceInfo(register ClientPtr client) { - xXF86DRIGetDeviceInfoReply rep; + xXF86DRIGetDeviceInfoReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; drm_handle_t hFrameBuffer; void *pDevPrivate; @@ -476,10 +487,6 @@ ProcXF86DRIGetDeviceInfo(register ClientPtr client) return BadValue; } - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - if (!DRIGetDeviceInfo(screenInfo.screens[stuff->screen], &hFrameBuffer, (int *) &rep.framebufferOrigin, @@ -496,16 +503,15 @@ ProcXF86DRIGetDeviceInfo(register ClientPtr client) rep.hFrameBufferHigh = 0; #endif - rep.length = 0; if (rep.devPrivateSize) { rep.length = bytes_to_int32(SIZEOF(xXF86DRIGetDeviceInfoReply) - SIZEOF(xGenericReply) + pad_to_int32(rep.devPrivateSize)); } - WriteToClient(client, sizeof(xXF86DRIGetDeviceInfoReply), (char *) &rep); + WriteToClient(client, sizeof(xXF86DRIGetDeviceInfoReply), &rep); if (rep.length) { - WriteToClient(client, rep.devPrivateSize, (char *) pDevPrivate); + WriteToClient(client, rep.devPrivateSize, pDevPrivate); } return Success; } @@ -522,7 +528,7 @@ ProcXF86DRIDispatch(register ClientPtr client) return ProcXF86DRIQueryDirectRenderingCapable(client); } - if (!LocalClient(client)) + if (!client->local) return DRIErrorBase + XF86DRIClientNotLocal; switch (stuff->data) { diff --git a/xserver/hw/xfree86/dri2/Makefile.am b/xserver/hw/xfree86/dri2/Makefile.am index c9fdde2f8..502a2ee29 100644 --- a/xserver/hw/xfree86/dri2/Makefile.am +++ b/xserver/hw/xfree86/dri2/Makefile.am @@ -1,16 +1,14 @@ -libdri2_la_LTLIBRARIES = libdri2.la -libdri2_la_CFLAGS = \ +noinst_LTLIBRARIES = libdri2.la +AM_CFLAGS = \ -DHAVE_XORG_CONFIG_H \ - @DRI_CFLAGS@ \ - @DIX_CFLAGS@ @XORG_CFLAGS@ @DRI2PROTO_CFLAGS@ @LIBDRM_CFLAGS@ \ + @DIX_CFLAGS@ @XORG_CFLAGS@ \ -I$(top_srcdir)/hw/xfree86/common \ -I$(top_srcdir)/hw/xfree86/os-support/bus -libdri2_la_LDFLAGS = -module -avoid-version @LIBDRM_LIBS@ -libdri2_ladir = $(moduledir)/extensions libdri2_la_SOURCES = \ dri2.c \ dri2.h \ - dri2ext.c + dri2ext.c \ + dri2int.h sdk_HEADERS = dri2.h diff --git a/xserver/hw/xfree86/dri2/Makefile.in b/xserver/hw/xfree86/dri2/Makefile.in index c714dedfd..4771b7427 100644 --- a/xserver/hw/xfree86/dri2/Makefile.in +++ b/xserver/hw/xfree86/dri2/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -73,45 +73,14 @@ CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ $(top_builddir)/include/version-config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(libdri2_ladir)" "$(DESTDIR)$(sdkdir)" -LTLIBRARIES = $(libdri2_la_LTLIBRARIES) +LTLIBRARIES = $(noinst_LTLIBRARIES) libdri2_la_LIBADD = -am_libdri2_la_OBJECTS = libdri2_la-dri2.lo libdri2_la-dri2ext.lo +am_libdri2_la_OBJECTS = dri2.lo dri2ext.lo libdri2_la_OBJECTS = $(am_libdri2_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = -libdri2_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libdri2_la_CFLAGS) \ - $(CFLAGS) $(libdri2_la_LDFLAGS) $(LDFLAGS) -o $@ AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -153,6 +122,34 @@ am__can_run_installinfo = \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(sdkdir)" HEADERS = $(sdk_HEADERS) ETAGS = etags CTAGS = ctags @@ -214,13 +211,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -242,6 +235,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -266,6 +260,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -281,7 +276,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -380,6 +374,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -479,27 +474,25 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -libdri2_la_LTLIBRARIES = libdri2.la -libdri2_la_CFLAGS = \ +noinst_LTLIBRARIES = libdri2.la +AM_CFLAGS = \ -DHAVE_XORG_CONFIG_H \ - @DRI_CFLAGS@ \ - @DIX_CFLAGS@ @XORG_CFLAGS@ @DRI2PROTO_CFLAGS@ @LIBDRM_CFLAGS@ \ + @DIX_CFLAGS@ @XORG_CFLAGS@ \ -I$(top_srcdir)/hw/xfree86/common \ -I$(top_srcdir)/hw/xfree86/os-support/bus -libdri2_la_LDFLAGS = -module -avoid-version @LIBDRM_LIBS@ -libdri2_ladir = $(moduledir)/extensions libdri2_la_SOURCES = \ dri2.c \ dri2.h \ - dri2ext.c + dri2ext.c \ + dri2int.h sdk_HEADERS = dri2.h all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -524,38 +517,15 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): -install-libdri2_laLTLIBRARIES: $(libdri2_la_LTLIBRARIES) - @$(NORMAL_INSTALL) - @list='$(libdri2_la_LTLIBRARIES)'; test -n "$(libdri2_ladir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(libdri2_ladir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(libdri2_ladir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdri2_ladir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdri2_ladir)"; \ - } -uninstall-libdri2_laLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(libdri2_la_LTLIBRARIES)'; test -n "$(libdri2_ladir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdri2_ladir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdri2_ladir)/$$f"; \ - done - -clean-libdri2_laLTLIBRARIES: - -test -z "$(libdri2_la_LTLIBRARIES)" || rm -f $(libdri2_la_LTLIBRARIES) - @list='$(libdri2_la_LTLIBRARIES)'; \ +clean-noinstLTLIBRARIES: + -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) + @list='$(noinst_LTLIBRARIES)'; \ locs=`for p in $$list; do echo $$p; done | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sort -u`; \ @@ -564,7 +534,7 @@ clean-libdri2_laLTLIBRARIES: rm -f $${locs}; \ } libdri2.la: $(libdri2_la_OBJECTS) $(libdri2_la_DEPENDENCIES) $(EXTRA_libdri2_la_DEPENDENCIES) - $(AM_V_CCLD)$(libdri2_la_LINK) -rpath $(libdri2_ladir) $(libdri2_la_OBJECTS) $(libdri2_la_LIBADD) $(LIBS) + $(AM_V_CCLD)$(LINK) $(libdri2_la_OBJECTS) $(libdri2_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -572,8 +542,8 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdri2_la-dri2.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libdri2_la-dri2ext.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dri2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dri2ext.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -596,20 +566,6 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< -libdri2_la-dri2.lo: dri2.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdri2_la_CFLAGS) $(CFLAGS) -MT libdri2_la-dri2.lo -MD -MP -MF $(DEPDIR)/libdri2_la-dri2.Tpo -c -o libdri2_la-dri2.lo `test -f 'dri2.c' || echo '$(srcdir)/'`dri2.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdri2_la-dri2.Tpo $(DEPDIR)/libdri2_la-dri2.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dri2.c' object='libdri2_la-dri2.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdri2_la_CFLAGS) $(CFLAGS) -c -o libdri2_la-dri2.lo `test -f 'dri2.c' || echo '$(srcdir)/'`dri2.c - -libdri2_la-dri2ext.lo: dri2ext.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdri2_la_CFLAGS) $(CFLAGS) -MT libdri2_la-dri2ext.lo -MD -MP -MF $(DEPDIR)/libdri2_la-dri2ext.Tpo -c -o libdri2_la-dri2ext.lo `test -f 'dri2ext.c' || echo '$(srcdir)/'`dri2ext.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libdri2_la-dri2ext.Tpo $(DEPDIR)/libdri2_la-dri2ext.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dri2ext.c' object='libdri2_la-dri2ext.lo' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdri2_la_CFLAGS) $(CFLAGS) -c -o libdri2_la-dri2ext.lo `test -f 'dri2ext.c' || echo '$(srcdir)/'`dri2ext.c - mostlyclean-libtool: -rm -f *.lo @@ -737,7 +693,7 @@ check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(HEADERS) installdirs: - for dir in "$(DESTDIR)$(libdri2_ladir)" "$(DESTDIR)$(sdkdir)"; do \ + for dir in "$(DESTDIR)$(sdkdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am @@ -772,7 +728,7 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libdri2_laLTLIBRARIES clean-libtool \ +clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ mostlyclean-am distclean: distclean-am @@ -793,7 +749,7 @@ info: info-am info-am: -install-data-am: install-libdri2_laLTLIBRARIES install-sdkHEADERS +install-data-am: install-sdkHEADERS install-dvi: install-dvi-am @@ -839,25 +795,23 @@ ps: ps-am ps-am: -uninstall-am: uninstall-libdri2_laLTLIBRARIES uninstall-sdkHEADERS +uninstall-am: uninstall-sdkHEADERS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libdri2_laLTLIBRARIES clean-libtool cscopelist ctags \ + clean-libtool clean-noinstLTLIBRARIES cscopelist ctags \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ - install-info-am install-libdri2_laLTLIBRARIES install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-sdkHEADERS install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-libdri2_laLTLIBRARIES \ - uninstall-sdkHEADERS + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-sdkHEADERS install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-sdkHEADERS # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/xserver/hw/xfree86/dri2/dri2.c b/xserver/hw/xfree86/dri2/dri2.c index 591ff3ace..40963c3b0 100644 --- a/xserver/hw/xfree86/dri2/dri2.c +++ b/xserver/hw/xfree86/dri2/dri2.c @@ -44,13 +44,16 @@ #include "windowstr.h" #include "dixstruct.h" #include "dri2.h" +#include "dri2int.h" #include "xf86VGAarbiter.h" - +#include "damage.h" #include "xf86.h" CARD8 dri2_major; /* version of DRI2 supported by DDX */ CARD8 dri2_minor; +uint32_t prime_id_allocate_bitmask; + static DevPrivateKeyRec dri2ScreenPrivateKeyRec; #define dri2ScreenPrivateKey (&dri2ScreenPrivateKeyRec) @@ -63,6 +66,17 @@ static DevPrivateKeyRec dri2PixmapPrivateKeyRec; #define dri2PixmapPrivateKey (&dri2PixmapPrivateKeyRec) +static DevPrivateKeyRec dri2ClientPrivateKeyRec; + +#define dri2ClientPrivateKey (&dri2ClientPrivateKeyRec) + +#define dri2ClientPrivate(_pClient) (dixLookupPrivate(&(_pClient)->devPrivates, \ + dri2ClientPrivateKey)) + +typedef struct _DRI2Client { + int prime_id; +} DRI2ClientRec, *DRI2ClientPtr; + static RESTYPE dri2DrawableRes; typedef struct _DRI2Screen *DRI2ScreenPtr; @@ -87,6 +101,9 @@ typedef struct _DRI2Drawable { int swap_limit; /* for N-buffering */ unsigned long serialNumber; Bool needInvalidate; + int prime_id; + PixmapPtr prime_slave_pixmap; + PixmapPtr redirectpixmap; } DRI2DrawableRec, *DRI2DrawablePtr; typedef struct _DRI2Screen { @@ -97,6 +114,7 @@ typedef struct _DRI2Screen { const char *deviceName; int fd; unsigned int lastSequence; + int prime_id; DRI2CreateBufferProcPtr CreateBuffer; DRI2DestroyBufferProcPtr DestroyBuffer; @@ -104,21 +122,55 @@ typedef struct _DRI2Screen { DRI2ScheduleSwapProcPtr ScheduleSwap; DRI2GetMSCProcPtr GetMSC; DRI2ScheduleWaitMSCProcPtr ScheduleWaitMSC; - DRI2AuthMagicProcPtr AuthMagic; + DRI2AuthMagic2ProcPtr AuthMagic; + DRI2AuthMagicProcPtr LegacyAuthMagic; DRI2ReuseBufferNotifyProcPtr ReuseBufferNotify; DRI2SwapLimitValidateProcPtr SwapLimitValidate; + DRI2GetParamProcPtr GetParam; HandleExposuresProcPtr HandleExposures; ConfigNotifyProcPtr ConfigNotify; + DRI2CreateBuffer2ProcPtr CreateBuffer2; + DRI2DestroyBuffer2ProcPtr DestroyBuffer2; + DRI2CopyRegion2ProcPtr CopyRegion2; } DRI2ScreenRec; +static void +destroy_buffer(DrawablePtr pDraw, DRI2BufferPtr buffer, int prime_id); + static DRI2ScreenPtr DRI2GetScreen(ScreenPtr pScreen) { return dixLookupPrivate(&pScreen->devPrivates, dri2ScreenPrivateKey); } +static ScreenPtr +GetScreenPrime(ScreenPtr master, int prime_id) +{ + ScreenPtr slave; + if (prime_id == 0 || xorg_list_is_empty(&master->offload_slave_list)) { + return master; + } + xorg_list_for_each_entry(slave, &master->offload_slave_list, offload_head) { + DRI2ScreenPtr ds; + + ds = DRI2GetScreen(slave); + if (ds->prime_id == prime_id) + break; + } + if (!slave) + return master; + return slave; +} + +static DRI2ScreenPtr +DRI2GetScreenPrime(ScreenPtr master, int prime_id) +{ + ScreenPtr slave = GetScreenPrime(master, prime_id); + return DRI2GetScreen(slave); +} + static DRI2DrawablePtr DRI2GetDrawable(DrawablePtr pDraw) { @@ -185,7 +237,8 @@ DRI2AllocateDrawable(DrawablePtr pDraw) xorg_list_init(&pPriv->reference_list); pPriv->serialNumber = DRI2DrawableSerial(pDraw); pPriv->needInvalidate = FALSE; - + pPriv->redirectpixmap = NULL; + pPriv->prime_slave_pixmap = NULL; if (pDraw->type == DRAWABLE_WINDOW) { pWin = (WindowPtr) pDraw; dixSetPrivate(&pWin->devPrivates, dri2WindowPrivateKey, pPriv); @@ -280,10 +333,12 @@ DRI2AddDrawableRef(DRI2DrawablePtr pPriv, XID id, XID dri2_id, } int -DRI2CreateDrawable(ClientPtr client, DrawablePtr pDraw, XID id, - DRI2InvalidateProcPtr invalidate, void *priv) +DRI2CreateDrawable2(ClientPtr client, DrawablePtr pDraw, XID id, + DRI2InvalidateProcPtr invalidate, void *priv, + XID *dri2_id_out) { DRI2DrawablePtr pPriv; + DRI2ClientPtr dri2_client = dri2ClientPrivate(client); XID dri2_id; int rc; @@ -293,19 +348,30 @@ DRI2CreateDrawable(ClientPtr client, DrawablePtr pDraw, XID id, if (pPriv == NULL) return BadAlloc; + pPriv->prime_id = dri2_client->prime_id; + dri2_id = FakeClientID(client->index); rc = DRI2AddDrawableRef(pPriv, id, dri2_id, invalidate, priv); if (rc != Success) return rc; + if (dri2_id_out) + *dri2_id_out = dri2_id; + return Success; } +int +DRI2CreateDrawable(ClientPtr client, DrawablePtr pDraw, XID id, + DRI2InvalidateProcPtr invalidate, void *priv) +{ + return DRI2CreateDrawable2(client, pDraw, id, invalidate, priv, NULL); +} + static int DRI2DrawableGone(pointer p, XID id) { DRI2DrawablePtr pPriv = p; - DRI2ScreenPtr ds = pPriv->dri2_screen; DRI2DrawableRefPtr ref, next; WindowPtr pWin; PixmapPtr pPixmap; @@ -343,18 +409,59 @@ DRI2DrawableGone(pointer p, XID id) dixSetPrivate(&pPixmap->devPrivates, dri2PixmapPrivateKey, NULL); } + if (pPriv->prime_slave_pixmap) { + (*pPriv->prime_slave_pixmap->master_pixmap->drawable.pScreen->DestroyPixmap)(pPriv->prime_slave_pixmap->master_pixmap); + (*pPriv->prime_slave_pixmap->drawable.pScreen->DestroyPixmap)(pPriv->prime_slave_pixmap); + } + if (pPriv->buffers != NULL) { for (i = 0; i < pPriv->bufferCount; i++) - (*ds->DestroyBuffer) (pDraw, pPriv->buffers[i]); + destroy_buffer(pDraw, pPriv->buffers[i], pPriv->prime_id); free(pPriv->buffers); } + if (pPriv->redirectpixmap) { + (*pDraw->pScreen->ReplaceScanoutPixmap)(pDraw, pPriv->redirectpixmap, FALSE); + (*pDraw->pScreen->DestroyPixmap)(pPriv->redirectpixmap); + } + free(pPriv); return Success; } +static DRI2BufferPtr +create_buffer(DrawablePtr pDraw, + unsigned int attachment, unsigned int format) +{ + ScreenPtr primeScreen; + DRI2DrawablePtr pPriv; + DRI2ScreenPtr ds; + DRI2BufferPtr buffer; + pPriv = DRI2GetDrawable(pDraw); + primeScreen = GetScreenPrime(pDraw->pScreen, pPriv->prime_id); + ds = DRI2GetScreenPrime(pDraw->pScreen, pPriv->prime_id); + if (ds->CreateBuffer2) + buffer = (*ds->CreateBuffer2)(primeScreen, pDraw, attachment, format); + else + buffer = (*ds->CreateBuffer)(pDraw, attachment, format); + return buffer; +} + +static void +destroy_buffer(DrawablePtr pDraw, DRI2BufferPtr buffer, int prime_id) +{ + ScreenPtr primeScreen; + DRI2ScreenPtr ds; + primeScreen = GetScreenPrime(pDraw->pScreen, prime_id); + ds = DRI2GetScreen(primeScreen); + if (ds->DestroyBuffer2) + (*ds->DestroyBuffer2)(primeScreen, pDraw, buffer); + else + (*ds->DestroyBuffer)(pDraw, buffer); +} + static int find_attachment(DRI2DrawablePtr pPriv, unsigned attachment) { @@ -385,7 +492,7 @@ allocate_or_reuse_buffer(DrawablePtr pDraw, DRI2ScreenPtr ds, if ((old_buf < 0) || attachment == DRI2BufferFrontLeft || !dimensions_match || (pPriv->buffers[old_buf]->format != format)) { - *buffer = (*ds->CreateBuffer) (pDraw, attachment, format); + *buffer = create_buffer (pDraw, attachment, format); pPriv->serialNumber = DRI2DrawableSerial(pDraw); return TRUE; @@ -406,13 +513,12 @@ update_dri2_drawable_buffers(DRI2DrawablePtr pPriv, DrawablePtr pDraw, DRI2BufferPtr * buffers, int out_count, int *width, int *height) { - DRI2ScreenPtr ds = DRI2GetScreen(pDraw->pScreen); int i; if (pPriv->buffers != NULL) { for (i = 0; i < pPriv->bufferCount; i++) { if (pPriv->buffers[i] != NULL) { - (*ds->DestroyBuffer) (pDraw, pPriv->buffers[i]); + destroy_buffer(pDraw, pPriv->buffers[i], pPriv->prime_id); } } @@ -432,8 +538,8 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height, unsigned int *attachments, int count, int *out_count, int has_format) { - DRI2ScreenPtr ds = DRI2GetScreen(pDraw->pScreen); DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw); + DRI2ScreenPtr ds; DRI2BufferPtr *buffers; int need_real_front = 0; int need_fake_front = 0; @@ -450,6 +556,8 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height, return NULL; } + ds = DRI2GetScreen(pDraw->pScreen); + dimensions_match = (pDraw->width == pPriv->width) && (pDraw->height == pPriv->height) && (pPriv->serialNumber == DRI2DrawableSerial(pDraw)); @@ -554,7 +662,7 @@ do_get_buffers(DrawablePtr pDraw, int *width, int *height, if (buffers) { for (i = 0; i < count; i++) { if (buffers[i] != NULL) - (*ds->DestroyBuffer) (pDraw, buffers[i]); + destroy_buffer(pDraw, buffers[i], 0); } free(buffers); @@ -648,11 +756,159 @@ DRI2BlockClient(ClientPtr client, DrawablePtr pDraw) pPriv->blockedOnMsc = TRUE; } +static inline PixmapPtr GetDrawablePixmap(DrawablePtr drawable) +{ + if (drawable->type == DRAWABLE_PIXMAP) + return (PixmapPtr)drawable; + else { + struct _Window *pWin = (struct _Window *)drawable; + return drawable->pScreen->GetWindowPixmap(pWin); + } +} + +/* + * A TraverseTree callback to invalidate all windows using the same + * pixmap + */ +static int +DRI2InvalidateWalk(WindowPtr pWin, pointer data) +{ + if (pWin->drawable.pScreen->GetWindowPixmap(pWin) != data) + return WT_DONTWALKCHILDREN; + DRI2InvalidateDrawable(&pWin->drawable); + return WT_WALKCHILDREN; +} + +static void +DRI2InvalidateDrawableAll(DrawablePtr pDraw) +{ + if (pDraw->type == DRAWABLE_WINDOW) { + WindowPtr pWin = (WindowPtr) pDraw; + PixmapPtr pPixmap = pDraw->pScreen->GetWindowPixmap(pWin); + + /* + * Find the top-most window using this pixmap + */ + while (pWin->parent && + pDraw->pScreen->GetWindowPixmap(pWin->parent) == pPixmap) + pWin = pWin->parent; + + /* + * Walk the sub-tree to invalidate all of the + * windows using the same pixmap + */ + TraverseTree(pWin, DRI2InvalidateWalk, pPixmap); + DRI2InvalidateDrawable(&pPixmap->drawable); + } + else + DRI2InvalidateDrawable(pDraw); +} + +DrawablePtr DRI2UpdatePrime(DrawablePtr pDraw, DRI2BufferPtr pDest) +{ + DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw); + PixmapPtr spix; + PixmapPtr mpix = GetDrawablePixmap(pDraw); + ScreenPtr master, slave; + Bool ret; + + master = mpix->drawable.pScreen; + + if (pDraw->type == DRAWABLE_WINDOW) { + WindowPtr pWin = (WindowPtr)pDraw; + PixmapPtr pPixmap = pDraw->pScreen->GetWindowPixmap(pWin); + + if (pDraw->pScreen->GetScreenPixmap(pDraw->pScreen) == pPixmap) { + if (pPriv->redirectpixmap && + pPriv->redirectpixmap->drawable.width == pDraw->width && + pPriv->redirectpixmap->drawable.height == pDraw->height && + pPriv->redirectpixmap->drawable.depth == pDraw->depth) { + mpix = pPriv->redirectpixmap; + } else { + if (master->ReplaceScanoutPixmap) { + mpix = (*master->CreatePixmap)(master, pDraw->width, pDraw->height, + pDraw->depth, CREATE_PIXMAP_USAGE_SHARED); + if (!mpix) + return NULL; + + ret = (*master->ReplaceScanoutPixmap)(pDraw, mpix, TRUE); + if (ret == FALSE) { + (*master->DestroyPixmap)(mpix); + return NULL; + } + pPriv->redirectpixmap = mpix; + } else + return NULL; + } + } else if (pPriv->redirectpixmap) { + (*master->ReplaceScanoutPixmap)(pDraw, pPriv->redirectpixmap, FALSE); + (*master->DestroyPixmap)(pPriv->redirectpixmap); + pPriv->redirectpixmap = NULL; + } + } + + slave = GetScreenPrime(pDraw->pScreen, pPriv->prime_id); + + /* check if the pixmap is still fine */ + if (pPriv->prime_slave_pixmap) { + if (pPriv->prime_slave_pixmap->master_pixmap == mpix) + return &pPriv->prime_slave_pixmap->drawable; + else { + (*pPriv->prime_slave_pixmap->master_pixmap->drawable.pScreen->DestroyPixmap)(pPriv->prime_slave_pixmap->master_pixmap); + (*slave->DestroyPixmap)(pPriv->prime_slave_pixmap); + pPriv->prime_slave_pixmap = NULL; + } + } + + spix = PixmapShareToSlave(mpix, slave); + if (!spix) + return NULL; + + pPriv->prime_slave_pixmap = spix; +#ifdef COMPOSITE + spix->screen_x = mpix->screen_x; + spix->screen_y = mpix->screen_y; +#endif + + DRI2InvalidateDrawableAll(pDraw); + return &spix->drawable; +} + +static void dri2_copy_region(DrawablePtr pDraw, RegionPtr pRegion, + DRI2BufferPtr pDest, DRI2BufferPtr pSrc) +{ + DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw); + DRI2ScreenPtr ds; + ScreenPtr primeScreen; + + primeScreen = GetScreenPrime(pDraw->pScreen, pPriv->prime_id); + ds = DRI2GetScreen(primeScreen); + + if (ds->CopyRegion2) + (*ds->CopyRegion2)(primeScreen, pDraw, pRegion, pDest, pSrc); + else + (*ds->CopyRegion) (pDraw, pRegion, pDest, pSrc); + + /* cause damage to the box */ + if (pPriv->prime_id) { + BoxRec box; + RegionRec region; + box.x1 = 0; + box.x2 = box.x1 + pDraw->width; + box.y1 = 0; + box.y2 = box.y1 + pDraw->height; + RegionInit(®ion, &box, 1); + RegionTranslate(®ion, pDraw->x, pDraw->y); + DamageRegionAppend(pDraw, ®ion); + DamageRegionProcessPending(pDraw); + RegionUninit(®ion); + } +} + int DRI2CopyRegion(DrawablePtr pDraw, RegionPtr pRegion, unsigned int dest, unsigned int src) { - DRI2ScreenPtr ds = DRI2GetScreen(pDraw->pScreen); DRI2DrawablePtr pPriv; DRI2BufferPtr pDestBuffer, pSrcBuffer; int i; @@ -672,7 +928,7 @@ DRI2CopyRegion(DrawablePtr pDraw, RegionPtr pRegion, if (pSrcBuffer == NULL || pDestBuffer == NULL) return BadValue; - (*ds->CopyRegion) (pDraw, pRegion, pDestBuffer, pSrcBuffer); + dri2_copy_region(pDraw, pRegion, pDestBuffer, pSrcBuffer); return Success; } @@ -832,18 +1088,7 @@ DRI2WaitSwap(ClientPtr client, DrawablePtr pDrawable) return FALSE; } -/* - * A TraverseTree callback to invalidate all windows using the same - * pixmap - */ -static int -DRI2InvalidateWalk(WindowPtr pWin, pointer data) -{ - if (pWin->drawable.pScreen->GetWindowPixmap(pWin) != data) - return WT_DONTWALKCHILDREN; - DRI2InvalidateDrawable(&pWin->drawable); - return WT_WALKCHILDREN; -} + int DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc, @@ -877,7 +1122,7 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc, } /* Old DDX or no swap interval, just blit */ - if (!ds->ScheduleSwap || !pPriv->swap_interval) { + if (!ds->ScheduleSwap || !pPriv->swap_interval || pPriv->prime_id) { BoxRec box; RegionRec region; @@ -889,7 +1134,7 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc, pPriv->swapsPending++; - (*ds->CopyRegion) (pDraw, ®ion, pDestBuffer, pSrcBuffer); + dri2_copy_region(pDraw, ®ion, pDestBuffer, pSrcBuffer); DRI2SwapComplete(client, pDraw, target_msc, 0, 0, DRI2_BLIT_COMPLETE, func, data); return Success; @@ -946,26 +1191,7 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc, */ *swap_target = pPriv->swap_count + pPriv->swapsPending; - if (pDraw->type == DRAWABLE_WINDOW) { - WindowPtr pWin = (WindowPtr) pDraw; - PixmapPtr pPixmap = pScreen->GetWindowPixmap(pWin); - - /* - * Find the top-most window using this pixmap - */ - while (pWin->parent && - pScreen->GetWindowPixmap(pWin->parent) == pPixmap) - pWin = pWin->parent; - - /* - * Walk the sub-tree to invalidate all of the - * windows using the same pixmap - */ - TraverseTree(pWin, DRI2InvalidateWalk, pPixmap); - DRI2InvalidateDrawable(&pPixmap->drawable); - } - else - DRI2InvalidateDrawable(pDraw); + DRI2InvalidateDrawableAll(pDraw); return Success; } @@ -1089,34 +1315,62 @@ DRI2HasSwapControl(ScreenPtr pScreen) } Bool -DRI2Connect(ScreenPtr pScreen, unsigned int driverType, int *fd, +DRI2Connect(ClientPtr client, ScreenPtr pScreen, + unsigned int driverType, int *fd, const char **driverName, const char **deviceName) { DRI2ScreenPtr ds; + uint32_t prime_id = DRI2DriverPrimeId(driverType); + uint32_t driver_id = driverType & 0xffff; if (!dixPrivateKeyRegistered(dri2ScreenPrivateKey)) return FALSE; - ds = DRI2GetScreen(pScreen); - if (ds == NULL || driverType >= ds->numDrivers || - !ds->driverNames[driverType]) + ds = DRI2GetScreenPrime(pScreen, prime_id); + if (ds == NULL) return FALSE; - *fd = ds->fd; - *driverName = ds->driverNames[driverType]; + if (driver_id >= ds->numDrivers || + !ds->driverNames[driver_id]) + return FALSE; + + *driverName = ds->driverNames[driver_id]; *deviceName = ds->deviceName; + *fd = ds->fd; + + if (client) { + DRI2ClientPtr dri2_client; + dri2_client = dri2ClientPrivate(client); + dri2_client->prime_id = prime_id; + } return TRUE; } -Bool -DRI2Authenticate(ScreenPtr pScreen, uint32_t magic) +static int +DRI2AuthMagic (ScreenPtr pScreen, uint32_t magic) { DRI2ScreenPtr ds = DRI2GetScreen(pScreen); + if (ds == NULL) + return -EINVAL; - if (ds == NULL || (*ds->AuthMagic) (ds->fd, magic)) + return (*ds->LegacyAuthMagic) (ds->fd, magic); +} + +Bool +DRI2Authenticate(ClientPtr client, ScreenPtr pScreen, uint32_t magic) +{ + DRI2ScreenPtr ds; + DRI2ClientPtr dri2_client = dri2ClientPrivate(client); + ScreenPtr primescreen; + + ds = DRI2GetScreenPrime(pScreen, dri2_client->prime_id); + if (ds == NULL) return FALSE; + primescreen = GetScreenPrime(pScreen, dri2_client->prime_id); + if ((*ds->AuthMagic)(primescreen, magic)) + return FALSE; return TRUE; } @@ -1148,6 +1402,22 @@ DRI2ConfigNotify(WindowPtr pWin, int x, int y, int w, int h, int bw, return Success; } +#define MAX_PRIME DRI2DriverPrimeMask +static int +get_prime_id(void) +{ + int i; + /* start at 1, prime id 0 is just normal driver */ + for (i = 1; i < MAX_PRIME; i++) { + if (prime_id_allocate_bitmask & (1 << i)) + continue; + + prime_id_allocate_bitmask |= (1 << i); + return i; + } + return -1; +} + Bool DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) { @@ -1178,6 +1448,9 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) if (!dixRegisterPrivateKey(&dri2PixmapPrivateKeyRec, PRIVATE_PIXMAP, 0)) return FALSE; + if (!dixRegisterPrivateKey(&dri2ClientPrivateKeyRec, PRIVATE_CLIENT, sizeof(DRI2ClientRec))) + return FALSE; + ds = calloc(1, sizeof *ds); if (!ds) return FALSE; @@ -1201,8 +1474,11 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) cur_minor = 1; } + if (info->version >= 8) { + ds->AuthMagic = info->AuthMagic2; + } if (info->version >= 5) { - ds->AuthMagic = info->AuthMagic; + ds->LegacyAuthMagic = info->AuthMagic; } if (info->version >= 6) { @@ -1210,16 +1486,41 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) ds->SwapLimitValidate = info->SwapLimitValidate; } + if (info->version >= 7) { + ds->GetParam = info->GetParam; + cur_minor = 4; + } + + if (info->version >= 9) { + ds->CreateBuffer2 = info->CreateBuffer2; + if (info->CreateBuffer2 && pScreen->isGPU) { + ds->prime_id = get_prime_id(); + if (ds->prime_id == -1) { + free(ds); + return FALSE; + } + } + ds->DestroyBuffer2 = info->DestroyBuffer2; + ds->CopyRegion2 = info->CopyRegion2; + } + /* * if the driver doesn't provide an AuthMagic function or the info struct - * version is too low, it relies on the old method (using libdrm) or fail + * version is too low, call through LegacyAuthMagic */ - if (!ds->AuthMagic) + if (!ds->AuthMagic) { + ds->AuthMagic = DRI2AuthMagic; + /* + * If the driver doesn't provide an AuthMagic function + * it relies on the old method (using libdrm) or fails + */ + if (!ds->LegacyAuthMagic) #ifdef WITH_LIBDRM - ds->AuthMagic = drmAuthMagic; + ds->LegacyAuthMagic = drmAuthMagic; #else - goto err_out; + goto err_out; #endif + } /* Initialize minor if needed and set to minimum provied by DDX */ if (!dri2_minor || dri2_minor > cur_minor) @@ -1272,12 +1573,13 @@ DRI2CloseScreen(ScreenPtr pScreen) pScreen->ConfigNotify = ds->ConfigNotify; + if (ds->prime_id) + prime_id_allocate_bitmask &= ~(1 << ds->prime_id); free(ds->driverNames); free(ds); dixSetPrivate(&pScreen->devPrivates, dri2ScreenPrivateKey, NULL); } -extern ExtensionModule dri2ExtensionModule; extern Bool DRI2ModuleSetup(void); /* Called by InitExtensions() */ @@ -1291,44 +1593,47 @@ DRI2ModuleSetup(void) return TRUE; } -static pointer -DRI2Setup(pointer module, pointer opts, int *errmaj, int *errmin) -{ - static Bool setupDone = FALSE; - - if (!setupDone) { - setupDone = TRUE; - LoadExtension(&dri2ExtensionModule, FALSE); - } - else { - if (errmaj) - *errmaj = LDR_ONCEONLY; - } - - return (pointer) 1; -} - -static XF86ModuleVersionInfo DRI2VersRec = { - "dri2", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - 1, 2, 0, - ABI_CLASS_EXTENSION, - ABI_EXTENSION_VERSION, - MOD_CLASS_NONE, - {0, 0, 0, 0} -}; - -_X_EXPORT XF86ModuleData dri2ModuleData = { &DRI2VersRec, DRI2Setup, NULL }; - void DRI2Version(int *major, int *minor) { if (major != NULL) - *major = DRI2VersRec.majorversion; + *major = 1; if (minor != NULL) - *minor = DRI2VersRec.minorversion; + *minor = 2; +} + +int +DRI2GetParam(ClientPtr client, + DrawablePtr drawable, + CARD64 param, + BOOL *is_param_recognized, + CARD64 *value) +{ + DRI2ScreenPtr ds = DRI2GetScreen(drawable->pScreen); + char high_byte = (param >> 24); + + switch (high_byte) { + case 0: + /* Parameter names whose high_byte is 0 are reserved for the X + * server. The server currently recognizes no parameters. + */ + goto not_recognized; + case 1: + /* Parameter names whose high byte is 1 are reserved for the DDX. */ + if (ds->GetParam) + return ds->GetParam(client, drawable, param, + is_param_recognized, value); + else + goto not_recognized; + default: + /* Other parameter names are reserved for future use. They are never + * recognized. + */ + goto not_recognized; + } + +not_recognized: + *is_param_recognized = FALSE; + return Success; } diff --git a/xserver/hw/xfree86/dri2/dri2.h b/xserver/hw/xfree86/dri2/dri2.h index 00b3668cc..1e7afddbd 100644 --- a/xserver/hw/xfree86/dri2/dri2.h +++ b/xserver/hw/xfree86/dri2/dri2.h @@ -64,6 +64,7 @@ typedef void (*DRI2CopyRegionProcPtr) (DrawablePtr pDraw, DRI2BufferPtr pSrcBuffer); typedef void (*DRI2WaitProcPtr) (WindowPtr pWin, unsigned int sequence); typedef int (*DRI2AuthMagicProcPtr) (int fd, uint32_t magic); +typedef int (*DRI2AuthMagic2ProcPtr) (ScreenPtr pScreen, uint32_t magic); /** * Schedule a buffer swap @@ -175,10 +176,36 @@ typedef void (*DRI2InvalidateProcPtr) (DrawablePtr pDraw, void *data, XID id); typedef Bool (*DRI2SwapLimitValidateProcPtr) (DrawablePtr pDraw, int swap_limit); +typedef DRI2BufferPtr(*DRI2CreateBuffer2ProcPtr) (ScreenPtr pScreen, + DrawablePtr pDraw, + unsigned int attachment, + unsigned int format); +typedef void (*DRI2DestroyBuffer2ProcPtr) (ScreenPtr pScreen, DrawablePtr pDraw, + DRI2BufferPtr buffer); + +typedef void (*DRI2CopyRegion2ProcPtr) (ScreenPtr pScreen, DrawablePtr pDraw, + RegionPtr pRegion, + DRI2BufferPtr pDestBuffer, + DRI2BufferPtr pSrcBuffer); + +/** + * \brief Get the value of a parameter. + * + * The parameter's \a value is looked up on the screen associated with + * \a pDrawable. + * + * \return \c Success or error code. + */ +typedef int (*DRI2GetParamProcPtr) (ClientPtr client, + DrawablePtr pDrawable, + CARD64 param, + BOOL *is_param_recognized, + CARD64 *value); + /** * Version of the DRI2InfoRec structure defined in this header */ -#define DRI2INFOREC_VERSION 6 +#define DRI2INFOREC_VERSION 9 typedef struct { unsigned int version; /**< Version of this struct */ @@ -211,9 +238,21 @@ typedef struct { DRI2ReuseBufferNotifyProcPtr ReuseBufferNotify; DRI2SwapLimitValidateProcPtr SwapLimitValidate; -} DRI2InfoRec, *DRI2InfoPtr; -extern _X_EXPORT int DRI2EventBase; + /* added in version 7 */ + DRI2GetParamProcPtr GetParam; + + /* added in version 8 */ + /* AuthMagic callback which passes extra context */ + /* If this is NULL the AuthMagic callback is used */ + /* If this is non-NULL the AuthMagic callback is ignored */ + DRI2AuthMagic2ProcPtr AuthMagic2; + + /* added in version 9 */ + DRI2CreateBuffer2ProcPtr CreateBuffer2; + DRI2DestroyBuffer2ProcPtr DestroyBuffer2; + DRI2CopyRegion2ProcPtr CopyRegion2; +} DRI2InfoRec, *DRI2InfoPtr; extern _X_EXPORT Bool DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info); @@ -221,13 +260,13 @@ extern _X_EXPORT void DRI2CloseScreen(ScreenPtr pScreen); extern _X_EXPORT Bool DRI2HasSwapControl(ScreenPtr pScreen); -extern _X_EXPORT Bool DRI2Connect(ScreenPtr pScreen, +extern _X_EXPORT Bool DRI2Connect(ClientPtr client, ScreenPtr pScreen, unsigned int driverType, int *fd, const char **driverName, const char **deviceName); -extern _X_EXPORT Bool DRI2Authenticate(ScreenPtr pScreen, uint32_t magic); +extern _X_EXPORT Bool DRI2Authenticate(ClientPtr client, ScreenPtr pScreen, uint32_t magic); extern _X_EXPORT int DRI2CreateDrawable(ClientPtr client, DrawablePtr pDraw, @@ -235,7 +274,12 @@ extern _X_EXPORT int DRI2CreateDrawable(ClientPtr client, DRI2InvalidateProcPtr invalidate, void *priv); -extern _X_EXPORT void DRI2DestroyDrawable(DrawablePtr pDraw); +extern _X_EXPORT int DRI2CreateDrawable2(ClientPtr client, + DrawablePtr pDraw, + XID id, + DRI2InvalidateProcPtr invalidate, + void *priv, + XID *dri2_id_out); extern _X_EXPORT DRI2BufferPtr *DRI2GetBuffers(DrawablePtr pDraw, int *width, @@ -308,4 +352,11 @@ extern _X_EXPORT void DRI2WaitMSCComplete(ClientPtr client, DrawablePtr pDraw, int frame, unsigned int tv_sec, unsigned int tv_usec); +extern _X_EXPORT int DRI2GetParam(ClientPtr client, + DrawablePtr pDrawable, + CARD64 param, + BOOL *is_param_recognized, + CARD64 *value); + +extern _X_EXPORT DrawablePtr DRI2UpdatePrime(DrawablePtr pDraw, DRI2BufferPtr pDest); #endif diff --git a/xserver/hw/xfree86/dri2/dri2ext.c b/xserver/hw/xfree86/dri2/dri2ext.c index 2579a5c86..e1decec9e 100644 --- a/xserver/hw/xfree86/dri2/dri2ext.c +++ b/xserver/hw/xfree86/dri2/dri2ext.c @@ -44,13 +44,15 @@ #include "extnsionst.h" #include "xfixes.h" #include "dri2.h" +#include "dri2int.h" #include "protocol-versions.h" -/* The only xf86 include */ +/* The only xf86 includes */ #include "xf86Module.h" +#include "xf86Extensions.h" + +static int DRI2EventBase; -static ExtensionEntry *dri2Extension; -extern Bool DRI2ModuleSetup(void); static Bool validDrawable(ClientPtr client, XID drawable, Mask access_mode, @@ -71,17 +73,18 @@ static int ProcDRI2QueryVersion(ClientPtr client) { REQUEST(xDRI2QueryVersionReq); - xDRI2QueryVersionReply rep; + xDRI2QueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .majorVersion = dri2_major, + .minorVersion = dri2_minor + }; if (client->swapped) swaps(&stuff->length); REQUEST_SIZE_MATCH(xDRI2QueryVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = dri2_major; - rep.minorVersion = dri2_minor; if (client->swapped) { swaps(&rep.sequenceNumber); @@ -99,7 +102,13 @@ static int ProcDRI2Connect(ClientPtr client) { REQUEST(xDRI2ConnectReq); - xDRI2ConnectReply rep; + xDRI2ConnectReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .driverNameLength = 0, + .deviceNameLength = 0 + }; DrawablePtr pDraw; int fd, status; const char *driverName; @@ -110,13 +119,7 @@ ProcDRI2Connect(ClientPtr client) &pDraw, &status)) return status; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.driverNameLength = 0; - rep.deviceNameLength = 0; - - if (!DRI2Connect(pDraw->pScreen, + if (!DRI2Connect(client, pDraw->pScreen, stuff->driverType, &fd, &driverName, &deviceName)) goto fail; @@ -146,10 +149,12 @@ ProcDRI2Authenticate(ClientPtr client) &pDraw, &status)) return status; - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.authenticated = DRI2Authenticate(pDraw->pScreen, stuff->magic); + rep = (xDRI2AuthenticateReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .authenticated = DRI2Authenticate(client, pDraw->pScreen, stuff->magic) + }; WriteToClient(client, sizeof(xDRI2AuthenticateReply), &rep); return Success; @@ -158,11 +163,11 @@ ProcDRI2Authenticate(ClientPtr client) static void DRI2InvalidateBuffersEvent(DrawablePtr pDraw, void *priv, XID id) { - xDRI2InvalidateBuffers event; ClientPtr client = priv; - - event.type = DRI2EventBase + DRI2_InvalidateBuffers; - event.drawable = id; + xDRI2InvalidateBuffers event = { + .type = DRI2EventBase + DRI2_InvalidateBuffers, + .drawable = id + }; WriteEventsToClient(client, 1, (xEvent *) &event); } @@ -225,12 +230,14 @@ send_buffers_reply(ClientPtr client, DrawablePtr pDrawable, } } - rep.type = X_Reply; - rep.length = (count - skip) * sizeof(xDRI2Buffer) / 4; - rep.sequenceNumber = client->sequence; - rep.width = width; - rep.height = height; - rep.count = count - skip; + rep = (xDRI2GetBuffersReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = (count - skip) * sizeof(xDRI2Buffer) / 4, + .width = width, + .height = height, + .count = count - skip + }; WriteToClient(client, sizeof(xDRI2GetBuffersReply), &rep); for (i = 0; i < count; i++) { @@ -330,9 +337,11 @@ ProcDRI2CopyRegion(ClientPtr client) * that yet. */ - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; + rep = (xDRI2CopyRegionReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; WriteToClient(client, sizeof(xDRI2CopyRegionReply), &rep); @@ -356,17 +365,17 @@ static void DRI2SwapEvent(ClientPtr client, void *data, int type, CARD64 ust, CARD64 msc, CARD32 sbc) { - xDRI2BufferSwapComplete2 event; DrawablePtr pDrawable = data; - - event.type = DRI2EventBase + DRI2_BufferSwapComplete; - event.event_type = type; - event.drawable = pDrawable->id; - event.ust_hi = (CARD64) ust >> 32; - event.ust_lo = ust & 0xffffffff; - event.msc_hi = (CARD64) msc >> 32; - event.msc_lo = msc & 0xffffffff; - event.sbc = sbc; + xDRI2BufferSwapComplete2 event = { + .type = DRI2EventBase + DRI2_BufferSwapComplete, + .event_type = type, + .drawable = pDrawable->id, + .ust_hi = (CARD64) ust >> 32, + .ust_lo = ust & 0xffffffff, + .msc_hi = (CARD64) msc >> 32, + .msc_lo = msc & 0xffffffff, + .sbc = sbc + }; WriteEventsToClient(client, 1, (xEvent *) &event); } @@ -375,7 +384,11 @@ static int ProcDRI2SwapBuffers(ClientPtr client) { REQUEST(xDRI2SwapBuffersReq); - xDRI2SwapBuffersReply rep; + xDRI2SwapBuffersReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; DrawablePtr pDrawable; CARD64 target_msc, divisor, remainder, swap_target; int status; @@ -402,9 +415,6 @@ ProcDRI2SwapBuffers(ClientPtr client) if (status != Success) return BadDrawable; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; load_swap_reply(&rep, swap_target); WriteToClient(client, sizeof(xDRI2SwapBuffersReply), &rep); @@ -427,7 +437,11 @@ static int ProcDRI2GetMSC(ClientPtr client) { REQUEST(xDRI2GetMSCReq); - xDRI2MSCReply rep; + xDRI2MSCReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; DrawablePtr pDrawable; CARD64 ust, msc, sbc; int status; @@ -442,9 +456,6 @@ ProcDRI2GetMSC(ClientPtr client) if (status != Success) return status; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; load_msc_reply(&rep, ust, msc, sbc); WriteToClient(client, sizeof(xDRI2MSCReply), &rep); @@ -482,11 +493,12 @@ ProcDRI2WaitMSC(ClientPtr client) int ProcDRI2WaitMSCReply(ClientPtr client, CARD64 ust, CARD64 msc, CARD64 sbc) { - xDRI2MSCReply rep; + xDRI2MSCReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; load_msc_reply(&rep, ust, msc, sbc); WriteToClient(client, sizeof(xDRI2MSCReply), &rep); @@ -534,6 +546,38 @@ ProcDRI2WaitSBC(ClientPtr client) return status; } +static int +ProcDRI2GetParam(ClientPtr client) +{ + REQUEST(xDRI2GetParamReq); + xDRI2GetParamReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; + DrawablePtr pDrawable; + CARD64 value; + int status; + + REQUEST_SIZE_MATCH(xDRI2GetParamReq); + + if (!validDrawable(client, stuff->drawable, DixReadAccess, + &pDrawable, &status)) + return status; + + status = DRI2GetParam(client, pDrawable, stuff->param, + &rep.is_param_recognized, &value); + rep.value_hi = value >> 32; + rep.value_lo = value & 0xffffffff; + + if (status != Success) + return status; + + WriteToClient(client, sizeof(xDRI2GetParamReply), &rep); + + return status; +} + static int ProcDRI2Dispatch(ClientPtr client) { @@ -544,7 +588,7 @@ ProcDRI2Dispatch(ClientPtr client) return ProcDRI2QueryVersion(client); } - if (!LocalClient(client)) + if (!client->local) return BadRequest; switch (stuff->data) { @@ -572,6 +616,8 @@ ProcDRI2Dispatch(ClientPtr client) return ProcDRI2WaitSBC(client); case X_DRI2SwapInterval: return ProcDRI2SwapInterval(client); + case X_DRI2GetParam: + return ProcDRI2GetParam(client); default: return BadRequest; } @@ -581,7 +627,13 @@ static int SProcDRI2Connect(ClientPtr client) { REQUEST(xDRI2ConnectReq); - xDRI2ConnectReply rep; + xDRI2ConnectReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .driverNameLength = 0, + .deviceNameLength = 0 + }; /* If the client is swapped, it's not local. Talk to the hand. */ @@ -589,11 +641,9 @@ SProcDRI2Connect(ClientPtr client) if (sizeof(*stuff) / 4 != client->req_len) return BadLength; - rep.sequenceNumber = client->sequence; swaps(&rep.sequenceNumber); - rep.length = 0; - rep.driverNameLength = 0; - rep.deviceNameLength = 0; + + WriteToClient(client, sizeof(xDRI2ConnectReply), &rep); return Success; } @@ -617,11 +667,11 @@ SProcDRI2Dispatch(ClientPtr client) } } -int DRI2EventBase; - -static void +void DRI2ExtensionInit(void) { + ExtensionEntry *dri2Extension; + dri2Extension = AddExtension(DRI2_NAME, DRI2NumberEvents, DRI2NumberErrors, @@ -632,13 +682,3 @@ DRI2ExtensionInit(void) DRI2ModuleSetup(); } - -extern Bool noDRI2Extension; - -_X_HIDDEN ExtensionModule dri2ExtensionModule = { - DRI2ExtensionInit, - DRI2_NAME, - &noDRI2Extension, - NULL, - NULL -}; diff --git a/xserver/mi/mibstore.c b/xserver/hw/xfree86/dri2/dri2int.h similarity index 66% rename from xserver/mi/mibstore.c rename to xserver/hw/xfree86/dri2/dri2int.h index 6cadb2b8f..7f53eba45 100644 --- a/xserver/mi/mibstore.c +++ b/xserver/hw/xfree86/dri2/dri2int.h @@ -1,5 +1,5 @@ /* - * Copyright 2007 Red Hat, Inc. + * Copyright © 2011 Daniel Stone * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -19,25 +19,8 @@ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif -#include "scrnintstr.h" -#include "mibstore.h" - -/* - * There is no longer an mi implementation of backing store. This function - * is only for source compatibility with old drivers. * - * Note though that you do get backing store for free if your server has - * Composite enabled, since the automatic redirection mechanism provides - * essentially the same functionality. See compChangeWindowAttributes() - * for the implementation. + * Author: Daniel Stone */ -void -miInitializeBackingStore(ScreenPtr pScreen) -{ -} +extern Bool DRI2ModuleSetup(void); diff --git a/xserver/hw/xfree86/exa/Makefile.am b/xserver/hw/xfree86/exa/Makefile.am index 3ced531fa..433908411 100644 --- a/xserver/hw/xfree86/exa/Makefile.am +++ b/xserver/hw/xfree86/exa/Makefile.am @@ -2,7 +2,7 @@ SUBDIRS = man module_LTLIBRARIES = libexa.la -libexa_la_LDFLAGS = -module -avoid-version +libexa_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) INCLUDES = \ $(XORG_INCS) \ @@ -15,4 +15,4 @@ libexa_la_SOURCES = \ examodule.c libexa_la_LIBADD = \ - ../../../exa/libexa.la + ../../../exa/libexa.la $(PIXMAN_LIBS) diff --git a/xserver/hw/xfree86/exa/Makefile.in b/xserver/hw/xfree86/exa/Makefile.in index 7ff252015..216d11b50 100644 --- a/xserver/hw/xfree86/exa/Makefile.in +++ b/xserver/hw/xfree86/exa/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -101,7 +101,8 @@ am__uninstall_files_from_dir = { \ } am__installdirs = "$(DESTDIR)$(moduledir)" LTLIBRARIES = $(module_LTLIBRARIES) -libexa_la_DEPENDENCIES = ../../../exa/libexa.la +am__DEPENDENCIES_1 = +libexa_la_DEPENDENCIES = ../../../exa/libexa.la $(am__DEPENDENCIES_1) am_libexa_la_OBJECTS = examodule.lo libexa_la_OBJECTS = $(am_libexa_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) @@ -250,13 +251,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -278,6 +275,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -302,6 +300,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -317,7 +316,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -416,6 +414,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -517,7 +516,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = man module_LTLIBRARIES = libexa.la -libexa_la_LDFLAGS = -module -avoid-version +libexa_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) INCLUDES = \ $(XORG_INCS) \ -I$(srcdir)/../../../exa \ @@ -528,13 +527,13 @@ libexa_la_SOURCES = \ examodule.c libexa_la_LIBADD = \ - ../../../exa/libexa.la + ../../../exa/libexa.la $(PIXMAN_LIBS) all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -559,9 +558,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-moduleLTLIBRARIES: $(module_LTLIBRARIES) diff --git a/xserver/hw/xfree86/exa/examodule.c b/xserver/hw/xfree86/exa/examodule.c index 72cf7988d..4e809ea37 100644 --- a/xserver/hw/xfree86/exa/examodule.c +++ b/xserver/hw/xfree86/exa/examodule.c @@ -38,7 +38,7 @@ typedef struct _ExaXorgScreenPrivRec { CloseScreenProcPtr SavedCloseScreen; - EnableDisableFBAccessProcPtr SavedEnableDisableFBAccess; + xf86EnableDisableFBAccessProc *SavedEnableDisableFBAccess; OptionInfoPtr options; } ExaXorgScreenPrivRec, *ExaXorgScreenPrivPtr; @@ -70,9 +70,9 @@ static const OptionInfoRec EXAOptions[] = { }; static Bool -exaXorgCloseScreen(int i, ScreenPtr pScreen) +exaXorgCloseScreen(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = XF86SCRNINFO(pScreen); + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); ExaXorgScreenPrivPtr pScreenPriv = (ExaXorgScreenPrivPtr) dixLookupPrivate(&pScreen->devPrivates, exaXorgScreenPrivateKey); @@ -83,24 +83,24 @@ exaXorgCloseScreen(int i, ScreenPtr pScreen) free(pScreenPriv->options); free(pScreenPriv); - return pScreen->CloseScreen(i, pScreen); + return pScreen->CloseScreen(pScreen); } static void -exaXorgEnableDisableFBAccess(int index, Bool enable) +exaXorgEnableDisableFBAccess(ScrnInfoPtr pScrn, Bool enable) { - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); ExaXorgScreenPrivPtr pScreenPriv = (ExaXorgScreenPrivPtr) dixLookupPrivate(&pScreen->devPrivates, exaXorgScreenPrivateKey); if (!enable) - exaEnableDisableFBAccess(index, enable); + exaEnableDisableFBAccess(pScreen, enable); if (pScreenPriv->SavedEnableDisableFBAccess) - pScreenPriv->SavedEnableDisableFBAccess(index, enable); + pScreenPriv->SavedEnableDisableFBAccess(pScrn, enable); if (enable) - exaEnableDisableFBAccess(index, enable); + exaEnableDisableFBAccess(pScreen, enable); } /** @@ -111,8 +111,7 @@ void exaDDXDriverInit(ScreenPtr pScreen) { ExaScreenPriv(pScreen); - /* Do NOT use XF86SCRNINFO macro here!! */ - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); ExaXorgScreenPrivPtr pScreenPriv; if (!dixRegisterPrivateKey(&exaXorgScreenPrivateKeyRec, PRIVATE_SCREEN, 0)) diff --git a/xserver/hw/xfree86/exa/man/Makefile.in b/xserver/hw/xfree86/exa/man/Makefile.in index d1064b52f..f19c96234 100644 --- a/xserver/hw/xfree86/exa/man/Makefile.in +++ b/xserver/hw/xfree86/exa/man/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -179,13 +179,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -207,6 +203,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -231,6 +228,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -246,7 +244,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -361,6 +358,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -480,7 +478,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/manpages.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/manpages.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -506,9 +504,9 @@ $(top_srcdir)/manpages.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/xfree86/exa/man/exa.man b/xserver/hw/xfree86/exa/man/exa.man index 30d01824d..42a8de31d 100644 --- a/xserver/hw/xfree86/exa/man/exa.man +++ b/xserver/hw/xfree86/exa/man/exa.man @@ -14,7 +14,7 @@ The .B EXA architecture is designed to make accelerating the Render extension simple and efficient, and results in various performance tradeoffs compared to XAA. Some -__xconfigfile__ options are available for debugging performance issues or +xorg.conf options are available for debugging performance issues or driver rendering problems. They are not intended for general use. .TP .BI "Option \*qEXANoComposite\*q \*q" boolean \*q @@ -36,7 +36,7 @@ default is intended to be the best performing one for general use, though others may help with specific use cases. Available options include \*qalways\*q, \*qgreedy\*q, and \*qsmart\*q. Default: always. .SH "SEE ALSO" -.BR __xservername__ (__appmansuffix__), -.BR __xconfigfile__(__filemansuffix__). +.BR Xorg (__appmansuffix__), +.BR xorg.conf(__filemansuffix__). .SH AUTHORS Authors include: Keith Packard, Eric Anholt, Zack Rusin, and Michel D\(:anzer diff --git a/xserver/hw/xfree86/fbdevhw/Makefile.am b/xserver/hw/xfree86/fbdevhw/Makefile.am index 4472acd91..1fa9321cb 100644 --- a/xserver/hw/xfree86/fbdevhw/Makefile.am +++ b/xserver/hw/xfree86/fbdevhw/Makefile.am @@ -2,7 +2,7 @@ SUBDIRS = man module_LTLIBRARIES = libfbdevhw.la -libfbdevhw_la_LDFLAGS = -module -avoid-version +libfbdevhw_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) if FBDEVHW libfbdevhw_la_SOURCES = fbdevhw.c diff --git a/xserver/hw/xfree86/fbdevhw/Makefile.in b/xserver/hw/xfree86/fbdevhw/Makefile.in index e0995a4eb..20142048a 100644 --- a/xserver/hw/xfree86/fbdevhw/Makefile.in +++ b/xserver/hw/xfree86/fbdevhw/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -254,13 +254,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -282,6 +278,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -306,6 +303,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -321,7 +319,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -420,6 +417,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -521,7 +519,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = man module_LTLIBRARIES = libfbdevhw.la -libfbdevhw_la_LDFLAGS = -module -avoid-version +libfbdevhw_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) @FBDEVHW_FALSE@libfbdevhw_la_SOURCES = fbdevhwstub.c @FBDEVHW_TRUE@libfbdevhw_la_SOURCES = fbdevhw.c INCLUDES = $(XORG_INCS) -I$(srcdir)/../i2c @@ -532,7 +530,7 @@ all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -557,9 +555,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-moduleLTLIBRARIES: $(module_LTLIBRARIES) diff --git a/xserver/hw/xfree86/fbdevhw/fbdevhw.c b/xserver/hw/xfree86/fbdevhw/fbdevhw.c index 2881d7ec2..d4b5558a7 100644 --- a/xserver/hw/xfree86/fbdevhw/fbdevhw.c +++ b/xserver/hw/xfree86/fbdevhw/fbdevhw.c @@ -775,10 +775,8 @@ fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, /* these can be hooked directly into ScrnInfoRec */ ModeStatus -fbdevHWValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags) +fbdevHWValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool verbose, int flags) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; - if (!fbdevHWSetMode(pScrn, mode, TRUE)) return MODE_BAD; @@ -786,10 +784,8 @@ fbdevHWValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags) } Bool -fbdevHWSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) +fbdevHWSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; - if (!fbdevHWSetMode(pScrn, mode, FALSE)) return FALSE; @@ -797,9 +793,8 @@ fbdevHWSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) } void -fbdevHWAdjustFrame(int scrnIndex, int x, int y, int flags) +fbdevHWAdjustFrame(ScrnInfoPtr pScrn, int x, int y) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; fbdevHWPtr fPtr = FBDEVHWPTR(pScrn); if (x < 0 || x + fPtr->var.xres > fPtr->var.xres_virtual || @@ -809,26 +804,22 @@ fbdevHWAdjustFrame(int scrnIndex, int x, int y, int flags) fPtr->var.xoffset = x; fPtr->var.yoffset = y; if (-1 == ioctl(fPtr->fd, FBIOPAN_DISPLAY, (void *) &fPtr->var)) - xf86DrvMsgVerb(scrnIndex, X_WARNING, 5, + xf86DrvMsgVerb(pScrn->scrnIndex, X_WARNING, 5, "FBIOPAN_DISPLAY: %s\n", strerror(errno)); } Bool -fbdevHWEnterVT(int scrnIndex, int flags) +fbdevHWEnterVT(ScrnInfoPtr pScrn) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; - if (!fbdevHWModeInit(pScrn, pScrn->currentMode)) return FALSE; - fbdevHWAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); + fbdevHWAdjustFrame(pScrn, pScrn->frameX0, pScrn->frameY0); return TRUE; } void -fbdevHWLeaveVT(int scrnIndex, int flags) +fbdevHWLeaveVT(ScrnInfoPtr pScrn) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; - fbdevHWRestore(pScrn); } @@ -866,7 +857,7 @@ fbdevHWDPMSSet(ScrnInfoPtr pScrn, int mode, int flags) Bool fbdevHWSaveScreen(ScreenPtr pScreen, int mode) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); fbdevHWPtr fPtr = FBDEVHWPTR(pScrn); unsigned long unblank; diff --git a/xserver/hw/xfree86/fbdevhw/fbdevhw.h b/xserver/hw/xfree86/fbdevhw/fbdevhw.h index 536987101..4984ccf89 100644 --- a/xserver/hw/xfree86/fbdevhw/fbdevhw.h +++ b/xserver/hw/xfree86/fbdevhw/fbdevhw.h @@ -44,14 +44,12 @@ extern _X_EXPORT void fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO * colors, VisualPtr pVisual); -extern _X_EXPORT ModeStatus fbdevHWValidMode(int scrnIndex, DisplayModePtr mode, +extern _X_EXPORT ModeStatus fbdevHWValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool verbose, int flags); -extern _X_EXPORT Bool fbdevHWSwitchMode(int scrnIndex, DisplayModePtr mode, - int flags); -extern _X_EXPORT void fbdevHWAdjustFrame(int scrnIndex, int x, int y, - int flags); -extern _X_EXPORT Bool fbdevHWEnterVT(int scrnIndex, int flags); -extern _X_EXPORT void fbdevHWLeaveVT(int scrnIndex, int flags); +extern _X_EXPORT Bool fbdevHWSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode); +extern _X_EXPORT void fbdevHWAdjustFrame(ScrnInfoPtr pScrn, int x, int y); +extern _X_EXPORT Bool fbdevHWEnterVT(ScrnInfoPtr pScrn); +extern _X_EXPORT void fbdevHWLeaveVT(ScrnInfoPtr pScrn); extern _X_EXPORT void fbdevHWDPMSSet(ScrnInfoPtr pScrn, int mode, int flags); extern _X_EXPORT Bool fbdevHWSaveScreen(ScreenPtr pScreen, int mode); diff --git a/xserver/hw/xfree86/fbdevhw/fbdevhwstub.c b/xserver/hw/xfree86/fbdevhw/fbdevhwstub.c index 6e0a470b8..7d554e60a 100644 --- a/xserver/hw/xfree86/fbdevhw/fbdevhwstub.c +++ b/xserver/hw/xfree86/fbdevhw/fbdevhwstub.c @@ -131,30 +131,30 @@ fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, } ModeStatus -fbdevHWValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags) +fbdevHWValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool verbose, int flags) { return MODE_ERROR; } Bool -fbdevHWSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) +fbdevHWSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode) { return FALSE; } void -fbdevHWAdjustFrame(int scrnIndex, int x, int y, int flags) +fbdevHWAdjustFrame(ScrnInfoPtr pScrn, int x, int y) { } Bool -fbdevHWEnterVT(int scrnIndex, int flags) +fbdevHWEnterVT(ScrnInfoPtr pScrn) { return FALSE; } void -fbdevHWLeaveVT(int scrnIndex, int flags) +fbdevHWLeaveVT(ScrnInfoPtr pScrn) { } diff --git a/xserver/hw/xfree86/fbdevhw/man/Makefile.in b/xserver/hw/xfree86/fbdevhw/man/Makefile.in index bc85b1452..6f6ef9d82 100644 --- a/xserver/hw/xfree86/fbdevhw/man/Makefile.in +++ b/xserver/hw/xfree86/fbdevhw/man/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -179,13 +179,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -207,6 +203,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -231,6 +228,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -246,7 +244,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -361,6 +358,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -480,7 +478,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/manpages.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/manpages.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -506,9 +504,9 @@ $(top_srcdir)/manpages.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/xfree86/fbdevhw/man/fbdevhw.man b/xserver/hw/xfree86/fbdevhw/man/fbdevhw.man index fe5d1e17b..fa46df08f 100644 --- a/xserver/hw/xfree86/fbdevhw/man/fbdevhw.man +++ b/xserver/hw/xfree86/fbdevhw/man/fbdevhw.man @@ -14,7 +14,7 @@ fbdev(__drivermansuffix__) is a non-accelerated driver which runs on top of the fbdevhw module. fbdevhw can be used by other drivers too, this is usually activated with `Option "UseFBDev"' in the device section. .SH "SEE ALSO" -__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), +Xorg(__appmansuffix__), xorg.conf(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__), fbdev(__drivermansuffix__) .SH AUTHORS diff --git a/xserver/hw/xfree86/i2c/Makefile.am b/xserver/hw/xfree86/i2c/Makefile.am index 0b80cc8a6..cb18db188 100644 --- a/xserver/hw/xfree86/i2c/Makefile.am +++ b/xserver/hw/xfree86/i2c/Makefile.am @@ -21,23 +21,23 @@ sdk_HEADERS = xf86i2c.h bt829.h fi1236.h msp3430.h tda8425.h tda9850.h tda9885.h # # i2c drivers # -bt829_drv_la_LDFLAGS = -module -avoid-version +bt829_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) bt829_drv_la_SOURCES = bt829.c bt829.h bt829_module.c -fi1236_drv_la_LDFLAGS = -module -avoid-version -fi1236_drv_la_SOURCES = fi1236.c fi1236.h fi1236_module.c +fi1236_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) +fi1236_drv_la_SOURCES = fi1236.c fi1236.h fi1236_module.c tda9885.c -msp3430_drv_la_LDFLAGS = -module -avoid-version +msp3430_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) msp3430_drv_la_SOURCES = msp3430.c msp3430.h msp3430_module.c -tda8425_drv_la_LDFLAGS = -module -avoid-version +tda8425_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) tda8425_drv_la_SOURCES = tda8425.c tda8425.h tda8425_module.c -tda9850_drv_la_LDFLAGS = -module -avoid-version +tda9850_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) tda9850_drv_la_SOURCES = tda9850.c tda9850.h tda9850_module.c -tda9885_drv_la_LDFLAGS = -module -avoid-version +tda9885_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) tda9885_drv_la_SOURCES = tda9885.c tda9885.h tda9885_module.c -uda1380_drv_la_LDFLAGS = -module -avoid-version +uda1380_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) uda1380_drv_la_SOURCES = uda1380.c uda1380.h uda1380_module.c diff --git a/xserver/hw/xfree86/i2c/Makefile.in b/xserver/hw/xfree86/i2c/Makefile.in index ddcf90a10..685bce41b 100644 --- a/xserver/hw/xfree86/i2c/Makefile.in +++ b/xserver/hw/xfree86/i2c/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -113,7 +113,7 @@ bt829_drv_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(bt829_drv_la_LDFLAGS) $(LDFLAGS) -o $@ fi1236_drv_la_LIBADD = -am_fi1236_drv_la_OBJECTS = fi1236.lo fi1236_module.lo +am_fi1236_drv_la_OBJECTS = fi1236.lo fi1236_module.lo tda9885.lo fi1236_drv_la_OBJECTS = $(am_fi1236_drv_la_OBJECTS) fi1236_drv_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ @@ -264,13 +264,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -292,6 +288,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -316,6 +313,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -331,7 +329,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -430,6 +427,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -548,25 +546,25 @@ sdk_HEADERS = xf86i2c.h bt829.h fi1236.h msp3430.h tda8425.h tda9850.h tda9885.h # # i2c drivers # -bt829_drv_la_LDFLAGS = -module -avoid-version +bt829_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) bt829_drv_la_SOURCES = bt829.c bt829.h bt829_module.c -fi1236_drv_la_LDFLAGS = -module -avoid-version -fi1236_drv_la_SOURCES = fi1236.c fi1236.h fi1236_module.c -msp3430_drv_la_LDFLAGS = -module -avoid-version +fi1236_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) +fi1236_drv_la_SOURCES = fi1236.c fi1236.h fi1236_module.c tda9885.c +msp3430_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) msp3430_drv_la_SOURCES = msp3430.c msp3430.h msp3430_module.c -tda8425_drv_la_LDFLAGS = -module -avoid-version +tda8425_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) tda8425_drv_la_SOURCES = tda8425.c tda8425.h tda8425_module.c -tda9850_drv_la_LDFLAGS = -module -avoid-version +tda9850_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) tda9850_drv_la_SOURCES = tda9850.c tda9850.h tda9850_module.c -tda9885_drv_la_LDFLAGS = -module -avoid-version +tda9885_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) tda9885_drv_la_SOURCES = tda9885.c tda9885.h tda9885_module.c -uda1380_drv_la_LDFLAGS = -module -avoid-version +uda1380_drv_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) uda1380_drv_la_SOURCES = uda1380.c uda1380.h uda1380_module.c all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -591,9 +589,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-multimediaLTLIBRARIES: $(multimedia_LTLIBRARIES) diff --git a/xserver/hw/xfree86/i2c/fi1236.c b/xserver/hw/xfree86/i2c/fi1236.c index 282fe7e34..2eb27ba6d 100644 --- a/xserver/hw/xfree86/i2c/fi1236.c +++ b/xserver/hw/xfree86/i2c/fi1236.c @@ -91,7 +91,7 @@ MT2032_getid(FI1236Ptr f) CARD8 in; in = 0x11; - I2C_WriteRead(&(f->d), (I2CByte *) & in, 1, out, 4); + I2C_WriteRead(&(f->d), (I2CByte *) &in, 1, out, 4); xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "MT2032: Company code 0x%02x%02x, part code 0x%02x, revision code 0x%02x\n", out[0], out[1], out[2], out[3]); @@ -432,7 +432,7 @@ MT2032_get_afc_hint(FI1236Ptr f) CARD8 AFC; in = 0x0e; - I2C_WriteRead(&(f->d), (I2CByte *) & in, 1, out, 2); + I2C_WriteRead(&(f->d), (I2CByte *) &in, 1, out, 2); AFC = (out[0] >> 4) & 0x7; #if 0 xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "AFC=%d TAD1=%d TAD2=%d\n", @@ -467,7 +467,7 @@ MT2032_dump_status(FI1236Ptr f) CARD8 TAD2, TAD1; in = 0x0e; - I2C_WriteRead(&(f->d), (I2CByte *) & in, 1, out, 2); + I2C_WriteRead(&(f->d), (I2CByte *) &in, 1, out, 2); XOK = out[0] & 1; LO1LK = (out[0] >> 2) & 1; LO2LK = (out[0] >> 1) & 1; @@ -589,12 +589,12 @@ FI1236_tune(FI1236Ptr f, CARD32 frequency) if ((f->type == TUNER_TYPE_FM1216ME) || (f->type == TUNER_TYPE_FI1236W)) { f->tuner_data.aux = 0x20; - I2C_WriteRead(&(f->d), (I2CByte *) & (f->tuner_data), 5, NULL, 0); + I2C_WriteRead(&(f->d), (I2CByte *) &(f->tuner_data), 5, NULL, 0); I2C_WriteRead(&(f->d), NULL, 0, &data, 1); xf86DrvMsg(f->d.pI2CBus->scrnIndex, X_INFO, "Tuner status %x\n", data); } else - I2C_WriteRead(&(f->d), (I2CByte *) & (f->tuner_data), 4, NULL, 0); + I2C_WriteRead(&(f->d), (I2CByte *) &(f->tuner_data), 4, NULL, 0); } void diff --git a/xserver/hw/xfree86/i2c/tda9850.c b/xserver/hw/xfree86/i2c/tda9850.c index c2ce6971f..d258bda05 100644 --- a/xserver/hw/xfree86/i2c/tda9850.c +++ b/xserver/hw/xfree86/i2c/tda9850.c @@ -131,6 +131,6 @@ tda9850_getstatus(TDA9850Ptr t) { CARD16 status; - I2C_WriteRead(&(t->d), NULL, 0, (I2CByte *) & status, 2); + I2C_WriteRead(&(t->d), NULL, 0, (I2CByte *) &status, 2); return status; } diff --git a/xserver/hw/xfree86/i2c/xf86i2c.c b/xserver/hw/xfree86/i2c/xf86i2c.c index 1273f4bab..2d261d4ce 100644 --- a/xserver/hw/xfree86/i2c/xf86i2c.c +++ b/xserver/hw/xfree86/i2c/xf86i2c.c @@ -709,6 +709,7 @@ xf86CreateI2CBusRec(void) if (b != NULL) { b->scrnIndex = -1; + b->pScrn = NULL; b->HoldTime = 5; /* 100 kHz bus */ b->BitTimeout = 5; b->ByteTimeout = 5; diff --git a/xserver/hw/xfree86/i2c/xf86i2c.h b/xserver/hw/xfree86/i2c/xf86i2c.h index 9a8fb21a3..e296d7d81 100644 --- a/xserver/hw/xfree86/i2c/xf86i2c.h +++ b/xserver/hw/xfree86/i2c/xf86i2c.h @@ -6,6 +6,7 @@ #define _XF86I2C_H #include "regionstr.h" +#include "xf86.h" typedef unsigned char I2CByte; typedef unsigned short I2CSlaveAddr; @@ -18,6 +19,7 @@ typedef struct _I2CDevRec *I2CDevPtr; typedef struct _I2CBusRec { char *BusName; int scrnIndex; + ScrnInfoPtr pScrn; void (*I2CUDelay) (I2CBusPtr b, int usec); diff --git a/xserver/hw/xfree86/int10/Makefile.in b/xserver/hw/xfree86/int10/Makefile.in index 6054aba50..fecfb479d 100644 --- a/xserver/hw/xfree86/int10/Makefile.in +++ b/xserver/hw/xfree86/int10/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -229,13 +229,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -257,6 +253,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -281,6 +278,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -296,7 +294,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -395,6 +392,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -531,7 +529,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -556,9 +554,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-moduleLTLIBRARIES: $(module_LTLIBRARIES) diff --git a/xserver/hw/xfree86/int10/generic.c b/xserver/hw/xfree86/int10/generic.c index 8614e0b9b..d7594def2 100644 --- a/xserver/hw/xfree86/int10/generic.c +++ b/xserver/hw/xfree86/int10/generic.c @@ -70,12 +70,12 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) void *base = 0; void *vbiosMem = 0; void *options = NULL; - int screen; legacyVGARec vga; + ScrnInfoPtr pScrn; - screen = (xf86FindScreenForEntity(entityIndex))->scrnIndex; + pScrn = xf86FindScreenForEntity(entityIndex); - options = xf86HandleInt10Options(xf86Screens[screen], entityIndex); + options = xf86HandleInt10Options(pScrn, entityIndex); if (int10skip(options)) { free(options); @@ -89,7 +89,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) pInt->mem = &genericMem; pInt->private = (pointer) xnfcalloc(1, sizeof(genericInt10Priv)); INTPriv(pInt)->alloc = (pointer) xnfcalloc(1, ALLOC_ENTRIES(getpagesize())); - pInt->scrnIndex = screen; + pInt->pScrn = pScrn; base = INTPriv(pInt)->base = xnfalloc(SYS_BIOS); /* FIXME: Shouldn't this be a failure case? Leaving dev as NULL seems like @@ -109,7 +109,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) INTPriv(pInt)->sysMem = sysMem; if (xf86ReadBIOS(0, 0, base, LOW_PAGE_SIZE) < 0) { - xf86DrvMsg(screen, X_ERROR, "Cannot read int vect\n"); + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Cannot read int vect\n"); goto error1; } @@ -148,7 +148,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) vbiosMem = (unsigned char *) base + bios_location; err = pci_device_read_rom(rom_device, vbiosMem); if (err) { - xf86DrvMsg(screen, X_ERROR, "Cannot read V_BIOS (3) %s\n", + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Cannot read V_BIOS (3) %s\n", strerror(err)); goto error1; } @@ -178,8 +178,9 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) */ vbiosMem = (char *) base + V_BIOS; memset(vbiosMem, 0, 2 * V_BIOS_SIZE); - if (pci_device_read_rom(pInt->dev, vbiosMem) < V_BIOS_SIZE) { - xf86DrvMsg(screen, X_WARNING, + if (pci_device_read_rom(pInt->dev, vbiosMem) != 0 + || pInt->dev->rom_size < V_BIOS_SIZE) { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Unable to retrieve all of segment 0x0C0000.\n"); } @@ -194,10 +195,10 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) vbiosMem = (unsigned char *) base + bios_location; if (xf86IsEntityPrimary(entityIndex)) { - if (int10_check_bios(screen, bios_location >> 4, vbiosMem)) + if (int10_check_bios(pScrn->scrnIndex, bios_location >> 4, vbiosMem)) done = TRUE; else - xf86DrvMsg(screen, X_INFO, + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "No legacy BIOS found -- trying PCI\n"); } if (!done) { @@ -207,7 +208,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) err = pci_device_read_rom(rom_device, vbiosMem); if (err) { - xf86DrvMsg(screen, X_ERROR, "Cannot read V_BIOS (5) %s\n", + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Cannot read V_BIOS (5) %s\n", strerror(err)); goto error1; } @@ -249,7 +250,6 @@ MapVRam(xf86Int10InfoPtr pInt) static void UnmapVRam(xf86Int10InfoPtr pInt) { - int screen = pInt->scrnIndex; int pagesize = getpagesize(); int size = ((VRAM_SIZE + pagesize - 1) / pagesize) * pagesize; diff --git a/xserver/hw/xfree86/int10/helper_exec.c b/xserver/hw/xfree86/int10/helper_exec.c index 1e908778f..1c58cf7ae 100644 --- a/xserver/hw/xfree86/int10/helper_exec.c +++ b/xserver/hw/xfree86/int10/helper_exec.c @@ -125,7 +125,7 @@ run_bios_int(int num, xf86Int10InfoPtr pInt) if (MEM_RW(pInt, (num << 2) + 2) == (SYS_BIOS >> 4)) { /* SYS_BIOS_SEG ? */ if (num == 21 && X86_AH == 0x4e) { - xf86DrvMsg(pInt->scrnIndex, X_NOTICE, + xf86DrvMsg(pInt->pScrn->scrnIndex, X_NOTICE, "Failing Find-Matching-File on non-PC" " (int 21, func 4e)\n"); X86_AX = 2; @@ -133,7 +133,7 @@ run_bios_int(int num, xf86Int10InfoPtr pInt) return 1; } else { - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "Ignoring int 0x%02x call\n", num); if (xf86GetVerbosity() > 3) { dump_registers(pInt); @@ -169,7 +169,7 @@ dump_code(xf86Int10InfoPtr pInt) int i; CARD32 lina = SEG_ADR((CARD32), X86_CS, IP); - xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3, "code at 0x%8.8" PRIx32 ":\n", + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_INFO, 3, "code at 0x%8.8" PRIx32 ":\n", lina); for (i = 0; i < 0x10; i++) xf86ErrorFVerb(3, " %2.2x", MEM_RB(pInt, lina + i)); @@ -182,19 +182,19 @@ dump_code(xf86Int10InfoPtr pInt) void dump_registers(xf86Int10InfoPtr pInt) { - xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_INFO, 3, "EAX=0x%8.8lx, EBX=0x%8.8lx, ECX=0x%8.8lx, EDX=0x%8.8lx\n", (unsigned long) X86_EAX, (unsigned long) X86_EBX, (unsigned long) X86_ECX, (unsigned long) X86_EDX); - xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_INFO, 3, "ESP=0x%8.8lx, EBP=0x%8.8lx, ESI=0x%8.8lx, EDI=0x%8.8lx\n", (unsigned long) X86_ESP, (unsigned long) X86_EBP, (unsigned long) X86_ESI, (unsigned long) X86_EDI); - xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_INFO, 3, "CS=0x%4.4x, SS=0x%4.4x," " DS=0x%4.4x, ES=0x%4.4x, FS=0x%4.4x, GS=0x%4.4x\n", X86_CS, X86_SS, X86_DS, X86_ES, X86_FS, X86_GS); - xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_INFO, 3, "EIP=0x%8.8lx, EFLAGS=0x%8.8lx\n", (unsigned long) X86_EIP, (unsigned long) X86_EFLAGS); } @@ -337,7 +337,7 @@ x_inb(CARD16 port) } else if (port < 0x0100) { /* Don't interfere with mainboard */ val = 0; - xf86DrvMsgVerb(Int10Current->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(Int10Current->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "inb 0x%4.4x\n", port); if (xf86GetVerbosity() > 3) { dump_registers(Int10Current); @@ -395,7 +395,7 @@ x_outb(CARD16 port, CARD8 val) #ifdef __NOT_YET__ } else if (port < 0x0100) { /* Don't interfere with mainboard */ - xf86DrvMsgVerb(Int10Current->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(Int10Current->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "outb 0x%4.4x,0x%2.2x\n", port, val); if (xf86GetVerbosity() > 3) { dump_registers(Int10Current); diff --git a/xserver/hw/xfree86/int10/helper_mem.c b/xserver/hw/xfree86/int10/helper_mem.c index 96c598a53..160c5aedf 100644 --- a/xserver/hw/xfree86/int10/helper_mem.c +++ b/xserver/hw/xfree86/int10/helper_mem.c @@ -281,7 +281,7 @@ xf86int10GetBiosLocationType(const xf86Int10InfoPtr pInt) #define CHECK_V_SEGMENT_RANGE(x) \ if (((x) << 4) < V_BIOS) { \ - xf86DrvMsg(pInt->scrnIndex, X_ERROR, \ + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, \ "V_BIOS address 0x%lx out of range\n", \ (unsigned long)(x) << 4); \ return FALSE; \ @@ -306,17 +306,17 @@ xf86int10GetBiosSegment(xf86Int10InfoPtr pInt, void *base) CHECK_V_SEGMENT_RANGE(cs); vbiosMem = (unsigned char *) base + (cs << 4); - if (int10_check_bios(pInt->scrnIndex, cs, vbiosMem)) { + if (int10_check_bios(pInt->pScrn->scrnIndex, cs, vbiosMem)) { break; } } if (segments[i] == ~0) { - xf86DrvMsg(pInt->scrnIndex, X_ERROR, "No V_BIOS found\n"); + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "No V_BIOS found\n"); return FALSE; } - xf86DrvMsg(pInt->scrnIndex, X_INFO, "Primary V_BIOS segment is: 0x%lx\n", + xf86DrvMsg(pInt->pScrn->scrnIndex, X_INFO, "Primary V_BIOS segment is: 0x%lx\n", (unsigned long) cs); pInt->BIOSseg = cs; diff --git a/xserver/hw/xfree86/int10/xf86int10.c b/xserver/hw/xfree86/int10/xf86int10.c index df347d4dd..5ead44f23 100644 --- a/xserver/hw/xfree86/int10/xf86int10.c +++ b/xserver/hw/xfree86/int10/xf86int10.c @@ -57,7 +57,7 @@ int_handler(xf86Int10InfoPtr pInt) ret = run_bios_int(num, pInt); if (!ret) { - xf86DrvMsg(pInt->scrnIndex, X_ERROR, "Halting on int 0x%2.2x!\n", num); + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Halting on int 0x%2.2x!\n", num); dump_registers(pInt); stack_trace(pInt); } @@ -257,7 +257,7 @@ int42_handler(xf86Int10InfoPtr pInt) /* DL = character column */ /* Not Implemented */ { /* Localise */ - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x04) -- Get Light Pen Position\n", pInt->num); if (xf86GetVerbosity() > 3) { @@ -314,10 +314,10 @@ int42_handler(xf86Int10InfoPtr pInt) /* Leave: Nothing */ /* Not Implemented */ { /* Localise */ - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x06) -- Initialise or Scroll Window Up\n", pInt->num); - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3, " AL=0x%2.2x, BH=0x%2.2x," " CH=0x%2.2x, CL=0x%2.2x, DH=0x%2.2x, DL=0x%2.2x\n", X86_AL, X86_BH, X86_CH, X86_CL, X86_DH, X86_DL); @@ -339,10 +339,10 @@ int42_handler(xf86Int10InfoPtr pInt) /* Leave: Nothing */ /* Not Implemented */ { /* Localise */ - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x07) -- Initialise or Scroll Window Down\n", pInt->num); - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3, " AL=0x%2.2x, BH=0x%2.2x," " CH=0x%2.2x, CL=0x%2.2x, DH=0x%2.2x, DL=0x%2.2x\n", X86_AL, X86_BH, X86_CH, X86_CL, X86_DH, X86_DL); @@ -360,10 +360,10 @@ int42_handler(xf86Int10InfoPtr pInt) /* AL = character */ /* Not Implemented */ { /* Localise */ - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x08) -- Read Character and Attribute at" " Cursor\n", pInt->num); - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3, "BH=0x%2.2x\n", X86_BH); if (xf86GetVerbosity() > 3) { dump_registers(pInt); @@ -382,10 +382,10 @@ int42_handler(xf86Int10InfoPtr pInt) /* Leave: Nothing */ /* Not Implemented */ { /* Localise */ - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x09) -- Write Character and Attribute at" " Cursor\n", pInt->num); - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3, "AL=0x%2.2x, BH=0x%2.2x, BL=0x%2.2x, CX=0x%4.4x\n", X86_AL, X86_BH, X86_BL, X86_CX); if (xf86GetVerbosity() > 3) { @@ -404,10 +404,10 @@ int42_handler(xf86Int10InfoPtr pInt) /* Leave: Nothing */ /* Not Implemented */ { /* Localise */ - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x0A) -- Write Character at Cursor\n", pInt->num); - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3, "AL=0x%2.2x, BH=0x%2.2x, BL=0x%2.2x, CX=0x%4.4x\n", X86_AL, X86_BH, X86_BL, X86_CX); if (xf86GetVerbosity() > 3) { @@ -450,10 +450,10 @@ int42_handler(xf86Int10InfoPtr pInt) /* Leave: Nothing */ /* Not Implemented */ { /* Localise */ - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x0C) -- Write Graphics Pixel\n", pInt->num); - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3, "AL=0x%2.2x, BH=0x%2.2x, CX=0x%4.4x, DX=0x%4.4x\n", X86_AL, X86_BH, X86_CX, X86_DX); if (xf86GetVerbosity() > 3) { @@ -471,10 +471,10 @@ int42_handler(xf86Int10InfoPtr pInt) /* Leave: AL = pixel value */ /* Not Implemented */ { /* Localise */ - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x0D) -- Read Graphics Pixel\n", pInt->num); - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3, "BH=0x%2.2x, CX=0x%4.4x, DX=0x%4.4x\n", X86_BH, X86_CX, X86_DX); if (xf86GetVerbosity() > 3) { @@ -498,10 +498,10 @@ int42_handler(xf86Int10InfoPtr pInt) /* which might or might not have been */ /* installed yet. */ { /* Localise */ - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x0E) -- Write Character in Teletype Mode\n", pInt->num); - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3, "AL=0x%2.2x, BH=0x%2.2x, BL=0x%2.2x\n", X86_AL, X86_BH, X86_BL); if (xf86GetVerbosity() > 3) { @@ -564,10 +564,10 @@ int42_handler(xf86Int10InfoPtr pInt) /* which might or might not have been */ /* installed yet. */ { /* Localise */ - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x13) -- Write String in Teletype Mode\n", pInt->num); - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3, "AL=0x%2.2x, BL=0x%2.2x, CX=0x%4.4x," " DH=0x%2.2x, DL=0x%2.2x, ES:BP=0x%4.4x:0x%4.4x\n", X86_AL, X86_BL, X86_CX, X86_DH, X86_DL, X86_ES, X86_BP); @@ -840,7 +840,7 @@ int1A_handler(xf86Int10InfoPtr pInt) #endif return 1; default: - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x1a subfunction\n"); dump_registers(pInt); if (xf86GetVerbosity() > 3) diff --git a/xserver/hw/xfree86/int10/xf86int10.h b/xserver/hw/xfree86/int10/xf86int10.h index 36b659fd7..6d564fc1a 100644 --- a/xserver/hw/xfree86/int10/xf86int10.h +++ b/xserver/hw/xfree86/int10/xf86int10.h @@ -21,10 +21,10 @@ /* int10 info structure */ typedef struct { int entityIndex; - int scrnIndex; - pointer cpuRegs; CARD16 BIOSseg; CARD16 inb40time; + ScrnInfoPtr pScrn; + pointer cpuRegs; char *BIOSScratch; int Flags; pointer private; diff --git a/xserver/hw/xfree86/loader/Makefile.am b/xserver/hw/xfree86/loader/Makefile.am index ebe0c813a..bd47a635b 100644 --- a/xserver/hw/xfree86/loader/Makefile.am +++ b/xserver/hw/xfree86/loader/Makefile.am @@ -2,7 +2,7 @@ noinst_LTLIBRARIES = libloader.la INCLUDES = $(XORG_INCS) -I$(srcdir)/../parser -I$(top_srcdir)/miext/cw \ -I$(srcdir)/../ddc -I$(srcdir)/../i2c -I$(srcdir)/../modes \ - -I$(srcdir)/../ramdac + -I$(srcdir)/../ramdac -I$(srcdir)/../dri -I$(srcdir)/../dri2 #AM_LDFLAGS = -r AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) @@ -14,7 +14,6 @@ EXTRA_DIST = \ libloader_la_SOURCES = \ loader.c \ loaderProcs.h \ - loadext.c \ loadmod.c \ os.c diff --git a/xserver/hw/xfree86/loader/Makefile.in b/xserver/hw/xfree86/loader/Makefile.in index ad4073fd0..afa115a71 100644 --- a/xserver/hw/xfree86/loader/Makefile.in +++ b/xserver/hw/xfree86/loader/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -75,7 +75,7 @@ CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = libloader_la_DEPENDENCIES = $(am__DEPENDENCIES_1) -am_libloader_la_OBJECTS = loader.lo loadext.lo loadmod.lo os.lo +am_libloader_la_OBJECTS = loader.lo loadmod.lo os.lo libloader_la_OBJECTS = $(am_libloader_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -182,13 +182,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -210,6 +206,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -234,6 +231,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -249,7 +247,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -348,6 +345,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -450,7 +448,7 @@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libloader.la INCLUDES = $(XORG_INCS) -I$(srcdir)/../parser -I$(top_srcdir)/miext/cw \ -I$(srcdir)/../ddc -I$(srcdir)/../i2c -I$(srcdir)/../modes \ - -I$(srcdir)/../ramdac + -I$(srcdir)/../ramdac -I$(srcdir)/../dri -I$(srcdir)/../dri2 #AM_LDFLAGS = -r @@ -462,7 +460,6 @@ EXTRA_DIST = \ libloader_la_SOURCES = \ loader.c \ loaderProcs.h \ - loadext.c \ loadmod.c \ os.c @@ -471,7 +468,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -496,9 +493,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): @@ -522,7 +519,6 @@ distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loader.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loadext.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/loadmod.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/os.Plo@am__quote@ diff --git a/xserver/hw/xfree86/loader/loader.c b/xserver/hw/xfree86/loader/loader.c index b72b8b89d..64c69bb8a 100644 --- a/xserver/hw/xfree86/loader/loader.c +++ b/xserver/hw/xfree86/loader/loader.c @@ -160,10 +160,16 @@ LoaderSymbol(const char *name) return NULL; } +void * +LoaderSymbolFromModule(void *handle, const char *name) +{ + return dlsym(handle, name); +} + void LoaderUnload(const char *name, void *handle) { - xf86Msg(X_INFO, "Unloading %s\n", name); + LogMessageVerbSigSafe(X_INFO, 1, "Unloading %s\n", name); if (handle) dlclose(handle); } @@ -189,13 +195,12 @@ LoaderGetABIVersion(const char *abiclass) const char *name; int version; } classes[] = { - { - ABI_CLASS_ANSIC, LoaderVersionInfo.ansicVersion}, { - ABI_CLASS_VIDEODRV, LoaderVersionInfo.videodrvVersion}, { - ABI_CLASS_XINPUT, LoaderVersionInfo.xinputVersion}, { - ABI_CLASS_EXTENSION, LoaderVersionInfo.extensionVersion}, { - ABI_CLASS_FONT, LoaderVersionInfo.fontVersion}, { - NULL, 0} + {ABI_CLASS_ANSIC, LoaderVersionInfo.ansicVersion}, + {ABI_CLASS_VIDEODRV, LoaderVersionInfo.videodrvVersion}, + {ABI_CLASS_XINPUT, LoaderVersionInfo.xinputVersion}, + {ABI_CLASS_EXTENSION, LoaderVersionInfo.extensionVersion}, + {ABI_CLASS_FONT, LoaderVersionInfo.fontVersion}, + {NULL, 0} }; int i; diff --git a/xserver/hw/xfree86/loader/loader.h b/xserver/hw/xfree86/loader/loader.h index 5cadd5ad6..c89c6410a 100644 --- a/xserver/hw/xfree86/loader/loader.h +++ b/xserver/hw/xfree86/loader/loader.h @@ -72,5 +72,6 @@ extern unsigned long LoaderOptions; /* Internal Functions */ void *LoaderOpen(const char *, int *, int *); +void *LoaderSymbolFromModule(void *, const char *); #endif /* _LOADER_H */ diff --git a/xserver/hw/xfree86/loader/loaderProcs.h b/xserver/hw/xfree86/loader/loaderProcs.h index a7b752b9a..8b4b53f28 100644 --- a/xserver/hw/xfree86/loader/loaderProcs.h +++ b/xserver/hw/xfree86/loader/loaderProcs.h @@ -80,7 +80,6 @@ ModuleDescPtr LoadModule(const char *, const char *, const char **, ModuleDescPtr DuplicateModule(ModuleDescPtr mod, ModuleDescPtr parent); void UnloadDriver(ModuleDescPtr); void LoaderSetPath(const char *path); -void LoaderSortExtensions(void); void LoaderUnload(const char *, void *); unsigned long LoaderGetModuleVersion(ModuleDescPtr mod); diff --git a/xserver/hw/xfree86/loader/loadext.c b/xserver/hw/xfree86/loader/loadext.c deleted file mode 100644 index daa1abf8d..000000000 --- a/xserver/hw/xfree86/loader/loadext.c +++ /dev/null @@ -1,440 +0,0 @@ -/* - * Copyright (c) 2000 by The XFree86 Project, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the copyright holder(s) - * and author(s) shall not be used in advertising or otherwise to promote - * the sale, use or other dealings in this Software without prior written - * authorization from the copyright holder(s) and author(s). - */ - -/* Maybe this file belongs elsewhere? */ - -#define LOADERDECLARATIONS -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "loaderProcs.h" -#include "misc.h" -#include "xf86.h" - -/* - * This should be static, but miinitext wants it. FIXME: make extension - * initialization not completely terrible. - */ -ExtensionModule *ExtensionModuleList = NULL; -static int numExtensionModules = 0; - -static ExtensionModule * -NewExtensionModule(void) -{ - ExtensionModule *save = ExtensionModuleList; - int n; - - /* Sanity check */ - if (!ExtensionModuleList) - numExtensionModules = 0; - - n = numExtensionModules + 1; - ExtensionModuleList = realloc(ExtensionModuleList, - (n + 1) * sizeof(ExtensionModule)); - if (ExtensionModuleList == NULL) { - ExtensionModuleList = save; - return NULL; - } - else { - numExtensionModules++; - ExtensionModuleList[numExtensionModules].name = NULL; - return ExtensionModuleList + (numExtensionModules - 1); - } -} - -void -LoadExtension(ExtensionModule * e, Bool builtin) -{ - ExtensionModule *newext; - - if (e == NULL || e->name == NULL) - return; - - if (!(newext = NewExtensionModule())) - return; - - if (builtin) - xf86MsgVerb(X_INFO, 2, "Initializing built-in extension %s\n", e->name); - else - xf86MsgVerb(X_INFO, 2, "Loading extension %s\n", e->name); - - newext->name = e->name; - newext->initFunc = e->initFunc; - newext->disablePtr = e->disablePtr; - newext->setupFunc = e->setupFunc; - newext->initDependencies = e->initDependencies; - - if (e->setupFunc != NULL) - e->setupFunc(); -} - -/* - * Sort ExtensionModuleList according to the initialisation order - * dependencies. The code for this is taken from BSD's tsort, - * and carries the following copyright/license: - * - * - * Copyright (c) 1989, 1993, 1994 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Michael Rendell of Memorial University of Newfoundland. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#define NF_MARK 0x1 /* marker for cycle detection */ -#define NF_ACYCLIC 0x2 /* this node is cycle free */ -#define NF_NODEST 0x4 /* Unreachable */ - -typedef struct node_str NODE; -struct node_str { - NODE **n_prevp; /* pointer to previous node's n_next */ - NODE *n_next; /* next node in graph */ - NODE **n_arcs; /* array of arcs to other nodes */ - int n_narcs; /* number of arcs in n_arcs[] */ - int n_arcsize; /* size of n_arcs[] array */ - int n_refcnt; /* # of arcs pointing to this node */ - int n_flags; /* NF_* */ - const char *n_name; /* name of this node */ -}; - -static NODE *graph = NULL, **cycle_buf = NULL, **longest_cycle = NULL; -static int longest = 0; -static NODE *sorted = NULL, *last = NULL; - -/* Find a node in the graph (insert if not found) and return a pointer to it. */ -static NODE * -get_node(const char *name) -{ - NODE *n; - - for (n = graph; n && n->n_name && strcmp(n->n_name, name); n = n->n_next); - if (n) - return n; - - n = xnfalloc(sizeof(NODE)); - - n->n_narcs = 0; - n->n_arcsize = 0; - n->n_arcs = NULL; - n->n_refcnt = 0; - n->n_flags = 0; - n->n_name = name; - - /* Add to linked list. */ - if ((n->n_next = graph) != NULL) - graph->n_prevp = &n->n_next; - n->n_prevp = &graph; - graph = n; - - return n; -} - -/* - * add an arc from node s1 to node s2 in the graph. If s1 or s2 are not in - * the graph, then add them. - */ -static void -add_arc(const char *s1, const char *s2) -{ - NODE *n1; - NODE *n2; - int bsize, i; - - n1 = get_node(s1); - - if (!strcmp(s1, s2)) - return; - - n2 = get_node(s2); - - /* - * Check if this arc is already here. - */ - for (i = 0; i < n1->n_narcs; i++) - if (n1->n_arcs[i] == n2) - return; - /* - * Add it. - */ - if (n1->n_narcs == n1->n_arcsize) { - if (!n1->n_arcsize) - n1->n_arcsize = 10; - bsize = n1->n_arcsize * sizeof(*n1->n_arcs) * 2; - n1->n_arcs = xnfrealloc(n1->n_arcs, bsize); - n1->n_arcsize = bsize / sizeof(*n1->n_arcs); - } - n1->n_arcs[n1->n_narcs++] = n2; - ++n2->n_refcnt; -} - -/* - * Clear the NODEST flag from all nodes. - */ -static void -clear_cycle(void) -{ - NODE *n; - - for (n = graph; n != NULL; n = n->n_next) - n->n_flags &= ~NF_NODEST; -} - -/* print node and remove from graph (does not actually free node) */ -static void -remove_node(NODE * n) -{ - NODE **np; - NODE *newnode; - int i; - -#ifdef DEBUG - ErrorF("%s\n", n->n_name); -#endif - newnode = xnfalloc(sizeof(NODE)); - memcpy(newnode, n, sizeof(NODE)); - if (last) - last->n_next = newnode; - else - sorted = newnode; - last = newnode; - newnode->n_next = NULL; - - for (np = n->n_arcs, i = n->n_narcs; --i >= 0; np++) - --(*np)->n_refcnt; - n->n_narcs = 0; - *n->n_prevp = n->n_next; - if (n->n_next) - n->n_next->n_prevp = n->n_prevp; -} - -static void -free_nodes(NODE * nodelist) -{ - NODE *n, *nextnode; - - for (n = nodelist; n;) { - nextnode = n->n_next; - free(n); - n = nextnode; - } -} - -/* look for the longest? cycle from node from to node to. */ -static int -find_cycle(NODE * from, NODE * to, int longest_len, int depth) -{ - NODE **np; - int i, len; - - /* - * avoid infinite loops and ignore portions of the graph known - * to be acyclic - */ - if (from->n_flags & (NF_NODEST | NF_MARK | NF_ACYCLIC)) - return 0; - from->n_flags |= NF_MARK; - - for (np = from->n_arcs, i = from->n_narcs; --i >= 0; np++) { - cycle_buf[depth] = *np; - if (*np == to) { - if (depth + 1 > longest_len) { - longest_len = depth + 1; - memcpy((char *) longest_cycle, - (char *) cycle_buf, longest_len * sizeof(NODE *)); - } - } - else { - if ((*np)->n_flags & (NF_MARK | NF_ACYCLIC | NF_NODEST)) - continue; - len = find_cycle(*np, to, longest_len, depth + 1); - -#ifdef DEBUG - ErrorF("%*s %s->%s %d\n", depth, "", from->n_name, to->n_name, len); -#endif - - if (len == 0) - (*np)->n_flags |= NF_NODEST; - - if (len > longest_len) - longest_len = len; - - if (len > 0 && !longest) - break; - } - } - from->n_flags &= ~NF_MARK; - return longest_len; -} - -/* do topological sort on graph */ -static void -tsort(void) -{ - NODE *n, *next; - int cnt, i; - - while (graph != NULL) { - /* - * Keep getting rid of simple cases until there are none left, - * if there are any nodes still in the graph, then there is - * a cycle in it. - */ - do { - for (cnt = 0, n = graph; n != NULL; n = next) { - next = n->n_next; - if (n->n_refcnt == 0) { - remove_node(n); - ++cnt; - } - } - } while (graph != NULL && cnt); - - if (graph == NULL) - break; - - if (!cycle_buf) { - /* - * Allocate space for two cycle logs - one to be used - * as scratch space, the other to save the longest - * cycle. - */ - for (cnt = 0, n = graph; n != NULL; n = n->n_next) - ++cnt; - cycle_buf = xnfalloc(sizeof(NODE *) * cnt); - longest_cycle = xnfalloc(sizeof(NODE *) * cnt); - if (cycle_buf == NULL || longest_cycle == NULL) - return; - } - for (n = graph; n != NULL; n = n->n_next) - if (!(n->n_flags & NF_ACYCLIC)) { - if ((cnt = find_cycle(n, n, 0, 0))) { - ErrorF("tsort: cycle in data"); - for (i = 0; i < cnt; i++) - ErrorF("%s", longest_cycle[i]->n_name); - remove_node(n); - clear_cycle(); - break; - } - else { - /* to avoid further checks */ - n->n_flags |= NF_ACYCLIC; - clear_cycle(); - } - } - - if (n == NULL) - ErrorF("tsort: internal error -- could not find cycle"); - } - free(cycle_buf); - free(longest_cycle); - if (graph) - free_nodes(graph); -} - -void -LoaderSortExtensions(void) -{ - int i, j; - ExtensionModule *ext, *newList; - NODE *node; - - graph = NULL; - longest = 0; - sorted = NULL; - last = NULL; - cycle_buf = NULL; - longest_cycle = NULL; - - /* - * Parse list and build the graph. Enter them in reverse order - * because tsort() will reverse those that have no depedencies. - */ - for (i = numExtensionModules - 1; i >= 0; i--) { - ext = &ExtensionModuleList[i]; - add_arc(ext->name, ext->name); -#ifdef DEBUG - ErrorF("Extension %s:\n", ext->name); -#endif - if (ext->initDependencies) - for (j = 0; ext->initDependencies[j]; j++) { - add_arc(ext->initDependencies[j], ext->name); -#ifdef DEBUG - ErrorF("\t%s\n", ext->initDependencies[j]); -#endif - } - } - tsort(); - newList = xnfalloc((numExtensionModules + 1) * sizeof(ExtensionModule)); - i = 0; - for (node = sorted; node; node = node->n_next) { - for (j = 0; j < numExtensionModules; j++) - if (!strcmp(node->n_name, ExtensionModuleList[j].name)) - break; - if (j != numExtensionModules) - newList[i++] = ExtensionModuleList[j]; - } - if (sorted) - free_nodes(sorted); - if (graph) - free_nodes(graph); - newList[i].name = NULL; - free(ExtensionModuleList); - ExtensionModuleList = newList; -#ifdef DEBUG - for (i = 0; ExtensionModuleList[i].name; i++) - ErrorF("Extension %s\n", ExtensionModuleList[i].name); -#endif -} diff --git a/xserver/hw/xfree86/loader/loadmod.c b/xserver/hw/xfree86/loader/loadmod.c index c6b559072..2347b8e5b 100644 --- a/xserver/hw/xfree86/loader/loadmod.c +++ b/xserver/hw/xfree86/loader/loadmod.c @@ -212,9 +212,15 @@ static const char *stdSubdirs[] = { * to port this DDX to, say, Darwin, we'll need to fix this. */ static PatternRec stdPatterns[] = { +#ifdef __CYGWIN__ + {"^cyg(.*)\\.dll$",}, + {"(.*)_drv\\.dll$",}, + {"(.*)\\.dll$",}, +#else {"^lib(.*)\\.so$",}, {"(.*)_drv\\.so$",}, {"(.*)\\.so$",}, +#endif {NULL,} }; @@ -408,21 +414,33 @@ FindModuleInSubdir(const char *dirpath, const char *module) continue; } +#ifdef __CYGWIN__ + snprintf(tmpBuf, PATH_MAX, "cyg%s.dll", module); +#else snprintf(tmpBuf, PATH_MAX, "lib%s.so", module); +#endif if (strcmp(direntry->d_name, tmpBuf) == 0) { if (asprintf(&ret, "%s%s", dirpath, tmpBuf) == -1) ret = NULL; break; } +#ifdef __CYGWIN__ + snprintf(tmpBuf, PATH_MAX, "%s_drv.dll", module); +#else snprintf(tmpBuf, PATH_MAX, "%s_drv.so", module); +#endif if (strcmp(direntry->d_name, tmpBuf) == 0) { if (asprintf(&ret, "%s%s", dirpath, tmpBuf) == -1) ret = NULL; break; } +#ifdef __CYGWIN__ + snprintf(tmpBuf, PATH_MAX, "%s.dll", module); +#else snprintf(tmpBuf, PATH_MAX, "%s.so", module); +#endif if (strcmp(direntry->d_name, tmpBuf) == 0) { if (asprintf(&ret, "%s%s", dirpath, tmpBuf) == -1) ret = NULL; @@ -815,6 +833,11 @@ static const char *compiled_in_modules[] = { "ddc", "i2c", "ramdac", + "dbe", + "record", + "extmod", + "dri", + "dri2", NULL }; @@ -938,7 +961,7 @@ doLoadModule(const char *module, const char *path, const char **subdirlist, *errmin = 0; goto LoadModule_fail; } - initdata = LoaderSymbol(p); + initdata = LoaderSymbolFromModule(ret->handle, p); if (initdata) { ModuleSetupProc setup; ModuleTearDownProc teardown; @@ -974,10 +997,6 @@ doLoadModule(const char *module, const char *path, const char **subdirlist, ret->VersionInfo = vers; } else { - /* No initdata is OK for external modules */ - if (options == EXTERN_MODULE) - goto LoadModule_exit; - /* no initdata, fail the load */ xf86Msg(X_ERROR, "LoadModule: Module %s does not have a %s " "data object.\n", module, p); @@ -1075,9 +1094,10 @@ UnloadModuleOrDriver(ModuleDescPtr mod) return; if (mod->parent) - xf86MsgVerb(X_INFO, 3, "UnloadSubModule: \"%s\"\n", mod->name); + LogMessageVerbSigSafe(X_INFO, 3, "UnloadSubModule: \"%s\"\n", + mod->name); else - xf86MsgVerb(X_INFO, 3, "UnloadModule: \"%s\"\n", mod->name); + LogMessageVerbSigSafe(X_INFO, 3, "UnloadModule: \"%s\"\n", mod->name); if (mod->TearDownData != ModuleDuplicated) { if ((mod->TearDownProc) && (mod->TearDownData)) diff --git a/xserver/hw/xfree86/man/Makefile.in b/xserver/hw/xfree86/man/Makefile.in index 074007c68..9fe275955 100644 --- a/xserver/hw/xfree86/man/Makefile.in +++ b/xserver/hw/xfree86/man/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -179,13 +179,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -207,6 +203,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -231,6 +228,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -246,7 +244,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -361,6 +358,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -481,7 +479,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/manpages.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/manpages.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -507,9 +505,9 @@ $(top_srcdir)/manpages.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/xfree86/man/Xorg.man b/xserver/hw/xfree86/man/Xorg.man index 0c469129f..a48c4e8dd 100644 --- a/xserver/hw/xfree86/man/Xorg.man +++ b/xserver/hw/xfree86/man/Xorg.man @@ -1,16 +1,16 @@ .\" $XdotOrg: xserver/xorg/hw/xfree86/doc/man/Xorg.man.pre,v 1.3 2005/07/04 18:41:01 ajax Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH __xservername__ __appmansuffix__ __vendorversion__ +.TH Xorg __appmansuffix__ __vendorversion__ .SH NAME -__xservername__ - X11R7 X server +Xorg - X11R7 X server .SH SYNOPSIS -.B __xservername__ +.B Xorg .RI [\fB:\fP display ] .RI [ option .IR ... ] .SH DESCRIPTION -.B __xservername__ +.B Xorg is a full featured X server that was originally designed for UNIX and UNIX-like operating systems running on Intel x86 hardware. It now runs on a wider range of hardware and OS platforms. @@ -24,7 +24,7 @@ by Thomas Roell which was contributed to X11R5 by Snitily Graphics Consulting Service. .SH PLATFORMS .PP -.B __xservername__ +.B Xorg operates under a wide range of operating systems and hardware platforms. The Intel x86 (IA32) architecture is the most widely supported hardware platform. Other hardware platforms include Compaq Alpha, Intel IA64, AMD64, @@ -37,7 +37,7 @@ Xquartz(__appmansuffix__) X server. Win32/Cygwin is supported with the XWin(__appmansuffix__) X server. .PP .SH "NETWORK CONNECTIONS" -.B __xservername__ +.B Xorg supports connections made using the following reliable byte-streams: .TP 4 @@ -47,7 +47,7 @@ On some System V platforms, the "local" connection types also include STREAMS pipes, named pipes, and some other mechanisms. .TP 4 .I TCP\/IP -.B __xservername__ +.B Xorg listens on port .RI 6000+ n , where @@ -108,10 +108,10 @@ file. If you use xdm(1), the definitions should be early on in the .I __projectroot__/lib/X11/xdm/Xsession script. .SH OPTIONS -.B __xservername__ +.B Xorg supports several mechanisms for supplying/obtaining configuration and run-time parameters: command line options, environment variables, the -__xconfigfile__(__filemansuffix__) configuration files, auto-detection, and +xorg.conf(__filemansuffix__) configuration files, auto-detection, and fallback defaults. When the same information is supplied in more than one way, the highest precedence mechanism is used. The list of mechanisms is ordered from highest precedence to lowest. Note that not all parameters @@ -119,21 +119,21 @@ can be supplied via all methods. The available command line options and environment variables (and some defaults) are described here and in the Xserver(__appmansuffix__) manual page. Most configuration file parameters, with their defaults, are described in the -__xconfigfile__(__filemansuffix__) manual page. Driver and module specific +xorg.conf(__filemansuffix__) manual page. Driver and module specific configuration parameters are described in the relevant driver or module manual page. .PP In addition to the normal server options described in the Xserver(__appmansuffix__) manual page, -.B __xservername__ +.B Xorg accepts the following command line switches: .TP 8 .BI vt XX .I XX specifies the Virtual Terminal device number which -.B __xservername__ +.B Xorg will use. Without this option, -.B __xservername__ +.B Xorg will pick the first available Virtual Terminal that it can locate. This option applies only to platforms that have virtual terminal support, such as Linux, BSD, OpenSolaris, SVR3, and SVR4. @@ -142,14 +142,14 @@ as Linux, BSD, OpenSolaris, SVR3, and SVR4. Allow the server to start up even if the mouse device can't be opened or initialised. This is equivalent to the .B AllowMouseOpenFail -__xconfigfile__(__filemansuffix__) file option. +xorg.conf(__filemansuffix__) file option. .TP 8 .B \-allowNonLocalXvidtune Make the VidMode extension available to remote clients. This allows the xvidtune client to connect from another host. This is equivalent to the .B AllowNonLocalXvidtune -__xconfigfile__(__filemansuffix__) file option. By default non-local +xorg.conf(__filemansuffix__) file option. By default non-local connections are not allowed. .TP 8 .BI \-bgamma " value" @@ -187,9 +187,9 @@ config directory search path for all other users. .TP 8 .B \-configure When this option is specified, the -.B __xservername__ +.B Xorg server loads all video driver modules, probes for available hardware, -and writes out an initial __xconfigfile__(__filemansuffix__) file based on +and writes out an initial xorg.conf(__filemansuffix__) file based on what was detected. This option currently has some problems on some platforms, but in most cases it is a good way to bootstrap the configuration process. This option is only available when the server @@ -209,7 +209,7 @@ Disable the parts of the VidMode extension (used by the xvidtune client) that can be used to change the video modes. This is equivalent to the .B DisableVidModeExtension -__xconfigfile__(__filemansuffix__) file option. +xorg.conf(__filemansuffix__) file option. .TP 8 .B \-fbbpp \fIn\fP Sets the number of framebuffer bits per pixel. You should only set this @@ -249,7 +249,7 @@ options. .TP 8 .B \-ignoreABI The -.B __xservername__ +.B Xorg server checks the ABI revision levels of each module that it loads. It will normally refuse to load modules with ABI revisions that are newer than the server's. This is because such modules might use interfaces @@ -284,7 +284,7 @@ This option is only useful when debugging the server. Not all platforms support (or can use) this option. .TP 8 .BI \-keyboard " keyboard-name" -Use the __xconfigfile__(__filemansuffix__) file +Use the xorg.conf(__filemansuffix__) file .B InputDevice section called .I keyboard-name @@ -296,7 +296,7 @@ section and this option, the first relevant section is used for the core keyboard. .TP 8 .BI \-layout " layout-name" -Use the __xconfigfile__(__filemansuffix__) file +Use the xorg.conf(__filemansuffix__) file .B Layout section called .IR layout-name . @@ -308,20 +308,20 @@ section is used. Use the file called .I filename as the -.B __xservername__ +.B Xorg server log file. The default log file is -.BI __logdir__/__xservername__. n .log +.BI __logdir__/Xorg. n .log on most platforms, where .I n is the display number of the -.B __xservername__ +.B Xorg server. The default may be in a different directory on some platforms. This option is only available when the server is run as root (i.e, with real-uid 0). .TP 8 .BR \-logverbose " [\fIn\fP]" Sets the verbosity level for information printed to the -.B __xservername__ +.B Xorg server log file. If the .I n value isn't supplied, each occurrence of this option increments the log @@ -335,7 +335,7 @@ Set the module search path to .IR searchpath . .I searchpath is a comma separated list of directories to search for -.B __xservername__ +.B Xorg server modules. This option is only available when the server is run as root (i.e, with real-uid 0). .TP 8 @@ -353,16 +353,16 @@ reason to use this option. Some client applications don't like this pixmap format, even though it is a perfectly legal format. This is equivalent to the .B Pixmap -__xconfigfile__(__filemansuffix__) file option. +xorg.conf(__filemansuffix__) file option. .TP 8 .B \-pixmap32 Set the internal pixmap format for depth 24 pixmaps to 32 bits per pixel. This is usually the default. This is equivalent to the .B Pixmap -__xconfigfile__(__filemansuffix__) file option. +xorg.conf(__filemansuffix__) file option. .TP 8 .BI \-pointer " pointer-name" -Use the __xconfigfile__(__filemansuffix__) file +Use the xorg.conf(__filemansuffix__) file .B InputDevice section called .I pointer-name @@ -392,7 +392,7 @@ options. Share virtual terminals with another X server, if supported by the OS. .TP 8 .BI \-screen " screen-name" -Use the __xconfigfile__(__filemansuffix__) file +Use the xorg.conf(__filemansuffix__) file .B Screen section called .IR screen-name . @@ -442,7 +442,7 @@ support. .SH "KEYBOARD" .PP The -.B __xservername__ +.B Xorg server is normally configured to recognize various special combinations of key presses that instruct the server to perform some action, rather than just sending the key press event to a client application. These actions @@ -456,7 +456,7 @@ keymap. Immediately kills the server -- no questions asked. It can be disabled by setting the .B DontZap -__xconfigfile__(__filemansuffix__) file option to a TRUE value. +xorg.conf(__filemansuffix__) file option to a TRUE value. .PP .RS 8 It should be noted that zapping is triggered by the @@ -470,43 +470,43 @@ but can be enabled with the XKB option Change video mode to next one specified in the configuration file. This can be disabled with the .B DontZoom -__xconfigfile__(__filemansuffix__) file option. +xorg.conf(__filemansuffix__) file option. .TP 8 .B Ctrl+Alt+Keypad-Minus Change video mode to previous one specified in the configuration file. This can be disabled with the .B DontZoom -__xconfigfile__(__filemansuffix__) file option. +xorg.conf(__filemansuffix__) file option. .TP 8 .B Ctrl+Alt+F1...F12 For systems with virtual terminal support, these keystroke combinations are used to switch to virtual terminals 1 through 12, respectively. This can be disabled with the .B DontVTSwitch -__xconfigfile__(__filemansuffix__) file option. +xorg.conf(__filemansuffix__) file option. .SH CONFIGURATION -.B __xservername__ +.B Xorg typically uses a configuration file called -.B __xconfigfile__ +.B xorg.conf and configuration files with the suffix .I .conf in a directory called .B __xconfigdir__ for its initial setup. -Refer to the __xconfigfile__(__filemansuffix__) manual page for information +Refer to the xorg.conf(__filemansuffix__) manual page for information about the format of this file. .PP -.B __xservername__ +.B Xorg has a mechanism for automatically generating a built-in configuration at run-time when no -.B __xconfigfile__ +.B xorg.conf file or .B __xconfigdir__ files are present. The current version of this automatic configuration mechanism works in two ways. .PP The first is via enhancements that have made many components of the -.B __xconfigfile__ +.B xorg.conf file optional. This means that information that can be probed or reasonably deduced doesn't need to be specified explicitly, greatly reducing the amount of built-in configuration information that needs to @@ -514,33 +514,33 @@ be generated at run-time. .PP The second is to have "safe" fallbacks for most configuration information. This maximises the likelihood that the -.B __xservername__ +.B Xorg server will start up in some usable configuration even when information about the specific hardware is not available. .PP -The automatic configuration support for __xservername__ is work in progress. +The automatic configuration support for Xorg is work in progress. It is currently aimed at the most popular hardware and software platforms -supported by __xservername__. Enhancements are planned for future releases. +supported by Xorg. Enhancements are planned for future releases. .SH FILES The -.B __xservername__ +.B Xorg server config files can be found in a range of locations. These are -documented fully in the __xconfigfile__(__filemansuffix__) manual page. The +documented fully in the xorg.conf(__filemansuffix__) manual page. The most commonly used locations are shown here. .TP 30 -.B /etc/X11/__xconfigfile__ +.B /etc/X11/xorg.conf Server configuration file. .TP 30 -.B /etc/X11/__xconfigfile__-4 +.B /etc/X11/xorg.conf-4 Server configuration file. .TP 30 -.B /etc/__xconfigfile__ +.B /etc/xorg.conf Server configuration file. .TP 30 -.B __projectroot__/etc/__xconfigfile__ +.B __projectroot__/etc/xorg.conf Server configuration file. .TP 30 -.B __projectroot__/lib/X11/__xconfigfile__ +.B __projectroot__/lib/X11/xorg.conf Server configuration file. .TP 30 .B /etc/X11/__xconfigdir__ @@ -558,7 +558,7 @@ Server configuration directory. .B __projectroot__/lib/X11/__xconfigdir__ Server configuration directory. .TP 30 -.BI __logdir__/__xservername__. n .log +.BI __logdir__/Xorg. n .log Server log file for display .IR n . .TP 30 @@ -588,7 +588,7 @@ Initial access control list for display .IR n . .SH "SEE ALSO" X(__miscmansuffix__), Xserver(__appmansuffix__), xdm(__appmansuffix__), xinit(__appmansuffix__), -__xconfigfile__(__filemansuffix__), xvidtune(__appmansuffix__), +xorg.conf(__filemansuffix__), xvidtune(__appmansuffix__), xkeyboard-config (__miscmansuffix__), apm(__drivermansuffix__), ati(__drivermansuffix__), @@ -631,15 +631,15 @@ Web site .IR . .SH AUTHORS -__xservername__ has many contributors world wide. The names of most of them +Xorg has many contributors world wide. The names of most of them can be found in the documentation, ChangeLog files in the source tree, and in the actual source code. .PP -__xservername__ was originally based on XFree86 4.4rc2. +Xorg was originally based on XFree86 4.4rc2. That was originally based on \fIX386 1.2\fP by Thomas Roell, which was contributed to the then X Consortium's X11R5 distribution by SGCS. .PP -__xservername__ is released by the X.Org Foundation. +Xorg is released by the X.Org Foundation. .PP The project that became XFree86 was originally founded in 1992 by David Dawes, Glenn Lai, Jim Tsillas and David Wexelblat. @@ -679,7 +679,7 @@ Orest Zborowski \fIorestz@eskimo.com\fP .fi .RE .PP -__xservername__ source is available from the FTP server +Xorg source is available from the FTP server \fI\fP, and from the X.Org server \fI\fP. Documentation and other information can be found from the X.Org web site @@ -687,10 +687,10 @@ information can be found from the X.Org web site .SH LEGAL .PP -.B __xservername__ +.B Xorg is copyright software, provided under licenses that permit modification and redistribution in source and binary form without fee. -.B __xservername__ is copyright by numerous authors and +.B Xorg is copyright by numerous authors and contributors from around the world. Licensing information can be found at .IR . diff --git a/xserver/hw/xfree86/man/xorg.conf.man b/xserver/hw/xfree86/man/xorg.conf.man index c1b3c4f2d..9361ce978 100644 --- a/xserver/hw/xfree86/man/xorg.conf.man +++ b/xserver/hw/xfree86/man/xorg.conf.man @@ -1,35 +1,35 @@ .\" shorthand for double quote that works everywhere. .ds q \N'34' -.TH __xconfigfile__ __filemansuffix__ __vendorversion__ +.TH xorg.conf __filemansuffix__ __vendorversion__ .SH NAME -__xconfigfile__, __xconfigdir__ \- configuration files for -__xservername__ X server +xorg.conf, __xconfigdir__ \- configuration files for +Xorg X server .SH INTRODUCTION -.B __xservername__ +.B Xorg supports several mechanisms for supplying/obtaining configuration and run-time parameters: command line options, environment variables, the -__xconfigfile__ and __xconfigdir__ configuration files, auto-detection, +xorg.conf and __xconfigdir__ configuration files, auto-detection, and fallback defaults. When the same information is supplied in more than one way, the highest precedence mechanism is used. The list of mechanisms is ordered from highest precedence to lowest. Note that not all parameters can be supplied via all methods. The available command line options and environment variables (and some defaults) are described in the Xserver(__appmansuffix__) and -__xservername__(__appmansuffix__) manual pages. Most configuration file +Xorg(__appmansuffix__) manual pages. Most configuration file parameters, with their defaults, are described below. Driver and module specific configuration parameters are described in the relevant driver or module manual page. .SH DESCRIPTION -.B __xservername__ +.B Xorg uses a configuration file called -.I __xconfigfile__ +.I xorg.conf and files ending in the suffix .I .conf from the directory .I __xconfigdir__ for its initial setup. The -.I __xconfigfile__ +.I xorg.conf configuration file is searched for in the following places when the server is started as a normal user: .PP @@ -39,12 +39,12 @@ server is started as a normal user: .IR __projectroot__/etc/X11/ .IB /etc/X11/ $XORGCONFIG .IB __projectroot__/etc/X11/ $XORGCONFIG -.I /etc/X11/__xconfigfile__ -.I /etc/__xconfigfile__ -.IR __projectroot__/etc/X11/__xconfigfile__. -.I __projectroot__/etc/X11/__xconfigfile__ -.IR __projectroot__/lib/X11/__xconfigfile__. -.I __projectroot__/lib/X11/__xconfigfile__ +.I /etc/X11/xorg.conf +.I /etc/xorg.conf +.IR __projectroot__/etc/X11/xorg.conf. +.I __projectroot__/etc/X11/xorg.conf +.IR __projectroot__/lib/X11/xorg.conf. +.I __projectroot__/lib/X11/xorg.conf .fi .RE .PP @@ -60,7 +60,7 @@ environment variable, and is the machine's hostname as reported by .BR gethostname (__libmansuffix__). .PP -When the __xservername__ server is started by the \(lqroot\(rq user, the config file +When the Xorg server is started by the \(lqroot\(rq user, the config file search locations are as follows: .PP .RS 4 @@ -71,12 +71,12 @@ search locations are as follows: .B $XORGCONFIG .IB /etc/X11/ $XORGCONFIG .IB __projectroot__/etc/X11/ $XORGCONFIG -.I /etc/X11/__xconfigfile__ -.I /etc/__xconfigfile__ -.IR __projectroot__/etc/X11/__xconfigfile__. -.I __projectroot__/etc/X11/__xconfigfile__ -.IR __projectroot__/lib/X11/__xconfigfile__. -.I __projectroot__/lib/X11/__xconfigfile__ +.I /etc/X11/xorg.conf +.I /etc/xorg.conf +.IR __projectroot__/etc/X11/xorg.conf. +.I __projectroot__/etc/X11/xorg.conf +.IR __projectroot__/lib/X11/xorg.conf. +.I __projectroot__/lib/X11/xorg.conf .fi .RE .PP @@ -113,7 +113,7 @@ is a relative path (with no \(lq..\(rq components) specified with the .B \-configdir command line option. .PP -When the __xservername__ server is started by the \(lqroot\(rq user, the +When the Xorg server is started by the \(lqroot\(rq user, the config directory search locations are as follows: .PP .RS 4 @@ -145,7 +145,7 @@ These files are found in the following directories: .RE .PP The -.I __xconfigfile__ +.I xorg.conf and .I __xconfigdir__ files are composed of a number of sections which may be present in any order, @@ -331,7 +331,7 @@ section is used to specify some path names required by the server. Some of these paths can also be set from the command line (see .BR Xserver (__appmansuffix__) and -.BR __xservername__ (__appmansuffix__)). +.BR Xorg (__appmansuffix__)). The command line settings override the values specified in the config file. The @@ -342,7 +342,7 @@ The entries that can appear in this section are: .TP 7 .BI "FontPath \*q" path \*q sets the search path for fonts. -This path is a comma separated list of font path elements which the __xservername__ +This path is a comma separated list of font path elements which the Xorg server searches for font databases. Multiple .B FontPath @@ -426,8 +426,8 @@ font path when the server starts up. .RE .TP 7 .BI "ModulePath \*q" path \*q -sets the search path for loadable __xservername__ server modules. -This path is a comma separated list of directories which the __xservername__ server +sets the search path for loadable Xorg server modules. +This path is a comma separated list of directories which the Xorg server searches for loadable modules loading in the order specified. Multiple .B ModulePath @@ -441,17 +441,17 @@ __modulepath__ .ig .TP 7 .BI "LogFile \*q" path \*q -sets the name of the __xservername__ server log file. +sets the name of the Xorg server log file. The default log file name is .PP .RS 11 -.RI __logdir__/__xservername__. .log +.RI __logdir__/Xorg. .log .RE .PP .RS 7 where .I -is the display number for the __xservername__ server. +is the display number for the Xorg server. .. .TP 7 .BI "XkbDir \*q" path \*q @@ -466,7 +466,7 @@ __xkbdir__ In addition to options specific to this section (described below), the .B ServerFlags section is used to specify some global -__xservername__ server options. +Xorg server options. All of the entries in this section are .BR Options , although for compatibility purposes some of the old style entries are @@ -498,20 +498,20 @@ section to use in the absence of the command line option. .TP 7 .BI "Option \*qNoTrapSignals\*q \*q" boolean \*q -This prevents the __xservername__ server from trapping a range of unexpected fatal +This prevents the Xorg server from trapping a range of unexpected fatal signals and exiting cleanly. -Instead, the __xservername__ server will die and drop core where the fault occurred. -The default behaviour is for the __xservername__ server to exit cleanly, but still drop a +Instead, the Xorg server will die and drop core where the fault occurred. +The default behaviour is for the Xorg server to exit cleanly, but still drop a core file. -In general you never want to use this option unless you are debugging an __xservername__ +In general you never want to use this option unless you are debugging an Xorg server problem and know how to deal with the consequences. .TP 7 .BI "Option \*qUseSIGIO\*q \*q" boolean \*q -This controls whether the __xservername__ server requests that events from +This controls whether the Xorg server requests that events from input devices be reported via a SIGIO signal handler (also known as SIGPOLL on some platforms), or only reported via the standard select(3) loop. The default behaviour is platform specific. In general you do not want to -use this option unless you are debugging the __xservername__ server, or +use this option unless you are debugging the Xorg server, or working around a specific bug until it is fixed, and understand the consequences. .TP 7 @@ -531,7 +531,7 @@ Default: off. This disallows the use of the .B Terminate_Server XKB action (usually on Ctrl+Alt+Backspace, depending on XKB options). -This action is normally used to terminate the __xservername__ server. +This action is normally used to terminate the Xorg server. When this option is enabled, the action has no effect. Default: off. .TP 7 @@ -568,7 +568,7 @@ sets the inactivity timeout for the phase of the screensaver. .I time is in minutes. -This is equivalent to the __xservername__ server's +This is equivalent to the Xorg server's .B \-s flag, and the value can be changed at run\-time with .BR xset(__appmansuffix__). @@ -679,9 +679,9 @@ Unset by default. .SH "MODULE SECTION" The .B Module -section is used to specify which __xservername__ server modules should be loaded. -This section is ignored when the __xservername__ server is built in static form. -The type of modules normally loaded in this section are __xservername__ server +section is used to specify which Xorg server modules should be loaded. +This section is ignored when the Xorg server is built in static form. +The type of modules normally loaded in this section are Xorg server extension modules. Most other module types are loaded automatically when they are needed via other mechanisms. @@ -701,7 +701,7 @@ This instructs the server to load the module called The module name given should be the module's standard name, not the module file name. The standard name is case\-sensitive, and does not include the \(lqlib\(rq -prefix, or the \(lq.a\(rq, \(lq.o\(rq, or \(lq.so\(rq suffixes. +or \(lqcyg\(rq prefixes, or the \(lq.so\(rq or \(lq.dll\(rq suffixes. .PP .RS 7 Example: the DRI extension module can be loaded with the following entry: @@ -1324,14 +1324,14 @@ recommends that you do. .BI "ClockChip \*q" clockchip\-type \*q This optional entry is used to specify the clock chip type on graphics boards which have a programmable clock generator. -Only a few __xservername__ drivers support programmable clock chips. +Only a few Xorg drivers support programmable clock chips. For details, see the appropriate driver manual page. .TP 7 .BI "VideoRam " "mem" This optional entry specifies the amount of video ram that is installed on the graphics board. This is measured in kBytes. -In most cases this is not required because the __xservername__ server probes +In most cases this is not required because the Xorg server probes the graphics board to determine this quantity. The driver-specific documentation should indicate when it might be needed. .TP 7 @@ -1481,7 +1481,7 @@ if or .B Hz is added to the end of the line. -The data given here is used by the __xservername__ server to determine if video +The data given here is used by the Xorg server to determine if video modes are within the specifications of the monitor. This information should be available in the monitor's handbook. If this entry is omitted, a default range of 28\-33kHz is used. @@ -1500,7 +1500,7 @@ if or .B kHz is added to the end of the line. -The data given here is used by the __xservername__ server to determine if video +The data given here is used by the Xorg server to determine if video modes are within the specifications of the monitor. This information should be available in the monitor's handbook. If this entry is omitted, a default range of 43\-72Hz is used. @@ -1821,9 +1821,7 @@ sections have the following format: .PP The .B Identifier -and -.B Device -entries are mandatory. +entry is mandatory. All others are optional. .PP The @@ -1841,11 +1839,10 @@ The entries available for this section are: .TP 7 .BI "Device \*q" device\-id \*q -This mandatory entry specifies the +This entry specifies the .B Device -section to be used for this screen. -This is what ties a specific graphics card to a screen. -The +section to be used for this screen. When multiple graphics cards are +present, this is what ties a specific card to a screen. The .I device\-id must match the .B Identifier @@ -1894,8 +1891,7 @@ Others are driver\-independent, and will eventually be described here. .\" XXX These should really be in an xaa man page. .TP 7 .BI "Option \*qAccel\*q" -Enables XAA (X Acceleration Architecture), a mechanism that makes video cards' -2D hardware acceleration available to the __xservername__ server. +Enables 2D hardware acceleration. This option is on by default, but it may be necessary to turn it off if there are bugs in the driver. There are many options to disable specific accelerated operations, listed @@ -1920,73 +1916,6 @@ Disables MTRR (Memory Type Range Register) support, a feature of modern processors which can improve video performance by a factor of up to 2.5. Some hardware has buggy MTRR support, and some video drivers have been known to exhibit problems when MTRR's are used. -.TP 7 -.BI "Option \*qXaaNoCPUToScreenColorExpandFill\*q" -Disables accelerated rectangular expansion blits from source patterns -stored in system memory (using a memory\-mapped aperture). -.TP 7 -.BI "Option \*qXaaNoColor8x8PatternFillRect\*q" -Disables accelerated fills of a rectangular region with a full\-color -pattern. -.TP 7 -.BI "Option \*qXaaNoColor8x8PatternFillTrap\*q" -Disables accelerated fills of a trapezoidal region with a full\-color -pattern. -.TP 7 -.BI "Option \*qXaaNoDashedBresenhamLine\*q" -Disables accelerated dashed Bresenham line draws. -.TP 7 -.BI "Option \*qXaaNoDashedTwoPointLine\*q" -Disables accelerated dashed line draws between two arbitrary points. -.TP 7 -.BI "Option \*qXaaNoImageWriteRect\*q" -Disables accelerated transfers of full\-color rectangular patterns from -system memory to video memory (using a memory\-mapped aperture). -.TP 7 -.BI "Option \*qXaaNoMono8x8PatternFillRect\*q" -Disables accelerated fills of a rectangular region with a monochrome -pattern. -.TP 7 -.BI "Option \*qXaaNoMono8x8PatternFillTrap\*q" -Disables accelerated fills of a trapezoidal region with a monochrome -pattern. -.TP 7 -.BI "Option \*qXaaNoOffscreenPixmaps\*q" -Disables accelerated draws into pixmaps stored in offscreen video memory. -.TP 7 -.BI "Option \*qXaaNoPixmapCache\*q" -Disables caching of patterns in offscreen video memory. -.TP 7 -.BI "Option \*qXaaNoScanlineCPUToScreenColorExpandFill\*q" -Disables accelerated rectangular expansion blits from source patterns -stored in system memory (one scan line at a time). -.TP 7 -.BI "Option \*qXaaNoScanlineImageWriteRect\*q" -Disables accelerated transfers of full\-color rectangular patterns from -system memory to video memory (one scan line at a time). -.TP 7 -.BI "Option \*qXaaNoScreenToScreenColorExpandFill\*q" -Disables accelerated rectangular expansion blits from source patterns -stored in offscreen video memory. -.TP 7 -.BI "Option \*qXaaNoScreenToScreenCopy\*q" -Disables accelerated copies of rectangular regions from one part of -video memory to another part of video memory. -.TP 7 -.BI "Option \*qXaaNoSolidBresenhamLine\*q" -Disables accelerated solid Bresenham line draws. -.TP 7 -.BI "Option \*qXaaNoSolidFillRect\*q" -Disables accelerated solid\-color fills of rectangles. -.TP 7 -.BI "Option \*qXaaNoSolidFillTrap\*q" -Disables accelerated solid\-color fills of Bresenham trapezoids. -.TP 7 -.BI "Option \*qXaaNoSolidHorVertLine\*q" -Disables accelerated solid horizontal and vertical line draws. -.TP 7 -.BI "Option \*qXaaNoSolidTwoPointLine\*q" -Disables accelerated solid line draws between two arbitrary points. .PP Each .B Screen @@ -2070,7 +1999,7 @@ formats. This may also be specified from the command line with the .B \-weight option (see -.BR __xservername__(__appmansuffix__)). +.BR Xorg(__appmansuffix__)). .TP 7 .BI "Virtual " "xdim ydim" This optional entry specifies the virtual screen resolution to be used. @@ -2414,7 +2343,7 @@ The data therein is not used in this release. General: .BR X (__miscmansuffix__), .BR Xserver (__appmansuffix__), -.BR __xservername__ (__appmansuffix__), +.BR Xorg (__appmansuffix__), .BR cvt (__appmansuffix__), .BR gtf (__appmansuffix__). .PP diff --git a/xserver/hw/xfree86/modes/Makefile.in b/xserver/hw/xfree86/modes/Makefile.in index 1bb4f78b8..07e5d39d7 100644 --- a/xserver/hw/xfree86/modes/Makefile.in +++ b/xserver/hw/xfree86/modes/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -218,13 +218,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -246,6 +242,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -270,6 +267,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -285,7 +283,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -384,6 +381,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -518,7 +516,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -543,9 +541,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/xfree86/modes/xf86Crtc.c b/xserver/hw/xfree86/modes/xf86Crtc.c index 6d5e92f12..f9ae46596 100644 --- a/xserver/hw/xfree86/modes/xf86Crtc.c +++ b/xserver/hw/xfree86/modes/xf86Crtc.c @@ -44,7 +44,9 @@ #include "X11/Xatom.h" #include "picturestr.h" +#ifdef XV #include "xf86xv.h" +#endif #define NO_OUTPUT_DEFAULT_WIDTH 1024 #define NO_OUTPUT_DEFAULT_HEIGHT 768 @@ -64,6 +66,7 @@ xf86CrtcConfigInit(ScrnInfoPtr scrn, const xf86CrtcConfigFuncsRec * funcs) config = xnfcalloc(1, sizeof(xf86CrtcConfigRec)); config->funcs = funcs; + config->compat_output = -1; scrn->privates[xf86CrtcConfigPrivateIndex].ptr = config; } @@ -180,7 +183,7 @@ xf86CrtcSetScreenSubpixelOrder(ScreenPtr pScreen) { int subpixel_order = SubPixelUnknown; Bool has_none = FALSE; - ScrnInfoPtr scrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); int c, o; @@ -696,7 +699,7 @@ xf86OutputDestroy(xf86OutputPtr output) static Bool xf86CrtcCreateScreenResources(ScreenPtr screen) { - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); screen->CreateScreenResources = config->CreateScreenResources; @@ -714,9 +717,9 @@ xf86CrtcCreateScreenResources(ScreenPtr screen) * Clean up config on server reset */ static Bool -xf86CrtcCloseScreen(int index, ScreenPtr screen) +xf86CrtcCloseScreen(ScreenPtr screen) { - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); int o, c; @@ -724,6 +727,10 @@ xf86CrtcCloseScreen(int index, ScreenPtr screen) xf86RotateCloseScreen(screen); + xf86RandR12CloseScreen(screen); + + screen->CloseScreen(screen); + for (o = 0; o < config->num_output; o++) { xf86OutputPtr output = config->output[o]; @@ -734,9 +741,12 @@ xf86CrtcCloseScreen(int index, ScreenPtr screen) crtc->randr_crtc = NULL; } - xf86RandR12CloseScreen(screen); - - return screen->CloseScreen(index, screen); + /* detach any providers */ + if (config->randr_provider) { + RRProviderDestroy(config->randr_provider); + config->randr_provider = NULL; + } + return TRUE; } /* @@ -749,7 +759,7 @@ Bool #endif xf86CrtcScreenInit(ScreenPtr screen) { - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); int c; @@ -1824,11 +1834,17 @@ SetCompatOutput(xf86CrtcConfigPtr config) if (compat >= 0) { config->compat_output = compat; } - else { + else if (config->compat_output >= 0 && config->compat_output < config->num_output) { /* Don't change the compat output when no valid outputs found */ output = config->output[config->compat_output]; } + /* All outputs are disconnected, select one to fake */ + if (!output && config->num_output) { + config->compat_output = 0; + output = config->output[config->compat_output]; + } + return output; } @@ -2054,12 +2070,13 @@ xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, /* * If there's no preferred mode, but only one monitor, pick the - * biggest mode for its aspect ratio, assuming one exists. + * biggest mode for its aspect ratio or 4:3, assuming one exists. */ if (!ret) do { int i = 0; float aspect = 0.0; + DisplayModePtr a = NULL, b = NULL; /* count the number of enabled outputs */ for (i = 0, p = -1; nextEnabledOutput(config, enabled, &p); i++); @@ -2073,8 +2090,11 @@ xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config, aspect = (float) config->output[p]->mm_width / (float) config->output[p]->mm_height; + a = bestModeForAspect(config, enabled, 4.0/3.0); if (aspect) - preferred_match[p] = bestModeForAspect(config, enabled, aspect); + b = bestModeForAspect(config, enabled, aspect); + + preferred_match[p] = biggestMode(a, b); if (preferred_match[p]) ret = TRUE; @@ -2434,7 +2454,7 @@ xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow) xf86CrtcPtr crtc = crtcs[o]; if (mode && crtc) { - crtc->desiredMode = *mode; + xf86SaveModeContents(&crtc->desiredMode, mode); crtc->desiredRotation = output->initial_rotation; crtc->desiredX = output->initial_x; crtc->desiredY = output->initial_y; @@ -2579,6 +2599,7 @@ xf86SetDesiredModes(ScrnInfoPtr scrn) xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); xf86CrtcPtr crtc = config->crtc[0]; int c; + int enabled = 0; /* A driver with this hook will take care of this */ if (!crtc->funcs->set_mode_major) { @@ -2618,7 +2639,7 @@ xf86SetDesiredModes(ScrnInfoPtr scrn) if (!mode) return FALSE; - crtc->desiredMode = *mode; + xf86SaveModeContents(&crtc->desiredMode, mode); crtc->desiredRotation = RR_Rotate_0; crtc->desiredTransformPresent = FALSE; crtc->desiredX = 0; @@ -2629,14 +2650,20 @@ xf86SetDesiredModes(ScrnInfoPtr scrn) transform = &crtc->desiredTransform; else transform = NULL; - if (!xf86CrtcSetModeTransform + if (xf86CrtcSetModeTransform (crtc, &crtc->desiredMode, crtc->desiredRotation, transform, - crtc->desiredX, crtc->desiredY)) - return FALSE; + crtc->desiredX, crtc->desiredY)) { + ++enabled; + } else { + for (o = 0; o < config->num_output; o++) + if (config->output[o]->crtc == crtc) + config->output[o]->crtc = NULL; + crtc->enabled = FALSE; + } } xf86DisableUnusedFunctions(scrn); - return TRUE; + return enabled != 0; } /** @@ -2757,7 +2784,7 @@ xf86SetSingleMode(ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation) if (!xf86CrtcSetModeTransform(crtc, crtc_mode, rotation, NULL, 0, 0)) ok = FALSE; else { - crtc->desiredMode = *crtc_mode; + xf86SaveModeContents(&crtc->desiredMode, crtc_mode); crtc->desiredRotation = rotation; crtc->desiredTransformPresent = FALSE; crtc->desiredX = 0; @@ -2821,7 +2848,7 @@ xf86DPMSSet(ScrnInfoPtr scrn, int mode, int flags) Bool xf86SaveScreen(ScreenPtr pScreen, int mode) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); if (xf86IsUnblank(mode)) xf86DPMSSet(pScrn, DPMSModeOn, 0); @@ -3007,7 +3034,7 @@ xf86OutputGetEDID(xf86OutputPtr output, I2CBusPtr pDDCBus) ScrnInfoPtr scrn = output->scrn; xf86MonPtr mon; - mon = xf86DoEEDID(scrn->scrnIndex, pDDCBus, TRUE); + mon = xf86DoEEDID(scrn, pDDCBus, TRUE); if (mon) xf86DDCApplyQuirks(scrn->scrnIndex, mon); @@ -3149,7 +3176,7 @@ xf86_crtc_notify_proc_ptr xf86_wrap_crtc_notify(ScreenPtr screen, xf86_crtc_notify_proc_ptr new) { if (xf86CrtcConfigPrivateIndex != -1) { - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); xf86_crtc_notify_proc_ptr old; @@ -3164,7 +3191,7 @@ void xf86_unwrap_crtc_notify(ScreenPtr screen, xf86_crtc_notify_proc_ptr old) { if (xf86CrtcConfigPrivateIndex != -1) { - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); config->xf86_crtc_notify = old; @@ -3174,7 +3201,7 @@ xf86_unwrap_crtc_notify(ScreenPtr screen, xf86_crtc_notify_proc_ptr old) void xf86_crtc_notify(ScreenPtr screen) { - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); if (config->xf86_crtc_notify) @@ -3200,3 +3227,40 @@ xf86_crtc_supports_gamma(ScrnInfoPtr pScrn) return FALSE; } + +void +xf86ProviderSetup(ScrnInfoPtr scrn, + const xf86ProviderFuncsRec *funcs, const char *name) +{ + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + + assert(!xf86_config->name); + assert(name); + + xf86_config->name = strdup(name); + xf86_config->provider_funcs = funcs; +#ifdef RANDR_12_INTERFACE + xf86_config->randr_provider = NULL; +#endif +} + +void +xf86DetachAllCrtc(ScrnInfoPtr scrn) +{ + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); + int i; + + for (i = 0; i < xf86_config->num_crtc; i++) { + xf86CrtcPtr crtc = xf86_config->crtc[i]; + + if (crtc->randr_crtc) + RRCrtcDetachScanoutPixmap(crtc->randr_crtc); + + /* dpms off */ + (*crtc->funcs->dpms) (crtc, DPMSModeOff); + /* force a reset the next time its used */ + crtc->randr_crtc->mode = NULL; + crtc->mode.HDisplay = 0; + crtc->x = crtc->y = 0; + } +} diff --git a/xserver/hw/xfree86/modes/xf86Crtc.h b/xserver/hw/xfree86/modes/xf86Crtc.h index a6a3c2e95..802303f74 100644 --- a/xserver/hw/xfree86/modes/xf86Crtc.h +++ b/xserver/hw/xfree86/modes/xf86Crtc.h @@ -218,9 +218,14 @@ typedef struct _xf86CrtcFuncs { void (*set_origin) (xf86CrtcPtr crtc, int x, int y); + /** + */ + Bool + (*set_scanout_pixmap)(xf86CrtcPtr crtc, PixmapPtr pixmap); + } xf86CrtcFuncsRec, *xf86CrtcFuncsPtr; -#define XF86_CRTC_VERSION 4 +#define XF86_CRTC_VERSION 5 struct _xf86Crtc { /** @@ -371,6 +376,10 @@ struct _xf86Crtc { * Added in ABI version 4 */ Bool driverIsPerformingTransform; + + /* Added in ABI version 5 + */ + PixmapPtr current_scanout; }; typedef struct _xf86OutputFuncs { @@ -607,6 +616,29 @@ struct _xf86Output { INT16 initialBorder[4]; }; +typedef struct _xf86ProviderFuncs { + /** + * Called to allow the provider a chance to create properties after the + * RandR objects have been created. + */ + void + (*create_resources) (ScrnInfoPtr scrn); + + /** + * Callback when an provider's property has changed. + */ + Bool + (*set_property) (ScrnInfoPtr scrn, + Atom property, RRPropertyValuePtr value); + + /** + * Callback to get an updated property value + */ + Bool + (*get_property) (ScrnInfoPtr provider, Atom property); + +} xf86ProviderFuncsRec, *xf86ProviderFuncsPtr; + typedef struct _xf86CrtcConfigFuncs { /** * Requests that the driver resize the screen. @@ -681,6 +713,13 @@ typedef struct _xf86CrtcConfig { /* callback when crtc configuration changes */ xf86_crtc_notify_proc_ptr xf86_crtc_notify; + char *name; + const xf86ProviderFuncsRec *provider_funcs; +#ifdef RANDR_12_INTERFACE + RRProviderPtr randr_provider; +#else + void *randr_provider; +#endif } xf86CrtcConfigRec, *xf86CrtcConfigPtr; extern _X_EXPORT int xf86CrtcConfigPrivateIndex; @@ -975,4 +1014,11 @@ extern _X_EXPORT void extern _X_EXPORT Bool xf86_crtc_supports_gamma(ScrnInfoPtr pScrn); +extern _X_EXPORT void +xf86ProviderSetup(ScrnInfoPtr scrn, + const xf86ProviderFuncsRec * funcs, const char *name); + +extern _X_EXPORT void +xf86DetachAllCrtc(ScrnInfoPtr scrn); + #endif /* _XF86CRTC_H_ */ diff --git a/xserver/hw/xfree86/modes/xf86Cursors.c b/xserver/hw/xfree86/modes/xf86Cursors.c index 95a78921d..634ee3fe0 100644 --- a/xserver/hw/xfree86/modes/xf86Cursors.c +++ b/xserver/hw/xfree86/modes/xf86Cursors.c @@ -477,7 +477,7 @@ xf86_load_cursor_image(ScrnInfoPtr scrn, unsigned char *src) static Bool xf86_use_hw_cursor(ScreenPtr screen, CursorPtr cursor) { - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; @@ -496,7 +496,7 @@ xf86_use_hw_cursor(ScreenPtr screen, CursorPtr cursor) static Bool xf86_use_hw_cursor_argb(ScreenPtr screen, CursorPtr cursor) { - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; @@ -564,7 +564,7 @@ xf86_load_cursor_argb(ScrnInfoPtr scrn, CursorPtr cursor) Bool xf86_cursors_init(ScreenPtr screen, int max_width, int max_height, int flags) { - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); xf86CursorInfoPtr cursor_info; @@ -631,7 +631,7 @@ xf86_reload_cursors(ScreenPtr screen) if (!cursor_screen_priv || !cursor_screen_priv->isUp) return; - scrn = xf86Screens[screen->myNum]; + scrn = xf86ScreenToScrn(screen); xf86_config = XF86_CRTC_CONFIG_PTR(scrn); /* make sure the cursor code has been initialized */ @@ -667,7 +667,7 @@ xf86_reload_cursors(ScreenPtr screen) void xf86_cursors_fini(ScreenPtr screen) { - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); if (xf86_config->cursor_info) { diff --git a/xserver/hw/xfree86/modes/xf86DiDGA.c b/xserver/hw/xfree86/modes/xf86DiDGA.c index fafd95aed..3f1a3309f 100644 --- a/xserver/hw/xfree86/modes/xf86DiDGA.c +++ b/xserver/hw/xfree86/modes/xf86DiDGA.c @@ -41,7 +41,7 @@ static Bool xf86_dga_get_modes(ScreenPtr pScreen) { - ScrnInfoPtr scrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); DGAModePtr modes, mode; DisplayModePtr display_mode; @@ -137,7 +137,7 @@ xf86_dga_get_viewport(ScrnInfoPtr scrn) static void xf86_dga_set_viewport(ScrnInfoPtr scrn, int x, int y, int flags) { - scrn->AdjustFrame(scrn->pScreen->myNum, x, y, flags); + scrn->AdjustFrame(scrn, x, y); } static Bool @@ -175,10 +175,10 @@ xf86DiDGAReInit(ScreenPtr pScreen) Bool _xf86_di_dga_reinit_internal(ScreenPtr pScreen) { - ScrnInfoPtr scrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); - if (!DGAAvailable(pScreen->myNum)) + if (!DGAScreenAvailable(pScreen)) return TRUE; if (!xf86_dga_get_modes(pScreen)) @@ -197,7 +197,7 @@ xf86DiDGAInit(ScreenPtr pScreen, unsigned long dga_address) Bool _xf86_di_dga_init_internal(ScreenPtr pScreen) { - ScrnInfoPtr scrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); xf86_config->dga_flags = 0; diff --git a/xserver/hw/xfree86/modes/xf86DisplayIDModes.c b/xserver/hw/xfree86/modes/xf86DisplayIDModes.c index 781c806bc..bead1265a 100644 --- a/xserver/hw/xfree86/modes/xf86DisplayIDModes.c +++ b/xserver/hw/xfree86/modes/xf86DisplayIDModes.c @@ -184,105 +184,96 @@ static const struct did_dmt { short w, h, r, f; } did_dmt[] = { /* byte 3 */ - { - 640, 350, 85, 0}, { - 640, 400, 85, 0}, { - 720, 400, 85, 0}, { - 640, 480, 60, 0}, { - 640, 480, 72, 0}, { - 640, 480, 75, 0}, { - 640, 480, 85, 0}, { - 800, 600, 56, 0}, + {640, 350, 85, 0}, + {640, 400, 85, 0}, + {720, 400, 85, 0}, + {640, 480, 60, 0}, + {640, 480, 72, 0}, + {640, 480, 75, 0}, + {640, 480, 85, 0}, + {800, 600, 56, 0}, /* byte 4 */ - { - 800, 600, 60, 0}, { - 800, 600, 72, 0}, { - 800, 600, 75, 0}, { - 800, 600, 85, 0}, { - 800, 600, 120, RB}, { - 848, 480, 60, 0}, { - 1024, 768, 43, INT}, { - 1024, 768, 60, 0}, + {800, 600, 60, 0}, + {800, 600, 72, 0}, + {800, 600, 75, 0}, + {800, 600, 85, 0}, + {800, 600, 120, RB}, + {848, 480, 60, 0}, + {1024, 768, 43, INT}, + {1024, 768, 60, 0}, /* byte 5 */ - { - 1024, 768, 70, 0}, { - 1024, 768, 75, 0}, { - 1024, 768, 85, 0}, { - 1024, 768, 120, RB}, { - 1152, 864, 75, 0}, { - 1280, 768, 60, RB}, { - 1280, 768, 60, 0}, { - 1280, 768, 75, 0}, + {1024, 768, 70, 0}, + {1024, 768, 75, 0}, + {1024, 768, 85, 0}, + {1024, 768, 120, RB}, + {1152, 864, 75, 0}, + {1280, 768, 60, RB}, + {1280, 768, 60, 0}, + {1280, 768, 75, 0}, /* byte 6 */ - { - 1280, 768, 85, 0}, { - 1280, 768, 120, RB}, { - 1280, 800, 60, RB}, { - 1280, 800, 60, 0}, { - 1280, 800, 75, 0}, { - 1280, 800, 85, 0}, { - 1280, 800, 120, RB}, { - 1280, 960, 60, 0}, + {1280, 768, 85, 0}, + {1280, 768, 120, RB}, + {1280, 800, 60, RB}, + {1280, 800, 60, 0}, + {1280, 800, 75, 0}, + {1280, 800, 85, 0}, + {1280, 800, 120, RB}, + {1280, 960, 60, 0}, /* byte 7 */ - { - 1280, 960, 85, 0}, { - 1280, 960, 120, RB}, { - 1280, 1024, 60, 0}, { - 1280, 1024, 75, 0}, { - 1280, 1024, 85, 0}, { - 1280, 1024, 120, RB}, { - 1360, 768, 60, 0}, { - 1360, 768, 120, RB}, + {1280, 960, 85, 0}, + {1280, 960, 120, RB}, + {1280, 1024, 60, 0}, + {1280, 1024, 75, 0}, + {1280, 1024, 85, 0}, + {1280, 1024, 120, RB}, + {1360, 768, 60, 0}, + {1360, 768, 120, RB}, /* byte 8 */ - { - 1400, 1050, 60, RB}, { - 1400, 1050, 60, 0}, { - 1400, 1050, 75, 0}, { - 1400, 1050, 85, 0}, { - 1400, 1050, 120, RB}, { - 1440, 900, 60, RB}, { - 1440, 900, 60, 0}, { - 1440, 900, 75, 0}, + {1400, 1050, 60, RB}, + {1400, 1050, 60, 0}, + {1400, 1050, 75, 0}, + {1400, 1050, 85, 0}, + {1400, 1050, 120, RB}, + {1440, 900, 60, RB}, + {1440, 900, 60, 0}, + {1440, 900, 75, 0}, /* byte 9 */ - { - 1440, 900, 85, 0}, { - 1440, 900, 120, RB}, { - 1600, 1200, 60, 0}, { - 1600, 1200, 65, 0}, { - 1600, 1200, 70, 0}, { - 1600, 1200, 75, 0}, { - 1600, 1200, 85, 0}, { - 1600, 1200, 120, RB}, + {1440, 900, 85, 0}, + {1440, 900, 120, RB}, + {1600, 1200, 60, 0}, + {1600, 1200, 65, 0}, + {1600, 1200, 70, 0}, + {1600, 1200, 75, 0}, + {1600, 1200, 85, 0}, + {1600, 1200, 120, RB}, /* byte a */ - { - 1680, 1050, 60, RB}, { - 1680, 1050, 60, 0}, { - 1680, 1050, 75, 0}, { - 1680, 1050, 85, 0}, { - 1680, 1050, 120, RB}, { - 1792, 1344, 60, 0}, { - 1792, 1344, 75, 0}, { - 1792, 1344, 120, RB}, + {1680, 1050, 60, RB}, + {1680, 1050, 60, 0}, + {1680, 1050, 75, 0}, + {1680, 1050, 85, 0}, + {1680, 1050, 120, RB}, + {1792, 1344, 60, 0}, + {1792, 1344, 75, 0}, + {1792, 1344, 120, RB}, /* byte b */ - { - 1856, 1392, 60, 0}, { - 1856, 1392, 75, 0}, { - 1856, 1392, 120, RB}, { - 1920, 1200, 60, RB}, { - 1920, 1200, 60, 0}, { - 1920, 1200, 75, 0}, { - 1920, 1200, 85, 0}, { - 1920, 1200, 120, RB}, + {1856, 1392, 60, 0}, + {1856, 1392, 75, 0}, + {1856, 1392, 120, RB}, + {1920, 1200, 60, RB}, + {1920, 1200, 60, 0}, + {1920, 1200, 75, 0}, + {1920, 1200, 85, 0}, + {1920, 1200, 120, RB}, /* byte c */ - { - 1920, 1440, 60, 0}, { - 1920, 1440, 75, 0}, { - 1920, 1440, 120, RB}, { - 2560, 1600, 60, RB}, { - 2560, 1600, 60, 0}, { - 2560, 1600, 75, 0}, { - 2560, 1600, 85, 0}, { -2560, 1600, 120, RB},}; + {1920, 1440, 60, 0}, + {1920, 1440, 75, 0}, + {1920, 1440, 120, RB}, + {2560, 1600, 60, RB}, + {2560, 1600, 60, 0}, + {2560, 1600, 75, 0}, + {2560, 1600, 85, 0}, + {2560, 1600, 120, RB}, +}; static void didVesaTiming(int scrn, unsigned char *x, MonPtr mon) diff --git a/xserver/hw/xfree86/modes/xf86EdidModes.c b/xserver/hw/xfree86/modes/xf86EdidModes.c index 258ada5b4..4ee862da0 100644 --- a/xserver/hw/xfree86/modes/xf86EdidModes.c +++ b/xserver/hw/xfree86/modes/xf86EdidModes.c @@ -513,14 +513,14 @@ DDCModeDoInterlaceQuirks(DisplayModePtr mode) static const struct { int w, h; } cea_interlaced[] = { - { - 1920, 1080}, { - 720, 480}, { - 1440, 480}, { - 2880, 480}, { - 720, 576}, { - 1440, 576}, { - 2880, 576},}; + {1920, 1080}, + {720, 480}, + {1440, 480}, + {2880, 480}, + {720, 576}, + {1440, 576}, + {2880, 576}, + }; static const int n_modes = sizeof(cea_interlaced) / sizeof(cea_interlaced[0]); int i; @@ -668,68 +668,62 @@ static const struct { short r; short rb; } EstIIIModes[] = { - /* byte 6 */ - { - 640, 350, 85, 0}, { - 640, 400, 85, 0}, { - 720, 400, 85, 0}, { - 640, 480, 85, 0}, { - 848, 480, 60, 0}, { - 800, 600, 85, 0}, { - 1024, 768, 85, 0}, { - 1152, 864, 75, 0}, + /* byte 6 */ + {640, 350, 85, 0}, + {640, 400, 85, 0}, + {720, 400, 85, 0}, + {640, 480, 85, 0}, + {848, 480, 60, 0}, + {800, 600, 85, 0}, + {1024, 768, 85, 0}, + {1152, 864, 75, 0}, /* byte 7 */ - { - 1280, 768, 60, 1}, { - 1280, 768, 60, 0}, { - 1280, 768, 75, 0}, { - 1280, 768, 85, 0}, { - 1280, 960, 60, 0}, { - 1280, 960, 85, 0}, { - 1280, 1024, 60, 0}, { - 1280, 1024, 85, 0}, + {1280, 768, 60, 1}, + {1280, 768, 60, 0}, + {1280, 768, 75, 0}, + {1280, 768, 85, 0}, + {1280, 960, 60, 0}, + {1280, 960, 85, 0}, + {1280, 1024, 60, 0}, + {1280, 1024, 85, 0}, /* byte 8 */ - { - 1360, 768, 60, 0}, { - 1440, 900, 60, 1}, { - 1440, 900, 60, 0}, { - 1440, 900, 75, 0}, { - 1440, 900, 85, 0}, { - 1400, 1050, 60, 1}, { - 1400, 1050, 60, 0}, { - 1400, 1050, 75, 0}, + {1360, 768, 60, 0}, + {1440, 900, 60, 1}, + {1440, 900, 60, 0}, + {1440, 900, 75, 0}, + {1440, 900, 85, 0}, + {1400, 1050, 60, 1}, + {1400, 1050, 60, 0}, + {1400, 1050, 75, 0}, /* byte 9 */ - { - 1400, 1050, 85, 0}, { - 1680, 1050, 60, 1}, { - 1680, 1050, 60, 0}, { - 1680, 1050, 75, 0}, { - 1680, 1050, 85, 0}, { - 1600, 1200, 60, 0}, { - 1600, 1200, 65, 0}, { - 1600, 1200, 70, 0}, + {1400, 1050, 85, 0}, + {1680, 1050, 60, 1}, + {1680, 1050, 60, 0}, + {1680, 1050, 75, 0}, + {1680, 1050, 85, 0}, + {1600, 1200, 60, 0}, + {1600, 1200, 65, 0}, + {1600, 1200, 70, 0}, /* byte 10 */ - { - 1600, 1200, 75, 0}, { - 1600, 1200, 85, 0}, { - 1792, 1344, 60, 0}, { - 1792, 1344, 85, 0}, { - 1856, 1392, 60, 0}, { - 1856, 1392, 75, 0}, { - 1920, 1200, 60, 1}, { - 1920, 1200, 60, 0}, + {1600, 1200, 75, 0}, + {1600, 1200, 85, 0}, + {1792, 1344, 60, 0}, + {1792, 1344, 85, 0}, + {1856, 1392, 60, 0}, + {1856, 1392, 75, 0}, + {1920, 1200, 60, 1}, + {1920, 1200, 60, 0}, /* byte 11 */ - { - 1920, 1200, 75, 0}, { - 1920, 1200, 85, 0}, { - 1920, 1440, 60, 0}, { - 1920, 1440, 75, 0}, + {1920, 1200, 75, 0}, + {1920, 1200, 85, 0}, + {1920, 1440, 60, 0}, + {1920, 1440, 75, 0}, /* fill up last byte */ - { - 0,0,0,0}, { - 0,0,0,0}, { - 0,0,0,0}, { - 0,0,0,0}, }; + {0,0,0,0}, + {0,0,0,0}, + {0,0,0,0}, + {0,0,0,0}, +}; static DisplayModePtr DDCModesFromEstIII(unsigned char *est) diff --git a/xserver/hw/xfree86/modes/xf86Modes.c b/xserver/hw/xfree86/modes/xf86Modes.c index 2a6d26756..c4a3eb0a3 100644 --- a/xserver/hw/xfree86/modes/xf86Modes.c +++ b/xserver/hw/xfree86/modes/xf86Modes.c @@ -190,6 +190,21 @@ xf86SetModeCrtc(DisplayModePtr p, int adjustFlags) p->CrtcVAdjusted = FALSE; } +/** + * Fills in a copy of mode, removing all stale pointer references. + * xf86ModesEqual will return true when comparing with original mode. + */ +void +xf86SaveModeContents(DisplayModePtr intern, const DisplayModeRec *mode) +{ + *intern = *mode; + intern->prev = intern->next = NULL; + intern->name = NULL; + intern->PrivSize = 0; + intern->PrivFlags = 0; + intern->Private = NULL; +} + /** * Allocates and returns a copy of pMode, including pointers within pMode. */ diff --git a/xserver/hw/xfree86/modes/xf86RandR12.c b/xserver/hw/xfree86/modes/xf86RandR12.c index daa24d716..edc31a922 100644 --- a/xserver/hw/xfree86/modes/xf86RandR12.c +++ b/xserver/hw/xfree86/modes/xf86RandR12.c @@ -450,7 +450,7 @@ static Bool xf86RandR12GetInfo(ScreenPtr pScreen, Rotation * rotations) { RRScreenSizePtr pSize; - ScrnInfoPtr scrp = XF86SCRNINFO(pScreen); + ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); DisplayModePtr mode; int refresh0 = 60; @@ -507,7 +507,7 @@ xf86RandR12SetMode(ScreenPtr pScreen, DisplayModePtr mode, Bool useVirtual, int mmWidth, int mmHeight) { - ScrnInfoPtr scrp = XF86SCRNINFO(pScreen); + ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); int oldWidth = pScreen->width; int oldHeight = pScreen->height; @@ -518,7 +518,7 @@ xf86RandR12SetMode(ScreenPtr pScreen, Bool ret = TRUE; if (pRoot) - (*scrp->EnableDisableFBAccess) (pScreen->myNum, FALSE); + (*scrp->EnableDisableFBAccess) (scrp, FALSE); if (useVirtual) { scrp->virtualX = randrp->virtualX; scrp->virtualY = randrp->virtualY; @@ -571,7 +571,7 @@ xf86RandR12SetMode(ScreenPtr pScreen, xf86SetViewport(pScreen, pScreen->width, pScreen->height); xf86SetViewport(pScreen, 0, 0); if (pRoot) - (*scrp->EnableDisableFBAccess) (pScreen->myNum, TRUE); + (*scrp->EnableDisableFBAccess) (scrp, TRUE); return ret; } @@ -579,7 +579,7 @@ Bool xf86RandR12SetConfig(ScreenPtr pScreen, Rotation rotation, int rate, RRScreenSizePtr pSize) { - ScrnInfoPtr scrp = XF86SCRNINFO(pScreen); + ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); DisplayModePtr mode; int pos[MAXDEVICES][2]; @@ -678,7 +678,7 @@ xf86RandR12ScreenSetSize(ScreenPtr pScreen, CARD16 height, CARD32 mmWidth, CARD32 mmHeight) { XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); - ScrnInfoPtr pScrn = XF86SCRNINFO(pScreen); + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); WindowPtr pRoot = pScreen->root; PixmapPtr pScrnPix; @@ -693,7 +693,7 @@ xf86RandR12ScreenSetSize(ScreenPtr pScreen, } } if (pRoot && pScrn->vtSema) - (*pScrn->EnableDisableFBAccess) (pScreen->myNum, FALSE); + (*pScrn->EnableDisableFBAccess) (pScrn, FALSE); /* Let the driver update virtualX and virtualY */ if (!(*config->funcs->resize) (pScrn, width, height)) @@ -732,7 +732,7 @@ xf86RandR12ScreenSetSize(ScreenPtr pScreen, update_desktop_dimensions(); if (pRoot && pScrn->vtSema) - (*pScrn->EnableDisableFBAccess) (pScreen->myNum, TRUE); + (*pScrn->EnableDisableFBAccess) (pScrn, TRUE); #if RANDR_12_INTERFACE if (xf86RandR12Key && pScreen->root && ret) RRScreenSizeNotify(pScreen); @@ -751,7 +751,7 @@ xf86RandR12GetRotation(ScreenPtr pScreen) Bool xf86RandR12CreateScreenResources(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr config; XF86RandRInfoPtr randrp; int c; @@ -911,7 +911,7 @@ xf86RandR12CloseScreen(ScreenPtr pScreen) randrp = XF86RANDRINFO(pScreen); #if RANDR_12_INTERFACE - xf86Screens[pScreen->myNum]->EnterVT = randrp->orig_EnterVT; + xf86ScreenToScrn(pScreen)->EnterVT = randrp->orig_EnterVT; pScreen->ConstrainCursorHarder = randrp->orig_ConstrainCursorHarder; #endif @@ -924,7 +924,7 @@ xf86RandR12SetRotations(ScreenPtr pScreen, Rotation rotations) XF86RandRInfoPtr randrp; #if RANDR_12_INTERFACE - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); int c; xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); #endif @@ -949,7 +949,7 @@ xf86RandR12SetTransformSupport(ScreenPtr pScreen, Bool transforms) XF86RandRInfoPtr randrp; #if RANDR_13_INTERFACE - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); int c; xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); #endif @@ -970,7 +970,7 @@ xf86RandR12SetTransformSupport(ScreenPtr pScreen, Bool transforms) void xf86RandR12GetOriginalVirtualSize(ScrnInfoPtr pScrn, int *x, int *y) { - ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); if (xf86RandR12Generation != serverGeneration || XF86RANDRINFO(pScreen)->virtualX == -1) { @@ -1051,7 +1051,7 @@ static Bool xf86RandR12CrtcNotify(RRCrtcPtr randr_crtc) { ScreenPtr pScreen = randr_crtc->pScreen; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); RRModePtr randr_mode = NULL; int x; @@ -1146,7 +1146,7 @@ xf86RandR12CrtcSet(ScreenPtr pScreen, int num_randr_outputs, RROutputPtr * randr_outputs) { XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); xf86CrtcPtr crtc = randr_crtc->devPrivate; RRTransformPtr transform; @@ -1167,6 +1167,9 @@ xf86RandR12CrtcSet(ScreenPtr pScreen, if (rotation != crtc->rotation) changed = TRUE; + if (crtc->current_scanout != randr_crtc->scanout_pixmap) + changed = TRUE; + transform = RRCrtcGetTransform(randr_crtc); if ((transform != NULL) != crtc->transformPresent) changed = TRUE; @@ -1227,8 +1230,9 @@ xf86RandR12CrtcSet(ScreenPtr pScreen, /* * Save the last successful setting for EnterVT */ - crtc->desiredMode = mode; + xf86SaveModeContents(&crtc->desiredMode, &mode); crtc->desiredRotation = rotation; + crtc->current_scanout = randr_crtc->scanout_pixmap; if (transform) { crtc->desiredTransform = *transform; crtc->desiredTransformPresent = TRUE; @@ -1360,7 +1364,7 @@ static Bool xf86RandR12OutputValidateMode(ScreenPtr pScreen, RROutputPtr randr_output, RRModePtr randr_mode) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86OutputPtr output = randr_output->devPrivate; DisplayModeRec mode; @@ -1445,7 +1449,7 @@ xf86RROutputSetModes(RROutputPtr randr_output, DisplayModePtr modes) static Bool xf86RandR12SetInfo12(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); RROutputPtr *clones; RRCrtcPtr *crtcs; @@ -1521,7 +1525,7 @@ xf86RandR12SetInfo12(ScreenPtr pScreen) static Bool xf86RandR12GetInfo12(ScreenPtr pScreen, Rotation * rotations) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); if (!pScrn->vtSema) return TRUE; @@ -1533,7 +1537,7 @@ xf86RandR12GetInfo12(ScreenPtr pScreen, Rotation * rotations) static Bool xf86RandR12CreateObjects12(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); int c; int o; @@ -1563,6 +1567,14 @@ xf86RandR12CreateObjects12(ScreenPtr pScreen) output->funcs->create_resources(output); RRPostPendingProperties(output->randr_output); } + + if (config->name) { + config->randr_provider = RRProviderCreate(pScreen, config->name, + strlen(config->name)); + + RRProviderSetCapabilities(config->randr_provider, pScrn->capabilities); + } + return TRUE; } @@ -1570,7 +1582,7 @@ static Bool xf86RandR12CreateScreenResources12(ScreenPtr pScreen) { int c; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); if (xf86RandR12Key == NULL) @@ -1592,7 +1604,7 @@ xf86RandR12CreateScreenResources12(ScreenPtr pScreen) void xf86RandR12TellChanged(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); int c; @@ -1607,10 +1619,9 @@ xf86RandR12TellChanged(ScreenPtr pScreen) } static void -xf86RandR12PointerMoved(int scrnIndex, int x, int y) +xf86RandR12PointerMoved(ScrnInfoPtr pScrn, int x, int y) { - ScreenPtr pScreen = screenInfo.screens[scrnIndex]; - ScrnInfoPtr pScrn = XF86SCRNINFO(pScreen); + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); int c; @@ -1693,19 +1704,18 @@ gamma_to_ramp(float gamma, CARD16 *ramp, int size) for (i = 0; i < size; i++) { if (gamma == 1.0) - ramp[i] = i << 8; + ramp[i] = i | i << 8; else ramp[i] = (CARD16) (pow((double) i / (double) (size - 1), 1. / gamma) - * (double) (size - 1) * 256); + * (double) (size - 1) * 257); } } static int -xf86RandR12ChangeGamma(int scrnIndex, Gamma gamma) +xf86RandR12ChangeGamma(ScrnInfoPtr pScrn, Gamma gamma) { CARD16 *points, *red, *green, *blue; - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; RRCrtcPtr crtc = xf86CompatRRCrtc(pScrn); int size; @@ -1737,10 +1747,9 @@ xf86RandR12ChangeGamma(int scrnIndex, Gamma gamma) } static Bool -xf86RandR12EnterVT(int screen_index, int flags) +xf86RandR12EnterVT(ScrnInfoPtr pScrn) { - ScreenPtr pScreen = screenInfo.screens[screen_index]; - ScrnInfoPtr pScrn = xf86Screens[screen_index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); rrScrPrivPtr rp = rrGetScrPriv(pScreen); Bool ret; @@ -1748,7 +1757,7 @@ xf86RandR12EnterVT(int screen_index, int flags) if (randrp->orig_EnterVT) { pScrn->EnterVT = randrp->orig_EnterVT; - ret = pScrn->EnterVT(screen_index, flags); + ret = pScrn->EnterVT(pScrn); randrp->orig_EnterVT = pScrn->EnterVT; pScrn->EnterVT = xf86RandR12EnterVT; if (!ret) @@ -1762,6 +1771,106 @@ xf86RandR12EnterVT(int screen_index, int flags) return RRGetInfo(pScreen, TRUE); /* force a re-probe of outputs and notify clients about changes */ } +static Bool +xf86RandR14ProviderSetOutputSource(ScreenPtr pScreen, + RRProviderPtr provider, + RRProviderPtr source_provider) +{ + if (!source_provider) { + if (provider->output_source) { + ScreenPtr cmScreen = pScreen->current_master; + + DetachOutputGPU(pScreen); + AttachUnboundGPU(cmScreen, pScreen); + } + provider->output_source = NULL; + return TRUE; + } + + if (provider->output_source == source_provider) + return TRUE; + + SetRootClip(source_provider->pScreen, FALSE); + + DetachUnboundGPU(pScreen); + AttachOutputGPU(source_provider->pScreen, pScreen); + + provider->output_source = source_provider; + SetRootClip(source_provider->pScreen, TRUE); + return TRUE; +} + +static Bool +xf86RandR14ProviderSetOffloadSink(ScreenPtr pScreen, + RRProviderPtr provider, + RRProviderPtr sink_provider) +{ + if (!sink_provider) { + if (provider->offload_sink) { + ScreenPtr cmScreen = pScreen->current_master; + DetachOutputGPU(pScreen); + AttachUnboundGPU(cmScreen, pScreen); + } + + provider->offload_sink = NULL; + return TRUE; + } + + if (provider->offload_sink == sink_provider) + return TRUE; + + DetachUnboundGPU(pScreen); + AttachOffloadGPU(sink_provider->pScreen, pScreen); + + provider->offload_sink = sink_provider; + return TRUE; +} + +static Bool +xf86RandR14ProviderSetProperty(ScreenPtr pScreen, + RRProviderPtr randr_provider, + Atom property, RRPropertyValuePtr value) +{ + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); + + /* If we don't have any property handler, then we don't care what the + * user is setting properties to. + */ + if (config->provider_funcs->set_property == NULL) + return TRUE; + + /* + * This function gets called even when vtSema is FALSE, as + * drivers will need to remember the correct value to apply + * when the VT switch occurs + */ + return config->provider_funcs->set_property(pScrn, property, value); +} + +static Bool +xf86RandR14ProviderGetProperty(ScreenPtr pScreen, + RRProviderPtr randr_provider, Atom property) +{ + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); + + if (config->provider_funcs->get_property == NULL) + return TRUE; + + /* Should be safe even w/o vtSema */ + return config->provider_funcs->get_property(pScrn, property); +} + +static Bool +xf86CrtcSetScanoutPixmap(RRCrtcPtr randr_crtc, PixmapPtr pixmap) +{ + xf86CrtcPtr crtc = randr_crtc->devPrivate; + if (!crtc->funcs->set_scanout_pixmap) + return FALSE; + return crtc->funcs->set_scanout_pixmap(crtc, pixmap); +} + static void xf86RandR13ConstrainCursorHarder(DeviceIntPtr dev, ScreenPtr screen, int mode, int *x, int *y) { @@ -1777,10 +1886,31 @@ xf86RandR13ConstrainCursorHarder(DeviceIntPtr dev, ScreenPtr screen, int mode, i } } +static void +xf86RandR14ProviderDestroy(ScreenPtr screen, RRProviderPtr provider) +{ + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + + if (config->randr_provider == provider) { + if (config->randr_provider->offload_sink) { + DetachOffloadGPU(screen); + config->randr_provider->offload_sink = NULL; + } + else if (config->randr_provider->output_source) { + DetachOutputGPU(screen); + config->randr_provider->output_source = NULL; + } + else if (screen->current_master) + DetachUnboundGPU(screen); + } + config->randr_provider = NULL; +} + static Bool xf86RandR12Init12(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); rrScrPrivPtr rp = rrGetScrPriv(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); int i; @@ -1799,6 +1929,15 @@ xf86RandR12Init12(ScreenPtr pScreen) #endif rp->rrModeDestroy = xf86RandR12ModeDestroy; rp->rrSetConfig = NULL; + + rp->rrProviderSetOutputSource = xf86RandR14ProviderSetOutputSource; + rp->rrProviderSetOffloadSink = xf86RandR14ProviderSetOffloadSink; + + rp->rrProviderSetProperty = xf86RandR14ProviderSetProperty; + rp->rrProviderGetProperty = xf86RandR14ProviderGetProperty; + rp->rrCrtcSetScanoutPixmap = xf86CrtcSetScanoutPixmap; + rp->rrProviderDestroy = xf86RandR14ProviderDestroy; + pScrn->PointerMoved = xf86RandR12PointerMoved; pScrn->ChangeGamma = xf86RandR12ChangeGamma; diff --git a/xserver/hw/xfree86/modes/xf86Rotate.c b/xserver/hw/xfree86/modes/xf86Rotate.c index cbc868735..a3937478f 100644 --- a/xserver/hw/xfree86/modes/xf86Rotate.c +++ b/xserver/hw/xfree86/modes/xf86Rotate.c @@ -46,28 +46,6 @@ /* borrowed from composite extension, move to Render and publish? */ -static VisualPtr -compGetWindowVisual(WindowPtr pWin) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - VisualID vid = wVisual(pWin); - int i; - - for (i = 0; i < pScreen->numVisuals; i++) - if (pScreen->visuals[i].vid == vid) - return &pScreen->visuals[i]; - return 0; -} - -static PictFormatPtr -compWindowFormat(WindowPtr pWin) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - - return PictureMatchVisual(pScreen, pWin->drawable.depth, - compGetWindowVisual(pWin)); -} - #define F(x) IntToxFixed(x) #define toF(x) ((float) (x) / 65536.0f) @@ -79,7 +57,7 @@ xf86RotateCrtcRedisplay(xf86CrtcPtr crtc, RegionPtr region) ScreenPtr screen = scrn->pScreen; WindowPtr root = screen->root; PixmapPtr dst_pixmap = crtc->rotatedPixmap; - PictFormatPtr format = compWindowFormat(screen->root); + PictFormatPtr format = PictureWindowFormat(screen->root); int error; PicturePtr src, dst; int n = RegionNumRects(region); @@ -144,7 +122,7 @@ xf86CrtcDamageShadow(xf86CrtcPtr crtc) ScrnInfoPtr pScrn = crtc->scrn; BoxRec damage_box; RegionRec damage_region; - ScreenPtr pScreen = pScrn->pScreen; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); damage_box.x1 = 0; damage_box.x2 = crtc->mode.HDisplay; @@ -174,7 +152,7 @@ xf86CrtcDamageShadow(xf86CrtcPtr crtc) static void xf86RotatePrepare(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); int c; @@ -204,7 +182,7 @@ xf86RotatePrepare(ScreenPtr pScreen) static Bool xf86RotateRedisplay(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); DamagePtr damage = xf86_config->rotation_damage; RegionPtr region; @@ -250,17 +228,16 @@ xf86RotateRedisplay(ScreenPtr pScreen) } static void -xf86RotateBlockHandler(int screenNum, pointer blockData, +xf86RotateBlockHandler(ScreenPtr pScreen, pointer pTimeout, pointer pReadmask) { - ScreenPtr pScreen = screenInfo.screens[screenNum]; - ScrnInfoPtr pScrn = xf86Screens[screenNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); Bool rotation_active; rotation_active = xf86RotateRedisplay(pScreen); pScreen->BlockHandler = xf86_config->BlockHandler; - (*pScreen->BlockHandler) (screenNum, blockData, pTimeout, pReadmask); + (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); /* cannot avoid re-wrapping until all wrapping is audited */ xf86_config->BlockHandler = pScreen->BlockHandler; pScreen->BlockHandler = xf86RotateBlockHandler; @@ -270,7 +247,7 @@ void xf86RotateDestroy(xf86CrtcPtr crtc) { ScrnInfoPtr pScrn = crtc->scrn; - ScreenPtr pScreen = pScrn->pScreen; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); int c; @@ -328,7 +305,7 @@ xf86RotateFreeShadow(ScrnInfoPtr pScrn) void xf86RotateCloseScreen(ScreenPtr screen) { - ScrnInfoPtr scrn = xf86Screens[screen->myNum]; + ScrnInfoPtr scrn = xf86ScreenToScrn(screen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); int c; @@ -345,6 +322,12 @@ xf86CrtcFitsScreen(xf86CrtcPtr crtc, struct pict_f_transform *crtc_to_fb) /* When called before PreInit, the driver is * presumably doing load detect */ + if (pScrn->is_gpu) { + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); + if (pScreen->current_master) + pScrn = xf86ScreenToScrn(pScreen->current_master); + } + if (pScrn->virtualX == 0 || pScrn->virtualY == 0) return TRUE; @@ -370,9 +353,7 @@ xf86CrtcRotate(xf86CrtcPtr crtc) { ScrnInfoPtr pScrn = crtc->scrn; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); - - /* if this is called during ScreenInit() we don't have pScrn->pScreen yet */ - ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); PictTransform crtc_to_fb; struct pict_f_transform f_crtc_to_fb, f_fb_to_crtc; xFixed *new_params = NULL; diff --git a/xserver/hw/xfree86/os-support/Makefile.in b/xserver/hw/xfree86/os-support/Makefile.in index d856f2a10..26a7f7474 100644 --- a/xserver/hw/xfree86/os-support/Makefile.in +++ b/xserver/hw/xfree86/os-support/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -246,13 +246,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -274,6 +270,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -298,6 +295,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -313,7 +311,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -412,6 +409,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -529,7 +527,7 @@ AM_CFLAGS = $(DIX_CFLAGS) all: all-recursive .SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -554,9 +552,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/xfree86/os-support/bsd/Makefile.in b/xserver/hw/xfree86/os-support/bsd/Makefile.in index e9cae2794..e3ca02991 100644 --- a/xserver/hw/xfree86/os-support/bsd/Makefile.in +++ b/xserver/hw/xfree86/os-support/bsd/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -216,13 +216,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -244,6 +240,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -268,6 +265,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -283,7 +281,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -382,6 +379,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -550,7 +548,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -575,9 +573,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/xfree86/os-support/bsd/alpha_video.c b/xserver/hw/xfree86/os-support/bsd/alpha_video.c index 2fc482792..2da673c10 100644 --- a/xserver/hw/xfree86/os-support/bsd/alpha_video.c +++ b/xserver/hw/xfree86/os-support/bsd/alpha_video.c @@ -6,19 +6,19 @@ * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting - * documentation, and that the names of Rich Murphey and David Wexelblat - * not be used in advertising or publicity pertaining to distribution of + * documentation, and that the names of Rich Murphey and David Wexelblat + * not be used in advertising or publicity pertaining to distribution of * the software without specific, written prior permission. Rich Murphey and - * David Wexelblat make no representations about the suitability of this - * software for any purpose. It is provided "as is" without express or + * David Wexelblat make no representations about the suitability of this + * software for any purpose. It is provided "as is" without express or * implied warranty. * - * RICH MURPHEY AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH REGARD TO - * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID WEXELBLAT BE LIABLE FOR - * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER - * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * RICH MURPHEY AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID WEXELBLAT BE LIABLE FOR + * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER + * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF + * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ @@ -67,6 +67,7 @@ memory_base(void) if (base == 0) { size_t len = sizeof(base); int error; + #ifdef __OpenBSD__ int mib[3]; @@ -76,11 +77,11 @@ memory_base(void) if ((error = sysctl(mib, 3, &base, &len, NULL, 0)) < 0) #else - if ((error = sysctlbyname("hw.chipset.memory", &base, &len, - 0, 0)) < 0) + if ((error = sysctlbyname("hw.chipset.memory", &base, &len, 0, 0)) < 0) #endif FatalError("xf86MapVidMem: can't find memory\n"); } + return base; } @@ -90,6 +91,7 @@ has_bwx(void) static int bwx = 0; size_t len = sizeof(bwx); int error; + #ifdef __OpenBSD__ int mib[3]; @@ -108,9 +110,9 @@ has_bwx(void) return bwx; #endif } -#else /* __NetBSD__ */ +#else /* __NetBSD__ */ static unsigned long hae_thresh = (1UL << 24); -static unsigned long hae_mask = 0xf8000000UL; /* XXX - should use xf86AXP.c */ +static unsigned long hae_mask = 0xf8000000UL; /* XXX - should use xf86AXP.c */ static struct alpha_bus_window *abw; static int abw_count = -1; @@ -130,8 +132,7 @@ has_bwx(void) if (abw_count < 0) init_abw(); - xf86Msg(X_INFO, "has_bwx = %d\n", - abw[0].abw_abst.abst_flags & ABST_BWX ? 1 : 0); /* XXXX */ + xf86Msg(X_INFO, "has_bwx = %d\n", abw[0].abw_abst.abst_flags & ABST_BWX ? 1 : 0); /* XXXX */ return abw[0].abw_abst.abst_flags & ABST_BWX; } @@ -142,8 +143,7 @@ dense_base(void) init_abw(); /* XXX check abst_flags for ABST_DENSE just to be safe? */ - xf86Msg(X_INFO, "dense base = %#lx\n", - abw[0].abw_abst.abst_sys_start); /* XXXX */ + xf86Msg(X_INFO, "dense base = %#lx\n", abw[0].abw_abst.abst_sys_start); /* XXXX */ return abw[0].abw_abst.abst_sys_start; } @@ -163,23 +163,23 @@ memory_base(void) return 0; } } -#endif /* __NetBSD__ */ +#endif /* __NetBSD__ */ -#define BUS_BASE dense_base() -#define BUS_BASE_BWX memory_base() +#define BUS_BASE dense_base() +#define BUS_BASE_BWX memory_base() /***************************************************************************/ /* Video Memory Mapping section */ /***************************************************************************/ #ifdef __OpenBSD__ -#define SYSCTL_MSG "\tCheck that you have set 'machdep.allowaperture=1'\n" \ +#define SYSCTL_MSG "\tCheck that you have set 'machdep.allowaperture=1'\n"\ "\tin /etc/sysctl.conf and reboot your machine\n" \ "\trefer to xf86(4) for details" #endif static Bool useDevMem = FALSE; -static int devMemFd = -1; +static int devMemFd = -1; #ifdef HAS_APERTURE_DRV #define DEV_APERTURE "/dev/xf86" @@ -209,11 +209,11 @@ checkDevMem(Bool warn) /* Try the aperture driver first */ if ((fd = open(DEV_APERTURE, O_RDWR)) >= 0) { /* Try to map a page at the VGA address */ - base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE, - MAP_FLAGS, fd, (off_t)0xA0000 + BUS_BASE); + base = mmap((caddr_t) 0, 4096, PROT_READ | PROT_WRITE, + MAP_FLAGS, fd, (off_t) 0xA0000 + BUS_BASE); if (base != MAP_FAILED) { - munmap((caddr_t)base, 4096); + munmap((caddr_t) base, 4096); devMemFd = fd; useDevMem = TRUE; xf86Msg(X_INFO, "checkDevMem: using aperture driver %s\n", @@ -230,11 +230,11 @@ checkDevMem(Bool warn) #endif if ((fd = open(DEV_MEM, O_RDWR)) >= 0) { /* Try to map a page at the VGA address */ - base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE, - MAP_FLAGS, fd, (off_t)0xA0000 + BUS_BASE); + base = mmap((caddr_t) 0, 4096, PROT_READ | PROT_WRITE, + MAP_FLAGS, fd, (off_t) 0xA0000 + BUS_BASE); if (base != MAP_FAILED) { - munmap((caddr_t)base, 4096); + munmap((caddr_t) base, 4096); devMemFd = fd; useDevMem = TRUE; return; @@ -254,11 +254,11 @@ checkDevMem(Bool warn) #ifndef __OpenBSD__ xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n" "\t(%s)\n", DEV_APERTURE, DEV_MEM, strerror(errno)); -#else /* __OpenBSD__ */ +#else /* __OpenBSD__ */ xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n" "\t(%s)\n%s", DEV_APERTURE, DEV_MEM, strerror(errno), SYSCTL_MSG); -#endif /* __OpenBSD__ */ +#endif /* __OpenBSD__ */ #endif xf86ErrorF("\tlinear framebuffer access unavailable\n"); } @@ -273,12 +273,12 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem) pVidMem->linearSupported = useDevMem; if (has_bwx()) { - xf86Msg(X_PROBED,"Machine type has 8/16 bit access\n"); + xf86Msg(X_PROBED, "Machine type has 8/16 bit access\n"); pVidMem->mapMem = mapVidMem; pVidMem->unmapMem = unmapVidMem; } else { - xf86Msg(X_PROBED,"Machine needs sparse mapping\n"); + xf86Msg(X_PROBED, "Machine needs sparse mapping\n"); pVidMem->mapMem = mapVidMemSparse; pVidMem->unmapMem = unmapVidMemSparse; #ifndef __NetBSD__ @@ -286,7 +286,7 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem) axpSystem = bsdGetAXP(); hae_thresh = xf86AXPParams[axpSystem].hae_thresh; hae_mask = xf86AXPParams[axpSystem].hae_mask; -#endif /* __NetBSD__ */ +#endif /* __NetBSD__ */ } pVidMem->initialised = TRUE; } @@ -297,35 +297,33 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) pointer base; checkDevMem(FALSE); - Base = Base & ((1L<<32) - 1); + Base = Base & ((1L << 32) - 1); if (useDevMem) { if (devMemFd < 0) { FatalError("xf86MapVidMem: failed to open %s (%s)\n", DEV_MEM, strerror(errno)); } - base = mmap((caddr_t)0, Size, + base = mmap((caddr_t) 0, Size, (flags & VIDMEM_READONLY) ? PROT_READ : (PROT_READ | PROT_WRITE), - MAP_FLAGS, devMemFd, (off_t)Base + BUS_BASE_BWX); + MAP_FLAGS, devMemFd, (off_t) Base + BUS_BASE_BWX); if (base == MAP_FAILED) { FatalError("%s: could not mmap %s [s=%lx,a=%lx] (%s)\n", - "xf86MapVidMem", DEV_MEM, Size, Base, - strerror(errno)); + "xf86MapVidMem", DEV_MEM, Size, Base, strerror(errno)); } return base; } /* else, mmap /dev/vga */ - if ((unsigned long)Base < 0xA0000 || (unsigned long)Base >= 0xC0000) { + if ((unsigned long) Base < 0xA0000 || (unsigned long) Base >= 0xC0000) { FatalError("%s: Address 0x%lx outside allowable range\n", "xf86MapVidMem", Base); } base = mmap(0, Size, (flags & VIDMEM_READONLY) ? PROT_READ : (PROT_READ | PROT_WRITE), - MAP_FLAGS, xf86Info.consoleFd, - (unsigned long)Base + BUS_BASE); + MAP_FLAGS, xf86Info.consoleFd, (unsigned long) Base + BUS_BASE); if (base == MAP_FAILED) { FatalError("xf86MapVidMem: Could not mmap /dev/vga (%s)\n", strerror(errno)); @@ -336,7 +334,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) static void unmapVidMem(int ScreenNum, pointer Base, unsigned long Size) { - munmap((caddr_t)Base, Size); + munmap((caddr_t) Base, Size); } /* @@ -360,20 +358,21 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf, Offset += Base & (psize - 1); Base &= ~(psize - 1); mlen = (Offset + Len + psize - 1) & ~(psize - 1); - ptr = (unsigned char *)mmap((caddr_t)0, mlen, PROT_READ, - MAP_SHARED, devMemFd, (off_t)Base+BUS_BASE); - if ((long)ptr == -1) { + ptr = (unsigned char *) mmap((caddr_t) 0, mlen, PROT_READ, + MAP_SHARED, devMemFd, (off_t) Base + BUS_BASE); + if ((long) ptr == -1) { xf86Msg(X_WARNING, "xf86ReadBIOS: %s mmap[s=%x,a=%lx,o=%lx] failed (%s)\n", DEV_MEM, Len, Base, Offset, strerror(errno)); return -1; } #ifdef DEBUG - xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n", - Base, ptr[0] | (ptr[1] << 8)); + xf86MsgVerb(X_INFO, 3, + "xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n", Base, + ptr[0] | (ptr[1] << 8)); #endif - (void)memcpy(Buf, (void *)(ptr + Offset), Len); - (void)munmap((caddr_t)ptr, mlen); + (void) memcpy(Buf, (void *) (ptr + Offset), Len); + (void) munmap((caddr_t) ptr, mlen); #ifdef DEBUG xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS(%x, %x, Buf, %x)" "-> %02x %02x %02x %02x...\n", @@ -382,7 +381,6 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf, return Len; } - #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) extern int ioperm(unsigned long from, unsigned long num, int on); @@ -401,7 +399,7 @@ xf86DisableIO() return; } -#endif /* __FreeBSD_kernel__ || __OpenBSD__ */ +#endif /* __FreeBSD_kernel__ || __OpenBSD__ */ #ifdef USE_ALPHA_PIO @@ -418,7 +416,7 @@ xf86DisableIO() alpha_pci_io_enable(0); } -#endif /* USE_ALPHA_PIO */ +#endif /* USE_ALPHA_PIO */ #define vuip volatile unsigned int * @@ -429,33 +427,33 @@ extern int readDense8(pointer Base, register unsigned long Offset); extern int readDense16(pointer Base, register unsigned long Offset); extern int readDense32(pointer Base, register unsigned long Offset); extern void -writeDenseNB8(int Value, pointer Base, register unsigned long Offset); + writeDenseNB8(int Value, pointer Base, register unsigned long Offset); extern void -writeDenseNB16(int Value, pointer Base, register unsigned long Offset); + writeDenseNB16(int Value, pointer Base, register unsigned long Offset); extern void -writeDenseNB32(int Value, pointer Base, register unsigned long Offset); + writeDenseNB32(int Value, pointer Base, register unsigned long Offset); extern void -writeDense8(int Value, pointer Base, register unsigned long Offset); + writeDense8(int Value, pointer Base, register unsigned long Offset); extern void -writeDense16(int Value, pointer Base, register unsigned long Offset); + writeDense16(int Value, pointer Base, register unsigned long Offset); extern void -writeDense32(int Value, pointer Base, register unsigned long Offset); + writeDense32(int Value, pointer Base, register unsigned long Offset); static int readSparse8(pointer Base, register unsigned long Offset); static int readSparse16(pointer Base, register unsigned long Offset); static int readSparse32(pointer Base, register unsigned long Offset); static void -writeSparseNB8(int Value, pointer Base, register unsigned long Offset); + writeSparseNB8(int Value, pointer Base, register unsigned long Offset); static void -writeSparseNB16(int Value, pointer Base, register unsigned long Offset); + writeSparseNB16(int Value, pointer Base, register unsigned long Offset); static void -writeSparseNB32(int Value, pointer Base, register unsigned long Offset); + writeSparseNB32(int Value, pointer Base, register unsigned long Offset); static void -writeSparse8(int Value, pointer Base, register unsigned long Offset); + writeSparse8(int Value, pointer Base, register unsigned long Offset); static void -writeSparse16(int Value, pointer Base, register unsigned long Offset); + writeSparse16(int Value, pointer Base, register unsigned long Offset); static void -writeSparse32(int Value, pointer Base, register unsigned long Offset); + writeSparse32(int Value, pointer Base, register unsigned long Offset); #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) extern int sysarch(int, void *); @@ -474,13 +472,14 @@ sethae(u_int64_t hae) if (p.hae != hae) { p.hae = hae; - sysarch(ALPHA_SETHAE, (char *)&p); + sysarch(ALPHA_SETHAE, (char *) &p); } } #endif static pointer -mapVidMemSparse(int ScreenNum, unsigned long Base, unsigned long Size, int flags) +mapVidMemSparse(int ScreenNum, unsigned long Base, unsigned long Size, + int flags) { static Bool was_here = FALSE; @@ -499,21 +498,19 @@ mapVidMemSparse(int ScreenNum, unsigned long Base, unsigned long Size, int flags xf86ReadMmio16 = readSparse16; xf86ReadMmio32 = readSparse32; - memBase = mmap((caddr_t)0, 0x100000000, + memBase = mmap((caddr_t) 0, 0x100000000, PROT_READ | PROT_WRITE, - MAP_SHARED, devMemFd, - (off_t) BUS_BASE); - memSBase = mmap((caddr_t)0, 0x100000000, + MAP_SHARED, devMemFd, (off_t) BUS_BASE); + memSBase = mmap((caddr_t) 0, 0x100000000, PROT_READ | PROT_WRITE, - MAP_SHARED, devMemFd, - (off_t) BUS_BASE_BWX); + MAP_SHARED, devMemFd, (off_t) BUS_BASE_BWX); - if (memSBase == MAP_FAILED || memBase == MAP_FAILED) { + if (memSBase == MAP_FAILED || memBase == MAP_FAILED) { FatalError("xf86MapVidMem: Could not mmap framebuffer (%s)\n", strerror(errno)); } } - return (pointer)((unsigned long)memBase + Base); + return (pointer) ((unsigned long) memBase + Base); } static void @@ -526,8 +523,9 @@ readSparse8(pointer Base, register unsigned long Offset) { register unsigned long result, shift; register unsigned long msb; + mem_barrier(); - Offset += (unsigned long)Base - (unsigned long)memBase; + Offset += (unsigned long) Base - (unsigned long) memBase; shift = (Offset & 0x3) << 3; if (Offset >= (hae_thresh)) { msb = Offset & hae_mask; @@ -536,7 +534,7 @@ readSparse8(pointer Base, register unsigned long Offset) sethae(msb); #endif } - result = *(vuip) ((unsigned long)memSBase + (Offset << 5)); + result = *(vuip) ((unsigned long) memSBase + (Offset << 5)); result >>= shift; return 0xffUL & result; } @@ -548,7 +546,7 @@ readSparse16(pointer Base, register unsigned long Offset) register unsigned long msb; mem_barrier(); - Offset += (unsigned long)Base - (unsigned long)memBase; + Offset += (unsigned long) Base - (unsigned long) memBase; shift = (Offset & 0x2) << 3; if (Offset >= (hae_thresh)) { msb = Offset & hae_mask; @@ -557,7 +555,8 @@ readSparse16(pointer Base, register unsigned long Offset) sethae(msb); #endif } - result = *(vuip)((unsigned long)memSBase+(Offset<<5)+(1<<(5-2))); + result = + *(vuip) ((unsigned long) memSBase + (Offset << 5) + (1 << (5 - 2))); result >>= shift; return 0xffffUL & result; } @@ -566,7 +565,7 @@ static int readSparse32(pointer Base, register unsigned long Offset) { mem_barrier(); - return *(vuip)((unsigned long)Base+(Offset)); + return *(vuip) ((unsigned long) Base + (Offset)); } static void @@ -576,7 +575,7 @@ writeSparse8(int Value, pointer Base, register unsigned long Offset) register unsigned int b = Value & 0xffU; write_mem_barrier(); - Offset += (unsigned long)Base - (unsigned long)memBase; + Offset += (unsigned long) Base - (unsigned long) memBase; if (Offset >= (hae_thresh)) { msb = Offset & hae_mask; Offset -= msb; @@ -584,7 +583,7 @@ writeSparse8(int Value, pointer Base, register unsigned long Offset) sethae(msb); #endif } - *(vuip) ((unsigned long)memSBase + (Offset << 5)) = b * 0x01010101; + *(vuip) ((unsigned long) memSBase + (Offset << 5)) = b * 0x01010101; } static void @@ -594,7 +593,7 @@ writeSparse16(int Value, pointer Base, register unsigned long Offset) register unsigned int w = Value & 0xffffU; write_mem_barrier(); - Offset += (unsigned long)Base - (unsigned long)memBase; + Offset += (unsigned long) Base - (unsigned long) memBase; if (Offset >= (hae_thresh)) { msb = Offset & hae_mask; Offset -= msb; @@ -602,7 +601,7 @@ writeSparse16(int Value, pointer Base, register unsigned long Offset) sethae(msb); #endif } - *(vuip)((unsigned long)memSBase+(Offset<<5)+(1<<(5-2))) = + *(vuip) ((unsigned long) memSBase + (Offset << 5) + (1 << (5 - 2))) = w * 0x00010001; } @@ -611,7 +610,7 @@ static void writeSparse32(int Value, pointer Base, register unsigned long Offset) { write_mem_barrier(); - *(vuip)((unsigned long)Base + (Offset)) = Value; + *(vuip) ((unsigned long) Base + (Offset)) = Value; return; } @@ -621,7 +620,7 @@ writeSparseNB8(int Value, pointer Base, register unsigned long Offset) register unsigned long msb; register unsigned int b = Value & 0xffU; - Offset += (unsigned long)Base - (unsigned long)memBase; + Offset += (unsigned long) Base - (unsigned long) memBase; if (Offset >= (hae_thresh)) { msb = Offset & hae_mask; Offset -= msb; @@ -629,7 +628,7 @@ writeSparseNB8(int Value, pointer Base, register unsigned long Offset) sethae(msb); #endif } - *(vuip) ((unsigned long)memSBase + (Offset << 5)) = b * 0x01010101; + *(vuip) ((unsigned long) memSBase + (Offset << 5)) = b * 0x01010101; } static void @@ -638,47 +637,47 @@ writeSparseNB16(int Value, pointer Base, register unsigned long Offset) register unsigned long msb; register unsigned int w = Value & 0xffffU; - Offset += (unsigned long)Base - (unsigned long)memBase; + Offset += (unsigned long) Base - (unsigned long) memBase; if (Offset >= (hae_thresh)) { - msb = Offset & hae_mask ; + msb = Offset & hae_mask; Offset -= msb; #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) sethae(msb); #endif } - *(vuip)((unsigned long)memSBase+(Offset<<5)+(1<<(5-2))) = + *(vuip) ((unsigned long) memSBase + (Offset << 5) + (1 << (5 - 2))) = w * 0x00010001; } static void writeSparseNB32(int Value, pointer Base, register unsigned long Offset) { - *(vuip)((unsigned long)Base + (Offset)) = Value; + *(vuip) ((unsigned long) Base + (Offset)) = Value; return; } -_X_EXPORT void (*xf86WriteMmio8)(int Value, pointer Base, unsigned long Offset) - = writeDense8; -_X_EXPORT void (*xf86WriteMmio16)(int Value, pointer Base, unsigned long Offset) - = writeDense16; -_X_EXPORT void (*xf86WriteMmio32)(int Value, pointer Base, unsigned long Offset) - = writeDense32; -_X_EXPORT void (*xf86WriteMmioNB8)(int Value, pointer Base, unsigned long Offset) - = writeDenseNB8; -_X_EXPORT void (*xf86WriteMmioNB16)(int Value, pointer Base, unsigned long Offset) - = writeDenseNB16; -_X_EXPORT void (*xf86WriteMmioNB32)(int Value, pointer Base, unsigned long Offset) - = writeDenseNB32; -_X_EXPORT int (*xf86ReadMmio8)(pointer Base, unsigned long Offset) - = readDense8; -_X_EXPORT int (*xf86ReadMmio16)(pointer Base, unsigned long Offset) - = readDense16; -_X_EXPORT int (*xf86ReadMmio32)(pointer Base, unsigned long Offset) - = readDense32; +void (*xf86WriteMmio8) (int Value, pointer Base, unsigned long Offset) + = writeDense8; +void (*xf86WriteMmio16) (int Value, pointer Base, unsigned long Offset) + = writeDense16; +void (*xf86WriteMmio32) (int Value, pointer Base, unsigned long Offset) + = writeDense32; +void (*xf86WriteMmioNB8) (int Value, pointer Base, unsigned long Offset) + = writeDenseNB8; +void (*xf86WriteMmioNB16) (int Value, pointer Base, unsigned long Offset) + = writeDenseNB16; +void (*xf86WriteMmioNB32) (int Value, pointer Base, unsigned long Offset) + = writeDenseNB32; +int (*xf86ReadMmio8) (pointer Base, unsigned long Offset) + = readDense8; +int (*xf86ReadMmio16) (pointer Base, unsigned long Offset) + = readDense16; +int (*xf86ReadMmio32) (pointer Base, unsigned long Offset) + = readDense32; /* - * Do all things that need root privileges early - * and revoke those priviledges + * Do all things that need root privileges early + * and revoke those priviledges */ _X_EXPORT void xf86PrivilegedInit(void) @@ -688,3 +687,4 @@ xf86PrivilegedInit(void) pci_system_init(); xf86OpenConsole(); } + diff --git a/xserver/hw/xfree86/os-support/bsd/arm_video.c b/xserver/hw/xfree86/os-support/bsd/arm_video.c index 0d9c41f6a..ea4e50455 100644 --- a/xserver/hw/xfree86/os-support/bsd/arm_video.c +++ b/xserver/hw/xfree86/os-support/bsd/arm_video.c @@ -1,5 +1,5 @@ /* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/ppc_video.c,v 1.6 2003/10/07 23:14:55 herrb Exp $ */ -/* $OpenBSD: arm_video.c,v 1.9 2012/06/10 13:21:25 matthieu Exp $ */ +/* $OpenBSD: arm_video.c,v 1.10 2013/06/07 17:28:52 matthieu Exp $ */ /* * Copyright 1992 by Rich Murphey * Copyright 1993 by David Wexelblat @@ -119,13 +119,14 @@ ppcMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) if (base == MAP_FAILED) FatalError("%s: could not mmap screen [s=%lx,a=%lx] (%s)", "xf86MapVidMem", Size, Base, strerror(errno)); - + return base; } static void ppcUnmapVidMem(int ScreenNum, pointer Base, unsigned long Size) { + munmap(Base, Size); } @@ -136,24 +137,24 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf, int Len) { int rv; - + if (Base < 0x80000000) { xf86Msg(X_WARNING, "No VGA Base=%#lx\n", Base); return 0; } - + if (kmem == -1) { kmem = open(DEV_MEM, 2); if (kmem == -1) { FatalError("xf86ReadBIOS: open %s", DEV_MEM); } } - + #ifdef DEBUG xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS() %lx %lx, %x\n", Base, Offset, Len); #endif - + lseek(kmem, Base + Offset, 0); rv = read(kmem, Buf, Len); return rv; @@ -168,7 +169,7 @@ xf86PrivilegedInit(void) int mib[2]; char buf[128]; size_t len; - + mib[0] = CTL_HW; mib[1] = HW_MACHINE; len = sizeof(buf); @@ -195,58 +196,58 @@ xf86PrivilegedInit(void) */ arm_softfloat() { - void __adddf3(); - void __addsf3(); - void __eqdf2(); - void __eqsf2(); - void __extendsfdf2(); - void __fixdfsi(); - void __fixsfsi(); - void __fixunsdfsi(); - void __fixunssfsi(); - void __floatsidf(); - void __floatsisf(); - void __gedf2(); - void __gesf2(); - void __gtdf2(); - void __gtsf2(); - void __ledf2(); - void __lesf2(); - void __ltdf2(); - void __ltsf2(); - void __nedf2(); - void __negdf2(); - void __negsf2(); - void __nesf2(); - void __subdf3(); - void __subsf3(); - void __truncdfsf2(); +void __adddf3(); +void __addsf3(); +void __eqdf2(); +void __eqsf2(); +void __extendsfdf2(); +void __fixdfsi(); +void __fixsfsi(); +void __fixunsdfsi(); +void __fixunssfsi(); +void __floatsidf(); +void __floatsisf(); +void __gedf2(); +void __gesf2(); +void __gtdf2(); +void __gtsf2(); +void __ledf2(); +void __lesf2(); +void __ltdf2(); +void __ltsf2(); +void __nedf2(); +void __negdf2(); +void __negsf2(); +void __nesf2(); +void __subdf3(); +void __subsf3(); +void __truncdfsf2(); - __adddf3(); - __addsf3(); - __eqdf2(); - __eqsf2(); - __extendsfdf2(); - __fixdfsi(); - __fixsfsi(); - __fixunsdfsi(); - __fixunssfsi(); - __floatsidf(); - __floatsisf(); - __gedf2(); - __gesf2(); - __gtdf2(); - __gtsf2(); - __ledf2(); - __lesf2(); - __ltdf2(); - __ltsf2(); - __nedf2(); - __negdf2(); - __negsf2(); - __nesf2(); - __subdf3(); - __subsf3(); - __truncdfsf2(); +__adddf3(); +__addsf3(); +__eqdf2(); +__eqsf2(); +__extendsfdf2(); +__fixdfsi(); +__fixsfsi(); +__fixunsdfsi(); +__fixunssfsi(); +__floatsidf(); +__floatsisf(); +__gedf2(); +__gesf2(); +__gtdf2(); +__gtsf2(); +__ledf2(); +__lesf2(); +__ltdf2(); +__ltsf2(); +__nedf2(); +__negdf2(); +__negsf2(); +__nesf2(); +__subdf3(); +__subsf3(); +__truncdfsf2(); } #endif /* __VFP_FP__ */ diff --git a/xserver/hw/xfree86/os-support/bsd/bsd_agp.c b/xserver/hw/xfree86/os-support/bsd/bsd_agp.c index c32a5bc56..122035a07 100644 --- a/xserver/hw/xfree86/os-support/bsd/bsd_agp.c +++ b/xserver/hw/xfree86/os-support/bsd/bsd_agp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bsd_agp.c,v 1.5 2012/06/10 13:21:25 matthieu Exp $ */ +/* $OpenBSD: bsd_agp.c,v 1.6 2013/06/07 17:28:52 matthieu Exp $ */ /* * Abstraction of the AGP GART interface. * diff --git a/xserver/hw/xfree86/os-support/bsd/bsd_apm.c b/xserver/hw/xfree86/os-support/bsd/bsd_apm.c index a8a4164e0..b1938cf0d 100644 --- a/xserver/hw/xfree86/os-support/bsd/bsd_apm.c +++ b/xserver/hw/xfree86/os-support/bsd/bsd_apm.c @@ -21,21 +21,19 @@ static struct { u_int apmBsd; pmEvent xf86; } bsdToXF86Array[] = { - { - APM_STANDBY_REQ, XF86_APM_SYS_STANDBY}, { - APM_SUSPEND_REQ, XF86_APM_SYS_SUSPEND}, { - APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME}, { - APM_CRIT_RESUME, XF86_APM_CRITICAL_RESUME}, { - APM_BATTERY_LOW, XF86_APM_LOW_BATTERY}, { - APM_POWER_CHANGE, XF86_APM_POWER_STATUS_CHANGE}, { - APM_UPDATE_TIME, XF86_APM_UPDATE_TIME}, { - APM_CRIT_SUSPEND_REQ, XF86_APM_CRITICAL_SUSPEND}, { - APM_USER_STANDBY_REQ, XF86_APM_USER_STANDBY}, { - APM_USER_SUSPEND_REQ, XF86_APM_USER_SUSPEND}, { - APM_SYS_STANDBY_RESUME, XF86_APM_STANDBY_RESUME}, + {APM_STANDBY_REQ, XF86_APM_SYS_STANDBY}, + {APM_SUSPEND_REQ, XF86_APM_SYS_SUSPEND}, + {APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME}, + {APM_CRIT_RESUME, XF86_APM_CRITICAL_RESUME}, + {APM_BATTERY_LOW, XF86_APM_LOW_BATTERY}, + {APM_POWER_CHANGE, XF86_APM_POWER_STATUS_CHANGE}, + {APM_UPDATE_TIME, XF86_APM_UPDATE_TIME}, + {APM_CRIT_SUSPEND_REQ, XF86_APM_CRITICAL_SUSPEND}, + {APM_USER_STANDBY_REQ, XF86_APM_USER_STANDBY}, + {APM_USER_SUSPEND_REQ, XF86_APM_USER_SUSPEND}, + {APM_SYS_STANDBY_RESUME, XF86_APM_STANDBY_RESUME}, #ifdef APM_CAPABILITY_CHANGE - { - APM_CAPABILITY_CHANGE, XF86_APM_CAPABILITY_CHANGED}, + {APM_CAPABILITY_CHANGE, XF86_APM_CAPABILITY_CHANGED}, #endif }; diff --git a/xserver/hw/xfree86/os-support/bsd/bsd_init.c b/xserver/hw/xfree86/os-support/bsd/bsd_init.c index b78912191..0c4501a25 100644 --- a/xserver/hw/xfree86/os-support/bsd/bsd_init.c +++ b/xserver/hw/xfree86/os-support/bsd/bsd_init.c @@ -47,7 +47,9 @@ static Bool KeepTty = FALSE; +#ifdef PCCONS_SUPPORT static int devConsoleFd = -1; +#endif #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) static int VTnum = -1; static int initialVT = -1; @@ -104,7 +106,6 @@ static char *supported_drivers[] = { #endif }; - /* * Functions to probe for the existance of a supported console driver. * Any function returns either a valid file descriptor (driver probed @@ -113,19 +114,19 @@ static char *supported_drivers[] = { * an X server. */ -typedef int (*xf86ConsOpen_t)(void); +typedef int (*xf86ConsOpen_t) (void); #ifdef PCCONS_SUPPORT static int xf86OpenPccons(void); -#endif /* PCCONS_SUPPORT */ +#endif /* PCCONS_SUPPORT */ #ifdef SYSCONS_SUPPORT static int xf86OpenSyscons(void); -#endif /* SYSCONS_SUPPORT */ +#endif /* SYSCONS_SUPPORT */ #ifdef PCVT_SUPPORT static int xf86OpenPcvt(void); -#endif /* PCVT_SUPPORT */ +#endif /* PCVT_SUPPORT */ #ifdef WSCONS_SUPPORT static int xf86OpenWScons(void); @@ -150,17 +151,18 @@ static xf86ConsOpen_t xf86ConsTab[] = { #ifdef WSCONS_SUPPORT xf86OpenWScons, #endif - (xf86ConsOpen_t)NULL + (xf86ConsOpen_t) NULL }; - void xf86OpenConsole() { int i, fd = -1; xf86ConsOpen_t *driver; + #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) int result; + #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) struct utsname uts; #endif @@ -171,50 +173,50 @@ xf86OpenConsole() return; } if (serverGeneration == 1) { - /* check if we are run with euid==0 */ - if (geteuid() != 0 && issetugid()) { - FatalError("xf86OpenConsole: Server must either be suid root" + /* check if we are run with euid==0 */ + if (geteuid() != 0 && issetugid()) { + FatalError("xf86OpenConsole: Server must either be suid root" " or without privileges at all"); - } - - if (!KeepTty) { - /* - * detaching the controlling tty solves problems of kbd character - * loss. This is not interesting for CO driver, because it is - * exclusive. - */ - setpgrp(0, getpid()); - if ((i = open("/dev/tty",O_RDWR)) >= 0) { - ioctl(i,TIOCNOTTY,(char *)0); - close(i); - } - } - - /* detect which driver we are running on */ - for (driver = xf86ConsTab; *driver; driver++) { - if ((fd = (*driver)()) >= 0) - break; - } - - /* Check that a supported console driver was found */ - if (fd < 0) { - char cons_drivers[80] = {0, }; - for (i = 0; i < sizeof(supported_drivers) / sizeof(char *); i++) { - if (i) { - strcat(cons_drivers, ", "); - } - strcat(cons_drivers, supported_drivers[i]); - } - FatalError - ("%s: No console driver found\n\tSupported drivers: %s\n\t%s", - "xf86OpenConsole", cons_drivers, CHECK_DRIVER_MSG); - } - xf86Info.consoleFd = fd; - - switch (xf86Info.consType) { + } + + if (!KeepTty) { + /* + * detaching the controlling tty solves problems of kbd character + * loss. This is not interesting for CO driver, because it is + * exclusive. + */ + setpgrp(0, getpid()); + if ((i = open("/dev/tty",O_RDWR)) >= 0) { + ioctl(i,TIOCNOTTY,(char *)0); + close(i); + } + } + + /* detect which driver we are running on */ + for (driver = xf86ConsTab; *driver; driver++) { + if ((fd = (*driver)()) >= 0) + break; + } + + /* Check that a supported console driver was found */ + if (fd < 0) { + char cons_drivers[80] = {0, }; + for (i = 0; i < sizeof(supported_drivers) / sizeof(char *); i++) { + if (i) { + strcat(cons_drivers, ", "); + } + strcat(cons_drivers, supported_drivers[i]); + } + FatalError( + "%s: No console driver found\n\tSupported drivers: %s\n\t%s", + "xf86OpenConsole", cons_drivers, CHECK_DRIVER_MSG); + } + xf86Info.consoleFd = fd; + + switch (xf86Info.consType) { #ifdef PCCONS_SUPPORT case PCCONS: - if (ioctl (xf86Info.consoleFd, CONSOLE_X_MODE_ON, 0) < 0) { + if (ioctl(xf86Info.consoleFd, CONSOLE_X_MODE_ON, 0) < 0) { FatalError("%s: CONSOLE_X_MODE_ON failed (%s)\n%s", "xf86OpenConsole", strerror(errno), CHECK_DRIVER_MSG); @@ -223,7 +225,7 @@ xf86OpenConsole() * Hack to prevent keyboard hanging when syslogd closes * /dev/console */ - if ((devConsoleFd = open("/dev/console", O_WRONLY,0)) < 0) { + if ((devConsoleFd = open("/dev/console", O_WRONLY, 0)) < 0) { xf86Msg(X_WARNING, "xf86OpenConsole: couldn't open /dev/console (%s)\n", strerror(errno)); @@ -235,31 +237,32 @@ xf86OpenConsole() /* as of FreeBSD 2.2.8, syscons driver does not need the #1 vt * switching anymore. Here we check for FreeBSD 3.1 and up. * Add cases for other *BSD that behave the same. - */ + */ #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) - uname (&uts); + uname(&uts); i = atof(uts.release) * 100; - if (i >= 310) goto acquire_vt; + if (i >= 310) + goto acquire_vt; #endif /* otherwise fall through */ case PCVT: #if !(defined(__NetBSD__) && (__NetBSD_Version__ >= 200000000)) /* - * First activate the #1 VT. This is a hack to allow a server - * to be started while another one is active. There should be - * a better way. - */ - if (initialVT != 1) { + * First activate the #1 VT. This is a hack to allow a server + * to be started while another one is active. There should be + * a better way. + */ + if (initialVT != 1) { - if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, 1) != 0) { - xf86Msg(X_WARNING, + if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, 1) != 0) { + xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n"); - } - sleep(1); - } + } + sleep(1); + } #endif acquire_vt: - if (!xf86Info.ShareVTs) { + if (!xf86Info.ShareVTs) { /* * now get the VT */ @@ -275,7 +278,7 @@ acquire_vt: } signal(SIGUSR2, xf86VTRequest); - + vtmode.mode = VT_PROCESS; vtmode.relsig = SIGUSR2; vtmode.acqsig = SIGUSR2; @@ -292,21 +295,21 @@ acquire_vt: if (ioctl(xf86Info.consoleFd, KDSETMODE, KD_GRAPHICS) < 0) { FatalError("xf86OpenConsole: KDSETMODE KD_GRAPHICS failed"); } - } + } else { /* xf86Info.ShareVTs */ close(xf86Info.consoleFd); - } - break; + } + break; #endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */ #ifdef WSCONS_SUPPORT - case WSCONS: - /* Nothing to do */ - break; + case WSCONS: + /* Nothing to do */ + break; #endif } } else { - /* serverGeneration != 1 */ + /* serverGeneration != 1 */ #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) if (!xf86Info.ShareVTs && (xf86Info.consType == SYSCONS || xf86Info.consType == PCVT)) { @@ -314,12 +317,11 @@ acquire_vt: xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed\n"); } } -#endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */ +#endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */ } return; } - #ifdef PCCONS_SUPPORT static int @@ -328,16 +330,14 @@ xf86OpenPccons() int fd = -1; if ((fd = open(PCCONS_CONSOLE_DEV1, PCCONS_CONSOLE_MODE, 0)) - >= 0 || - (fd = open(PCCONS_CONSOLE_DEV2, PCCONS_CONSOLE_MODE, 0)) + >= 0 || (fd = open(PCCONS_CONSOLE_DEV2, PCCONS_CONSOLE_MODE, 0)) >= 0) { if (ioctl(fd, CONSOLE_X_MODE_OFF, 0) < 0) { - FatalError( - "%s: CONSOLE_X_MODE_OFF failed (%s)\n%s\n%s", - "xf86OpenPccons", - strerror(errno), - "Was expecting pccons driver with X support", - CHECK_DRIVER_MSG); + FatalError("%s: CONSOLE_X_MODE_OFF failed (%s)\n%s\n%s", + "xf86OpenPccons", + strerror(errno), + "Was expecting pccons driver with X support", + CHECK_DRIVER_MSG); } xf86Info.consType = PCCONS; xf86Msg(X_PROBED, "Using pccons driver with X support\n"); @@ -345,7 +345,7 @@ xf86OpenPccons() return fd; } -#endif /* PCCONS_SUPPORT */ +#endif /* PCCONS_SUPPORT */ #ifdef SYSCONS_SUPPORT @@ -394,68 +394,67 @@ xf86OpenSyscons() xf86Info.vtno = -1; } #if 0 - } + } #endif - - if (xf86Info.vtno == -1) { - /* - * All VTs are in use. If initialVT was found, use it. - */ - if (initialVT != -1) { - xf86Info.vtno = initialVT; - } + + if (xf86Info.vtno == -1) { + /* + * All VTs are in use. If initialVT was found, use it. + */ + if (initialVT != -1) { + xf86Info.vtno = initialVT; + } else { - if (syscons_version >= 0x100) { - FatalError("%s: Cannot find a free VT", - "xf86OpenSyscons"); - } - /* Should no longer reach here */ - FatalError("%s: %s %s\n\t%s %s", - "xf86OpenSyscons", - "syscons versions prior to 1.0 require", - "either the", - "server's stdin be a VT", - "or the use of the vtxx server option"); - } - } - from = X_PROBED; - } - - close(fd); + if (syscons_version >= 0x100) { + FatalError("%s: Cannot find a free VT", + "xf86OpenSyscons"); + } + /* Should no longer reach here */ + FatalError("%s: %s %s\n\t%s %s", + "xf86OpenSyscons", + "syscons versions prior to 1.0 require", + "either the", + "server's stdin be a VT", + "or the use of the vtxx server option"); + } + } + from = X_PROBED; + } + + close(fd); #ifndef __OpenBSD__ - snprintf(vtname, sizeof(vtname), "/dev/ttyv%01x", xf86Info.vtno - 1); + snprintf(vtname, sizeof(vtname), "/dev/ttyv%01x", xf86Info.vtno - 1); #else - sprintf(vtname, sizeof(vtname), "/dev/ttyC%01x", xf86Info.vtno - 1); + sprintf(vtname, sizeof(vtname), "/dev/ttyC%01x", xf86Info.vtno - 1); #endif - if ((fd = open(vtname, SYSCONS_CONSOLE_MODE, 0)) < 0) { - FatalError("xf86OpenSyscons: Cannot open %s (%s)", - vtname, strerror(errno)); - } - if (ioctl(fd, VT_GETMODE, &vtmode) < 0) { - FatalError("xf86OpenSyscons: VT_GETMODE failed"); - } - xf86Info.consType = SYSCONS; - xf86Msg(X_PROBED, "Using syscons driver with X support"); - if (syscons_version >= 0x100) { - xf86ErrorF(" (version %ld.%ld)\n", syscons_version >> 8, - syscons_version & 0xFF); - } + if ((fd = open(vtname, SYSCONS_CONSOLE_MODE, 0)) < 0) { + FatalError("xf86OpenSyscons: Cannot open %s (%s)", + vtname, strerror(errno)); + } + if (ioctl(fd, VT_GETMODE, &vtmode) < 0) { + FatalError("xf86OpenSyscons: VT_GETMODE failed"); + } + xf86Info.consType = SYSCONS; + xf86Msg(X_PROBED, "Using syscons driver with X support"); + if (syscons_version >= 0x100) { + xf86ErrorF(" (version %ld.%ld)\n", syscons_version >> 8, + syscons_version & 0xFF); + } else { - xf86ErrorF(" (version 0.x)\n"); - } - xf86Msg(from, "using VT number %d\n\n", xf86Info.vtno); - } + xf86ErrorF(" (version 0.x)\n"); + } + xf86Msg(from, "using VT number %d\n\n", xf86Info.vtno); + } else { - /* VT_GETMODE failed, probably not syscons */ - close(fd); - fd = -1; - } + /* VT_GETMODE failed, probably not syscons */ + close(fd); + fd = -1; + } } return fd; } -#endif /* SYSCONS_SUPPORT */ - +#endif /* SYSCONS_SUPPORT */ #ifdef PCVT_SUPPORT @@ -475,11 +474,11 @@ xf86OpenPcvt() #endif if (VTnum != -1) { - snprintf(vtname, sizeof(vtname), "%s%x", vtprefix, VTnum - 1); - fd = open(vtname, PCVT_CONSOLE_MODE, 0); - } + snprintf(vtname, sizeof(vtname), "%s%x", vtprefix, VTnum - 1); + fd = open(vtname, PCVT_CONSOLE_MODE, 0); + } else { - fd = open(PCVT_CONSOLE_DEV, PCVT_CONSOLE_MODE, 0); + fd = open(PCVT_CONSOLE_DEV, PCVT_CONSOLE_MODE, 0); } #ifdef WSCONS_PCVT_COMPAT_CONSOLE_DEV if (fd < 0) { @@ -488,55 +487,55 @@ xf86OpenPcvt() } #endif if (fd >= 0) { - if (ioctl(fd, VGAPCVTID, &pcvt_version) >= 0) { - if(ioctl(fd, VT_GETMODE, &vtmode) < 0) { - FatalError("%s: VT_GETMODE failed\n%s%s\n%s", - "xf86OpenPcvt", - "Found pcvt driver but X11 seems to be", - " not supported.", CHECK_DRIVER_MSG); - } + if (ioctl(fd, VGAPCVTID, &pcvt_version) >= 0) { + if(ioctl(fd, VT_GETMODE, &vtmode) < 0) { + FatalError("%s: VT_GETMODE failed\n%s%s\n%s", + "xf86OpenPcvt", + "Found pcvt driver but X11 seems to be", + " not supported.", CHECK_DRIVER_MSG); + } + + xf86Info.vtno = VTnum; + + if (ioctl(fd, VT_GETACTIVE, &initialVT) < 0) + initialVT = -1; - xf86Info.vtno = VTnum; - - if (ioctl(fd, VT_GETACTIVE, &initialVT) < 0) - initialVT = -1; - - if (xf86Info.vtno == -1) { - if (ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) { - /* No free VTs */ - xf86Info.vtno = -1; - } - - if (xf86Info.vtno == -1) { - /* - * All VTs are in use. If initialVT was found, use it. - */ - if (initialVT != -1) { - xf86Info.vtno = initialVT; - } + if (xf86Info.vtno == -1) { + if (ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) { + /* No free VTs */ + xf86Info.vtno = -1; + } + + if (xf86Info.vtno == -1) { + /* + * All VTs are in use. If initialVT was found, use it. + */ + if (initialVT != -1) { + xf86Info.vtno = initialVT; + } else { - FatalError("%s: Cannot find a free VT", - "xf86OpenPcvt"); - } - } - } + FatalError("%s: Cannot find a free VT", + "xf86OpenPcvt"); + } + } + } - close(fd); + close(fd); snprintf(vtname, sizeof(vtname), "%s%01x", vtprefix, xf86Info.vtno - 1); - if ((fd = open(vtname, PCVT_CONSOLE_MODE, 0)) < 0) { - ErrorF("xf86OpenPcvt: Cannot open %s (%s)", - vtname, strerror(errno)); - xf86Info.vtno = initialVT; - snprintf(vtname, sizeof(vtname), "%s%01x", vtprefix, xf86Info.vtno - 1); - if ((fd = open(vtname, PCVT_CONSOLE_MODE, 0)) < 0) { - FatalError("xf86OpenPcvt: Cannot open %s (%s)", - vtname, strerror(errno)); - } - } - if (ioctl(fd, VT_GETMODE, &vtmode) < 0) { - FatalError("xf86OpenPcvt: VT_GETMODE failed"); - } - xf86Info.consType = PCVT; + if ((fd = open(vtname, PCVT_CONSOLE_MODE, 0)) < 0) { + ErrorF("xf86OpenPcvt: Cannot open %s (%s)", + vtname, strerror(errno)); + xf86Info.vtno = initialVT; + snprintf(vtname, sizeof(vtname), "%s%01x", vtprefix, xf86Info.vtno - 1); + if ((fd = open(vtname, PCVT_CONSOLE_MODE, 0)) < 0) { + FatalError("xf86OpenPcvt: Cannot open %s (%s)", + vtname, strerror(errno)); + } + } + if (ioctl(fd, VT_GETMODE, &vtmode) < 0) { + FatalError("xf86OpenPcvt: VT_GETMODE failed"); + } + xf86Info.consType = PCVT; #ifdef WSCONS_SUPPORT xf86Msg(X_PROBED, "Using wscons driver on %s in pcvt compatibility mode " @@ -556,7 +555,7 @@ xf86OpenPcvt() return fd; } -#endif /* PCVT_SUPPORT */ +#endif /* PCVT_SUPPORT */ #ifdef WSCONS_SUPPORT @@ -576,31 +575,30 @@ xf86OpenWScons() mib[1] = KERN_CONSDEV; len = sizeof(dev); if (sysctl(mib, 2, &dev, &len, NULL, 0) != -1) { - snprintf(ttyname, sizeof(ttyname), "/dev/%s", devname(dev, S_IFCHR)); - if ((fd = open(ttyname, 2)) != -1) { - if (ioctl(fd, WSDISPLAYIO_GTYPE, &i) == -1) { - close(fd); - fd = -1; - } - } + snprintf(ttyname, sizeof(ttyname), "/dev/%s", devname(dev, S_IFCHR)); + if ((fd = open(ttyname, 2)) != -1) { + if (ioctl(fd, WSDISPLAYIO_GTYPE, &i) == -1) { + close(fd); + fd = -1; + } + } } #endif if (fd == -1) { - for (i = 0; i < 8; i++) { + for (i = 0; i < 8; i++) { #if defined(__NetBSD__) - snprintf(ttyname, sizeof(ttyname), "/dev/ttyE%d", i); + snprintf(ttyname, sizeof(ttyname), "/dev/ttyE%d", i); #elif defined(__OpenBSD__) - snprintf(ttyname, sizeof(ttyname), "/dev/ttyC%x", i); + snprintf(ttyname, sizeof(ttyname), "/dev/ttyC%x", i); #endif - if ((fd = open(ttyname, 2)) != -1) - break; + if ((fd = open(ttyname, 2)) != -1) + break; } } if (fd != -1) { if (ioctl(fd, WSDISPLAYIO_SMODE, &mode) < 0) { FatalError("%s: WSDISPLAYIO_MODE_MAPPED failed (%s)\n%s", - "xf86OpenConsole", strerror(errno), - CHECK_DRIVER_MSG); + "xf86OpenConsole", strerror(errno), CHECK_DRIVER_MSG); } xf86Info.consType = WSCONS; xf86Msg(X_PROBED, "Using wscons driver\n"); @@ -608,23 +606,24 @@ xf86OpenWScons() return fd; } -#endif /* WSCONS_SUPPORT */ +#endif /* WSCONS_SUPPORT */ void xf86CloseConsole() { #if defined(SYSCONS_SUPPORT) || defined(PCVT_SUPPORT) - struct vt_mode VT; + struct vt_mode VT; #endif - if (xf86Info.ShareVTs) return; + if (xf86Info.ShareVTs) + return; switch (xf86Info.consType) { #ifdef PCCONS_SUPPORT case PCCONS: - ioctl (xf86Info.consoleFd, CONSOLE_X_MODE_OFF, 0); + ioctl(xf86Info.consoleFd, CONSOLE_X_MODE_OFF, 0); break; -#endif /* PCCONS_SUPPORT */ +#endif /* PCCONS_SUPPORT */ #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) case SYSCONS: case PCVT: @@ -633,7 +632,7 @@ xf86CloseConsole() VT.mode = VT_AUTO; ioctl(xf86Info.consoleFd, VT_SETMODE, &VT); /* dflt vt handling */ } -#if !defined(OpenBSD) && !defined(USE_DEV_IO) && !defined(USE_I386_IOPL) +#if !defined(__OpenBSD__) && !defined(USE_DEV_IO) && !defined(USE_I386_IOPL) if (ioctl(xf86Info.consoleFd, KDDISABIO, 0) < 0) { xf86FatalError("xf86CloseConsole: KDDISABIO failed (%s)", strerror(errno)); @@ -642,13 +641,15 @@ xf86CloseConsole() if (initialVT != -1) ioctl(xf86Info.consoleFd, VT_ACTIVATE, initialVT); break; -#endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */ +#endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */ #ifdef WSCONS_SUPPORT - case WSCONS: { + case WSCONS: + { int mode = WSDISPLAYIO_MODE_EMUL; + ioctl(xf86Info.consoleFd, WSDISPLAYIO_SMODE, &mode); break; - } + } #endif } @@ -667,7 +668,7 @@ int xf86ProcessArgument(int argc, char *argv[], int i) { /* - * Keep server from detaching from controlling tty. This is useful + * Keep server from detaching from controlling tty. This is useful * when debugging (so the server can receive keyboard signals. */ if (!strcmp(argv[i], "-keeptty")) { @@ -676,15 +677,14 @@ xf86ProcessArgument(int argc, char *argv[], int i) } #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) if ((argv[i][0] == 'v') && (argv[i][1] == 't')) { - if (sscanf(argv[i], "vt%2d", &VTnum) == 0 || - VTnum < 1 || VTnum > 12) { + if (sscanf(argv[i], "vt%2d", &VTnum) == 0 || VTnum < 1 || VTnum > 12) { UseMsg(); VTnum = -1; return 0; } return 1; } -#endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */ +#endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */ return 0; } @@ -693,7 +693,7 @@ xf86UseMsg() { #if defined (SYSCONS_SUPPORT) || defined (PCVT_SUPPORT) ErrorF("vtXX use the specified VT number (1-12)\n"); -#endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */ +#endif /* SYSCONS_SUPPORT || PCVT_SUPPORT */ ErrorF("-keeptty "); ErrorF("don't detach controlling tty (for debugging only)\n"); return; @@ -709,29 +709,29 @@ xf86UseMsg() void xf86DropPriv(char *disp) { - struct passwd *pw; + struct passwd *pw; - /* revoke privileges */ - if (getuid() == 0) { - /* Running as root */ - pw = getpwnam("_x11"); - if (!pw) - return; - /* give away lock file to unpriviledged user */ - if (ChownLock(pw->pw_uid, pw->pw_gid) == -1) { - FatalError("Chown Lock"); - } + /* revoke privileges */ + if (getuid() == 0) { + /* Running as root */ + pw = getpwnam("_x11"); + if (!pw) + return; + /* give away lock file to unpriviledged user */ + if (ChownLock(pw->pw_uid, pw->pw_gid) == -1) { + FatalError("Chown Lock"); + } - /* Start privileged child */ - if (priv_init(pw->pw_uid, pw->pw_gid) == -1) { - FatalError("priv_init"); - } - } - else { - /* Normal user */ - if (priv_init(getuid(), getgid()) == -1) { - FatalError("priv_init"); - } - } + /* Start privileged child */ + if (priv_init(pw->pw_uid, pw->pw_gid) == -1) { + FatalError("priv_init"); + } + } + else { + /* Normal user */ + if (priv_init(getuid(), getgid()) == -1) { + FatalError("priv_init"); + } + } } #endif diff --git a/xserver/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c b/xserver/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c index 79703c5d7..8417c335a 100644 --- a/xserver/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c +++ b/xserver/hw/xfree86/os-support/bsd/bsd_kqueue_apm.c @@ -54,21 +54,19 @@ static struct { u_int apmBsd; pmEvent xf86; } bsdToXF86Array[] = { - { - APM_STANDBY_REQ, XF86_APM_SYS_STANDBY}, { - APM_SUSPEND_REQ, XF86_APM_SYS_SUSPEND}, { - APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME}, { - APM_CRIT_RESUME, XF86_APM_CRITICAL_RESUME}, { - APM_BATTERY_LOW, XF86_APM_LOW_BATTERY}, { - APM_POWER_CHANGE, XF86_APM_POWER_STATUS_CHANGE}, { - APM_UPDATE_TIME, XF86_APM_UPDATE_TIME}, { - APM_CRIT_SUSPEND_REQ, XF86_APM_CRITICAL_SUSPEND}, { - APM_USER_STANDBY_REQ, XF86_APM_USER_STANDBY}, { - APM_USER_SUSPEND_REQ, XF86_APM_USER_SUSPEND}, { - APM_SYS_STANDBY_RESUME, XF86_APM_STANDBY_RESUME}, + {APM_STANDBY_REQ, XF86_APM_SYS_STANDBY}, + {APM_SUSPEND_REQ, XF86_APM_SYS_SUSPEND}, + {APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME}, + {APM_CRIT_RESUME, XF86_APM_CRITICAL_RESUME}, + {APM_BATTERY_LOW, XF86_APM_LOW_BATTERY}, + {APM_POWER_CHANGE, XF86_APM_POWER_STATUS_CHANGE}, + {APM_UPDATE_TIME, XF86_APM_UPDATE_TIME}, + {APM_CRIT_SUSPEND_REQ, XF86_APM_CRITICAL_SUSPEND}, + {APM_USER_STANDBY_REQ, XF86_APM_USER_STANDBY}, + {APM_USER_SUSPEND_REQ, XF86_APM_USER_SUSPEND}, + {APM_SYS_STANDBY_RESUME, XF86_APM_STANDBY_RESUME}, #ifdef APM_CAPABILITY_CHANGE - { - APM_CAPABILITY_CHANGE, XF86_APM_CAPABILITY_CHANGED}, + {APM_CAPABILITY_CHANGE, XF86_APM_CAPABILITY_CHANGED}, #endif }; diff --git a/xserver/hw/xfree86/os-support/bsd/hp300_video.c b/xserver/hw/xfree86/os-support/bsd/hp300_video.c index 83292e202..8850378e6 100644 --- a/xserver/hw/xfree86/os-support/bsd/hp300_video.c +++ b/xserver/hw/xfree86/os-support/bsd/hp300_video.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hp300_video.c,v 1.4 2012/06/16 15:08:08 matthieu Exp $ */ +/* $OpenBSD: hp300_video.c,v 1.5 2013/06/07 17:28:52 matthieu Exp $ */ /* * Copyright 1992 by Rich Murphey * Copyright 1993 by David Wexelblat diff --git a/xserver/hw/xfree86/os-support/bsd/hppa_video.c b/xserver/hw/xfree86/os-support/bsd/hppa_video.c index 111eec527..2938b1d26 100644 --- a/xserver/hw/xfree86/os-support/bsd/hppa_video.c +++ b/xserver/hw/xfree86/os-support/bsd/hppa_video.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hppa_video.c,v 1.7 2012/06/16 15:08:08 matthieu Exp $ */ +/* $OpenBSD: hppa_video.c,v 1.8 2013/06/07 17:28:52 matthieu Exp $ */ /* * Copyright 1992 by Rich Murphey * Copyright 1993 by David Wexelblat diff --git a/xserver/hw/xfree86/os-support/bsd/i386_video.c b/xserver/hw/xfree86/os-support/bsd/i386_video.c index f7057c625..3141e27c1 100644 --- a/xserver/hw/xfree86/os-support/bsd/i386_video.c +++ b/xserver/hw/xfree86/os-support/bsd/i386_video.c @@ -65,12 +65,12 @@ #ifdef __OpenBSD__ #define SYSCTL_MSG "\tCheck that you have set 'machdep.allowaperture=1'\n"\ - "\tin /etc/sysctl.conf and reboot your machine\n" \ - "\trefer to xf86(4) for details\n" + "\tin /etc/sysctl.conf and reboot your machine\n" \ + "\trefer to xf86(4) for details\n" #define SYSCTL_MSG2 \ - "Check that you have set 'machdep.allowaperture=2'\n" \ - "\tin /etc/sysctl.conf and reboot your machine\n" \ - "\trefer to xf86(4) for details\n" + "Check that you have set 'machdep.allowaperture=2'\n" \ + "\tin /etc/sysctl.conf and reboot your machine\n" \ + "\trefer to xf86(4) for details\n" #endif /***************************************************************************/ @@ -78,7 +78,7 @@ /***************************************************************************/ static Bool useDevMem = FALSE; -static int devMemFd = -1; +static int devMemFd = -1; #ifdef HAS_APERTURE_DRV #define DEV_APERTURE "/dev/xf86" @@ -108,18 +108,18 @@ checkDevMem(Bool warn) static Bool devMemChecked = FALSE; int fd; pointer base; - + if (devMemChecked) return; devMemChecked = TRUE; - + #ifdef HAS_APERTURE_DRV /* Try the aperture driver first */ if ((fd = open(DEV_APERTURE, O_RDWR)) >= 0) { /* Try to map a page at the VGA address */ base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE, MAP_FLAGS, fd, (off_t)0xA0000); - + if (base != MAP_FAILED) { munmap((caddr_t)base, 4096); devMemFd = fd; @@ -140,7 +140,7 @@ checkDevMem(Bool warn) /* Try to map a page at the VGA address */ base = mmap((caddr_t)0, 4096, PROT_READ | PROT_WRITE, MAP_FLAGS, fd, (off_t)0xA0000); - + if (base != MAP_FAILED) { munmap((caddr_t)base, 4096); devMemFd = fd; @@ -162,13 +162,13 @@ checkDevMem(Bool warn) #else #ifndef __OpenBSD__ xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n" - "\t(%s)\n", DEV_APERTURE, DEV_MEM, strerror(errno)); + "\t(%s)\n", DEV_APERTURE, DEV_MEM, strerror(errno)); #else /* __OpenBSD__ */ xf86Msg(X_WARNING, "checkDevMem: failed to open %s and %s\n" "\t(%s)\n%s", DEV_APERTURE, DEV_MEM, strerror(errno), SYSCTL_MSG); #endif /* __OpenBSD__ */ - + xf86ErrorF("\tlinear framebuffer access unavailable\n"); } useDevMem = FALSE; @@ -206,9 +206,9 @@ static pointer mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) { pointer base; - + checkDevMem(FALSE); - + if (useDevMem) { if (devMemFd < 0) { FatalError("xf86MapVidMem: failed to open %s (%s)", @@ -246,7 +246,7 @@ mapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) static void unmapVidMem(int ScreenNum, pointer Base, unsigned long Size) { - munmap((caddr_t)Base, Size); + munmap((caddr_t) Base, Size); } /* @@ -260,12 +260,12 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf, unsigned char *ptr; int psize; int mlen; - + checkDevMem(TRUE); if (devMemFd == -1) { return -1; } - + psize = getpagesize(); Offset += Base & (psize - 1); Base &= ~(psize - 1); @@ -287,8 +287,8 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf, ErrorF("xf86ReadBIOS: BIOS at 0x%08x has signature 0x%04x\n", Base, ptr[0] | (ptr[1] << 8)); #endif - (void)memcpy(Buf, (void *)(ptr + Offset), Len); - (void)munmap((caddr_t)ptr, mlen); + (void) memcpy(Buf, (void *) (ptr + Offset), Len); + (void) munmap((caddr_t) ptr, mlen); #ifdef DEBUG xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS(%x, %x, Buf, %x)" "-> %02x %02x %02x %02x...\n", @@ -310,13 +310,12 @@ xf86EnableIO() if (ExtendedEnabled) return TRUE; - if (i386_iopl(TRUE) < 0) - { + if (i386_iopl(TRUE) < 0) { #ifndef __OpenBSD__ - xf86Msg(X_WARNING,"%s: Failed to set IOPL for extended I/O", + xf86Msg(X_WARNING, "%s: Failed to set IOPL for extended I/O", "xf86EnableIO"); #else - xf86Msg(X_WARNING,"%s: Failed to set IOPL for extended I/O\n%s", + xf86Msg(X_WARNING, "%s: Failed to set IOPL for extended I/O\n%s", "xf86EnableIO", SYSCTL_MSG); #endif return FALSE; @@ -337,11 +336,10 @@ xf86DisableIO() } /* Otherwise, the X server has revoqued its root uid, and thus cannot give up IO privileges any more */ - return; } -#endif /* USE_I386_IOPL */ +#endif /* USE_I386_IOPL */ #ifdef USE_AMD64_IOPL /***************************************************************************/ @@ -358,10 +356,10 @@ xf86EnableIO() if (amd64_iopl(TRUE) < 0) { #ifndef __OpenBSD__ - xf86Msg(X_WARNING,"%s: Failed to set IOPL for extended I/O", + xf86Msg(X_WARNING, "%s: Failed to set IOPL for extended I/O", "xf86EnableIO"); #else - xf86Msg(X_WARNING,"%s: Failed to set IOPL for extended I/O\n%s", + xf86Msg(X_WARNING, "%s: Failed to set IOPL for extended I/O\n%s", "xf86EnableIO", SYSCTL_MSG); #endif return FALSE; @@ -376,17 +374,17 @@ 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 */ +#endif /* USE_AMD64_IOPL */ #ifdef USE_DEV_IO static int IoFd = -1; @@ -398,7 +396,7 @@ xf86EnableIO() return TRUE; if ((IoFd = open("/dev/io", O_RDWR)) == -1) { - xf86Msg(X_WARNING,"xf86EnableIO: " + xf86Msg(X_WARNING, "xf86EnableIO: " "Failed to open /dev/io for extended I/O"); return FALSE; } @@ -427,17 +425,18 @@ xf86SetTVOut(int mode) { switch (xf86Info.consType) { #ifdef PCCONS_SUPPORT - case PCCONS:{ - if (ioctl (xf86Info.consoleFd, CONSOLE_X_TV_ON, &mode) < 0) { - xf86Msg(X_WARNING, - "xf86SetTVOut: Could not set console to TV output, %s\n", - strerror(errno)); - } - } - break; + case PCCONS:{ + + if (ioctl (xf86Info.consoleFd, CONSOLE_X_TV_ON, &mode) < 0) { + xf86Msg(X_WARNING, + "xf86SetTVOut: Could not set console to TV output, %s\n", + strerror(errno)); + } + } + break; #endif /* PCCONS_SUPPORT */ - default: + default: FatalError("Xf86SetTVOut: Unsupported console"); break; } @@ -449,17 +448,18 @@ xf86SetRGBOut() { switch (xf86Info.consType) { #ifdef PCCONS_SUPPORT - case PCCONS:{ - if (ioctl (xf86Info.consoleFd, CONSOLE_X_TV_OFF, 0) < 0) { - xf86Msg(X_WARNING, - "xf86SetTVOut: Could not set console to RGB output, %s\n", - strerror(errno)); - } - } - break; + case PCCONS:{ + + if (ioctl (xf86Info.consoleFd, CONSOLE_X_TV_OFF, 0) < 0) { + xf86Msg(X_WARNING, + "xf86SetTVOut: Could not set console to RGB output, %s\n", + strerror(errno)); + } + } + break; #endif /* PCCONS_SUPPORT */ - default: + default: FatalError("Xf86SetTVOut: Unsupported console"); break; } @@ -528,8 +528,8 @@ cleanMTRR() (mrd[i].mr_flags & MDF_ACTIVE)) { #ifdef DEBUG ErrorF("Clean for (0x%lx,0x%lx)\n", - (unsigned long)mrd[i].mr_base, - (unsigned long)mrd[i].mr_len); + (unsigned long) mrd[i].mr_base, + (unsigned long) mrd[i].mr_len); #endif if (mrd[i].mr_flags & MDF_FIXACTIVE) { mro.mo_arg[0] = MEMRANGE_SET_UPDATE; @@ -624,15 +624,16 @@ sortRangeList(RangePtr list) */ static void -findRanges(unsigned long base, unsigned long size, RangePtr *ucp, RangePtr *wcp) +findRanges(unsigned long base, unsigned long size, RangePtr * ucp, + RangePtr * wcp) { struct mem_range_desc *mrd; int nmr, i; RangePtr rp, *p; - + if (!(mrd = getAllRanges(&nmr))) return; - + for (i = 0; i < nmr; i++) { if ((mrd[i].mr_flags & MDF_ACTIVE) && mrd[i].mr_base < base + size && @@ -691,17 +692,17 @@ addWC(int screenNum, unsigned long base, unsigned long size, MessageType from) RangePtr uc = NULL, wc = NULL, retlist = NULL; struct mem_range_desc mrd; struct mem_range_op mro; - + findRanges(base, size, &uc, &wc); - + /* See of the full range is already WC */ if (!uc && fullCoverage(base, size, wc)) { xf86DrvMsg(screenNum, from, - "Write-combining range (0x%lx,0x%lx) was already set\n", + "Write-combining range (0x%lx,0x%lx) was already set\n", base, size); return NULL; } - + /* Otherwise, try to add the new range */ mrd.mr_base = base; mrd.mr_len = size; @@ -732,20 +733,20 @@ delWC(int screenNum, unsigned long base, unsigned long size, MessageType from) RangePtr uc = NULL, wc = NULL, retlist = NULL; struct mem_range_desc mrd; struct mem_range_op mro; - + findRanges(base, size, &uc, &wc); - + /* * See of the full range is already not WC, or if there is full * coverage from UC ranges. */ if (!wc || fullCoverage(base, size, uc)) { xf86DrvMsg(screenNum, from, - "Write-combining range (0x%lx,0x%lx) was already clear\n", + "Write-combining range (0x%lx,0x%lx) was already clear\n", base, size); return NULL; } - + /* Otherwise, try to add the new range */ mrd.mr_base = base; mrd.mr_len = size; @@ -793,8 +794,8 @@ undoWC(int screenNum, pointer list) while (rp) { #ifdef DEBUG ErrorF("Undo for (0x%lx,0x%lx), %d\n", - (unsigned long)rp->mrd.mr_base, - (unsigned long)rp->mrd.mr_len, rp->wasWC); + (unsigned long) rp->mrd.mr_base, + (unsigned long) rp->mrd.mr_len, rp->wasWC); #endif failed = FALSE; if (rp->wasWC) { @@ -821,15 +822,14 @@ undoWC(int screenNum, pointer list) if (failed) { xf86DrvMsg(screenNum, X_WARNING, "Failed to restore MTRR range (0x%lx,0x%lx)\n", - (unsigned long)rp->mrd.mr_base, - (unsigned long)rp->mrd.mr_len); + (unsigned long) rp->mrd.mr_base, + (unsigned long) rp->mrd.mr_len); } rp = rp->next; } } -#endif /* HAS_MTRR_SUPPORT */ - +#endif /* HAS_MTRR_SUPPORT */ #if defined(HAS_MTRR_BUILTIN) && defined(__NetBSD__) static pointer @@ -843,7 +843,7 @@ NetBSDsetWC(int screenNum, unsigned long base, unsigned long size, Bool enable, "%s MTRR %lx - %lx\n", enable ? "set" : "remove", base, (base + size)); - mtrrp = xnfalloc(sizeof (struct mtrr)); + mtrrp = xnfalloc(sizeof(struct mtrr)); mtrrp->base = base; mtrrp->len = size; mtrrp->type = MTRR_TYPE_WC; @@ -870,7 +870,7 @@ NetBSDsetWC(int screenNum, unsigned long base, unsigned long size, Bool enable, static void NetBSDundoWC(int screenNum, pointer list) { - struct mtrr *mtrrp = (struct mtrr *)list; + struct mtrr *mtrrp = (struct mtrr *) list; int n; if (mtrrp == NULL) diff --git a/xserver/hw/xfree86/os-support/bsd/ppc_video.c b/xserver/hw/xfree86/os-support/bsd/ppc_video.c index 7790774d1..9c256f53f 100644 --- a/xserver/hw/xfree86/os-support/bsd/ppc_video.c +++ b/xserver/hw/xfree86/os-support/bsd/ppc_video.c @@ -56,24 +56,25 @@ void xf86OSInitVidMem(VidMemInfoPtr pVidMem) { xf86OpenConsole(); - + pVidMem->linearSupported = TRUE; pVidMem->mapMem = ppcMapVidMem; pVidMem->unmapMem = ppcUnmapVidMem; pVidMem->initialised = TRUE; - + pci_system_init_dev_mem(xf86Info.consoleFd); xf86EnableIO(); } -_X_EXPORT volatile unsigned char *ioBase = MAP_FAILED; +volatile unsigned char *ioBase = MAP_FAILED; static pointer ppcMapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, int flags) { int fd = xf86Info.consoleFd; pointer base; + #ifdef DEBUG xf86MsgVerb(X_INFO, 3, "mapVidMem %lx, %lx, fd = %d", Base, Size, fd); @@ -103,7 +104,7 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf, int Len) { int rv; - + if (Base < 0x80000000) { xf86Msg(X_WARNING, "No VGA Base=%#lx\n", Base); return 0; @@ -117,18 +118,15 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf, } #ifdef DEBUG - xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS() %lx %lx, %x\n", - Base, Offset, Len); + xf86MsgVerb(X_INFO, 3, "xf86ReadBIOS() %lx %lx, %x\n", Base, Offset, Len); #endif - lseek(kmem, Base + Offset, 0); rv = read(kmem, Buf, Len); return rv; } - #ifdef X_PRIVSEP /* * Do all initialisation that need root privileges @@ -155,7 +153,7 @@ Bool xf86EnableIO() xf86MsgVerb(X_WARNING, 3, "xf86EnableIO %d\n", fd); if (ioBase == MAP_FAILED) { - ioBase = mmap(NULL, 0x10000, PROT_READ|PROT_WRITE, MAP_SHARED, fd, + ioBase = mmap(NULL, 0x10000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0xf2000000); xf86MsgVerb(X_INFO, 3, "xf86EnableIO: %08x\n", ioBase); if (ioBase == MAP_FAILED) { @@ -166,7 +164,8 @@ Bool xf86EnableIO() return TRUE; } -void xf86DisableIO() +void +xf86DisableIO() { if (ioBase != MAP_FAILED) { diff --git a/xserver/hw/xfree86/os-support/bsd/sparc64_video.c b/xserver/hw/xfree86/os-support/bsd/sparc64_video.c index 39ccc7a6b..c500f5e11 100644 --- a/xserver/hw/xfree86/os-support/bsd/sparc64_video.c +++ b/xserver/hw/xfree86/os-support/bsd/sparc64_video.c @@ -6,19 +6,19 @@ * documentation for any purpose is hereby granted without fee, provided that * the above copyright notice appear in all copies and that both that * copyright notice and this permission notice appear in supporting - * documentation, and that the names of Rich Murphey and David Wexelblat - * not be used in advertising or publicity pertaining to distribution of + * documentation, and that the names of Rich Murphey and David Wexelblat + * not be used in advertising or publicity pertaining to distribution of * the software without specific, written prior permission. Rich Murphey and - * David Wexelblat make no representations about the suitability of this - * software for any purpose. It is provided "as is" without express or + * David Wexelblat make no representations about the suitability of this + * software for any purpose. It is provided "as is" without express or * implied warranty. * - * RICH MURPHEY AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH REGARD TO - * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID WEXELBLAT BE LIABLE FOR - * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER - * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * RICH MURPHEY AND DAVID WEXELBLAT DISCLAIM ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS, IN NO EVENT SHALL RICH MURPHEY OR DAVID WEXELBLAT BE LIABLE FOR + * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER + * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF + * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * */ @@ -61,14 +61,12 @@ sparc64MapVidMem(int ScreenNum, unsigned long Base, unsigned long Size, pointer base; #ifdef DEBUG - xf86MsgVerb(X_INFO, 3, "mapVidMem %lx, %lx, fd = %d", - Base, Size, fd); + xf86MsgVerb(X_INFO, 3, "mapVidMem %lx, %lx, fd = %d", Base, Size, fd); #endif base = mmap(0, Size, (flags & VIDMEM_READONLY) ? - PROT_READ : (PROT_READ | PROT_WRITE), - MAP_SHARED, fd, Base); + PROT_READ : (PROT_READ | PROT_WRITE), MAP_SHARED, fd, Base); if (base == MAP_FAILED) FatalError("%s: could not mmap screen [s=%x,a=%x] (%s)", "xf86MapVidMem", Size, Base, strerror(errno)); @@ -91,13 +89,13 @@ xf86ReadBIOS(unsigned long Base, unsigned long Offset, unsigned char *Buf, #ifdef X_PRIVSEP /* - * Do all things that need root privileges early - * and revoke those privileges + * Do all things that need root privileges early + * and revoke those privileges */ _X_EXPORT void xf86PrivilegedInit(void) { - pci_system_init(); - xf86OpenConsole(); + pci_system_init(); + xf86OpenConsole(); } #endif diff --git a/xserver/hw/xfree86/os-support/bus/Makefile.in b/xserver/hw/xfree86/os-support/bus/Makefile.in index 37c87b882..17f209159 100644 --- a/xserver/hw/xfree86/os-support/bus/Makefile.in +++ b/xserver/hw/xfree86/os-support/bus/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -220,13 +220,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -248,6 +244,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -272,6 +269,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -287,7 +285,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -386,6 +383,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -497,7 +495,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -522,9 +520,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/xfree86/os-support/bus/Sbus.c b/xserver/hw/xfree86/os-support/bus/Sbus.c index b75308aa1..826000712 100644 --- a/xserver/hw/xfree86/os-support/bus/Sbus.c +++ b/xserver/hw/xfree86/os-support/bus/Sbus.c @@ -403,16 +403,16 @@ sparcPromAssignNodes(void) int devId; char *prefix; } procFbPrefixes[] = { - { - SBUS_DEVICE_BW2, "BWtwo"}, { - SBUS_DEVICE_CG14, "CGfourteen"}, { - SBUS_DEVICE_CG6, "CGsix"}, { - SBUS_DEVICE_CG3, "CGthree"}, { - SBUS_DEVICE_FFB, "Creator"}, { - SBUS_DEVICE_FFB, "Elite 3D"}, { - SBUS_DEVICE_LEO, "Leo"}, { - SBUS_DEVICE_TCX, "TCX"}, { - 0, NULL},}; + {SBUS_DEVICE_BW2, "BWtwo"}, + {SBUS_DEVICE_CG14, "CGfourteen"}, + {SBUS_DEVICE_CG6, "CGsix"}, + {SBUS_DEVICE_CG3, "CGthree"}, + {SBUS_DEVICE_FFB, "Creator"}, + {SBUS_DEVICE_FFB, "Elite 3D"}, + {SBUS_DEVICE_LEO, "Leo"}, + {SBUS_DEVICE_TCX, "TCX"}, + {0, NULL}, + }; while (fscanf(f, "%d %63s\n", &fbNum, buffer) == 2) { for (i = 0; procFbPrefixes[i].devId; i++) diff --git a/xserver/hw/xfree86/os-support/bus/nobus.c b/xserver/hw/xfree86/os-support/bus/nobus.c index dca58fee2..dc36ecd0a 100644 --- a/xserver/hw/xfree86/os-support/bus/nobus.c +++ b/xserver/hw/xfree86/os-support/bus/nobus.c @@ -1,5 +1,5 @@ static void -__noop_to_appease_ar__() +__noop_to_appease_ar__(void) { return; } diff --git a/xserver/hw/xfree86/os-support/hurd/Makefile.in b/xserver/hw/xfree86/os-support/hurd/Makefile.in index 726c77207..d2ae92048 100644 --- a/xserver/hw/xfree86/os-support/hurd/Makefile.in +++ b/xserver/hw/xfree86/os-support/hurd/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -183,13 +183,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -211,6 +207,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -235,6 +232,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -250,7 +248,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -349,6 +346,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -465,7 +463,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -490,9 +488,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/xfree86/os-support/linux/Makefile.am b/xserver/hw/xfree86/os-support/linux/Makefile.am index 36748df2c..61175b386 100644 --- a/xserver/hw/xfree86/os-support/linux/Makefile.am +++ b/xserver/hw/xfree86/os-support/linux/Makefile.am @@ -22,7 +22,7 @@ XORG_CFLAGS += -DHAVE_APM endif liblinux_la_SOURCES = lnx_init.c lnx_video.c \ - lnx_agp.c lnx_kmod.c lnx_bell.c \ + lnx_agp.c lnx_kmod.c lnx_bell.c lnx_platform.c \ $(srcdir)/../shared/bios_mmap.c \ $(srcdir)/../shared/VTsw_usl.c \ $(srcdir)/../shared/posix_tty.c \ diff --git a/xserver/hw/xfree86/os-support/linux/Makefile.in b/xserver/hw/xfree86/os-support/linux/Makefile.in index b01901474..24ea0a65f 100644 --- a/xserver/hw/xfree86/os-support/linux/Makefile.in +++ b/xserver/hw/xfree86/os-support/linux/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -78,18 +78,18 @@ CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) @LINUX_ALPHA_TRUE@liblinux_la_DEPENDENCIES = liblinuxev56.la am__liblinux_la_SOURCES_DIST = lnx_init.c lnx_video.c lnx_agp.c \ - lnx_kmod.c lnx_bell.c $(srcdir)/../shared/bios_mmap.c \ - $(srcdir)/../shared/VTsw_usl.c $(srcdir)/../shared/posix_tty.c \ - $(srcdir)/../shared/vidmem.c $(srcdir)/../shared/sigio.c \ - lnx_acpi.c lnx_apm.c $(srcdir)/lnx_axp.c \ - $(srcdir)/../shared/xf86Axp.c + lnx_kmod.c lnx_bell.c lnx_platform.c \ + $(srcdir)/../shared/bios_mmap.c $(srcdir)/../shared/VTsw_usl.c \ + $(srcdir)/../shared/posix_tty.c $(srcdir)/../shared/vidmem.c \ + $(srcdir)/../shared/sigio.c lnx_acpi.c lnx_apm.c \ + $(srcdir)/lnx_axp.c $(srcdir)/../shared/xf86Axp.c @LNXACPI_TRUE@am__objects_1 = lnx_acpi.lo lnx_apm.lo @LNXAPM_TRUE@am__objects_2 = lnx_apm.lo @LINUX_ALPHA_TRUE@am__objects_3 = lnx_axp.lo xf86Axp.lo am_liblinux_la_OBJECTS = lnx_init.lo lnx_video.lo lnx_agp.lo \ - lnx_kmod.lo lnx_bell.lo bios_mmap.lo VTsw_usl.lo posix_tty.lo \ - vidmem.lo sigio.lo $(am__objects_1) $(am__objects_2) \ - $(am__objects_3) + lnx_kmod.lo lnx_bell.lo lnx_platform.lo bios_mmap.lo \ + VTsw_usl.lo posix_tty.lo vidmem.lo sigio.lo $(am__objects_1) \ + $(am__objects_2) $(am__objects_3) liblinux_la_OBJECTS = $(am_liblinux_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -207,13 +207,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -235,6 +231,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -259,6 +256,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -274,7 +272,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -373,6 +370,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ $(am__append_2) $(am__append_3) +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -482,7 +480,7 @@ noinst_LTLIBRARIES = liblinux.la $(am__append_1) @LNXACPI_TRUE@ACPI_SRCS = lnx_acpi.c lnx_apm.c @LNXAPM_TRUE@APM_SRCS = lnx_apm.c liblinux_la_SOURCES = lnx_init.c lnx_video.c \ - lnx_agp.c lnx_kmod.c lnx_bell.c \ + lnx_agp.c lnx_kmod.c lnx_bell.c lnx_platform.c \ $(srcdir)/../shared/bios_mmap.c \ $(srcdir)/../shared/VTsw_usl.c \ $(srcdir)/../shared/posix_tty.c \ @@ -502,7 +500,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -527,9 +525,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): @@ -564,6 +562,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lnx_bell.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lnx_init.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lnx_kmod.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lnx_platform.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lnx_video.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/posix_tty.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigio.Plo@am__quote@ diff --git a/xserver/hw/xfree86/os-support/linux/int10/linux.c b/xserver/hw/xfree86/os-support/linux/int10/linux.c index fa58a72b6..8bca37524 100644 --- a/xserver/hw/xfree86/os-support/linux/int10/linux.c +++ b/xserver/hw/xfree86/os-support/linux/int10/linux.c @@ -52,7 +52,6 @@ typedef struct { int highMem; char *base; char *base_high; - int screen; char *alloc; } linuxInt10Priv; @@ -89,15 +88,16 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) memType cs; legacyVGARec vga; Bool videoBiosMapped = FALSE; - + ScrnInfoPtr pScrn; if (int10Generation != serverGeneration) { counter = 0; int10Generation = serverGeneration; } - screen = (xf86FindScreenForEntity(entityIndex))->scrnIndex; + pScrn = xf86FindScreenForEntity(entityIndex); + screen = pScrn->scrnIndex; - options = xf86HandleInt10Options(xf86Screens[screen], entityIndex); + options = xf86HandleInt10Options(pScrn, entityIndex); if (int10skip(options)) { free(options); @@ -106,7 +106,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) #if defined DoSubModules if (loadedSubModule == INT10_NOT_LOADED) - loadedSubModule = int10LinuxLoadSubModule(xf86Screens[screen]); + loadedSubModule = int10LinuxLoadSubModule(pScrn); if (loadedSubModule == INT10_LOAD_FAILED) return NULL; @@ -145,7 +145,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) } pInt = (xf86Int10InfoPtr) xnfcalloc(1, sizeof(xf86Int10InfoRec)); - pInt->scrnIndex = screen; + pInt->pScrn = pScrn; pInt->entityIndex = entityIndex; pInt->dev = xf86GetPciInfoForEntity(entityIndex); @@ -154,7 +154,6 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) pInt->mem = &linuxMem; pagesize = getpagesize(); pInt->private = (pointer) xnfcalloc(1, sizeof(linuxInt10Priv)); - ((linuxInt10Priv *) pInt->private)->screen = screen; ((linuxInt10Priv *) pInt->private)->alloc = (pointer) xnfcalloc(1, ALLOC_ENTRIES(pagesize)); @@ -333,28 +332,28 @@ MapCurrentInt10(xf86Int10InfoPtr pInt) addr = shmat(((linuxInt10Priv *) pInt->private)->lowMem, (char *) 1, SHM_RND); if (addr == SHMERRORPTR) { - xf86DrvMsg(pInt->scrnIndex, X_ERROR, "Cannot shmat() low memory\n"); - xf86DrvMsg(pInt->scrnIndex, X_ERROR, + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Cannot shmat() low memory\n"); + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "shmat(low_mem) error: %s\n", strerror(errno)); return FALSE; } if (mprotect((void *) 0, V_RAM, PROT_READ | PROT_WRITE | PROT_EXEC) != 0) - xf86DrvMsg(pInt->scrnIndex, X_ERROR, + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Cannot set EXEC bit on low memory: %s\n", strerror(errno)); if (((linuxInt10Priv *) pInt->private)->highMem >= 0) { addr = shmat(((linuxInt10Priv *) pInt->private)->highMem, (char *) HIGH_MEM, 0); if (addr == SHMERRORPTR) { - xf86DrvMsg(pInt->scrnIndex, X_ERROR, + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Cannot shmat() high memory\n"); - xf86DrvMsg(pInt->scrnIndex, X_ERROR, + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "shmget error: %s\n", strerror(errno)); return FALSE; } if (mprotect((void *) HIGH_MEM, HIGH_MEM_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC) != 0) - xf86DrvMsg(pInt->scrnIndex, X_ERROR, + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Cannot set EXEC bit on high memory: %s\n", strerror(errno)); } @@ -364,13 +363,13 @@ MapCurrentInt10(xf86Int10InfoPtr pInt) PROT_READ | PROT_WRITE | PROT_EXEC, MAP_SHARED | MAP_FIXED, fd, V_BIOS) == MAP_FAILED) { - xf86DrvMsg(pInt->scrnIndex, X_ERROR, "Cannot map V_BIOS\n"); + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Cannot map V_BIOS\n"); close(fd); return FALSE; } } else { - xf86DrvMsg(pInt->scrnIndex, X_ERROR, "Cannot open %s\n", DEV_MEM); + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Cannot open %s\n", DEV_MEM); return FALSE; } close(fd); diff --git a/xserver/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c b/xserver/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c index 8502b21b7..187698399 100644 --- a/xserver/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c +++ b/xserver/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c @@ -210,19 +210,19 @@ vm86_GP_fault(xf86Int10InfoPtr pInt) return FALSE; case 0x0f: - xf86DrvMsg(pInt->scrnIndex, X_ERROR, + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "CPU 0x0f Trap at CS:EIP=0x%4.4x:0x%8.8lx\n", X86_CS, X86_EIP); goto op0ferr; default: - xf86DrvMsg(pInt->scrnIndex, X_ERROR, "unknown reason for exception\n"); + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "unknown reason for exception\n"); op0ferr: dump_registers(pInt); stack_trace(pInt); dump_code(pInt); - xf86DrvMsg(pInt->scrnIndex, X_ERROR, "cannot continue\n"); + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "cannot continue\n"); return FALSE; } /* end of switch() */ return TRUE; @@ -238,7 +238,7 @@ do_vm86(xf86Int10InfoPtr pInt) xf86InterceptSignals(NULL); if (signo >= 0) { - xf86DrvMsg(pInt->scrnIndex, X_ERROR, + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "vm86() syscall generated signal %d.\n", signo); dump_registers(pInt); dump_code(pInt); @@ -252,7 +252,7 @@ do_vm86(xf86Int10InfoPtr pInt) return 0; break; case VM86_STI: - xf86DrvMsg(pInt->scrnIndex, X_ERROR, "vm86_sti :-((\n"); + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "vm86_sti :-((\n"); dump_registers(pInt); dump_code(pInt); stack_trace(pInt); @@ -260,7 +260,7 @@ do_vm86(xf86Int10InfoPtr pInt) case VM86_INTx: pInt->num = VM86_ARG(retval); if (!int_handler(pInt)) { - xf86DrvMsg(pInt->scrnIndex, X_ERROR, + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Unknown vm86_int: 0x%X\n\n", VM86_ARG(retval)); dump_registers(pInt); dump_code(pInt); @@ -275,10 +275,10 @@ do_vm86(xf86Int10InfoPtr pInt) * we used to warn here and bail out - but now the sigio stuff * always fires signals at us. So we just ignore them for now. */ - xf86DrvMsg(pInt->scrnIndex, X_WARNING, "received signal\n"); + xf86DrvMsg(pInt->pScrn->scrnIndex, X_WARNING, "received signal\n"); return 0; default: - xf86DrvMsg(pInt->scrnIndex, X_ERROR, "unknown type(0x%x)=0x%x\n", + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "unknown type(0x%x)=0x%x\n", VM86_ARG(retval), VM86_TYPE(retval)); dump_registers(pInt); dump_code(pInt); diff --git a/xserver/hw/xfree86/os-support/linux/lnx_acpi.c b/xserver/hw/xfree86/os-support/linux/lnx_acpi.c index d98efa247..dcaa19ee1 100644 --- a/xserver/hw/xfree86/os-support/linux/lnx_acpi.c +++ b/xserver/hw/xfree86/os-support/linux/lnx_acpi.c @@ -82,18 +82,21 @@ lnxACPIGetEventFromOs(int fd, pmEvent * events, int num) video = strtok(ev, " "); - GFX = strtok(NULL, " "); + if (!(GFX = strtok(NULL, " "))) + return 0; #if 0 ErrorF("GFX: %s\n", GFX); #endif - notify = strtok(NULL, " "); + if (!(notify = strtok(NULL, " "))) + return 0; notify_l = strtoul(notify, NULL, 16); #if 0 ErrorF("notify: 0x%lx\n", notify_l); #endif - data = strtok(NULL, " "); + if (!(data = strtok(NULL, " "))) + return 0; data_l = strtoul(data, NULL, 16); #if 0 ErrorF("data: 0x%lx\n", data_l); diff --git a/xserver/hw/xfree86/os-support/linux/lnx_apm.c b/xserver/hw/xfree86/os-support/linux/lnx_apm.c index a37331e52..387934099 100644 --- a/xserver/hw/xfree86/os-support/linux/lnx_apm.c +++ b/xserver/hw/xfree86/os-support/linux/lnx_apm.c @@ -42,26 +42,23 @@ static struct { apm_event_t apmLinux; pmEvent xf86; } LinuxToXF86[] = { - { - APM_SYS_STANDBY, XF86_APM_SYS_STANDBY}, { - APM_SYS_SUSPEND, XF86_APM_SYS_SUSPEND}, { - APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME}, { - APM_CRITICAL_RESUME, XF86_APM_CRITICAL_RESUME}, { - APM_LOW_BATTERY, XF86_APM_LOW_BATTERY}, { - APM_POWER_STATUS_CHANGE, XF86_APM_POWER_STATUS_CHANGE}, { - APM_UPDATE_TIME, XF86_APM_UPDATE_TIME}, { - APM_CRITICAL_SUSPEND, XF86_APM_CRITICAL_SUSPEND}, { - APM_USER_STANDBY, XF86_APM_USER_STANDBY}, { - APM_USER_SUSPEND, XF86_APM_USER_SUSPEND}, { - APM_STANDBY_RESUME, XF86_APM_STANDBY_RESUME}, + {APM_SYS_STANDBY, XF86_APM_SYS_STANDBY}, + {APM_SYS_SUSPEND, XF86_APM_SYS_SUSPEND}, + {APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME}, + {APM_CRITICAL_RESUME, XF86_APM_CRITICAL_RESUME}, + {APM_LOW_BATTERY, XF86_APM_LOW_BATTERY}, + {APM_POWER_STATUS_CHANGE, XF86_APM_POWER_STATUS_CHANGE}, + {APM_UPDATE_TIME, XF86_APM_UPDATE_TIME}, + {APM_CRITICAL_SUSPEND, XF86_APM_CRITICAL_SUSPEND}, + {APM_USER_STANDBY, XF86_APM_USER_STANDBY}, + {APM_USER_SUSPEND, XF86_APM_USER_SUSPEND}, + {APM_STANDBY_RESUME, XF86_APM_STANDBY_RESUME}, #if defined(APM_CAPABILITY_CHANGED) - { - APM_CAPABILITY_CHANGED, XF86_CAPABILITY_CHANGED}, + {APM_CAPABILITY_CHANGED, XF86_CAPABILITY_CHANGED}, #endif #if 0 - { - APM_STANDBY_FAILED, XF86_APM_STANDBY_FAILED}, { - APM_SUSPEND_FAILED, XF86_APM_SUSPEND_FAILED} + {APM_STANDBY_FAILED, XF86_APM_STANDBY_FAILED}, + {APM_SUSPEND_FAILED, XF86_APM_SUSPEND_FAILED} #endif }; diff --git a/xserver/hw/xfree86/os-support/linux/lnx_init.c b/xserver/hw/xfree86/os-support/linux/lnx_init.c index c938b87d3..bcb039f3f 100644 --- a/xserver/hw/xfree86/os-support/linux/lnx_init.c +++ b/xserver/hw/xfree86/os-support/linux/lnx_init.c @@ -38,6 +38,14 @@ #include +#ifndef K_OFF +#define K_OFF 0x4 +#endif + +#ifndef KDSKBMUTE +#define KDSKBMUTE 0x4B51 +#endif + static Bool KeepTty = FALSE; static int activeVT = -1; @@ -213,19 +221,23 @@ xf86OpenConsole(void) tcgetattr(xf86Info.consoleFd, &tty_attr); SYSCALL(ioctl(xf86Info.consoleFd, KDGKBMODE, &tty_mode)); -#ifdef K_OFF - /* disable kernel special keys and buffering */ - SYSCALL(ret = ioctl(xf86Info.consoleFd, KDSKBMODE, K_OFF)); + /* disable kernel special keys and buffering, new style */ + SYSCALL(ret = ioctl(xf86Info.consoleFd, KDSKBMUTE, 1)); if (ret < 0) -#endif { - SYSCALL(ret = ioctl(xf86Info.consoleFd, KDSKBMODE, K_RAW)); + /* disable kernel special keys and buffering, old style */ + SYSCALL(ret = ioctl(xf86Info.consoleFd, KDSKBMODE, K_OFF)); if (ret < 0) - FatalError("xf86OpenConsole: KDSKBMODE K_RAW failed %s\n", - strerror(errno)); + { + /* fine, just disable special keys */ + SYSCALL(ret = ioctl(xf86Info.consoleFd, KDSKBMODE, K_RAW)); + if (ret < 0) + FatalError("xf86OpenConsole: KDSKBMODE K_RAW failed %s\n", + strerror(errno)); - /* need to keep the buffer clean, else the kernel gets angry */ - xf86SetConsoleHandler(drain_console, NULL); + /* ... and drain events, else the kernel gets angry */ + xf86SetConsoleHandler(drain_console, NULL); + } } nTty = tty_attr; @@ -238,9 +250,6 @@ xf86OpenConsole(void) cfsetispeed(&nTty, 9600); cfsetospeed(&nTty, 9600); tcsetattr(xf86Info.consoleFd, TCSANOW, &nTty); - - /* we really should have a InitOSInputDevices() function instead - * of Init?$#*&Device(). So I just place it here */ } } else { /* serverGeneration != 1 */ @@ -274,6 +283,7 @@ xf86CloseConsole(void) xf86Msg(X_WARNING, "xf86CloseConsole: KDSETMODE failed: %s\n", strerror(errno)); + SYSCALL(ioctl(xf86Info.consoleFd, KDSKBMUTE, 0)); SYSCALL(ioctl(xf86Info.consoleFd, KDSKBMODE, tty_mode)); tcsetattr(xf86Info.consoleFd, TCSANOW, &tty_attr); diff --git a/xserver/hw/xfree86/os-support/linux/lnx_platform.c b/xserver/hw/xfree86/os-support/linux/lnx_platform.c new file mode 100644 index 000000000..76f5583dd --- /dev/null +++ b/xserver/hw/xfree86/os-support/linux/lnx_platform.c @@ -0,0 +1,179 @@ +#ifdef HAVE_XORG_CONFIG_H +#include +#endif + +#ifdef XSERVER_PLATFORM_BUS + +#include +#include +#include + +/* Linux platform device support */ +#include "xf86_OSproc.h" + +#include "xf86.h" +#include "xf86platformBus.h" +#include "xf86Bus.h" + +#include "hotplug.h" + +static Bool +get_drm_info(struct OdevAttributes *attribs, char *path) +{ + drmSetVersion sv; + char *buf; + int fd; + + fd = open(path, O_RDWR, O_CLOEXEC); + if (fd == -1) + return FALSE; + + sv.drm_di_major = 1; + sv.drm_di_minor = 4; + sv.drm_dd_major = -1; /* Don't care */ + sv.drm_dd_minor = -1; /* Don't care */ + if (drmSetInterfaceVersion(fd, &sv)) { + ErrorF("setversion 1.4 failed\n"); + return FALSE; + } + + xf86_add_platform_device(attribs); + + buf = drmGetBusid(fd); + xf86_add_platform_device_attrib(xf86_num_platform_devices - 1, + ODEV_ATTRIB_BUSID, buf); + drmFreeBusid(buf); + close(fd); + return TRUE; +} + +Bool +xf86PlatformDeviceCheckBusID(struct xf86_platform_device *device, const char *busid) +{ + struct OdevAttribute *attrib; + const char *syspath = NULL; + BusType bustype; + const char *id; + xorg_list_for_each_entry(attrib, &device->attribs->list, member) { + if (attrib->attrib_id == ODEV_ATTRIB_SYSPATH) { + syspath = attrib->attrib_name; + break; + } + } + + if (!syspath) + return FALSE; + + bustype = StringToBusType(busid, &id); + if (bustype == BUS_PCI) { + struct pci_device *pPci = device->pdev; + if (xf86ComparePciBusString(busid, + ((pPci->domain << 8) + | pPci->bus), + pPci->dev, pPci->func)) { + return TRUE; + } + } + else if (bustype == BUS_PLATFORM) { + /* match on the minimum string */ + int len = strlen(id); + + if (strlen(syspath) < strlen(id)) + len = strlen(syspath); + + if (strncmp(id, syspath, len)) + return FALSE; + return TRUE; + } + return FALSE; +} + +void +xf86PlatformDeviceProbe(struct OdevAttributes *attribs) +{ + struct OdevAttribute *attrib; + int i; + char *path = NULL; + Bool ret; + + xorg_list_for_each_entry(attrib, &attribs->list, member) { + if (attrib->attrib_id == ODEV_ATTRIB_PATH) { + path = attrib->attrib_name; + break; + } + } + if (!path) + goto out_free; + + for (i = 0; i < xf86_num_platform_devices; i++) { + char *dpath; + dpath = xf86_get_platform_attrib(i, ODEV_ATTRIB_PATH); + + if (!strcmp(path, dpath)) + break; + } + + if (i != xf86_num_platform_devices) + goto out_free; + + LogMessage(X_INFO, "config/udev: Adding drm device (%s)\n", + path); + + ret = get_drm_info(attribs, path); + if (ret == FALSE) + goto out_free; + + return; + +out_free: + config_odev_free_attribute_list(attribs); +} + +void NewGPUDeviceRequest(struct OdevAttributes *attribs) +{ + int old_num = xf86_num_platform_devices; + int ret; + xf86PlatformDeviceProbe(attribs); + + if (old_num == xf86_num_platform_devices) + return; + + ret = xf86platformAddDevice(xf86_num_platform_devices-1); + if (ret == -1) + xf86_remove_platform_device(xf86_num_platform_devices-1); + + ErrorF("xf86: found device %d\n", xf86_num_platform_devices); + return; +} + +void DeleteGPUDeviceRequest(struct OdevAttributes *attribs) +{ + struct OdevAttribute *attrib; + int index; + char *syspath = NULL; + + xorg_list_for_each_entry(attrib, &attribs->list, member) { + if (attrib->attrib_id == ODEV_ATTRIB_SYSPATH) { + syspath = attrib->attrib_name; + break; + } + } + + for (index = 0; index < xf86_num_platform_devices; index++) { + char *dspath; + dspath = xf86_get_platform_attrib(index, ODEV_ATTRIB_SYSPATH); + if (!strcmp(syspath, dspath)) + break; + } + + if (index == xf86_num_platform_devices) + goto out; + + ErrorF("xf86: remove device %d %s\n", index, syspath); + + xf86platformRemoveDevice(index); +out: + config_odev_free_attribute_list(attribs); +} + +#endif diff --git a/xserver/hw/xfree86/os-support/linux/lnx_video.c b/xserver/hw/xfree86/os-support/linux/lnx_video.c index 3526a21d4..d9a5da184 100644 --- a/xserver/hw/xfree86/os-support/linux/lnx_video.c +++ b/xserver/hw/xfree86/os-support/linux/lnx_video.c @@ -479,45 +479,39 @@ volatile unsigned char *ioBase = NULL; #define __NR_pciconfig_iobase 200 #endif -#endif - -Bool -xf86EnableIO(void) +static Bool +hwEnableIO(void) { -#if defined(__powerpc__) int fd; - unsigned int ioBase_phys; -#endif - - if (ExtendedEnabled) - return TRUE; - -#if defined(__powerpc__) - ioBase_phys = syscall(__NR_pciconfig_iobase, 2, 0, 0); + unsigned int ioBase_phys = syscall(__NR_pciconfig_iobase, 2, 0, 0); fd = open("/dev/mem", O_RDWR); if (ioBase == NULL) { ioBase = (volatile unsigned char *) mmap(0, 0x20000, PROT_READ | PROT_WRITE, MAP_SHARED, fd, ioBase_phys); -/* Should this be fatal or just a warning? */ -#if 0 - if (ioBase == MAP_FAILED) { - xf86Msg(X_WARNING, - "xf86EnableIOPorts: Failed to map iobase (%s)\n", - strerror(errno)); - return FALSE; - } -#endif } close(fd); -#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__) && !defined(__arm__) && !defined(__m32r__) && !defined(__nds32__) + + return ioBase != MAP_FAILED; +} + +static void +hwDisableIO(void) +{ + munmap(ioBase, 0x20000); + ioBase = NULL; +} + +#elif defined(__i386__) || defined(__x86_64__) || defined(__ia64__) || \ + defined(__alpha__) + +static Bool +hwEnableIO(void) +{ if (ioperm(0, 1024, 1) || iopl(3)) { - if (errno == ENODEV) - ErrorF("xf86EnableIOPorts: no I/O ports found\n"); - else - FatalError("xf86EnableIOPorts: failed to set IOPL" - " for I/O (%s)\n", strerror(errno)); + ErrorF("xf86EnableIOPorts: failed to set IOPL for I/O (%s)\n", + strerror(errno)); return FALSE; } #if !defined(__alpha__) @@ -526,27 +520,44 @@ xf86EnableIO(void) ioperm(0x40, 4, 0); /* trap access to the timer chip */ ioperm(0x60, 4, 0); /* trap access to the keyboard controller */ #endif -#endif - ExtendedEnabled = TRUE; return TRUE; } +static void +hwDisableIO(void) +{ + iopl(0); + ioperm(0, 1024, 0); +} + +#else /* non-IO architectures */ + +#define hwEnableIO() TRUE +#define hwDisableIO() do {} while (0) + +#endif + +Bool +xf86EnableIO(void) +{ + if (ExtendedEnabled) + return TRUE; + + ExtendedEnabled = hwEnableIO(); + + return ExtendedEnabled; +} + void xf86DisableIO(void) { if (!ExtendedEnabled) return; -#if defined(__powerpc__) - munmap(ioBase, 0x20000); - ioBase = NULL; -#elif !defined(__mc68000__) && !defined(__sparc__) && !defined(__mips__) && !defined(__sh__) && !defined(__hppa__) && !defined(__arm__) && !defined(__s390__) && !defined(__m32r__) && !defined(__nds32__) - iopl(0); - ioperm(0, 1024, 0); -#endif - ExtendedEnabled = FALSE; - return; + hwDisableIO(); + + ExtendedEnabled = FALSE; } #if defined (__alpha__) diff --git a/xserver/hw/xfree86/os-support/misc/Makefile.in b/xserver/hw/xfree86/os-support/misc/Makefile.in index 088de1a44..9738095ae 100644 --- a/xserver/hw/xfree86/os-support/misc/Makefile.in +++ b/xserver/hw/xfree86/os-support/misc/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -181,13 +181,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -209,6 +205,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -233,6 +230,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -248,7 +246,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -347,6 +344,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -457,7 +455,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -482,9 +480,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/xfree86/os-support/shared/agp_noop.c b/xserver/hw/xfree86/os-support/shared/agp_noop.c index 9c6ed4b8d..da486c051 100644 --- a/xserver/hw/xfree86/os-support/shared/agp_noop.c +++ b/xserver/hw/xfree86/os-support/shared/agp_noop.c @@ -47,7 +47,7 @@ xf86GARTCloseScreen(int screenNum) } Bool -xf86AgpGARTSupported() +xf86AgpGARTSupported(void) { return FALSE; } diff --git a/xserver/hw/xfree86/os-support/shared/ioperm_noop.c b/xserver/hw/xfree86/os-support/shared/ioperm_noop.c index 30688c0b5..eeacee9cc 100644 --- a/xserver/hw/xfree86/os-support/shared/ioperm_noop.c +++ b/xserver/hw/xfree86/os-support/shared/ioperm_noop.c @@ -36,13 +36,13 @@ #include "xf86_OSlib.h" Bool -xf86EnableIO() +xf86EnableIO(void) { return TRUE; } void -xf86DisableIO() +xf86DisableIO(void) { return; } diff --git a/xserver/hw/xfree86/os-support/shared/platform_noop.c b/xserver/hw/xfree86/os-support/shared/platform_noop.c new file mode 100644 index 000000000..199ae5e8e --- /dev/null +++ b/xserver/hw/xfree86/os-support/shared/platform_noop.c @@ -0,0 +1,23 @@ + +#ifdef HAVE_XORG_CONFIG_H +#include +#endif + +#ifdef XSERVER_PLATFORM_BUS +/* noop platform device support */ +#include "xf86_OSproc.h" + +#include "xf86.h" +#include "xf86platformBus.h" + +Bool +xf86PlatformDeviceCheckBusID(struct xf86_platform_device *device, const char *busid) +{ + return FALSE; +} + +void xf86PlatformDeviceProbe(struct OdevAttributes *attribs) +{ + +} +#endif diff --git a/xserver/hw/xfree86/os-support/shared/posix_tty.c b/xserver/hw/xfree86/os-support/shared/posix_tty.c index ff3724f78..af4900473 100644 --- a/xserver/hw/xfree86/os-support/shared/posix_tty.c +++ b/xserver/hw/xfree86/os-support/shared/posix_tty.c @@ -62,8 +62,8 @@ #include "xf86_OSlib.h" -static int -GetBaud(int baudrate) +static int +GetBaud (int baudrate) { #ifdef B300 if (baudrate == 300) @@ -119,63 +119,62 @@ xf86OpenSerial(XF86OptionPtr options) int fd, i; char *dev; - dev = xf86SetStrOption(options, "Device", NULL); + dev = xf86SetStrOption (options, "Device", NULL); if (!dev) { - xf86Msg(X_ERROR, "xf86OpenSerial: No Device specified.\n"); + xf86Msg (X_ERROR, "xf86OpenSerial: No Device specified.\n"); return -1; } - #ifndef X_PRIVSEP - SYSCALL(fd = open(dev, O_RDWR | O_NONBLOCK)); + SYSCALL (fd = open (dev, O_RDWR | O_NONBLOCK)); #else fd = priv_open_device (dev); #endif if (fd == -1) { - xf86Msg(X_ERROR, - "xf86OpenSerial: Cannot open device %s\n\t%s.\n", - dev, strerror(errno)); + xf86Msg (X_ERROR, + "xf86OpenSerial: Cannot open device %s\n\t%s.\n", + dev, strerror (errno)); free(dev); return -1; } - if (!isatty(fd)) { + if (!isatty (fd)) { /* Allow non-tty devices to be opened. */ free(dev); return fd; } /* set up default port parameters */ - SYSCALL(tcgetattr(fd, &t)); - t.c_iflag &= ~(IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR - | IGNCR | ICRNL | IXON); + SYSCALL (tcgetattr (fd, &t)); + t.c_iflag &= ~(IGNBRK|BRKINT|PARMRK|ISTRIP|INLCR + |IGNCR|ICRNL|IXON); t.c_oflag &= ~OPOST; - t.c_lflag &= ~(ECHO | ECHONL | ICANON | ISIG | IEXTEN); - t.c_cflag &= ~(CSIZE | PARENB); - t.c_cflag |= CS8 | CLOCAL; - - cfsetispeed(&t, B9600); - cfsetospeed(&t, B9600); + t.c_lflag &= ~(ECHO|ECHONL|ICANON|ISIG|IEXTEN); + t.c_cflag &= ~(CSIZE|PARENB); + t.c_cflag |= CS8|CLOCAL; + + cfsetispeed (&t, B9600); + cfsetospeed (&t, B9600); t.c_cc[VMIN] = 1; t.c_cc[VTIME] = 0; - SYSCALL(tcsetattr(fd, TCSANOW, &t)); + SYSCALL (tcsetattr (fd, TCSANOW, &t)); - if (xf86SetSerial(fd, options) == -1) { - SYSCALL(close(fd)); + if (xf86SetSerial (fd, options) == -1) { + SYSCALL (close (fd)); free(dev); return -1; } - SYSCALL(i = fcntl(fd, F_GETFL, 0)); + SYSCALL (i = fcntl (fd, F_GETFL, 0)); if (i == -1) { - SYSCALL(close(fd)); + SYSCALL (close (fd)); free(dev); return -1; } i &= ~O_NONBLOCK; - SYSCALL(i = fcntl(fd, F_SETFL, i)); + SYSCALL (i = fcntl (fd, F_SETFL, i)); if (i == -1) { - SYSCALL(close(fd)); + SYSCALL (close (fd)); free(dev); return -1; } @@ -426,7 +425,8 @@ xf86FlushInput(int fd) { fd_set fds; struct timeval timeout; - char c[4]; + /* this needs to be big enough to flush an evdev event. */ + char c[256]; DebugF("FlushingSerial\n"); if (tcflush(fd, TCIFLUSH) == 0) diff --git a/xserver/hw/xfree86/os-support/shared/sigio.c b/xserver/hw/xfree86/os-support/shared/sigio.c index 12ae8a480..f3c153b89 100644 --- a/xserver/hw/xfree86/os-support/shared/sigio.c +++ b/xserver/hw/xfree86/os-support/shared/sigio.c @@ -99,6 +99,8 @@ xf86SIGIO(int sig) int save_errno = errno; /* do not clobber the global errno */ int r; + inSignalContext = TRUE; + ready = xf86SigIOMask; to.tv_sec = 0; to.tv_usec = 0; @@ -114,6 +116,8 @@ xf86SIGIO(int sig) } /* restore global errno */ errno = save_errno; + + inSignalContext = FALSE; } static int @@ -132,7 +136,6 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure) struct sigaction sa; struct sigaction osa; int i; - int blocked; int installed = FALSE; if (!xf86Info.useSIGIO) @@ -142,7 +145,7 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure) if (!xf86SigIOFuncs[i].f) { if (xf86IsPipe(fd)) return 0; - blocked = xf86BlockSIGIO(); + OsBlockSIGIO(); #ifdef O_ASYNC if (fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_ASYNC) == -1) { xf86Msg(X_WARNING, "fcntl(%d, O_ASYNC): %s\n", @@ -170,7 +173,7 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure) } #endif if (!installed) { - xf86UnblockSIGIO(blocked); + OsReleaseSIGIO(); return 0; } sigemptyset(&sa.sa_mask); @@ -186,7 +189,7 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure) if (fd >= xf86SigIOMaxFd) xf86SigIOMaxFd = fd + 1; FD_SET(fd, &xf86SigIOMask); - xf86UnblockSIGIO(blocked); + OsReleaseSIGIO(); return 1; } /* Allow overwriting of the closure and callback */ @@ -259,26 +262,13 @@ xf86RemoveSIGIOHandler(int fd) int xf86BlockSIGIO(void) { - sigset_t set, old; - int ret; - - sigemptyset(&set); - sigaddset(&set, SIGIO); - sigprocmask(SIG_BLOCK, &set, &old); - ret = sigismember(&old, SIGIO); - return ret; + return OsBlockSIGIO(); } void xf86UnblockSIGIO(int wasset) { - sigset_t set; - - if (!wasset) { - sigemptyset(&set); - sigaddset(&set, SIGIO); - sigprocmask(SIG_UNBLOCK, &set, NULL); - } + OsReleaseSIGIO(); } void diff --git a/xserver/hw/xfree86/os-support/shared/vidmem.c b/xserver/hw/xfree86/os-support/shared/vidmem.c index a7717d8f6..514fc2fa7 100644 --- a/xserver/hw/xfree86/os-support/shared/vidmem.c +++ b/xserver/hw/xfree86/os-support/shared/vidmem.c @@ -156,19 +156,6 @@ checkMtrrOption(VidMapPtr vp) } } -void -xf86MakeNewMapping(int ScreenNum, int Flags, unsigned long Base, - unsigned long Size, pointer Vbase) -{ - VidMapPtr vp; - MappingPtr mp; - - vp = getVidMapRec(ScreenNum); - mp = newMapping(vp); - mp->size = Size; - mp->virtBase = Vbase; -} - void xf86InitVidMem(void) { diff --git a/xserver/hw/xfree86/os-support/solaris/Makefile.in b/xserver/hw/xfree86/os-support/solaris/Makefile.in index da91c0b29..a08f532ef 100644 --- a/xserver/hw/xfree86/os-support/solaris/Makefile.in +++ b/xserver/hw/xfree86/os-support/solaris/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -236,13 +236,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -264,6 +260,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -288,6 +285,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -303,7 +301,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -402,6 +399,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -528,7 +526,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .S .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -553,9 +551,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/xfree86/os-support/solaris/sun_apm.c b/xserver/hw/xfree86/os-support/solaris/sun_apm.c index 4ff64649a..b6a1432f6 100644 --- a/xserver/hw/xfree86/os-support/solaris/sun_apm.c +++ b/xserver/hw/xfree86/os-support/solaris/sun_apm.c @@ -97,21 +97,19 @@ static struct { u_int apmBsd; pmEvent xf86; } sunToXF86Array[] = { - { - APM_STANDBY_REQ, XF86_APM_SYS_STANDBY}, { - APM_SUSPEND_REQ, XF86_APM_SYS_SUSPEND}, { - APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME}, { - APM_CRIT_RESUME, XF86_APM_CRITICAL_RESUME}, { - APM_BATTERY_LOW, XF86_APM_LOW_BATTERY}, { - APM_POWER_CHANGE, XF86_APM_POWER_STATUS_CHANGE}, { - APM_UPDATE_TIME, XF86_APM_UPDATE_TIME}, { - APM_CRIT_SUSPEND_REQ, XF86_APM_CRITICAL_SUSPEND}, { - APM_USER_STANDBY_REQ, XF86_APM_USER_STANDBY}, { - APM_USER_SUSPEND_REQ, XF86_APM_USER_SUSPEND}, { - APM_SYS_STANDBY_RESUME, XF86_APM_STANDBY_RESUME}, + {APM_STANDBY_REQ, XF86_APM_SYS_STANDBY}, + {APM_SUSPEND_REQ, XF86_APM_SYS_SUSPEND}, + {APM_NORMAL_RESUME, XF86_APM_NORMAL_RESUME}, + {APM_CRIT_RESUME, XF86_APM_CRITICAL_RESUME}, + {APM_BATTERY_LOW, XF86_APM_LOW_BATTERY}, + {APM_POWER_CHANGE, XF86_APM_POWER_STATUS_CHANGE}, + {APM_UPDATE_TIME, XF86_APM_UPDATE_TIME}, + {APM_CRIT_SUSPEND_REQ, XF86_APM_CRITICAL_SUSPEND}, + {APM_USER_STANDBY_REQ, XF86_APM_USER_STANDBY}, + {APM_USER_SUSPEND_REQ, XF86_APM_USER_SUSPEND}, + {APM_SYS_STANDBY_RESUME, XF86_APM_STANDBY_RESUME}, #ifdef APM_CAPABILITY_CHANGE - { - APM_CAPABILITY_CHANGE, XF86_APM_CAPABILITY_CHANGED}, + {APM_CAPABILITY_CHANGE, XF86_APM_CAPABILITY_CHANGED}, #endif }; diff --git a/xserver/hw/xfree86/os-support/stub/Makefile.in b/xserver/hw/xfree86/os-support/stub/Makefile.in index e8ff97249..96f0609ae 100644 --- a/xserver/hw/xfree86/os-support/stub/Makefile.in +++ b/xserver/hw/xfree86/os-support/stub/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -183,13 +183,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -211,6 +207,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -235,6 +232,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -250,7 +248,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -349,6 +346,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -469,7 +467,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -494,9 +492,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/xfree86/os-support/stub/stub_init.c b/xserver/hw/xfree86/os-support/stub/stub_init.c index 629675d68..d3e0c3f29 100644 --- a/xserver/hw/xfree86/os-support/stub/stub_init.c +++ b/xserver/hw/xfree86/os-support/stub/stub_init.c @@ -5,12 +5,12 @@ #include "xf86_OSlib.h" void -xf86OpenConsole() +xf86OpenConsole(void) { } void -xf86CloseConsole() +xf86CloseConsole(void) { } @@ -21,6 +21,6 @@ xf86ProcessArgument(int argc, char *argv[], int i) } void -xf86UseMsg() +xf86UseMsg(void) { } diff --git a/xserver/hw/xfree86/os-support/xf86_OSlib.h b/xserver/hw/xfree86/os-support/xf86_OSlib.h index 9161e181e..e931b09a1 100644 --- a/xserver/hw/xfree86/os-support/xf86_OSlib.h +++ b/xserver/hw/xfree86/os-support/xf86_OSlib.h @@ -171,7 +171,7 @@ /**************************************************************************/ /* Linux or Glibc-based system */ /**************************************************************************/ -#if defined(__linux__) || defined(__GLIBC__) +#if defined(__linux__) || defined(__GLIBC__) || defined(__CYGWIN__) #include #include #include diff --git a/xserver/hw/xfree86/os-support/xf86_OSproc.h b/xserver/hw/xfree86/os-support/xf86_OSproc.h index e171146dd..ea2b16e46 100644 --- a/xserver/hw/xfree86/os-support/xf86_OSproc.h +++ b/xserver/hw/xfree86/os-support/xf86_OSproc.h @@ -215,12 +215,16 @@ extern _X_EXPORT int xf86ProcessArgument(int, char **, int); extern _X_EXPORT void xf86UseMsg(void); extern _X_EXPORT PMClose xf86OSPMOpen(void); -extern _X_EXPORT _X_DEPRECATED void xf86MakeNewMapping(int, int, unsigned long, - unsigned long, pointer); extern _X_EXPORT void xf86InitVidMem(void); #endif /* XF86_OS_PRIVS */ +#ifdef XSERVER_PLATFORM_BUS +#include "hotplug.h" +void +xf86PlatformDeviceProbe(struct OdevAttributes *attribs); +#endif + _XFUNCPROTOEND #endif /* NO_OSLIB_PROTOTYPES */ #endif /* _XF86_OSPROC_H */ diff --git a/xserver/hw/xfree86/parser/Device.c b/xserver/hw/xfree86/parser/Device.c index f27b56fef..bb1ba88fb 100644 --- a/xserver/hw/xfree86/parser/Device.c +++ b/xserver/hw/xfree86/parser/Device.c @@ -52,8 +52,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* View/edit this file with tab stops set to 4 */ - #ifdef HAVE_XORG_CONFIG_H #include #endif diff --git a/xserver/hw/xfree86/parser/Files.c b/xserver/hw/xfree86/parser/Files.c index d8152c008..0d3e47ac5 100644 --- a/xserver/hw/xfree86/parser/Files.c +++ b/xserver/hw/xfree86/parser/Files.c @@ -51,8 +51,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* View/edit this file with tab stops set to 4 */ - #ifdef HAVE_XORG_CONFIG_H #include #endif diff --git a/xserver/hw/xfree86/parser/Flags.c b/xserver/hw/xfree86/parser/Flags.c index 29a60a2e1..2461476d1 100644 --- a/xserver/hw/xfree86/parser/Flags.c +++ b/xserver/hw/xfree86/parser/Flags.c @@ -51,8 +51,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* View/edit this file with tab stops set to 4 */ - #ifdef HAVE_XORG_CONFIG_H #include #endif diff --git a/xserver/hw/xfree86/parser/Input.c b/xserver/hw/xfree86/parser/Input.c index 6e0073437..ff2b9acbc 100644 --- a/xserver/hw/xfree86/parser/Input.c +++ b/xserver/hw/xfree86/parser/Input.c @@ -52,8 +52,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* View/edit this file with tab stops set to 4 */ - #ifdef HAVE_XORG_CONFIG_H #include #endif diff --git a/xserver/hw/xfree86/parser/InputClass.c b/xserver/hw/xfree86/parser/InputClass.c index 8493685cd..de6a816ea 100644 --- a/xserver/hw/xfree86/parser/InputClass.c +++ b/xserver/hw/xfree86/parser/InputClass.c @@ -23,8 +23,6 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -/* View/edit this file with tab stops set to 4 */ - #ifdef HAVE_XORG_CONFIG_H #include #endif diff --git a/xserver/hw/xfree86/parser/Layout.c b/xserver/hw/xfree86/parser/Layout.c index bd33d6dfc..cbd8d247a 100644 --- a/xserver/hw/xfree86/parser/Layout.c +++ b/xserver/hw/xfree86/parser/Layout.c @@ -52,8 +52,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* View/edit this file with tab stops set to 4 */ - #ifdef HAVE_XORG_CONFIG_H #include #endif diff --git a/xserver/hw/xfree86/parser/Makefile.in b/xserver/hw/xfree86/parser/Makefile.in index 006b01345..35bcbbcc2 100644 --- a/xserver/hw/xfree86/parser/Makefile.in +++ b/xserver/hw/xfree86/parser/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -238,13 +238,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -266,6 +262,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -290,6 +287,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -305,7 +303,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -404,6 +401,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -558,7 +556,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -583,9 +581,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) diff --git a/xserver/hw/xfree86/parser/Module.c b/xserver/hw/xfree86/parser/Module.c index 1c458ae6c..87ddfc635 100644 --- a/xserver/hw/xfree86/parser/Module.c +++ b/xserver/hw/xfree86/parser/Module.c @@ -52,8 +52,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* View/edit this file with tab stops set to 4 */ - #ifdef HAVE_XORG_CONFIG_H #include #endif diff --git a/xserver/hw/xfree86/parser/Monitor.c b/xserver/hw/xfree86/parser/Monitor.c index b237dfb32..36b4ebe35 100644 --- a/xserver/hw/xfree86/parser/Monitor.c +++ b/xserver/hw/xfree86/parser/Monitor.c @@ -52,8 +52,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* View/edit this file with tab stops set to 4 */ - #ifdef HAVE_XORG_CONFIG_H #include #endif diff --git a/xserver/hw/xfree86/parser/Pointer.c b/xserver/hw/xfree86/parser/Pointer.c index cdbc09c1a..ff748d99a 100644 --- a/xserver/hw/xfree86/parser/Pointer.c +++ b/xserver/hw/xfree86/parser/Pointer.c @@ -52,8 +52,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* View/edit this file with tab stops set to 4 */ - #ifdef HAVE_XORG_CONFIG_H #include #endif diff --git a/xserver/hw/xfree86/parser/Screen.c b/xserver/hw/xfree86/parser/Screen.c index 71778d88d..f294ec490 100644 --- a/xserver/hw/xfree86/parser/Screen.c +++ b/xserver/hw/xfree86/parser/Screen.c @@ -52,8 +52,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* View/edit this file with tab stops set to 4 */ - #ifdef HAVE_XORG_CONFIG_H #include #endif diff --git a/xserver/hw/xfree86/parser/Vendor.c b/xserver/hw/xfree86/parser/Vendor.c index b4e2165b0..9b7695c8e 100644 --- a/xserver/hw/xfree86/parser/Vendor.c +++ b/xserver/hw/xfree86/parser/Vendor.c @@ -52,8 +52,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* View/edit this file with tab stops set to 4 */ - #ifdef HAVE_XORG_CONFIG_H #include #endif diff --git a/xserver/hw/xfree86/parser/Video.c b/xserver/hw/xfree86/parser/Video.c index fc1f1e544..68d611ae7 100644 --- a/xserver/hw/xfree86/parser/Video.c +++ b/xserver/hw/xfree86/parser/Video.c @@ -52,8 +52,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* View/edit this file with tab stops set to 4 */ - #ifdef HAVE_XORG_CONFIG_H #include #endif diff --git a/xserver/hw/xfree86/parser/read.c b/xserver/hw/xfree86/parser/read.c index eef873e89..6545bcdae 100644 --- a/xserver/hw/xfree86/parser/read.c +++ b/xserver/hw/xfree86/parser/read.c @@ -52,8 +52,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* View/edit this file with tab stops set to 4 */ - #ifdef HAVE_XORG_CONFIG_H #include #endif diff --git a/xserver/hw/xfree86/parser/scan.c b/xserver/hw/xfree86/parser/scan.c index 795da615f..f852b83ec 100644 --- a/xserver/hw/xfree86/parser/scan.c +++ b/xserver/hw/xfree86/parser/scan.c @@ -51,8 +51,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* View/edit this file with tab stops set to 4 */ - #ifdef HAVE_XORG_CONFIG_H #include #endif diff --git a/xserver/hw/xfree86/parser/write.c b/xserver/hw/xfree86/parser/write.c index c001c3d51..9c706a062 100644 --- a/xserver/hw/xfree86/parser/write.c +++ b/xserver/hw/xfree86/parser/write.c @@ -51,8 +51,6 @@ * authorization from the copyright holder(s) and author(s). */ -/* View/edit this file with tab stops set to 4 */ - #ifdef HAVE_XORG_CONFIG_H #include #endif diff --git a/xserver/hw/xfree86/ramdac/Makefile.am b/xserver/hw/xfree86/ramdac/Makefile.am index 3c3780516..346af4ccc 100644 --- a/xserver/hw/xfree86/ramdac/Makefile.am +++ b/xserver/hw/xfree86/ramdac/Makefile.am @@ -1,19 +1,12 @@ noinst_LTLIBRARIES = libramdac.la libramdac_la_SOURCES = xf86RamDac.c xf86RamDacCmap.c \ - xf86Cursor.c xf86HWCurs.c IBM.c BT.c TI.c \ - xf86BitOrder.c + xf86Cursor.c xf86HWCurs.c IBM.c BT.c TI.c sdk_HEADERS = BT.h IBM.h TI.h xf86Cursor.h xf86RamDac.h -DISTCLEANFILES = xf86BitOrder.c EXTRA_DIST = BTPriv.h IBMPriv.h TIPriv.h xf86CursorPriv.h xf86RamDacPriv.h \ CURSOR.NOTES -AM_CFLAGS = -DXAAReverseBitOrder=xf86ReverseBitOrder -DRAMDAC_MODULE \ - $(DIX_CFLAGS) $(XORG_CFLAGS) +AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) INCLUDES = $(XORG_INCS) - -xf86BitOrder.c: - $(AM_V_GEN)echo "#define XAAReverseBitOrder xf86ReverseBitOrder" > $@ - $(AM_V_GEN)echo "#include \"$(srcdir)/../xaa/xaaBitOrder.c\"" >> $@ diff --git a/xserver/hw/xfree86/ramdac/Makefile.in b/xserver/hw/xfree86/ramdac/Makefile.in index 2558f68e8..725efd65e 100644 --- a/xserver/hw/xfree86/ramdac/Makefile.in +++ b/xserver/hw/xfree86/ramdac/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -76,7 +76,7 @@ CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libramdac_la_LIBADD = am_libramdac_la_OBJECTS = xf86RamDac.lo xf86RamDacCmap.lo \ - xf86Cursor.lo xf86HWCurs.lo IBM.lo BT.lo TI.lo xf86BitOrder.lo + xf86Cursor.lo xf86HWCurs.lo IBM.lo BT.lo TI.lo libramdac_la_OBJECTS = $(am_libramdac_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -212,13 +212,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -240,6 +236,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -264,6 +261,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -279,7 +277,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -378,6 +375,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -479,23 +477,19 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libramdac.la libramdac_la_SOURCES = xf86RamDac.c xf86RamDacCmap.c \ - xf86Cursor.c xf86HWCurs.c IBM.c BT.c TI.c \ - xf86BitOrder.c + xf86Cursor.c xf86HWCurs.c IBM.c BT.c TI.c sdk_HEADERS = BT.h IBM.h TI.h xf86Cursor.h xf86RamDac.h -DISTCLEANFILES = xf86BitOrder.c EXTRA_DIST = BTPriv.h IBMPriv.h TIPriv.h xf86CursorPriv.h xf86RamDacPriv.h \ CURSOR.NOTES -AM_CFLAGS = -DXAAReverseBitOrder=xf86ReverseBitOrder -DRAMDAC_MODULE \ - $(DIX_CFLAGS) $(XORG_CFLAGS) - +AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) INCLUDES = $(XORG_INCS) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -520,9 +514,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): @@ -548,7 +542,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/BT.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/IBM.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/TI.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86BitOrder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86Cursor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86HWCurs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xf86RamDac.Plo@am__quote@ @@ -731,7 +724,6 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @@ -824,10 +816,6 @@ uninstall-am: uninstall-sdkHEADERS tags uninstall uninstall-am uninstall-sdkHEADERS -xf86BitOrder.c: - $(AM_V_GEN)echo "#define XAAReverseBitOrder xf86ReverseBitOrder" > $@ - $(AM_V_GEN)echo "#include \"$(srcdir)/../xaa/xaaBitOrder.c\"" >> $@ - # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/xserver/hw/xfree86/ramdac/xf86Cursor.c b/xserver/hw/xfree86/ramdac/xf86Cursor.c index 678d2be5c..8d48a7542 100644 --- a/xserver/hw/xfree86/ramdac/xf86Cursor.c +++ b/xserver/hw/xfree86/ramdac/xf86Cursor.c @@ -43,19 +43,19 @@ static miPointerSpriteFuncRec xf86CursorSpriteFuncs = { static void xf86CursorInstallColormap(ColormapPtr); static void xf86CursorRecolorCursor(DeviceIntPtr pDev, ScreenPtr, CursorPtr, Bool); -static Bool xf86CursorCloseScreen(int, ScreenPtr); +static Bool xf86CursorCloseScreen(ScreenPtr); static void xf86CursorQueryBestSize(int, unsigned short *, unsigned short *, ScreenPtr); /* ScrnInfoRec functions */ -static void xf86CursorEnableDisableFBAccess(int, Bool); -static Bool xf86CursorSwitchMode(int, DisplayModePtr, int); +static void xf86CursorEnableDisableFBAccess(ScrnInfoPtr, Bool); +static Bool xf86CursorSwitchMode(ScrnInfoPtr, DisplayModePtr); Bool xf86InitCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CursorScreenPtr ScreenPriv; miPointerScreenPtr PointPriv; @@ -118,9 +118,9 @@ xf86InitCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr) /***** Screen functions *****/ static Bool -xf86CursorCloseScreen(int i, ScreenPtr pScreen) +xf86CursorCloseScreen(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); miPointerScreenPtr PointPriv = (miPointerScreenPtr) dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey); @@ -149,7 +149,7 @@ xf86CursorCloseScreen(int i, ScreenPtr pScreen) free(ScreenPriv->transparentData); free(ScreenPriv); - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } static void @@ -203,11 +203,11 @@ xf86CursorRecolorCursor(DeviceIntPtr pDev, /***** ScrnInfoRec functions *********/ static void -xf86CursorEnableDisableFBAccess(int index, Bool enable) +xf86CursorEnableDisableFBAccess(ScrnInfoPtr pScrn, Bool enable) { DeviceIntPtr pDev = inputInfo.pointer; - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, xf86CursorScreenKey); @@ -223,7 +223,7 @@ xf86CursorEnableDisableFBAccess(int index, Bool enable) } if (ScreenPriv->EnableDisableFBAccess) - (*ScreenPriv->EnableDisableFBAccess) (index, enable); + (*ScreenPriv->EnableDisableFBAccess) (pScrn, enable); if (enable && ScreenPriv->SavedCursor) { /* @@ -237,10 +237,10 @@ xf86CursorEnableDisableFBAccess(int index, Bool enable) } static Bool -xf86CursorSwitchMode(int index, DisplayModePtr mode, int flags) +xf86CursorSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode) { Bool ret; - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, xf86CursorScreenKey); @@ -250,7 +250,7 @@ xf86CursorSwitchMode(int index, DisplayModePtr mode, int flags) ScreenPriv->isUp = FALSE; } - ret = (*ScreenPriv->SwitchMode) (index, mode, flags); + ret = (*ScreenPriv->SwitchMode) (pScrn, mode); /* * Cannot restore cursor here because the new frame[XY][01] haven't been @@ -336,28 +336,19 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs, if (!infoPtr->pScrn->vtSema) ScreenPriv->SavedCursor = pCurs; - if (infoPtr->pScrn->vtSema && (ScreenPriv->ForceHWCursorCount || (( + if (infoPtr->pScrn->vtSema && xorg_list_is_empty(&pScreen->pixmap_dirty_list) && + (ScreenPriv->ForceHWCursorCount || + (( #ifdef ARGB_CURSOR - pCurs-> - bits-> - argb - && - infoPtr-> - UseHWCursorARGB - && - (*infoPtr-> - UseHWCursorARGB) - (pScreen, - pCurs)) - || - (pCurs-> - bits-> - argb - == 0 - && + pCurs->bits->argb && + infoPtr->UseHWCursorARGB && + (*infoPtr->UseHWCursorARGB)(pScreen, pCurs)) || + (pCurs->bits->argb == 0 && #endif - (pCurs->bits->height <= infoPtr->MaxHeight) && (pCurs->bits->width <= infoPtr->MaxWidth) && (!infoPtr->UseHWCursor || (*infoPtr->UseHWCursor) (pScreen, pCurs)))))) { - + (pCurs->bits->height <= infoPtr->MaxHeight) && + (pCurs->bits->width <= infoPtr->MaxWidth) && + (!infoPtr->UseHWCursor || (*infoPtr->UseHWCursor) (pScreen, pCurs)))))) { + if (ScreenPriv->SWCursor) /* remove the SW cursor */ (*ScreenPriv->spriteFuncs->SetCursor) (pDev, pScreen, NullCursor, x, y); diff --git a/xserver/hw/xfree86/ramdac/xf86CursorPriv.h b/xserver/hw/xfree86/ramdac/xf86CursorPriv.h index 062b2eb7c..04be14135 100644 --- a/xserver/hw/xfree86/ramdac/xf86CursorPriv.h +++ b/xserver/hw/xfree86/ramdac/xf86CursorPriv.h @@ -26,7 +26,7 @@ typedef struct { miPointerSpriteFuncPtr spriteFuncs; Bool PalettedCursor; ColormapPtr pInstalledMap; - Bool (*SwitchMode) (int, DisplayModePtr, int); + Bool (*SwitchMode) (ScrnInfoPtr, DisplayModePtr); xf86EnableDisableFBAccessProc *EnableDisableFBAccess; CursorPtr SavedCursor; @@ -43,8 +43,6 @@ void xf86MoveCursor(ScreenPtr pScreen, int x, int y); void xf86RecolorCursor(ScreenPtr pScreen, CursorPtr pCurs, Bool displayed); Bool xf86InitHardwareCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr); -CARD32 xf86ReverseBitOrder(CARD32 data); - extern _X_EXPORT DevPrivateKeyRec xf86CursorScreenKeyRec; #define xf86CursorScreenKey (&xf86CursorScreenKeyRec) diff --git a/xserver/hw/xfree86/ramdac/xf86HWCurs.c b/xserver/hw/xfree86/ramdac/xf86HWCurs.c index 95721490a..197abff8f 100644 --- a/xserver/hw/xfree86/ramdac/xf86HWCurs.c +++ b/xserver/hw/xfree86/ramdac/xf86HWCurs.c @@ -21,6 +21,15 @@ #include "servermd.h" +static CARD32 +xf86ReverseBitOrder(CARD32 v) +{ + return (((0x01010101 & v) << 7) | ((0x02020202 & v) << 5) | + ((0x04040404 & v) << 3) | ((0x08080808 & v) << 1) | + ((0x10101010 & v) >> 1) | ((0x20202020 & v) >> 3) | + ((0x40404040 & v) >> 5) | ((0x80808080 & v) >> 7)); +} + #if BITMAP_SCANLINE_PAD == 64 #if 1 @@ -105,7 +114,7 @@ xf86InitHardwareCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr) infoPtr->RealizeCursor = RealizeCursorInterleave0; } - infoPtr->pScrn = xf86Screens[pScreen->myNum]; + infoPtr->pScrn = xf86ScreenToScrn(pScreen); return TRUE; } diff --git a/xserver/hw/xfree86/ramdac/xf86RamDacCmap.c b/xserver/hw/xfree86/ramdac/xf86RamDacCmap.c index 7a903d8e4..fa7a86663 100644 --- a/xserver/hw/xfree86/ramdac/xf86RamDacCmap.c +++ b/xserver/hw/xfree86/ramdac/xf86RamDacCmap.c @@ -59,7 +59,7 @@ Bool RamDacHandleColormaps(ScreenPtr pScreen, int maxColors, int sigRGBbits, unsigned int flags) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); RamDacRecPtr hwp = RAMDACSCRPTR(pScrn); if (hwp->LoadPalette == NULL) diff --git a/xserver/hw/xfree86/sdksyms.sh b/xserver/hw/xfree86/sdksyms.sh index 7584e8c88..5c04a6040 100644 --- a/xserver/hw/xfree86/sdksyms.sh +++ b/xserver/hw/xfree86/sdksyms.sh @@ -45,10 +45,10 @@ cat > sdksyms.c << EOF #include "misyncstr.h" /* Xext/Makefile.am -- half is module, half is builtin */ -/* +#ifdef XV #include "xvdix.h" #include "xvmcext.h" - */ +#endif #include "geext.h" #include "geint.h" #ifdef MITSHM @@ -94,11 +94,9 @@ cat > sdksyms.c << EOF /* hw/xfree86/dri2/Makefile.am -- module */ -/* #if DRI2 # include "dri2.h" #endif - */ /* hw/xfree86/vgahw/Makefile.am -- module */ @@ -134,12 +132,9 @@ cat > sdksyms.c << EOF # include "xf86xvmc.h" # include "xf86xvpriv.h" #endif -/* XF86VidMode code is in libextmod module */ -/* #if XF86VIDMODE # include "vidmodeproc.h" #endif - */ #include "xorgVersion.h" #if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__) # include "xf86sbusBus.h" @@ -180,18 +175,10 @@ cat > sdksyms.c << EOF #endif -/* hw/xfree86/xaa/Makefile.am -- module */ -/* -#include "xaa.h" -#include "xaalocal.h" -#include "xaarop.h" - */ - - /* hw/xfree86/dixmods/extmod/Makefile.am -- module */ -/* +#ifdef XFreeXDGA #include "dgaproc.h" - */ +#endif /* hw/xfree86/parser/Makefile.am */ @@ -207,13 +194,11 @@ cat > sdksyms.c << EOF /* hw/xfree86/dri/Makefile.am -- module */ -/* #if XF86DRI # include "dri.h" # include "sarea.h" # include "dristruct.h" #endif - */ /* mi/Makefile.am */ @@ -221,7 +206,6 @@ cat > sdksyms.c << EOF #include "miline.h" #include "mipointer.h" #include "mi.h" -#include "mibstore.h" #include "migc.h" #include "mipointrst.h" #include "mizerarc.h" @@ -240,9 +224,9 @@ cat > sdksyms.c << EOF /* dbe/Makefile.am -- module */ -/* +#ifdef DBE #include "dbestruct.h" - */ +#endif /* exa/Makefile.am -- module */ @@ -250,6 +234,9 @@ cat > sdksyms.c << EOF #include "exa.h" */ +#ifdef COMPOSITE +#include "compositeext.h" +#endif /* xfixes/Makefile.am */ #include "xfixes.h" @@ -271,11 +258,11 @@ cat > sdksyms.c << EOF #include "dixevents.h" #include "dixfont.h" #include "dixfontstr.h" +#include "dixfontstubs.h" #include "dixgrabs.h" #include "dixstruct.h" #include "exevents.h" #include "extension.h" -#include "extinit.h" #include "extnsionst.h" #include "gc.h" #include "gcstruct.h" @@ -331,8 +318,8 @@ topdir=$1 shift LC_ALL=C export LC_ALL -${CPP:-cpp} "$@" -DXorgLoader sdksyms.c > /dev/null || exit $? -${CPP:-cpp} "$@" -DXorgLoader sdksyms.c | ${AWK:-awk} -v topdir=$topdir ' +${CPP:-cpp} "$@" sdksyms.c > /dev/null || exit $? +${CPP:-cpp} "$@" sdksyms.c | ${AWK:-awk} -v topdir=$topdir ' BEGIN { sdk = 0; print("/*"); @@ -367,7 +354,6 @@ BEGIN { /^extern[ ]/ { if (sdk) { n = 3; - printf("/* %s */\n", $0) # skip attribute, if any while ($n ~ /^(__attribute__|__global)/ || diff --git a/xserver/hw/xfree86/shadowfb/Makefile.am b/xserver/hw/xfree86/shadowfb/Makefile.am index 39c66109e..5756fca3b 100644 --- a/xserver/hw/xfree86/shadowfb/Makefile.am +++ b/xserver/hw/xfree86/shadowfb/Makefile.am @@ -1,6 +1,7 @@ module_LTLIBRARIES = libshadowfb.la -libshadowfb_la_LDFLAGS = -module -avoid-version +libshadowfb_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) libshadowfb_la_SOURCES = sfbmodule.c shadow.c +libshadowfb_la_LIBADD = $(PIXMAN_LIBS) sdk_HEADERS = shadowfb.h diff --git a/xserver/hw/xfree86/shadowfb/Makefile.in b/xserver/hw/xfree86/shadowfb/Makefile.in index df7fd3a20..1b578ba2a 100644 --- a/xserver/hw/xfree86/shadowfb/Makefile.in +++ b/xserver/hw/xfree86/shadowfb/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -102,7 +102,8 @@ am__uninstall_files_from_dir = { \ } am__installdirs = "$(DESTDIR)$(moduledir)" "$(DESTDIR)$(sdkdir)" LTLIBRARIES = $(module_LTLIBRARIES) -libshadowfb_la_LIBADD = +am__DEPENDENCIES_1 = +libshadowfb_la_DEPENDENCIES = $(am__DEPENDENCIES_1) am_libshadowfb_la_OBJECTS = sfbmodule.lo shadow.lo libshadowfb_la_OBJECTS = $(am_libshadowfb_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) @@ -215,13 +216,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -243,6 +240,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -267,6 +265,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -282,7 +281,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -381,6 +379,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -481,8 +480,9 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ module_LTLIBRARIES = libshadowfb.la -libshadowfb_la_LDFLAGS = -module -avoid-version +libshadowfb_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) libshadowfb_la_SOURCES = sfbmodule.c shadow.c +libshadowfb_la_LIBADD = $(PIXMAN_LIBS) sdk_HEADERS = shadowfb.h INCLUDES = $(XORG_INCS) AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) @@ -490,7 +490,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -515,9 +515,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-moduleLTLIBRARIES: $(module_LTLIBRARIES) diff --git a/xserver/hw/xfree86/shadowfb/shadow.c b/xserver/hw/xfree86/shadowfb/shadow.c index 714dd141a..614501770 100644 --- a/xserver/hw/xfree86/shadowfb/shadow.c +++ b/xserver/hw/xfree86/shadowfb/shadow.c @@ -28,13 +28,13 @@ #include "picturestr.h" -static Bool ShadowCloseScreen(int i, ScreenPtr pScreen); +static Bool ShadowCloseScreen(ScreenPtr pScreen); static void ShadowCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgn); static Bool ShadowCreateGC(GCPtr pGC); -static Bool ShadowEnterVT(int index, int flags); -static void ShadowLeaveVT(int index, int flags); +static Bool ShadowEnterVT(ScrnInfoPtr pScrn); +static void ShadowLeaveVT(ScrnInfoPtr pScrn); static void ShadowComposite(CARD8 op, PicturePtr pSrc, @@ -56,8 +56,8 @@ typedef struct { CreateGCProcPtr CreateGC; ModifyPixmapHeaderProcPtr ModifyPixmapHeader; CompositeProcPtr Composite; - Bool (*EnterVT) (int, int); - void (*LeaveVT) (int, int); + Bool (*EnterVT) (ScrnInfoPtr); + void (*LeaveVT) (ScrnInfoPtr); Bool vtSema; } ShadowScreenRec, *ShadowScreenPtr; @@ -136,7 +136,7 @@ ShadowFBInit2(ScreenPtr pScreen, RefreshAreaFuncPtr preRefreshArea, RefreshAreaFuncPtr postRefreshArea) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); ShadowScreenPtr pPriv; PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); @@ -192,14 +192,13 @@ ShadowFBInit(ScreenPtr pScreen, RefreshAreaFuncPtr refreshArea) /**********************************************************/ static Bool -ShadowEnterVT(int index, int flags) +ShadowEnterVT(ScrnInfoPtr pScrn) { - ScrnInfoPtr pScrn = xf86Screens[index]; Bool ret; ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScrn->pScreen); pScrn->EnterVT = pPriv->EnterVT; - ret = (*pPriv->EnterVT) (index, flags); + ret = (*pPriv->EnterVT) (pScrn); pPriv->EnterVT = pScrn->EnterVT; pScrn->EnterVT = ShadowEnterVT; if (ret) { @@ -211,15 +210,14 @@ ShadowEnterVT(int index, int flags) } static void -ShadowLeaveVT(int index, int flags) +ShadowLeaveVT(ScrnInfoPtr pScrn) { - ScrnInfoPtr pScrn = xf86Screens[index]; - ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(xf86Screens[index]->pScreen); + ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScrn->pScreen); pPriv->vtSema = FALSE; pScrn->LeaveVT = pPriv->LeaveVT; - (*pPriv->LeaveVT) (index, flags); + (*pPriv->LeaveVT) (pScrn); pPriv->LeaveVT = pScrn->LeaveVT; pScrn->LeaveVT = ShadowLeaveVT; } @@ -227,9 +225,9 @@ ShadowLeaveVT(int index, int flags) /**********************************************************/ static Bool -ShadowCloseScreen(int i, ScreenPtr pScreen) +ShadowCloseScreen(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScreen); PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); @@ -247,7 +245,7 @@ ShadowCloseScreen(int i, ScreenPtr pScreen) free((pointer) pPriv); - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } static void diff --git a/xserver/hw/xfree86/utils/Makefile.in b/xserver/hw/xfree86/utils/Makefile.in index 8aa59352e..61a3bc505 100644 --- a/xserver/hw/xfree86/utils/Makefile.in +++ b/xserver/hw/xfree86/utils/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -187,13 +187,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -215,6 +211,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -239,6 +236,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -254,7 +252,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -353,6 +350,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -460,7 +458,7 @@ SUBDIRS = \ all: all-recursive .SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -485,9 +483,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/xfree86/utils/cvt/Makefile.in b/xserver/hw/xfree86/utils/cvt/Makefile.in index 086df0b6b..e4784dd54 100644 --- a/xserver/hw/xfree86/utils/cvt/Makefile.in +++ b/xserver/hw/xfree86/utils/cvt/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -209,13 +209,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -237,6 +233,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -261,6 +258,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -276,7 +274,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -375,6 +372,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -489,7 +487,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -514,9 +512,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) diff --git a/xserver/hw/xfree86/utils/gtf/Makefile.in b/xserver/hw/xfree86/utils/gtf/Makefile.in index 6908044e6..6ffb17c30 100644 --- a/xserver/hw/xfree86/utils/gtf/Makefile.in +++ b/xserver/hw/xfree86/utils/gtf/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -208,13 +208,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -236,6 +232,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -260,6 +257,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -275,7 +273,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -374,6 +371,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -480,7 +478,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -505,9 +503,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) diff --git a/xserver/hw/xfree86/utils/man/Makefile.in b/xserver/hw/xfree86/utils/man/Makefile.in index 3d9cf420e..015114f45 100644 --- a/xserver/hw/xfree86/utils/man/Makefile.in +++ b/xserver/hw/xfree86/utils/man/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -179,13 +179,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -207,6 +203,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -231,6 +228,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -246,7 +244,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -361,6 +358,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -480,7 +478,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/manpages.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/manpages.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -506,9 +504,9 @@ $(top_srcdir)/manpages.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/xfree86/utils/man/cvt.man b/xserver/hw/xfree86/utils/man/cvt.man index 2125fd146..8d70ead1b 100644 --- a/xserver/hw/xfree86/utils/man/cvt.man +++ b/xserver/hw/xfree86/utils/man/cvt.man @@ -12,8 +12,8 @@ cvt - calculate VESA CVT mode lines .I Cvt is a utility for calculating VESA Coordinated Video Timing modes. Given the desired horizontal and vertical resolutions, a modeline adhering to the CVT -standard is printed. This modeline can be included in __xservername__ -.B __xconfigfile__(__filemansuffix__) +standard is printed. This modeline can be included in Xorg +.B xorg.conf(__filemansuffix__) . .SH OPTIONS @@ -31,7 +31,7 @@ Create a mode with reduced blanking. This allows for higher frequency signals, with a lower or equal dotclock. Not for Cathode Ray Tube based displays though. .SH "SEE ALSO" -__xconfigfile__(__filemansuffix__), gtf(__appmansuffix__) +xorg.conf(__filemansuffix__), gtf(__appmansuffix__) .SH AUTHOR Luc Verhaegen. .PP diff --git a/xserver/hw/xfree86/utils/man/gtf.man b/xserver/hw/xfree86/utils/man/gtf.man index 8e83650aa..004d2f059 100644 --- a/xserver/hw/xfree86/utils/man/gtf.man +++ b/xserver/hw/xfree86/utils/man/gtf.man @@ -14,8 +14,8 @@ gtf - calculate VESA GTF mode lines is a utility for calculating VESA GTF modes. Given the desired horizontal and vertical resolutions and refresh rate (in Hz), the parameters for a matching VESA GTF mode are printed out. Two output formats are -supported: mode lines suitable for the __xservername__ -.B __xconfigfile__(__filemansuffix__) +supported: mode lines suitable for the Xorg +.B xorg.conf(__filemansuffix__) file, and mode parameters suitable for the Linux .B fbset(8) utility. @@ -27,14 +27,14 @@ Enable verbose printouts This shows a trace for each step of the computation. .TP 8 .BR \-x | \-\-xorgmode -Print the mode parameters as __xservername__-style mode lines. This is the +Print the mode parameters as Xorg-style mode lines. This is the default format. .TP 8 .BR \-f | \-\-fbset Print the mode parameters in a format suitable for .BR fbset(8) . .SH "SEE ALSO" -__xconfigfile__(__filemansuffix__), cvt(__appmansuffix__) +xorg.conf(__filemansuffix__), cvt(__appmansuffix__) .SH AUTHOR Andy Ritger. .PP diff --git a/xserver/hw/xfree86/vbe/Makefile.am b/xserver/hw/xfree86/vbe/Makefile.am index 4b794e647..0b24faf1f 100644 --- a/xserver/hw/xfree86/vbe/Makefile.am +++ b/xserver/hw/xfree86/vbe/Makefile.am @@ -1,6 +1,9 @@ module_LTLIBRARIES = libvbe.la -libvbe_la_LDFLAGS = -module -avoid-version +libvbe_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) libvbe_la_SOURCES = vbe.c vbeModes.c vbe_module.c +if NO_UNDEFINED +libvbe_la_LIBADD = ../int10/libint10.la +endif sdk_HEADERS = vbe.h vbeModes.h diff --git a/xserver/hw/xfree86/vbe/Makefile.in b/xserver/hw/xfree86/vbe/Makefile.in index 4a41abe2a..02dcee546 100644 --- a/xserver/hw/xfree86/vbe/Makefile.in +++ b/xserver/hw/xfree86/vbe/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -102,7 +102,7 @@ am__uninstall_files_from_dir = { \ } am__installdirs = "$(DESTDIR)$(moduledir)" "$(DESTDIR)$(sdkdir)" LTLIBRARIES = $(module_LTLIBRARIES) -libvbe_la_LIBADD = +@NO_UNDEFINED_TRUE@libvbe_la_DEPENDENCIES = ../int10/libint10.la am_libvbe_la_OBJECTS = vbe.lo vbeModes.lo vbe_module.lo libvbe_la_OBJECTS = $(am_libvbe_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) @@ -214,13 +214,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -242,6 +238,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -266,6 +263,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -281,7 +279,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -380,6 +377,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -480,8 +478,9 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ module_LTLIBRARIES = libvbe.la -libvbe_la_LDFLAGS = -module -avoid-version +libvbe_la_LDFLAGS = -module -avoid-version $(LD_NO_UNDEFINED_FLAG) libvbe_la_SOURCES = vbe.c vbeModes.c vbe_module.c +@NO_UNDEFINED_TRUE@libvbe_la_LIBADD = ../int10/libint10.la sdk_HEADERS = vbe.h vbeModes.h AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) INCLUDES = $(XORG_INCS) -I$(srcdir)/../ddc -I$(srcdir)/../i2c \ @@ -491,7 +490,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -516,9 +515,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-moduleLTLIBRARIES: $(module_LTLIBRARIES) diff --git a/xserver/hw/xfree86/vbe/vbe.c b/xserver/hw/xfree86/vbe/vbe.c index bbb60e3a1..97a9bcf60 100644 --- a/xserver/hw/xfree86/vbe/vbe.c +++ b/xserver/hw/xfree86/vbe/vbe.c @@ -179,7 +179,7 @@ static Bool vbeProbeDDC(vbeInfoPtr pVbe) { const char *ddc_level; - int screen = pVbe->pInt10->scrnIndex; + int screen = pVbe->pInt10->pScrn->scrnIndex; if (pVbe->ddc == DDC_NONE) return FALSE; @@ -262,7 +262,8 @@ vbeReadEDID(vbeInfoPtr pVbe) unsigned char *tmp = NULL; Bool novbe = FALSE; Bool noddc = FALSE; - int screen = pVbe->pInt10->scrnIndex; + ScrnInfoPtr pScrn = pVbe->pInt10->pScrn; + int screen = pScrn->scrnIndex; OptionInfoPtr options; if (!page) @@ -270,7 +271,7 @@ vbeReadEDID(vbeInfoPtr pVbe) options = xnfalloc(sizeof(VBEOptions)); (void) memcpy(options, VBEOptions, sizeof(VBEOptions)); - xf86ProcessOptions(screen, xf86Screens[screen]->options, options); + xf86ProcessOptions(screen, pScrn->options, options); xf86GetOptValBool(options, VBEOPT_NOVBE, &novbe); xf86GetOptValBool(options, VBEOPT_NODDC, &noddc); free(options); @@ -330,7 +331,7 @@ vbeDoEDID(vbeInfoPtr pVbe, pointer pDDCModule) if (!(pModule = pDDCModule)) { pModule = - xf86LoadSubModule(xf86Screens[pVbe->pInt10->scrnIndex], "ddc"); + xf86LoadSubModule(pVbe->pInt10->pScrn, "ddc"); if (!pModule) return NULL; } @@ -340,7 +341,7 @@ vbeDoEDID(vbeInfoPtr pVbe, pointer pDDCModule) if (!DDC_data) return NULL; - pMonitor = xf86InterpretEDID(pVbe->pInt10->scrnIndex, DDC_data); + pMonitor = xf86InterpretEDID(pVbe->pInt10->pScrn->scrnIndex, DDC_data); if (!pDDCModule) xf86UnloadSubModule(pModule); @@ -598,7 +599,7 @@ VBESaveRestore(vbeInfoPtr pVbe, vbeSaveRestoreFunction function, */ if ((pVbe->version & 0xff00) > 0x100) { - int screen = pVbe->pInt10->scrnIndex; + int screen = pVbe->pInt10->pScrn->scrnIndex; if (function == MODE_QUERY || (function == MODE_SAVE && !*memory)) { /* Query amount of memory to save state */ @@ -904,7 +905,7 @@ VBEBuildVbeModeList(vbeInfoPtr pVbe, VbeInfoBlock * vbe) m->n = id; m->next = ModeList; - xf86DrvMsgVerb(pVbe->pInt10->scrnIndex, X_PROBED, 3, + xf86DrvMsgVerb(pVbe->pInt10->pScrn->scrnIndex, X_PROBED, 3, "BIOS reported VESA mode 0x%x: x:%i y:%i bpp:%i\n", m->n, m->width, m->height, m->bpp); @@ -1026,23 +1027,22 @@ VBEDPMSSet(vbeInfoPtr pVbe, int mode) } void -VBEInterpretPanelID(int scrnIndex, struct vbePanelID *data) +VBEInterpretPanelID(ScrnInfoPtr pScrn, struct vbePanelID *data) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; DisplayModePtr mode; const float PANEL_HZ = 60.0; if (!data) return; - xf86DrvMsg(scrnIndex, X_INFO, "PanelID returned panel resolution %dx%d\n", + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "PanelID returned panel resolution %dx%d\n", data->hsize, data->vsize); if (pScrn->monitor->nHsync || pScrn->monitor->nVrefresh) return; if (data->hsize < 320 || data->vsize < 240) { - xf86DrvMsg(scrnIndex, X_INFO, "...which I refuse to believe\n"); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "...which I refuse to believe\n"); return; } @@ -1069,7 +1069,7 @@ VBEReadPanelID(vbeInfoPtr pVbe) int RealOff = pVbe->real_mode_base; pointer page = pVbe->memory; void *tmp = NULL; - int screen = pVbe->pInt10->scrnIndex; + int screen = pVbe->pInt10->pScrn->scrnIndex; pVbe->pInt10->ax = 0x4F11; pVbe->pInt10->bx = 0x01; diff --git a/xserver/hw/xfree86/vbe/vbe.h b/xserver/hw/xfree86/vbe/vbe.h index 81be0ff40..3907c53f3 100644 --- a/xserver/hw/xfree86/vbe/vbe.h +++ b/xserver/hw/xfree86/vbe/vbe.h @@ -350,7 +350,7 @@ struct vbePanelID { char reserved[14]; }; -extern _X_EXPORT void VBEInterpretPanelID(int scrnIndex, +extern _X_EXPORT void VBEInterpretPanelID(ScrnInfoPtr pScrn, struct vbePanelID *data); extern _X_EXPORT struct vbePanelID *VBEReadPanelID(vbeInfoPtr pVbe); diff --git a/xserver/hw/xfree86/vgahw/Makefile.in b/xserver/hw/xfree86/vgahw/Makefile.in index 32112ff18..87abb237b 100644 --- a/xserver/hw/xfree86/vgahw/Makefile.in +++ b/xserver/hw/xfree86/vgahw/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -214,13 +214,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -242,6 +238,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -266,6 +263,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -281,7 +279,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -380,6 +377,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -490,7 +488,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -515,9 +513,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-moduleLTLIBRARIES: $(module_LTLIBRARIES) diff --git a/xserver/hw/xfree86/vgahw/vgaCmap.c b/xserver/hw/xfree86/vgahw/vgaCmap.c index 0cfabc5d6..e7a0d023e 100644 --- a/xserver/hw/xfree86/vgahw/vgaCmap.c +++ b/xserver/hw/xfree86/vgahw/vgaCmap.c @@ -81,11 +81,8 @@ xColorItem *pdefs; xColorItem directDefs[256]; Bool new_overscan = FALSE; Bool writeColormap; - - /* This can get called before the ScrnInfoRec is installed so we - can't rely on getting it with XF86SCRNINFO() */ int scrnIndex = pmap->pScreen->myNum; - ScrnInfoPtr scrninfp = xf86Screens[scrnIndex]; + ScrnInfoPtr scrninfp = xf86ScreenToScrn(pmap->pScreen); vgaHWPtr hwp = VGAHWPTR(scrninfp); unsigned char overscan = hwp->ModeReg.Attribute[OVERSCAN]; @@ -100,7 +97,7 @@ xColorItem *pdefs; } writeColormap = scrninfp->vtSema; - if (DGAAvailable(scrnIndex)) { + if (DGAScreenAvailable(pmap->pScreen)) { writeColormap = writeColormap || (DGAGetDirectMode(scrnIndex) && !(DGAGetFlags(scrnIndex) & XF86DGADirectColormap)) || diff --git a/xserver/hw/xfree86/vgahw/vgaHW.c b/xserver/hw/xfree86/vgahw/vgaHW.c index e044682c7..a64f4f85d 100644 --- a/xserver/hw/xfree86/vgahw/vgaHW.c +++ b/xserver/hw/xfree86/vgahw/vgaHW.c @@ -651,7 +651,7 @@ vgaHWSaveScreen(ScreenPtr pScreen, int mode) Bool on; if (pScreen != NULL) - pScrn = xf86Screens[pScreen->myNum]; + pScrn = xf86ScreenToScrn(pScreen); on = xf86IsUnblank(mode); @@ -1873,7 +1873,7 @@ vgaHWSetOverscan(ScrnInfoPtr pScrn, int overscan) Bool vgaHWHandleColormaps(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); if (pScrn->depth > 1 && pScrn->depth <= 8) { return xf86HandleColormaps(pScreen, 1 << pScrn->depth, diff --git a/xserver/hw/xfree86/x86emu/Makefile.in b/xserver/hw/xfree86/x86emu/Makefile.in index 5dd0c2fd8..ab4012e5d 100644 --- a/xserver/hw/xfree86/x86emu/Makefile.in +++ b/xserver/hw/xfree86/x86emu/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -183,13 +183,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -211,6 +207,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -235,6 +232,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -250,7 +248,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -349,6 +346,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -477,7 +475,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -502,9 +500,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/xfree86/xaa/Makefile.am b/xserver/hw/xfree86/xaa/Makefile.am deleted file mode 100644 index 78d934876..000000000 --- a/xserver/hw/xfree86/xaa/Makefile.am +++ /dev/null @@ -1,78 +0,0 @@ -LSB_FIRST = l-xaaBitmap.c l-xaaStipple.c l-xaaTEGlyph.c -LSB_3_FIRST = l3-xaaBitmap.c l3-xaaStipple.c -MSB_FIRST = m-xaaBitmap.c m-xaaStipple.c m-xaaTEGlyph.c -MSB_3_FIRST = m3-xaaBitmap.c m3-xaaStipple.c -LSB_FIXED = lf-xaaBitmap.c lf-xaaStipple.c lf-xaaTEGlyph.c -LSB_3_FIXED = lf3-xaaBitmap.c lf3-xaaStipple.c -MSB_FIXED = mf-xaaBitmap.c mf-xaaStipple.c mf-xaaTEGlyph.c -MSB_3_FIXED = mf3-xaaBitmap.c mf3-xaaStipple.c -POLYSEG = s-xaaLine.c s-xaaDashLine.c - -if XAA - -libxaa_la_LDFLAGS = -module -avoid-version -if COMPOSITE -libxaa_la_LIBADD = $(top_builddir)/miext/cw/libcw.la -endif - -module_LTLIBRARIES = libxaa.la -libxaa_la_SOURCES = xaaInit.c xaaGC.c xaaInitAccel.c xaaFallback.c \ - xaaBitBlt.c xaaCpyArea.c xaaGCmisc.c xaaCpyWin.c \ - xaaCpyPlane.c xaaFillRect.c xaaTEText.c xaaNonTEText.c \ - xaaPCache.c xaaSpans.c xaaROP.c xaaImage.c \ - xaaRect.c xaaLineMisc.c xaaBitOrder.c \ - xaaFillPoly.c xaaWideLine.c xaaTables.c xaaFillArc.c \ - xaaLine.c xaaDashLine.c xaaOverlay.c xaaOffscreen.c \ - xaaOverlayDF.c xaaStateChange.c xaaPict.c $(POLYSEG) \ - $(LSB_FIRST) $(MSB_FIRST) $(LSB_FIXED) $(MSB_FIXED) \ - $(LSB_3_FIRST) $(MSB_3_FIRST) $(LSB_3_FIXED) $(MSB_3_FIXED) -${POLYSEG}: - $(AM_V_GEN)echo "#define POLYSEGMENT" > $@ - $(AM_V_GEN)echo '#include "$(srcdir)/${@:s-%=%}"' >> $@ -${LSB_FIRST}: - $(AM_V_GEN)echo "#define LSBFIRST" > $@ - $(AM_V_GEN)echo '#include "$(srcdir)/${@:l-%=%}"' >> $@ -${LSB_3_FIRST}: - $(AM_V_GEN)echo "#define LSBFIRST" > $@ - $(AM_V_GEN)echo "#define TRIPLE_BITS" >> $@ - $(AM_V_GEN)echo '#include "$(srcdir)/${@:l3-%=%}"' >> $@ -${LSB_FIXED}: - $(AM_V_GEN)echo "#define LSBFIRST" > $@ - $(AM_V_GEN)echo "#define FIXEDBASE" >> $@ - $(AM_V_GEN)echo '#include "$(srcdir)/${@:lf-%=%}"' >> $@ -${LSB_3_FIXED}: - $(AM_V_GEN)echo "#define LSBFIRST" > $@ - $(AM_V_GEN)echo "#define TRIPLE_BITS" >> $@ - $(AM_V_GEN)echo "#define FIXEDBASE" >> $@ - $(AM_V_GEN)echo '#include "$(srcdir)/${@:lf3-%=%}"' >> $@ -${MSB_FIRST}: - $(AM_V_GEN)echo "#define MSBFIRST" > $@ - $(AM_V_GEN)echo '#include "$(srcdir)/${@:m-%=%}"' >> $@ -${MSB_3_FIRST}: - $(AM_V_GEN)echo "#define MSBFIRST" > $@ - $(AM_V_GEN)echo "#define TRIPLE_BITS" >> $@ - $(AM_V_GEN)echo '#include "$(srcdir)/${@:m3-%=%}"' >> $@ -${MSB_FIXED}: - $(AM_V_GEN)echo "#define MSBFIRST" > $@ - $(AM_V_GEN)echo "#define FIXEDBASE" >> $@ - $(AM_V_GEN)echo '#include "$(srcdir)/${@:mf-%=%}"' >> $@ -${MSB_3_FIXED}: - $(AM_V_GEN)echo "#define MSBFIRST" > $@ - $(AM_V_GEN)echo "#define TRIPLE_BITS" >> $@ - $(AM_V_GEN)echo "#define FIXEDBASE" >> $@ - $(AM_V_GEN)echo '#include "$(srcdir)/${@:mf3-%=%}"' >> $@ - -endif # XAA - -DISTCLEANFILES = $(POLYSEG) \ - $(LSB_FIRST) $(LSB_FIXED) $(MSB_FIRST) $(MSB_FIXED) \ - $(LSB_3_FIRST) $(LSB_3_FIXED) $(MSB_3_FIRST) $(MSB_3_FIXED) - -sdk_HEADERS = xaa.h xaalocal.h xaarop.h -EXTRA_DIST = xaacexp.h xaawrap.h xaaLine.c xaaDashLine.c \ - xaaStipple.c xaaTEGlyph.c xaaNonTEGlyph.c xaaBitmap.c \ - XAA.HOWTO - -INCLUDES = $(XORG_INCS) -I$(srcdir)/../../../miext/cw - -AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) diff --git a/xserver/hw/xfree86/xaa/Makefile.in b/xserver/hw/xfree86/xaa/Makefile.in deleted file mode 100644 index a607d2aae..000000000 --- a/xserver/hw/xfree86/xaa/Makefile.in +++ /dev/null @@ -1,990 +0,0 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2012 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - - -VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ - esac; \ - test $$am__dry = yes; \ - } -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = hw/xfree86/xaa -DIST_COMMON = $(sdk_HEADERS) $(srcdir)/Makefile.am \ - $(srcdir)/Makefile.in $(top_srcdir)/depcomp -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/xorg-tls.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ - $(top_builddir)/include/xorg-server.h \ - $(top_builddir)/include/dix-config.h \ - $(top_builddir)/include/xorg-config.h \ - $(top_builddir)/include/xkb-config.h \ - $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ - $(top_builddir)/include/version-config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -am__vpath_adj = case $$p in \ - $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ - *) f=$$p;; \ - esac; -am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; -am__install_max = 40 -am__nobase_strip_setup = \ - srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` -am__nobase_strip = \ - for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" -am__nobase_list = $(am__nobase_strip_setup); \ - for p in $$list; do echo "$$p $$p"; done | \ - sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ - $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ - if (++n[$$2] == $(am__install_max)) \ - { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ - END { for (dir in files) print dir, files[dir] }' -am__base_list = \ - sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ - sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' -am__uninstall_files_from_dir = { \ - test -z "$$files" \ - || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ - || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ - $(am__cd) "$$dir" && rm -f $$files; }; \ - } -am__installdirs = "$(DESTDIR)$(moduledir)" "$(DESTDIR)$(sdkdir)" -LTLIBRARIES = $(module_LTLIBRARIES) -@COMPOSITE_TRUE@@XAA_TRUE@libxaa_la_DEPENDENCIES = \ -@COMPOSITE_TRUE@@XAA_TRUE@ $(top_builddir)/miext/cw/libcw.la -am__libxaa_la_SOURCES_DIST = xaaInit.c xaaGC.c xaaInitAccel.c \ - xaaFallback.c xaaBitBlt.c xaaCpyArea.c xaaGCmisc.c xaaCpyWin.c \ - xaaCpyPlane.c xaaFillRect.c xaaTEText.c xaaNonTEText.c \ - xaaPCache.c xaaSpans.c xaaROP.c xaaImage.c xaaRect.c \ - xaaLineMisc.c xaaBitOrder.c xaaFillPoly.c xaaWideLine.c \ - xaaTables.c xaaFillArc.c xaaLine.c xaaDashLine.c xaaOverlay.c \ - xaaOffscreen.c xaaOverlayDF.c xaaStateChange.c xaaPict.c \ - s-xaaLine.c s-xaaDashLine.c l-xaaBitmap.c l-xaaStipple.c \ - l-xaaTEGlyph.c m-xaaBitmap.c m-xaaStipple.c m-xaaTEGlyph.c \ - lf-xaaBitmap.c lf-xaaStipple.c lf-xaaTEGlyph.c mf-xaaBitmap.c \ - mf-xaaStipple.c mf-xaaTEGlyph.c l3-xaaBitmap.c l3-xaaStipple.c \ - m3-xaaBitmap.c m3-xaaStipple.c lf3-xaaBitmap.c \ - lf3-xaaStipple.c mf3-xaaBitmap.c mf3-xaaStipple.c -am__objects_1 = s-xaaLine.lo s-xaaDashLine.lo -am__objects_2 = l-xaaBitmap.lo l-xaaStipple.lo l-xaaTEGlyph.lo -am__objects_3 = m-xaaBitmap.lo m-xaaStipple.lo m-xaaTEGlyph.lo -am__objects_4 = lf-xaaBitmap.lo lf-xaaStipple.lo lf-xaaTEGlyph.lo -am__objects_5 = mf-xaaBitmap.lo mf-xaaStipple.lo mf-xaaTEGlyph.lo -am__objects_6 = l3-xaaBitmap.lo l3-xaaStipple.lo -am__objects_7 = m3-xaaBitmap.lo m3-xaaStipple.lo -am__objects_8 = lf3-xaaBitmap.lo lf3-xaaStipple.lo -am__objects_9 = mf3-xaaBitmap.lo mf3-xaaStipple.lo -@XAA_TRUE@am_libxaa_la_OBJECTS = xaaInit.lo xaaGC.lo xaaInitAccel.lo \ -@XAA_TRUE@ xaaFallback.lo xaaBitBlt.lo xaaCpyArea.lo \ -@XAA_TRUE@ xaaGCmisc.lo xaaCpyWin.lo xaaCpyPlane.lo \ -@XAA_TRUE@ xaaFillRect.lo xaaTEText.lo xaaNonTEText.lo \ -@XAA_TRUE@ xaaPCache.lo xaaSpans.lo xaaROP.lo xaaImage.lo \ -@XAA_TRUE@ xaaRect.lo xaaLineMisc.lo xaaBitOrder.lo \ -@XAA_TRUE@ xaaFillPoly.lo xaaWideLine.lo xaaTables.lo \ -@XAA_TRUE@ xaaFillArc.lo xaaLine.lo xaaDashLine.lo \ -@XAA_TRUE@ xaaOverlay.lo xaaOffscreen.lo xaaOverlayDF.lo \ -@XAA_TRUE@ xaaStateChange.lo xaaPict.lo $(am__objects_1) \ -@XAA_TRUE@ $(am__objects_2) $(am__objects_3) $(am__objects_4) \ -@XAA_TRUE@ $(am__objects_5) $(am__objects_6) $(am__objects_7) \ -@XAA_TRUE@ $(am__objects_8) $(am__objects_9) -libxaa_la_OBJECTS = $(am_libxaa_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -libxaa_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(libxaa_la_LDFLAGS) $(LDFLAGS) -o $@ -@XAA_TRUE@am_libxaa_la_rpath = -rpath $(moduledir) -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(libxaa_la_SOURCES) -DIST_SOURCES = $(am__libxaa_la_SOURCES_DIST) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -HEADERS = $(sdk_HEADERS) -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ -ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ -APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ -APP_MAN_DIR = @APP_MAN_DIR@ -APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BASE_CFLAGS = @BASE_CFLAGS@ -BASE_FONT_PATH = @BASE_FONT_PATH@ -BUILD_DATE = @BUILD_DATE@ -BUILD_TIME = @BUILD_TIME@ -BUNDLE_ID_PREFIX = @BUNDLE_ID_PREFIX@ -CC = @CC@ -CCAS = @CCAS@ -CCASDEPMODE = @CCASDEPMODE@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CHANGELOG_CMD = @CHANGELOG_CMD@ -COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CWARNFLAGS = @CWARNFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_LIBS = @DBUS_LIBS@ -DEFAULT_LIBRARY_PATH = @DEFAULT_LIBRARY_PATH@ -DEFAULT_LOGDIR = @DEFAULT_LOGDIR@ -DEFAULT_LOGPREFIX = @DEFAULT_LOGPREFIX@ -DEFAULT_MODULE_PATH = @DEFAULT_MODULE_PATH@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DGA_CFLAGS = @DGA_CFLAGS@ -DGA_LIBS = @DGA_LIBS@ -DIX_CFLAGS = @DIX_CFLAGS@ -DIX_LIB = @DIX_LIB@ -DLLTOOL = @DLLTOOL@ -DLOPEN_LIBS = @DLOPEN_LIBS@ -DMXEXAMPLES_DEP_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@ -DMXEXAMPLES_DEP_LIBS = @DMXEXAMPLES_DEP_LIBS@ -DMXMODULES_CFLAGS = @DMXMODULES_CFLAGS@ -DMXMODULES_LIBS = @DMXMODULES_LIBS@ -DMXXIEXAMPLES_DEP_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@ -DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@ -DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@ -DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ -DOXYGEN = @DOXYGEN@ -DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ -DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ -DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ -DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ -DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DTRACE = @DTRACE@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FILE_MAN_DIR = @FILE_MAN_DIR@ -FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ -FONT100DPIDIR = @FONT100DPIDIR@ -FONT75DPIDIR = @FONT75DPIDIR@ -FONTMISCDIR = @FONTMISCDIR@ -FONTOTFDIR = @FONTOTFDIR@ -FONTROOTDIR = @FONTROOTDIR@ -FONTTTFDIR = @FONTTTFDIR@ -FONTTYPE1DIR = @FONTTYPE1DIR@ -FOP = @FOP@ -GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ -GLX_DEFINES = @GLX_DEFINES@ -GLX_TLS = @GLX_TLS@ -GL_CFLAGS = @GL_CFLAGS@ -GL_LIBS = @GL_LIBS@ -GREP = @GREP@ -HAL_CFLAGS = @HAL_CFLAGS@ -HAL_LIBS = @HAL_LIBS@ -INSTALL = @INSTALL@ -INSTALL_CMD = @INSTALL_CMD@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ -KDRIVE_INCS = @KDRIVE_INCS@ -KDRIVE_LIBS = @KDRIVE_LIBS@ -KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ -KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ -KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ -KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ -KHRONOS_OPENGL_REGISTRY_LIBS = @KHRONOS_OPENGL_REGISTRY_LIBS@ -KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBDRM_CFLAGS = @LIBDRM_CFLAGS@ -LIBDRM_LIBS = @LIBDRM_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBSHA1_CFLAGS = @LIBSHA1_CFLAGS@ -LIBSHA1_LIBS = @LIBSHA1_LIBS@ -LIBTOOL = @LIBTOOL@ -LIB_MAN_DIR = @LIB_MAN_DIR@ -LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAIN_LIB = @MAIN_LIB@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MAN_SUBSTS = @MAN_SUBSTS@ -MISC_MAN_DIR = @MISC_MAN_DIR@ -MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJC = @OBJC@ -OBJCCLD = @OBJCCLD@ -OBJCDEPMODE = @OBJCDEPMODE@ -OBJCFLAGS = @OBJCFLAGS@ -OBJCLINK = @OBJCLINK@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ -OS_LIB = @OS_LIB@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ -PCIACCESS_LIBS = @PCIACCESS_LIBS@ -PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@ -PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ -PIXMAN_LIBS = @PIXMAN_LIBS@ -PKG_CONFIG = @PKG_CONFIG@ -PROJECTROOT = @PROJECTROOT@ -RANLIB = @RANLIB@ -RAWCPP = @RAWCPP@ -RAWCPPFLAGS = @RAWCPPFLAGS@ -RELEASE_DATE = @RELEASE_DATE@ -SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ -SED = @SED@ -SELINUX_CFLAGS = @SELINUX_CFLAGS@ -SELINUX_LIBS = @SELINUX_LIBS@ -SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@ -SET_MAKE = @SET_MAKE@ -SHA1_CFLAGS = @SHA1_CFLAGS@ -SHA1_LIBS = @SHA1_LIBS@ -SHELL = @SHELL@ -SOLARIS_ASM_CFLAGS = @SOLARIS_ASM_CFLAGS@ -SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ -STRICT_CFLAGS = @STRICT_CFLAGS@ -STRIP = @STRIP@ -STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ -SYSCONFDIR = @SYSCONFDIR@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ -UDEV_CFLAGS = @UDEV_CFLAGS@ -UDEV_LIBS = @UDEV_LIBS@ -UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ -VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ -VERSION = @VERSION@ -WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ -WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ -WINDRES = @WINDRES@ -X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ -X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ -XDMCP_CFLAGS = @XDMCP_CFLAGS@ -XDMCP_LIBS = @XDMCP_LIBS@ -XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ -XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@ -XDMX_CFLAGS = @XDMX_CFLAGS@ -XDMX_LIBS = @XDMX_LIBS@ -XDMX_SYS_LIBS = @XDMX_SYS_LIBS@ -XEPHYR_CFLAGS = @XEPHYR_CFLAGS@ -XEPHYR_INCS = @XEPHYR_INCS@ -XEPHYR_LIBS = @XEPHYR_LIBS@ -XF86CONFIGDIR = @XF86CONFIGDIR@ -XF86CONFIGFILE = @XF86CONFIGFILE@ -XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@ -XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@ -XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@ -XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@ -XKB_COMPILED_DIR = @XKB_COMPILED_DIR@ -XKB_DFLT_LAYOUT = @XKB_DFLT_LAYOUT@ -XKB_DFLT_MODEL = @XKB_DFLT_MODEL@ -XKB_DFLT_OPTIONS = @XKB_DFLT_OPTIONS@ -XKB_DFLT_RULES = @XKB_DFLT_RULES@ -XKB_DFLT_VARIANT = @XKB_DFLT_VARIANT@ -XKM_OUTPUT_DIR = @XKM_OUTPUT_DIR@ -XLIB_CFLAGS = @XLIB_CFLAGS@ -XLIB_LIBS = @XLIB_LIBS@ -XMLTO = @XMLTO@ -XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@ -XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ -XNEST_LIBS = @XNEST_LIBS@ -XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ -XORG_CFLAGS = @XORG_CFLAGS@ -XORG_INCS = @XORG_INCS@ -XORG_LIBS = @XORG_LIBS@ -XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ -XORG_MAN_PAGE = @XORG_MAN_PAGE@ -XORG_MODULES_CFLAGS = @XORG_MODULES_CFLAGS@ -XORG_MODULES_LIBS = @XORG_MODULES_LIBS@ -XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ -XORG_SGML_PATH = @XORG_SGML_PATH@ -XORG_SYS_LIBS = @XORG_SYS_LIBS@ -XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ -XPBPROXY_LIBS = @XPBPROXY_LIBS@ -XQUARTZ_LIBS = @XQUARTZ_LIBS@ -XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@ -XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ -XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ -XSERVERCFLAGS_CFLAGS = @XSERVERCFLAGS_CFLAGS@ -XSERVERCFLAGS_LIBS = @XSERVERCFLAGS_LIBS@ -XSERVERLIBS_CFLAGS = @XSERVERLIBS_CFLAGS@ -XSERVERLIBS_LIBS = @XSERVERLIBS_LIBS@ -XSERVER_LIBS = @XSERVER_LIBS@ -XSERVER_SYS_LIBS = @XSERVER_SYS_LIBS@ -XSLTPROC = @XSLTPROC@ -XSL_STYLESHEET = @XSL_STYLESHEET@ -XTSTEXAMPLES_DEP_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@ -XTSTEXAMPLES_DEP_LIBS = @XTSTEXAMPLES_DEP_LIBS@ -XVFB_LIBS = @XVFB_LIBS@ -XVFB_SYS_LIBS = @XVFB_SYS_LIBS@ -XWINMODULES_CFLAGS = @XWINMODULES_CFLAGS@ -XWINMODULES_LIBS = @XWINMODULES_LIBS@ -XWIN_LIBS = @XWIN_LIBS@ -XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ -XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ -abi_ansic = @abi_ansic@ -abi_extension = @abi_extension@ -abi_videodrv = @abi_videodrv@ -abi_xinput = @abi_xinput@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -driverdir = @driverdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -extdir = @extdir@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -logdir = @logdir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -moduledir = @moduledir@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sdkdir = @sdkdir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -symbol_visibility = @symbol_visibility@ -sysconfdir = @sysconfdir@ -sysconfigdir = @sysconfigdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -LSB_FIRST = l-xaaBitmap.c l-xaaStipple.c l-xaaTEGlyph.c -LSB_3_FIRST = l3-xaaBitmap.c l3-xaaStipple.c -MSB_FIRST = m-xaaBitmap.c m-xaaStipple.c m-xaaTEGlyph.c -MSB_3_FIRST = m3-xaaBitmap.c m3-xaaStipple.c -LSB_FIXED = lf-xaaBitmap.c lf-xaaStipple.c lf-xaaTEGlyph.c -LSB_3_FIXED = lf3-xaaBitmap.c lf3-xaaStipple.c -MSB_FIXED = mf-xaaBitmap.c mf-xaaStipple.c mf-xaaTEGlyph.c -MSB_3_FIXED = mf3-xaaBitmap.c mf3-xaaStipple.c -POLYSEG = s-xaaLine.c s-xaaDashLine.c -@XAA_TRUE@libxaa_la_LDFLAGS = -module -avoid-version -@COMPOSITE_TRUE@@XAA_TRUE@libxaa_la_LIBADD = $(top_builddir)/miext/cw/libcw.la -@XAA_TRUE@module_LTLIBRARIES = libxaa.la -@XAA_TRUE@libxaa_la_SOURCES = xaaInit.c xaaGC.c xaaInitAccel.c xaaFallback.c \ -@XAA_TRUE@ xaaBitBlt.c xaaCpyArea.c xaaGCmisc.c xaaCpyWin.c \ -@XAA_TRUE@ xaaCpyPlane.c xaaFillRect.c xaaTEText.c xaaNonTEText.c \ -@XAA_TRUE@ xaaPCache.c xaaSpans.c xaaROP.c xaaImage.c \ -@XAA_TRUE@ xaaRect.c xaaLineMisc.c xaaBitOrder.c \ -@XAA_TRUE@ xaaFillPoly.c xaaWideLine.c xaaTables.c xaaFillArc.c \ -@XAA_TRUE@ xaaLine.c xaaDashLine.c xaaOverlay.c xaaOffscreen.c \ -@XAA_TRUE@ xaaOverlayDF.c xaaStateChange.c xaaPict.c $(POLYSEG) \ -@XAA_TRUE@ $(LSB_FIRST) $(MSB_FIRST) $(LSB_FIXED) $(MSB_FIXED) \ -@XAA_TRUE@ $(LSB_3_FIRST) $(MSB_3_FIRST) $(LSB_3_FIXED) $(MSB_3_FIXED) - -DISTCLEANFILES = $(POLYSEG) \ - $(LSB_FIRST) $(LSB_FIXED) $(MSB_FIRST) $(MSB_FIXED) \ - $(LSB_3_FIRST) $(LSB_3_FIXED) $(MSB_3_FIRST) $(MSB_3_FIXED) - -sdk_HEADERS = xaa.h xaalocal.h xaarop.h -EXTRA_DIST = xaacexp.h xaawrap.h xaaLine.c xaaDashLine.c \ - xaaStipple.c xaaTEGlyph.c xaaNonTEGlyph.c xaaBitmap.c \ - XAA.HOWTO - -INCLUDES = $(XORG_INCS) -I$(srcdir)/../../../miext/cw -AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign hw/xfree86/xaa/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign hw/xfree86/xaa/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): -install-moduleLTLIBRARIES: $(module_LTLIBRARIES) - @$(NORMAL_INSTALL) - @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ - list2=; for p in $$list; do \ - if test -f $$p; then \ - list2="$$list2 $$p"; \ - else :; fi; \ - done; \ - test -z "$$list2" || { \ - echo " $(MKDIR_P) '$(DESTDIR)$(moduledir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(moduledir)" || exit 1; \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(moduledir)'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(moduledir)"; \ - } - -uninstall-moduleLTLIBRARIES: - @$(NORMAL_UNINSTALL) - @list='$(module_LTLIBRARIES)'; test -n "$(moduledir)" || list=; \ - for p in $$list; do \ - $(am__strip_dir) \ - echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(moduledir)/$$f'"; \ - $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(moduledir)/$$f"; \ - done - -clean-moduleLTLIBRARIES: - -test -z "$(module_LTLIBRARIES)" || rm -f $(module_LTLIBRARIES) - @list='$(module_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } -libxaa.la: $(libxaa_la_OBJECTS) $(libxaa_la_DEPENDENCIES) $(EXTRA_libxaa_la_DEPENDENCIES) - $(AM_V_CCLD)$(libxaa_la_LINK) $(am_libxaa_la_rpath) $(libxaa_la_OBJECTS) $(libxaa_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/l-xaaBitmap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/l-xaaStipple.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/l-xaaTEGlyph.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/l3-xaaBitmap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/l3-xaaStipple.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lf-xaaBitmap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lf-xaaStipple.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lf-xaaTEGlyph.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lf3-xaaBitmap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lf3-xaaStipple.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m-xaaBitmap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m-xaaStipple.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m-xaaTEGlyph.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m3-xaaBitmap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m3-xaaStipple.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mf-xaaBitmap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mf-xaaStipple.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mf-xaaTEGlyph.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mf3-xaaBitmap.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mf3-xaaStipple.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s-xaaDashLine.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s-xaaLine.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaaBitBlt.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaaBitOrder.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaaCpyArea.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaaCpyPlane.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaaCpyWin.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaaDashLine.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaaFallback.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaaFillArc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaaFillPoly.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaaFillRect.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaaGC.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaaGCmisc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaaImage.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaaInit.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaaInitAccel.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaaLine.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaaLineMisc.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaaNonTEText.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaaOffscreen.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaaOverlay.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaaOverlayDF.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaaPCache.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaaPict.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaaROP.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaaRect.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaaSpans.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaaStateChange.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaaTEText.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaaTables.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xaaWideLine.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs -install-sdkHEADERS: $(sdk_HEADERS) - @$(NORMAL_INSTALL) - @list='$(sdk_HEADERS)'; test -n "$(sdkdir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(sdkdir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(sdkdir)" || exit 1; \ - fi; \ - for p in $$list; do \ - if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - echo "$$d$$p"; \ - done | $(am__base_list) | \ - while read files; do \ - echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(sdkdir)'"; \ - $(INSTALL_HEADER) $$files "$(DESTDIR)$(sdkdir)" || exit $$?; \ - done - -uninstall-sdkHEADERS: - @$(NORMAL_UNINSTALL) - @list='$(sdk_HEADERS)'; test -n "$(sdkdir)" || list=; \ - files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ - dir='$(DESTDIR)$(sdkdir)'; $(am__uninstall_files_from_dir) - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -cscopelist: $(HEADERS) $(SOURCES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) $(HEADERS) -installdirs: - for dir in "$(DESTDIR)$(moduledir)" "$(DESTDIR)$(sdkdir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-moduleLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: install-moduleLTLIBRARIES install-sdkHEADERS - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: uninstall-moduleLTLIBRARIES uninstall-sdkHEADERS - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-moduleLTLIBRARIES cscopelist ctags \ - distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-moduleLTLIBRARIES \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-sdkHEADERS install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ - uninstall-am uninstall-moduleLTLIBRARIES uninstall-sdkHEADERS - -@XAA_TRUE@${POLYSEG}: -@XAA_TRUE@ $(AM_V_GEN)echo "#define POLYSEGMENT" > $@ -@XAA_TRUE@ $(AM_V_GEN)echo '#include "$(srcdir)/${@:s-%=%}"' >> $@ -@XAA_TRUE@${LSB_FIRST}: -@XAA_TRUE@ $(AM_V_GEN)echo "#define LSBFIRST" > $@ -@XAA_TRUE@ $(AM_V_GEN)echo '#include "$(srcdir)/${@:l-%=%}"' >> $@ -@XAA_TRUE@${LSB_3_FIRST}: -@XAA_TRUE@ $(AM_V_GEN)echo "#define LSBFIRST" > $@ -@XAA_TRUE@ $(AM_V_GEN)echo "#define TRIPLE_BITS" >> $@ -@XAA_TRUE@ $(AM_V_GEN)echo '#include "$(srcdir)/${@:l3-%=%}"' >> $@ -@XAA_TRUE@${LSB_FIXED}: -@XAA_TRUE@ $(AM_V_GEN)echo "#define LSBFIRST" > $@ -@XAA_TRUE@ $(AM_V_GEN)echo "#define FIXEDBASE" >> $@ -@XAA_TRUE@ $(AM_V_GEN)echo '#include "$(srcdir)/${@:lf-%=%}"' >> $@ -@XAA_TRUE@${LSB_3_FIXED}: -@XAA_TRUE@ $(AM_V_GEN)echo "#define LSBFIRST" > $@ -@XAA_TRUE@ $(AM_V_GEN)echo "#define TRIPLE_BITS" >> $@ -@XAA_TRUE@ $(AM_V_GEN)echo "#define FIXEDBASE" >> $@ -@XAA_TRUE@ $(AM_V_GEN)echo '#include "$(srcdir)/${@:lf3-%=%}"' >> $@ -@XAA_TRUE@${MSB_FIRST}: -@XAA_TRUE@ $(AM_V_GEN)echo "#define MSBFIRST" > $@ -@XAA_TRUE@ $(AM_V_GEN)echo '#include "$(srcdir)/${@:m-%=%}"' >> $@ -@XAA_TRUE@${MSB_3_FIRST}: -@XAA_TRUE@ $(AM_V_GEN)echo "#define MSBFIRST" > $@ -@XAA_TRUE@ $(AM_V_GEN)echo "#define TRIPLE_BITS" >> $@ -@XAA_TRUE@ $(AM_V_GEN)echo '#include "$(srcdir)/${@:m3-%=%}"' >> $@ -@XAA_TRUE@${MSB_FIXED}: -@XAA_TRUE@ $(AM_V_GEN)echo "#define MSBFIRST" > $@ -@XAA_TRUE@ $(AM_V_GEN)echo "#define FIXEDBASE" >> $@ -@XAA_TRUE@ $(AM_V_GEN)echo '#include "$(srcdir)/${@:mf-%=%}"' >> $@ -@XAA_TRUE@${MSB_3_FIXED}: -@XAA_TRUE@ $(AM_V_GEN)echo "#define MSBFIRST" > $@ -@XAA_TRUE@ $(AM_V_GEN)echo "#define TRIPLE_BITS" >> $@ -@XAA_TRUE@ $(AM_V_GEN)echo "#define FIXEDBASE" >> $@ -@XAA_TRUE@ $(AM_V_GEN)echo '#include "$(srcdir)/${@:mf3-%=%}"' >> $@ - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/xserver/hw/xfree86/xaa/XAA.HOWTO b/xserver/hw/xfree86/xaa/XAA.HOWTO deleted file mode 100644 index cbd71c138..000000000 --- a/xserver/hw/xfree86/xaa/XAA.HOWTO +++ /dev/null @@ -1,1427 +0,0 @@ - - - XAA.HOWTO - - This file describes how to add basic XAA support to a chipset driver. - -0) What is XAA -1) XAA Initialization and Shutdown -2) The Primitives - 2.0 Generic Flags - 2.1 Screen to Screen Copies - 2.2 Solid Fills - 2.3 Solid Lines - 2.4 Dashed Lines - 2.5 Color Expand Fills - 2.5.1 Screen to Screen Color Expansion - 2.5.2 CPU to Screen Color Expansion - 2.5.2.1 The Direct Method - 2.5.2.2 The Indirect Method - 2.6 8x8 Mono Pattern Fills - 2.7 8x8 Color Pattern Fills - 2.8 Image Writes - 2.8.1 The Direct Method - 2.8.2 The Indirect Method - 2.9 Clipping -3) The Pixmap Cache -4) Offscreen Pixmaps - -/********************************************************************/ - -0) WHAT IS XAA - - XAA (the XFree86 Acceleration Architecture) is a device dependent -layer that encapsulates the unaccelerated framebuffer rendering layer, -intercepting rendering commands sent to it from higher levels of the -server. For rendering tasks where hardware acceleration is not -possible, XAA allows the requests to proceed to the software rendering -code. Otherwise, XAA breaks the sometimes complicated X primitives -into simpler primitives more suitable for hardware acceleration and -will use accelerated functions exported by the chipset driver to -render these. - - XAA provides a simple, easy to use driver interface that allows -the driver to communicate its acceleration capabilities and restrictions -back to XAA. XAA will use the information provided by the driver -to determine whether or not acceleration will be possible for a -particular X primitive. - - - -1) XAA INITIALIZATION AND SHUTDOWN - - All relevant prototypes and defines are in xaa.h. - - To Initialize the XAA layer, the driver should allocate an XAAInfoRec -via XAACreateInfoRec(), fill it out as described in this document -and pass it to XAAInit(). XAAInit() must be called _after_ the -framebuffer initialization (usually cfb?ScreenInit or similar) since -it is "wrapping" that layer. XAAInit() should be called _before_ the -cursor initialization (usually miDCInitialize) since the cursor -layer needs to "wrap" all the rendering code including XAA. - - When shutting down, the driver should free the XAAInfoRec -structure in its CloseScreen function via XAADestroyInfoRec(). -The prototypes for the functions mentioned above are as follows: - - XAAInfoRecPtr XAACreateInfoRec(void); - Bool XAAInit(ScreenPtr, XAAInfoRecPtr); - void XAADestroyInfoRec(XAAInfoRec); - - The driver informs XAA of it's acceleration capablities by -filling out an XAAInfoRec structure and passing it to XAAInit(). -The XAAInfoRec structure contains many fields, most of which are -function pointers and flags. Each primitive will typically have -two functions and a set of flags associated with it, but it may -have more. These two functions are the "SetupFor" and "Subsequent" -functions. The "SetupFor" function tells the driver that the -hardware should be initialized for a particular type of graphics -operation. After the "SetupFor" function, one or more calls to the -"Subsequent" function will be made to indicate that an instance -of the particular primitive should be rendered by the hardware. -The details of each instance (width, height, etc...) are given -with each "Subsequent" function. The set of flags associated -with each primitive lets the driver tell XAA what its hardware -limitations are (eg. It doesn't support a planemask, it can only -do one of the raster-ops, etc...). - - Of the XAAInfoRec fields, one is required. This is the -Sync function. XAA initialization will fail if this function -is not provided. - -void Sync(ScrnInfoPtr pScrn) /* Required */ - - Sync will be called when XAA needs to be certain that all - graphics coprocessor operations are finished, such as when - the framebuffer must be written to or read from directly - and it must be certain that the accelerator will not be - overwriting the area of interest. - - One needs to make certain that the Sync function not only - waits for the accelerator fifo to empty, but that it waits for - the rendering of that last operation to complete. - - It is guaranteed that no direct framebuffer access will - occur after a "SetupFor" or "Subsequent" function without - the Sync function being called first. - - - -2) THE PRIMITIVES - -2.0 Generic Flags - - Each primitive type has a set of flags associated with it which -allow the driver to tell XAA what the hardware limitations are. -The common ones are as follows: - -/* Foreground, Background, rop and planemask restrictions */ - - GXCOPY_ONLY - - This indicates that the accelerator only supports GXcopy - for the particular primitive. - - ROP_NEEDS_SOURCE - - This indicates that the accelerator doesn't supports a - particular primitive with rops that don't involve the source. - These rops are GXclear, GXnoop, GXinvert and GXset. If neither - this flag nor GXCOPY_ONLY is defined, it is assumed that the - accelerator supports all 16 raster operations (rops) for that - primitive. - - NO_PLANEMASK - - This indicates that the accelerator does not support a hardware - write planemask for the particular primitive. - - RGB_EQUAL - - This indicates that the particular primitive requires the red, - green and blue bytes of the foreground color (and background color, - if applicable) to be equal. This is useful for 24bpp when a graphics - coprocessor is used in 8bpp mode, which is not uncommon in older - hardware since some have no support for or only limited support for - acceleration at 24bpp. This way, many operations will be accelerated - for the common case of "grayscale" colors. This flag should only - be used in 24bpp. - - In addition to the common ones listed above which are possible for -nearly all primitives, each primitive may have its own flags specific -to that primitive. If such flags exist they are documented in the -descriptions of those primitives below. - - - - -2.1 Screen to Screen Copies - - The SetupFor and Subsequent ScreenToScreenCopy functions provide - an interface for copying rectangular areas from video memory to - video memory. To accelerate this primitive the driver should - provide both the SetupFor and Subsequent functions and indicate - the hardware restrictions via the ScreenToScreenCopyFlags. The - NO_PLANEMASK, GXCOPY_ONLY and ROP_NEEDS_SOURCE flags as described - in Section 2.0 are valid as well as the following: - - NO_TRANSPARENCY - - This indicates that the accelerator does not support skipping - of color keyed pixels when copying from the source to the destination. - - TRANSPARENCY_GXCOPY_ONLY - - This indicates that the accelerator supports skipping of color keyed - pixels only when the rop is GXcopy. - - ONLY_LEFT_TO_RIGHT_BITBLT - - This indicates that the hardware only accepts blitting when the - x direction is positive. - - ONLY_TWO_BITBLT_DIRECTIONS - - This indicates that the hardware can only cope with blitting when - the direction of x is the same as the direction in y. - - -void SetupForScreenToScreenCopy( ScrnInfoPtr pScrn, - int xdir, int ydir, - int rop, - unsigned int planemask, - int trans_color ) - - When this is called, SubsequentScreenToScreenCopy will be called - one or more times directly after. If ydir is 1, then the accelerator - should copy starting from the top (minimum y) of the source and - proceed downward. If ydir is -1, then the accelerator should copy - starting from the bottom of the source (maximum y) and proceed - upward. If xdir is 1, then the accelerator should copy each - y scanline starting from the leftmost pixel of the source. If - xdir is -1, it should start from the rightmost pixel. - If trans_color is not -1 then trans_color indicates that the - accelerator should not copy pixels with the color trans_color - from the source to the destination, but should skip them. - Trans_color is always -1 if the NO_TRANSPARENCY flag is set. - - -void SubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, - int x1, int y1, - int x2, int y2, - int width, int height) - - Copy a rectangle "width" x "height" from the source (x1,y1) to the - destination (x2,y2) using the parameters passed by the last - SetupForScreenToScreenCopy call. (x1,y1) and (x2,y2) always denote - the upper left hand corners of the source and destination regardless - of which xdir and ydir values are given by SetupForScreenToScreenCopy. - - - -2.2 Solid Fills - - The SetupFor and Subsequent SolidFill(Rect/Trap) functions provide - an interface for filling rectangular areas of the screen with a - foreground color. To accelerate this primitive the driver should - provide both the SetupForSolidFill and SubsequentSolidFillRect - functions and indicate the hardware restrictions via the SolidFillFlags. - The driver may optionally provide a SubsequentSolidFillTrap if - it is capable of rendering the primitive correctly. - The GXCOPY_ONLY, ROP_NEEDS_SOURCE, NO_PLANEMASK and RGB_EQUAL flags - as described in Section 2.0 are valid. - - -void SetupForSolidFill(ScrnInfoPtr pScrn, - int color, int rop, unsigned int planemask) - - SetupForSolidFill indicates that any combination of the following - may follow it. - - SubsequentSolidFillRect - SubsequentSolidFillTrap - - - -void SubsequentSolidFillRect(ScrnInfoPtr pScrn, int x, int y, int w, int h) - - Fill a rectangle of dimensions "w" by "h" with origin at (x,y) - using the color, rop and planemask given by the last - SetupForSolidFill call. - -void SubsequentSolidFillTrap(ScrnInfoPtr pScrn, int y, int h, - int left, int dxL, int dyL, int eL, - int right, int dxR, int dyR, int eR) - - These parameters describe a trapezoid via a version of - Bresenham's parameters. "y" is the top line. "h" is the - number of spans to be filled in the positive Y direction. - "left" and "right" indicate the starting X values of the - left and right edges. dy/dx describes the edge slope. - These are not the deltas between the beginning and ending - points on an edge. They merely describe the slope. "e" is - the initial error term. It's the relationships between dx, - dy and e that define the edge. - If your engine does not do bresenham trapezoids or does - not allow the programmer to specify the error term then - you are not expected to be able to accelerate them. - - -2.3 Solid Lines - - XAA provides an interface for drawing thin lines. In order to - draw X lines correctly a high degree of accuracy is required. - This usually limits line acceleration to hardware which has a - Bresenham line engine, though depending on the algorithm used, - other line engines may come close if they accept 16 bit line - deltas. XAA has both a Bresenham line interface and a two-point - line interface for drawing lines of arbitrary orientation. - Additionally there is a SubsequentSolidHorVertLine which will - be used for all horizontal and vertical lines. Horizontal and - vertical lines are handled separately since hardware that doesn't - have a line engine (or has one that is unusable due to precision - problems) can usually draw these lines by some other method such - as drawing them as thin rectangles. Even for hardware that can - draw arbitrary lines via the Bresenham or two-point interfaces, - the SubsequentSolidHorVertLine is used for horizontal and vertical - lines since most hardware is able to render the horizontal lines - and sometimes the vertical lines faster by other methods (Hint: - try rendering horizontal lines as flattened rectangles). If you have - not provided a SubsequentSolidHorVertLine but you have provided - Bresenham or two-point lines, a SubsequentSolidHorVertLine function - will be supplied for you. - - The flags field associated with Solid Lines is SolidLineFlags and - the GXCOPY_ONLY, ROP_NEEDS_SOURCE, NO_PLANEMASK and RGB_EQUAL flags as - described in Section 2.0 are valid restrictions. - - Some line engines have line biases hardcoded to comply with - Microsoft line biasing rules. A tell-tale sign of this is the - hardware lines not matching the software lines in the zeroth and - fourth octants. The driver can set the flag: - - MICROSOFT_ZERO_LINE_BIAS - - in the AccelInfoRec.Flags field to adjust the software lines to - match the hardware lines. This is in the generic flags field - rather than the SolidLineFlags since this flag applies to all - software zero-width lines on the screen and not just the solid ones. - - -void SetupForSolidLine(ScrnInfoPtr pScrn, - int color, int rop, unsigned int planemask) - - SetupForSolidLine indicates that any combination of the following - may follow it. - - SubsequentSolidBresenhamLine - SubsequentSolidTwoPointLine - SubsequentSolidHorVertLine - - -void SubsequentSolidHorVertLine( ScrnInfoPtr pScrn, - int x, int y, int len, int dir ) - - All vertical and horizontal solid thin lines are rendered with - this function. The line starts at coordinate (x,y) and extends - "len" pixels inclusive. In the direction indicated by "dir." - The direction is either DEGREES_O or DEGREES_270. That is, it - always extends to the right or down. - - - -void SubsequentSolidTwoPointLine(ScrnInfoPtr pScrn, - int x1, int y1, int x2, int y2, int flags) - - Draw a line from (x1,y1) to (x2,y2). If the flags field contains - the flag OMIT_LAST, the last pixel should not be drawn. Otherwise, - the pixel at (x2,y2) should be drawn. - - If you use the TwoPoint line interface there is a good possibility - that your line engine has hard-coded line biases that do not match - the default X zero-width lines. If so, you may need to set the - MICROSOFT_ZERO_LINE_BIAS flag described above. Note that since - any vertex in the 16-bit signed coordinate system is valid, your - line engine is expected to handle 16-bit values if you have hardware - line clipping enabled. If your engine cannot handle 16-bit values, - you should not use hardware line clipping. - - -void SubsequentSolidBresenhamLine(ScrnInfoPtr pScrn, - int x, int y, int major, int minor, int err, int len, int octant) - - "X" and "y" are the starting point of the line. "Major" and "minor" - are the major and minor step constants. "Err" is the initial error - term. "Len" is the number of pixels to be drawn (inclusive). "Octant" - can be any combination of the following flags OR'd together: - - Y_MAJOR Y is the major axis (X otherwise) - X_DECREASING The line is drawn from right to left - Y_DECREASING The line is drawn from bottom to top - - The major, minor and err terms are the "raw" Bresenham parameters - consistent with a line engine that does: - - e = err; - while(len--) { - DRAW_POINT(x,y); - e += minor; - if(e >= 0) { - e -= major; - TAKE_ONE_STEP_ALONG_MINOR_AXIS; - } - TAKE_ONE_STEP_ALONG_MAJOR_AXIS; - } - - IBM 8514 style Bresenham line interfaces require their parameters - modified in the following way: - - Axial = minor; - Diagonal = minor - major; - Error = minor + err; - -SolidBresenhamLineErrorTermBits - - This field allows the driver to tell XAA how many bits large its - Bresenham parameter registers are. Many engines have registers that - only accept 12 or 13 bit Bresenham parameters, and the parameters - for clipped lines may overflow these if they are not scaled down. - If this field is not set, XAA will assume the engine can accomodate - 16 bit parameters, otherwise, it will scale the parameters to the - size specified. - - -2.4 Dashed Lines - - The same degree of accuracy required by the solid lines is required - for drawing dashed lines as well. The dash pattern itself is a - buffer of binary data where ones are expanded into the foreground - color and zeros either correspond to the background color or - indicate transparency depending on whether or not DoubleDash or - OnOffDashes are being drawn. - - The flags field associated with dashed Lines is DashedLineFlags and - the GXCOPY_ONLY, ROP_NEEDS_SOURCE, NO_PLANEMASK and RGB_EQUAL flags as - described in Section 2.0 are valid restrictions. Additionally, the - following flags are valid: - - NO_TRANSPARENCY - - This indicates that the driver cannot support dashed lines - with transparent backgrounds (OnOffDashes). - - TRANSPARENCY_ONLY - - This indicates that the driver cannot support dashes with - both a foreground and background color (DoubleDashes). - - LINE_PATTERN_POWER_OF_2_ONLY - - This indicates that only patterns with a power of 2 length - can be accelerated. - - LINE_PATTERN_LSBFIRST_MSBJUSTIFIED - LINE_PATTERN_LSBFIRST_LSBJUSTIFIED - LINE_PATTERN_MSBFIRST_MSBJUSTIFIED - LINE_PATTERN_MSBFIRST_LSBJUSTIFIED - - These describe how the line pattern should be packed. - The pattern buffer is DWORD padded. LSBFIRST indicates - that the pattern runs from the LSB end to the MSB end. - MSBFIRST indicates that the pattern runs from the MSB end - to the LSB end. When the pattern does not completely fill - the DWORD padded buffer, the pattern will be justified - towards the MSB or LSB end based on the flags above. - - - The following field indicates the maximum length dash pattern that - should be accelerated. - - int DashPatternMaxLength - - -void SetupForDashedLine(ScrnInfoPtr pScrn, - int fg, int bg, int rop, unsigned int planemask, - int length, unsigned char *pattern) - - - SetupForDashedLine indicates that any combination of the following - may follow it. - - SubsequentDashedBresenhamLine - SubsequentDashedTwoPointLine - - If "bg" is -1, then the background (pixels corresponding to clear - bits in the pattern) should remain unmodified. "Bg" indicates the - background color otherwise. "Length" indicates the length of - the pattern in bits and "pattern" points to the DWORD padded buffer - holding the pattern which has been packed according to the flags - set above. - - -void SubsequentDashedTwoPointLine( ScrnInfoPtr pScrn, - int x1, int y1, int x2, int y2, int flags, int phase) - -void SubsequentDashedBresenhamLine(ScrnInfoPtr pScrn, - int x1, int y1, int major, int minor, int err, int len, int octant, - int phase) - - These are the same as the SubsequentSolidTwoPointLine and - SubsequentBresenhamLine functions except for the addition - of the "phase" field which indicates the offset into the dash - pattern that the pixel at (x1,y1) corresponds to. - - As with the SubsequentBresenhamLine, there is an - - int DashedBresenhamLineErrorTermBits - - field which indicates the size of the error term registers - used with dashed lines. This is usually the same value as - the field for the solid lines (because it's usually the same - register). - - - -2.5 Color Expansion Fills - - When filling a color expansion rectangle, the accelerator - paints each pixel depending on whether or not a bit in a - corresponding bitmap is set or clear. Opaque expansions are - when a set bit corresponds to the foreground color and a clear - bit corresponds to the background color. A transparent expansion - is when a set bit corresponds to the foreground color and a - clear bit indicates that the pixel should remain unmodified. - - The graphics accelerator usually has access to the source - bitmap in one of two ways: 1) the bitmap data is sent serially - to the accelerator by the CPU through some memory mapped aperture - or 2) the accelerator reads the source bitmap out of offscreen - video memory. Some types of primitives are better suited towards - one method or the other. Type 2 is useful for reusable patterns - such as stipples which can be cached in offscreen memory. The - aperature method can be used for stippling but the CPU must pass - the data across the bus each time a stippled fill is to be performed. - For expanding 1bpp client pixmaps or text strings to the screen, - the aperature method is usually superior because the intermediate - copy in offscreen memory needed by the second method would only be - used once. Unfortunately, many accelerators can only do one of these - methods and not both. - - XAA provides both ScreenToScreen and CPUToScreen color expansion - interfaces for doing color expansion fills. The ScreenToScreen - functions can only be used with hardware that supports reading - of source bitmaps from offscreen video memory, and these are only - used for cacheable patterns such as stipples. There are two - variants of the CPUToScreen routines - a direct method intended - for hardware that has a transfer aperature, and an indirect method - intended for hardware without transfer aperatures or hardware - with unusual transfer requirements. Hardware that can only expand - bitmaps from video memory should supply ScreenToScreen routines - but also ScanlineCPUToScreen (indirect) routines to optimize transfers - of non-cacheable data. Hardware that can only accept source bitmaps - through an aperature should supply CPUToScreen (or ScanlineCPUToScreen) - routines. Hardware that can do both should provide both ScreenToScreen - and CPUToScreen routines. - - For both ScreenToScreen and CPUToScreen interfaces, the GXCOPY_ONLY, - ROP_NEEDS_SOURCE, NO_PLANEMASK and RGB_EQUAL flags described in - Section 2.0 are valid as well as the following: - - /* bit order requirements (one of these must be set) */ - - BIT_ORDER_IN_BYTE_LSBFIRST - - This indicates that least significant bit in each byte of the source - data corresponds to the leftmost of that block of 8 pixels. This - is the prefered format. - - BIT_ORDER_IN_BYTE_MSBFIRST - - This indicates that most significant bit in each byte of the source - data corresponds to the leftmost of that block of 8 pixels. - - /* transparency restrictions */ - - NO_TRANSPARENCY - - This indicates that the accelerator cannot do a transparent expansion. - - TRANSPARENCY_ONLY - - This indicates that the accelerator cannot do an opaque expansion. - In cases where where the background needs to be filled, XAA will - render the primitive in two passes when using the CPUToScreen - interface, but will not do so with the ScreenToScreen interface - since that would require caching of two patterns. Some - ScreenToScreen hardware may be able to render two passes at the - driver level and remove the TRANSPARENCY_ONLY restriction if - it can render pixels corresponding to the zero bits. - - - -2.5.1 Screen To Screen Color Expansion - - The ScreenToScreenColorExpandFill routines provide an interface - for doing expansion blits from source patterns stored in offscreen - video memory. - - void SetupForScreenToScreenColorExpandFill (ScrnInfoPtr pScrn, - int fg, int bg, - int rop, unsigned int planemask) - - - Ones in the source bitmap will correspond to the fg color. - Zeros in the source bitmap will correspond to the bg color - unless bg = -1. In that case the pixels corresponding to the - zeros in the bitmap shall be left unmodified by the accelerator. - - For hardware that doesn't allow an easy implementation of skipleft, the - driver can replace CacheMonoStipple function with one that stores multiple - rotated copies of the stipple and select between them. In this case the - driver should set CacheColorExpandDensity to tell XAA how many copies of - the pattern are stored in the width of a cache slot. For instance if the - hardware can specify the starting address in bytes, then 8 rotated copies - of the stipple are needed and CacheColorExpandDensity should be set to 8. - - void SubsequentScreenToScreenColorExpandFill( ScrnInfoPtr pScrn, - int x, int y, int w, int h, - int srcx, int srcy, int offset ) - - - Fill a rectangle "w" x "h" at location (x,y). The source pitch - between scanlines is the framebuffer pitch (pScrn->displayWidth - pixels) and srcx and srcy indicate the start of the source pattern - in units of framebuffer pixels. "Offset" indicates the bit offset - into the pattern that corresponds to the pixel being painted at - "x" on the screen. Some hardware accepts source coordinates in - units of bits which makes implementation of the offset trivial. - In that case, the bit address of the source bit corresponding to - the pixel painted at (x,y) would be: - - (srcy * pScrn->displayWidth + srcx) * pScrn->bitsPerPixel + offset - - It should be noted that the offset assumes LSBFIRST hardware. - For MSBFIRST hardware, the driver may need to implement the - offset by bliting only from byte boundaries and hardware clipping. - - - -2.5.2 CPU To Screen Color Expansion - - - The CPUToScreenColorExpandFill routines provide an interface for - doing expansion blits from source patterns stored in system memory. - There are two varieties of this primitive, a CPUToScreenColorExpandFill - and a ScanlineCPUToScreenColorExpandFill. With the - CPUToScreenColorExpandFill method, the source data is sent serially - through a memory mapped aperature. With the Scanline version, the - data is rendered scanline at a time into intermediate buffers with - a call to SubsequentColorExpandScanline following each scanline. - - These two methods have separate flags fields, the - CPUToScreenColorExpandFillFlags and ScanlineCPUToScreenColorExpandFillFlags - respectively. Flags specific to one method or the other are described - in sections 2.5.2.1 and 2.5.2.2 but for both cases the bit order and - transparency restrictions listed at the beginning of section 2.5 are - valid as well as the following: - - /* clipping (optional) */ - - LEFT_EDGE_CLIPPING - - This indicates that the accelerator supports omission of up to - 31 pixels on the left edge of the rectangle to be filled. This - is beneficial since it allows transfer of the source bitmap to - always occur from DWORD boundaries. - - LEFT_EDGE_CLIPPING_NEGATIVE_X - - This flag indicates that the accelerator can render color expansion - rectangles even if the value of x origin is negative (off of - the screen on the left edge). - - /* misc */ - - TRIPLE_BITS_24BPP - - When enabled (must be in 24bpp mode), color expansion functions - are expected to require three times the amount of bits to be - transferred so that 24bpp grayscale colors can be used with color - expansion in 8bpp coprocessor mode. Each bit is expanded to 3 - bits when writing the monochrome data. - - - 2.5.1 The Direct Method - - - Using the direct method of color expansion XAA will send all - bitmap data to the accelerator serially through an memory mapped - transfer window defined by the following two fields: - - unsigned char *ColorExpandBase - - This indicates the memory address of the beginning of the aperture. - - int ColorExpandRange - - This indicates the size in bytes of the aperture. - - The driver should specify how the transfered data should be padded. - There are options for both the padding of each Y scanline and for the - total transfer to the aperature. - One of the following two flags must be set: - - CPU_TRANSFER_PAD_DWORD - - This indicates that the total transfer (sum of all scanlines) sent - to the aperature must be DWORD padded. This is the default behavior. - - CPU_TRANSFER_PAD_QWORD - - This indicates that the total transfer (sum of all scanlines) sent - to the aperature must be QWORD padded. With this set, XAA will send - an extra DWORD to the aperature when needed to ensure that only - an even number of DWORDs are sent. - - And then there are the flags for padding of each scanline: - - SCANLINE_PAD_DWORD - - This indicates that each Y scanline should be DWORD padded. - This is the only option available and is the default. - - Finally, there is the CPU_TRANSFER_BASE_FIXED flag which indicates - that the aperture is a single register rather than a range of - registers, and XAA should write all of the data to the first DWORD. - If the ColorExpandRange is not large enough to accomodate scanlines - the width of the screen, this option will be forced. That is, the - ColorExpandRange must be: - - ((virtualX + 31)/32) * 4 bytes or more. - - ((virtualX + 62)/32 * 4) if LEFT_EDGE_CLIPPING_NEGATIVE_X is set. - - If the TRIPLE_BITS_24BPP flag is set, the required area should be - multiplied by three. - - -void SetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, - int fg, int bg, - int rop, - unsigned int planemask) - - - - Ones in the source bitmap will correspond to the fg color. - Zeros in the source bitmap will correspond to the bg color - unless bg = -1. In that case the pixels corresponding to the - zeros in the bitmap shall be left unmodified by the accelerator. - - -void SubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - int skipleft ) - - When this function is called, the accelerator should be setup - to fill a rectangle of dimension "w" by "h" with origin at (x,y) - in the fill style prescribed by the last call to - SetupForCPUToScreenColorExpandFill. XAA will pass the data to - the aperture immediately after this function is called. If the - skipleft is non-zero (and LEFT_EDGE_CLIPPING has been enabled), then - the accelerator _should_not_ render skipleft pixels on the leftmost - edge of the rectangle. Some engines have an alignment feature - like this built in, some others can do this using a clipping - window. - - It can be arranged for XAA to call Sync() after it is through - calling the Subsequent function by setting SYNC_AFTER_COLOR_EXPAND - in the CPUToScreenColorExpandFillFlags. This can provide the driver - with an oportunity to reset a clipping window if needed. - - -2.5.2 The Indirect Method - - Using the indirect method, XAA will render the bitmap data scanline - at a time to one or more buffers. These buffers may be memory - mapped apertures or just intermediate storage. - - int NumScanlineColorExpandBuffers - - This indicates the number of buffers available. - - unsigned char **ScanlineColorExpandBuffers - - This is an array of pointers to the memory locations of each buffer. - Each buffer is expected to be large enough to accommodate scanlines - the width of the screen. That is: - - ((virtualX + 31)/32) * 4 bytes or more. - - ((virtualX + 62)/32 * 4) if LEFT_EDGE_CLIPPING_NEGATIVE_X is set. - - Scanlines are always DWORD padded. - If the TRIPLE_BITS_24BPP flag is set, the required area should be - multiplied by three. - - -void SetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, - int fg, int bg, - int rop, - unsigned int planemask) - - Ones in the source bitmap will correspond to the fg color. - Zeros in the source bitmap will correspond to the bg color - unless bg = -1. In that case the pixels corresponding to the - zeros in the bitmap shall be left unmodified by the accelerator. - - -void SubsequentScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - int skipleft ) - -void SubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno) - - - When SubsequentScanlineCPUToScreenColorExpandFill is called, XAA - will begin transfering the source data scanline at a time, calling - SubsequentColorExpandScanline after each scanline. If more than - one buffer is available, XAA will cycle through the buffers. - Subsequent scanlines will use the next buffer and go back to the - buffer 0 again when the last buffer is reached. The index into - the ScanlineColorExpandBuffers array is presented as "bufno" - with each SubsequentColorExpandScanline call. - - The skipleft field is the same as for the direct method. - - The indirect method can be use to send the source data directly - to a memory mapped aperture represented by a single color expand - buffer, scanline at a time, but more commonly it is used to place - the data into offscreen video memory so that the accelerator can - blit it to the visible screen from there. In the case where the - accelerator permits rendering into offscreen video memory while - the accelerator is active, several buffers can be used so that - XAA can be placing source data into the next buffer while the - accelerator is blitting the current buffer. For cases where - the accelerator requires some special manipulation of the source - data first, the buffers can be in system memory. The CPU can - manipulate these buffers and then send the data to the accelerator. - - - -2.6 8x8 Mono Pattern Fills - - XAA provides support for two types of 8x8 hardware patterns - - "Mono" patterns and "Color" patterns. Mono pattern data is - 64 bits of color expansion data with ones indicating the - foreground color and zeros indicating the background color. - The source bitmaps for the 8x8 mono patterns can be presented - to the graphics accelerator in one of two ways. They can be - passed as two DWORDS to the 8x8 mono pattern functions or - they can be cached in offscreen memory and their locations - passed to the 8x8 mono pattern functions. In addition to the - GXCOPY_ONLY, ROP_NEEDS_SOURCE, NO_PLANEMASK and RGB_EQUAL flags - defined in Section 2.0, the following are defined for the - Mono8x8PatternFillFlags: - - HARDWARE_PATTERN_PROGRAMMED_BITS - - This indicates that the 8x8 patterns should be packed into two - DWORDS and passed to the 8x8 mono pattern functions. The default - behavior is to cache the patterns in offscreen video memory and - pass the locations of these patterns to the functions instead. - The pixmap cache must be enabled for the default behavior (8x8 - pattern caching) to work. See Section 3 for how to enable the - pixmap cache. The pixmap cache is not necessary for - HARDWARE_PATTERN_PROGRAMMED_BITS. - - HARDWARE_PATTERN_PROGRAMMED_ORIGIN - - If the hardware supports programmable pattern offsets then - this option should be set. See the table below for further - infomation. - - HARDWARE_PATTERN_SCREEN_ORIGIN - - Some hardware wants the pattern offset specified with respect to the - upper left-hand corner of the primitive being drawn. Other hardware - needs the option HARDWARE_PATTERN_SCREEN_ORIGIN set to indicate that - all pattern offsets should be referenced to the upper left-hand - corner of the screen. HARDWARE_PATTERN_SCREEN_ORIGIN is preferable - since this is more natural for the X-Window system and offsets will - have to be recalculated for each Subsequent function otherwise. - - BIT_ORDER_IN_BYTE_MSBFIRST - BIT_ORDER_IN_BYTE_LSBFIRST - - As with other color expansion routines this indicates whether the - most or the least significant bit in each byte from the pattern is - the leftmost on the screen. - - TRANSPARENCY_ONLY - NO_TRANSPARENCY - - This means the same thing as for the color expansion rect routines - except that for TRANSPARENCY_ONLY XAA will not render the primitive - in two passes since this is more easily handled by the driver. - It is recommended that TRANSPARENCY_ONLY hardware handle rendering - of opaque patterns in two passes (the background can be filled as - a rectangle in GXcopy) in the Subsequent function so that the - TRANSPARENCY_ONLY restriction can be removed. - - - - Additional information about cached patterns... - For the case where HARDWARE_PATTERN_PROGRAMMED_BITS is not set and - the pattern must be cached in offscreen memory, the first pattern - starts at the cache slot boundary which is set by the - CachePixelGranularity field used to configure the pixmap cache. - One should ensure that the CachePixelGranularity reflects any - alignment restrictions that the accelerator may put on 8x8 pattern - storage locations. When HARDWARE_PATTERN_PROGRAMMED_ORIGIN is set - there is only one pattern stored. When this flag is not set, - all 64 pre-rotated copies of the pattern are cached in offscreen memory. - The MonoPatternPitch field can be used to specify the X position pixel - granularity that each of these patterns must align on. If the - MonoPatternPitch is not supplied, the patterns will be densely packed - within the cache slot. The behavior of the default XAA 8x8 pattern - caching mechanism to store all 8x8 patterns linearly in video memory. - If the accelerator needs the patterns stored in a more unusual fashion, - the driver will need to provide its own 8x8 mono pattern caching - routines for XAA to use. - - The following table describes the meanings of the "patx" and "paty" - fields in both the SetupFor and Subsequent functions. - - With HARDWARE_PATTERN_SCREEN_ORIGIN - ----------------------------------- - - HARDWARE_PATTERN_PROGRAMMED_BITS and HARDWARE_PATTERN_PROGRAMMED_ORIGIN - - SetupFor: patx and paty are the first and second DWORDS of the - 8x8 mono pattern. - - Subsequent: patx and paty are the x,y offset into that pattern. - All Subsequent calls will have the same offset in - the case of HARDWARE_PATTERN_SCREEN_ORIGIN so only - the offset specified by the first Subsequent call - after a SetupFor call will need to be observed. - - HARDWARE_PATTERN_PROGRAMMED_BITS only - - SetupFor: patx and paty hold the first and second DWORDS of - the 8x8 mono pattern pre-rotated to match the desired - offset. - - Subsequent: These just hold the same patterns and can be ignored. - - HARDWARE_PATTERN_PROGRAMMED_ORIGIN only - - SetupFor: patx and paty hold the x,y coordinates of the offscreen - memory location where the 8x8 pattern is stored. The - bits are stored linearly in memory at that location. - - Subsequent: patx and paty hold the offset into the pattern. - All Subsequent calls will have the same offset in - the case of HARDWARE_PATTERN_SCREEN_ORIGIN so only - the offset specified by the first Subsequent call - after a SetupFor call will need to be observed. - - Neither programmed bits or origin - - SetupFor: patx and paty hold the x,y coordinates of the offscreen - memory location where the pre-rotated 8x8 pattern is - stored. - - Subsequent: patx and paty are the same as in the SetupFor function - and can be ignored. - - - Without HARDWARE_PATTERN_SCREEN_ORIGIN - -------------------------------------- - - HARDWARE_PATTERN_PROGRAMMED_BITS and HARDWARE_PATTERN_PROGRAMMED_ORIGIN - - SetupFor: patx and paty are the first and second DWORDS of the - 8x8 mono pattern. - - Subsequent: patx and paty are the x,y offset into that pattern. - - HARDWARE_PATTERN_PROGRAMMED_BITS only - - SetupFor: patx and paty holds the first and second DWORDS of - the unrotated 8x8 mono pattern. This can be ignored. - - Subsequent: patx and paty hold the rotated 8x8 pattern to be - rendered. - - HARDWARE_PATTERN_PROGRAMMED_ORIGIN only - - SetupFor: patx and paty hold the x,y coordinates of the offscreen - memory location where the 8x8 pattern is stored. The - bits are stored linearly in memory at that location. - - Subsequent: patx and paty hold the offset into the pattern. - - Neither programmed bits or origin - - SetupFor: patx and paty hold the x,y coordinates of the offscreen - memory location where the unrotated 8x8 pattern is - stored. This can be ignored. - - Subsequent: patx and paty hold the x,y coordinates of the - rotated 8x8 pattern to be rendered. - - - -void SetupForMono8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty, - int fg, int bg, int rop, unsigned int planemask) - - SetupForMono8x8PatternFill indicates that any combination of the - following may follow it. - - SubsequentMono8x8PatternFillRect - SubsequentMono8x8PatternFillTrap - - The fg, bg, rop and planemask fields have the same meaning as the - ones used for the other color expansion routines. Patx's and paty's - meaning can be determined from the table above. - - -void SubsequentMono8x8PatternFillRect( ScrnInfoPtr pScrn, - int patx, int paty, int x, int y, int w, int h) - - Fill a rectangle of dimensions "w" by "h" with origin at (x,y) - using the parameters give by the last SetupForMono8x8PatternFill - call. The meanings of patx and paty can be determined by the - table above. - -void SubsequentMono8x8PatternFillTrap( ScrnInfoPtr pScrn, - int patx, int paty, int y, int h, - int left, int dxL, int dyL, int eL, - int right, int dxR, int dyR, int eR ) - - The meanings of patx and paty can be determined by the table above. - The rest of the fields have the same meanings as those in the - SubsequentSolidFillTrap function. - - - -2.7 8x8 Color Pattern Fills - - 8x8 color pattern data is 64 pixels of full color data that - is stored linearly in offscreen video memory. 8x8 color patterns - are useful as a substitute for 8x8 mono patterns when tiling, - doing opaque stipples, or in the case where transperency is - supported, regular stipples. 8x8 color pattern fills also have - the additional benefit of being able to tile full color 8x8 - patterns instead of just 2 color ones like the mono patterns. - However, full color 8x8 patterns aren't used very often in the - X Window system so you might consider passing this primitive - by if you already can do mono patterns, especially if they - require alot of cache area. Color8x8PatternFillFlags is - the flags field for this primitive and the GXCOPY_ONLY, - ROP_NEEDS_SOURCE and NO_PLANEMASK flags as described in - Section 2.0 are valid as well as the following: - - - HARDWARE_PATTERN_PROGRAMMED_ORIGIN - - If the hardware supports programmable pattern offsets then - this option should be set. - - HARDWARE_PATTERN_SCREEN_ORIGIN - - Some hardware wants the pattern offset specified with respect to the - upper left-hand corner of the primitive being drawn. Other hardware - needs the option HARDWARE_PATTERN_SCREEN_ORIGIN set to indicate that - all pattern offsets should be referenced to the upper left-hand - corner of the screen. HARDWARE_PATTERN_SCREEN_ORIGIN is preferable - since this is more natural for the X-Window system and offsets will - have to be recalculated for each Subsequent function otherwise. - - NO_TRANSPARENCY - TRANSPARENCY_GXCOPY_ONLY - - These mean the same as for the ScreenToScreenCopy functions. - - - The following table describes the meanings of patx and paty passed - to the SetupFor and Subsequent fields: - - HARDWARE_PATTERN_PROGRAMMED_ORIGIN && HARDWARE_PATTERN_SCREEN_ORIGIN - - SetupFor: patx and paty hold the x,y location of the unrotated - pattern. - - Subsequent: patx and paty hold the pattern offset. For the case - of HARDWARE_PATTERN_SCREEN_ORIGIN all Subsequent calls - have the same offset so only the first call will need - to be observed. - - - HARDWARE_PATTERN_PROGRAMMED_ORIGIN only - - SetupFor: patx and paty hold the x,y location of the unrotated - pattern. - - Subsequent: patx and paty hold the pattern offset. - - HARDWARE_PATTERN_SCREEN_ORIGIN - - SetupFor: patx and paty hold the x,y location of the rotated pattern. - - Subsequent: patx and paty hold the same location as the SetupFor - function so these can be ignored. - - neither flag - - SetupFor: patx and paty hold the x,y location of the unrotated - pattern. This can be ignored. - - Subsequent: patx and paty hold the x,y location of the rotated - pattern. - - Additional information about cached patterns... - All 8x8 color patterns are cached in offscreen video memory so - the pixmap cache must be enabled to use them. The first pattern - starts at the cache slot boundary which is set by the - CachePixelGranularity field used to configure the pixmap cache. - One should ensure that the CachePixelGranularity reflects any - alignment restrictions that the accelerator may put on 8x8 pattern - storage locations. When HARDWARE_PATTERN_PROGRAMMED_ORIGIN is set - there is only one pattern stored. When this flag is not set, - all 64 rotations off the pattern are accessible but it is assumed - that the accelerator is capable of accessing data stored on 8 - pixel boundaries. If the accelerator has stricter alignment - requirements than this the dirver will need to provide its own - 8x8 color pattern caching routines. - - -void SetupForColor8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty, - int rop, unsigned int planemask, int trans_color) - - SetupForColor8x8PatternFill indicates that any combination of the - following may follow it. - - SubsequentColor8x8PatternFillRect - SubsequentColor8x8PatternFillTrap (not implemented yet) - - For the meanings of patx and paty, see the table above. Trans_color - means the same as for the ScreenToScreenCopy functions. - - - -void SubsequentColor8x8PatternFillRect( ScrnInfoPtr pScrn, - int patx, int paty, int x, int y, int w, int h) - - Fill a rectangle of dimensions "w" by "h" with origin at (x,y) - using the parameters give by the last SetupForColor8x8PatternFill - call. The meanings of patx and paty can be determined by the - table above. - -void SubsequentColor8x8PatternFillTrap( ScrnInfoPtr pScrn, - int patx, int paty, int y, int h, - int left, int dxL, int dyL, int eL, - int right, int dxR, int dyR, int eR ) - - For the meanings of patx and paty, see the table above. - The rest of the fields have the same meanings as those in the - SubsequentSolidFillTrap function. - - - -2.8 Image Writes - - XAA provides a mechanism for transfering full color pixel data from - system memory to video memory through the accelerator. This is - useful for dealing with alignment issues and performing raster ops - on the data when writing it to the framebuffer. As with color - expansion rectangles, there is a direct and indirect method. The - direct method sends all data through a memory mapped aperature. - The indirect method sends the data to an intermediated buffer scanline - at a time. - - The direct and indirect methods have separate flags fields, the - ImageWriteFlags and ScanlineImageWriteFlags respectively. - Flags specific to one method or the other are described in sections - 2.8.1 and 2.8.2 but for both cases the GXCOPY_ONLY, ROP_NEEDS_SOURCE - and NO_PLANEMASK flags described in Section 2.0 are valid as well as - the following: - - NO_GXCOPY - - In order to have accelerated image transfers faster than the - software versions for GXcopy, the engine needs to support clipping, - be using the direct method and have a large enough image transfer - range so that CPU_TRANSFER_BASE_FIXED doesn't need to be set. - If these are not supported, then it is unlikely that transfering - the data through the accelerator will be of any advantage for the - simple case of GXcopy. In fact, it may be much slower. For such - cases it's probably best to set the NO_GXCOPY flag so that - Image writes will only be used for the more complicated rops. - - /* transparency restrictions */ - - NO_TRANSPARENCY - - This indicates that the accelerator does not support skipping - of color keyed pixels when copying from the source to the destination. - - TRANSPARENCY_GXCOPY_ONLY - - This indicates that the accelerator supports skipping of color keyed - pixels only when the rop is GXcopy. - - /* clipping (optional) */ - - LEFT_EDGE_CLIPPING - - This indicates that the accelerator supports omission of up to - 3 pixels on the left edge of the rectangle to be filled. This - is beneficial since it allows transfer from the source pixmap to - always occur from DWORD boundaries. - - LEFT_EDGE_CLIPPING_NEGATIVE_X - - This flag indicates that the accelerator can fill areas with - image write data even if the value of x origin is negative (off of - the screen on the left edge). - - -2.8.1 The Direct Method - - Using the direct method of ImageWrite XAA will send all - bitmap data to the accelerator serially through an memory mapped - transfer window defined by the following two fields: - - unsigned char *ImageWriteBase - - This indicates the memory address of the beginning of the aperture. - - int ImageWriteRange - - This indicates the size in bytes of the aperture. - - The driver should specify how the transfered data should be padded. - There are options for both the padding of each Y scanline and for the - total transfer to the aperature. - One of the following two flags must be set: - - CPU_TRANSFER_PAD_DWORD - - This indicates that the total transfer (sum of all scanlines) sent - to the aperature must be DWORD padded. This is the default behavior. - - CPU_TRANSFER_PAD_QWORD - - This indicates that the total transfer (sum of all scanlines) sent - to the aperature must be QWORD padded. With this set, XAA will send - an extra DWORD to the aperature when needed to ensure that only - an even number of DWORDs are sent. - - And then there are the flags for padding of each scanline: - - SCANLINE_PAD_DWORD - - This indicates that each Y scanline should be DWORD padded. - This is the only option available and is the default. - - Finally, there is the CPU_TRANSFER_BASE_FIXED flag which indicates - that the aperture is a single register rather than a range of - registers, and XAA should write all of the data to the first DWORD. - XAA will automatically select CPU_TRANSFER_BASE_FIXED if the - ImageWriteRange is not large enough to accomodate an entire scanline. - - -void SetupForImageWrite(ScrnInfoPtr pScrn, int rop, unsigned int planemask, - int trans_color, int bpp, int depth) - - If trans_color is not -1 then trans_color indicates the transparency - color key and pixels with color trans_color passed through the - aperature should not be transfered to the screen but should be - skipped. Bpp and depth indicate the bits per pixel and depth of - the source pixmap. Trans_color is always -1 if the NO_TRANSPARENCY - flag is set. - - -void SubsequentImageWriteRect(ScrnInfoPtr pScrn, - int x, int y, int w, int h, int skipleft) - - - Data passed through the aperature should be copied to a rectangle - of width "w" and height "h" with origin (x,y). If LEFT_EDGE_CLIPPING - has been enabled, skipleft will correspond to the number of pixels - on the left edge that should not be drawn. Skipleft is zero - otherwise. - - It can be arranged for XAA to call Sync() after it is through - calling the Subsequent functions by setting SYNC_AFTER_IMAGE_WRITE - in the ImageWriteFlags. This can provide the driver with an - oportunity to reset a clipping window if needed. - -2.8.2 The Indirect Method - - Using the indirect method, XAA will render the pixel data scanline - at a time to one or more buffers. These buffers may be memory - mapped apertures or just intermediate storage. - - int NumScanlineImageWriteBuffers - - This indicates the number of buffers available. - - unsigned char **ScanlineImageWriteBuffers - - This is an array of pointers to the memory locations of each buffer. - Each buffer is expected to be large enough to accommodate scanlines - the width of the screen. That is: - - pScrn->VirtualX * pScreen->bitsPerPixel/8 bytes or more. - - If LEFT_EDGE_CLIPPING_NEGATIVE_X is set, add an additional 4 - bytes to that requirement in 8 and 16bpp, 12 bytes in 24bpp. - - Scanlines are always DWORD padded. - -void SetupForScanlineImageWrite(ScrnInfoPtr pScrn, int rop, - unsigned int planemask, int trans_color, - int bpp, int depth) - - If trans_color is not -1 then trans_color indicates the transparency - color key and pixels with color trans_color in the buffer should not - be transfered to the screen but should be skipped. Bpp and depth - indicate the bits per pixel and depth of the source bitmap. - Trans_color is always -1 if the NO_TRANSPARENCY flag is set. - - -void SubsequentImageWriteRect(ScrnInfoPtr pScrn, - int x, int y, int w, int h, int skipleft) - - -void SubsequentImageWriteScanline(ScrnInfoPtr pScrn, int bufno) - - - When SubsequentImageWriteRect is called, XAA will begin - transfering the source data scanline at a time, calling - SubsequentImageWriteScanline after each scanline. If more than - one buffer is available, XAA will cycle through the buffers. - Subsequent scanlines will use the next buffer and go back to the - buffer 0 again when the last buffer is reached. The index into - the ScanlineImageWriteBuffers array is presented as "bufno" - with each SubsequentImageWriteScanline call. - - The skipleft field is the same as for the direct method. - - The indirect method can be use to send the source data directly - to a memory mapped aperture represented by a single image write - buffer, scanline at a time, but more commonly it is used to place - the data into offscreen video memory so that the accelerator can - blit it to the visible screen from there. In the case where the - accelerator permits rendering into offscreen video memory while - the accelerator is active, several buffers can be used so that - XAA can be placing source data into the next buffer while the - accelerator is blitting the current buffer. For cases where - the accelerator requires some special manipulation of the source - data first, the buffers can be in system memory. The CPU can - manipulate these buffers and then send the data to the accelerator. - - -2.9 Clipping - - XAA supports hardware clipping rectangles. To use clipping - in this way it is expected that the graphics accelerator can - clip primitives with verticies anywhere in the 16 bit signed - coordinate system. - -void SetClippingRectangle ( ScrnInfoPtr pScrn, - int left, int top, int right, int bottom) - -void DisableClipping (ScrnInfoPtr pScrn) - - When SetClippingRectangle is called, all hardware rendering - following it should be clipped to the rectangle specified - until DisableClipping is called. - - The ClippingFlags field indicates which operations this sort - of Set/Disable pairing can be used with. Any of the following - flags may be OR'd together. - - HARDWARE_CLIP_SCREEN_TO_SCREEN_COLOR_EXPAND - HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY - HARDWARE_CLIP_MONO_8x8_FILL - HARDWARE_CLIP_COLOR_8x8_FILL - HARDWARE_CLIP_SOLID_FILL - HARDWARE_CLIP_DASHED_LINE - HARDWARE_CLIP_SOLID_LINE - - - -3) XAA PIXMAP CACHE - - /* NOTE: XAA has no knowledge of framebuffer particulars so until - the framebuffer is able to render into offscreen memory, usage - of the pixmap cache requires that the driver provide ImageWrite - routines or a WritePixmap or WritePixmapToCache replacement so - that patterns can even be placed in the cache. - - ADDENDUM: XAA can now load the pixmap cache without requiring - that the driver supply an ImageWrite function, but this can - only be done on linear framebuffers. If you have a linear - framebuffer, set LINEAR_FRAMEBUFFER in the XAAInfoRec.Flags - field and XAA will then be able to upload pixmaps into the - cache without the driver providing functions to do so. - */ - - - The XAA pixmap cache provides a mechanism for caching of patterns - in offscreen video memory so that tiled fills and in some cases - stippling can be done by blitting the source patterns from offscreen - video memory. The pixmap cache also provides the mechanism for caching - of 8x8 color and mono hardware patterns. Any unused offscreen video - memory gets used for the pixmap cache and that information is - provided by the XFree86 Offscreen Memory Manager. XAA registers a - callback with the manager so that it can be informed of any changes - in the offscreen memory configuration. The driver writer does not - need to deal with any of this since it is all automatic. The driver - merely needs to initialize the Offscreen Memory Manager as described - in the DESIGN document and set the PIXMAP_CACHE flag in the - XAAInfoRec.Flags field. The Offscreen Memory Manager initialization - must occur before XAA is initialized or else pixmap cache - initialization will fail. - - PixmapCacheFlags is an XAAInfoRec field which allows the driver to - control pixmap cache behavior to some extent. Currently only one - flag is defined: - - DO_NOT_BLIT_STIPPLES - - This indicates that the stippling should not be done by blitting - from the pixmap cache. This does not apply to 8x8 pattern fills. - - - CachePixelGranularity is an optional field. If the hardware requires - that a 8x8 patterns have some particular pixel alignment it should - be reflected in this field. Ignoring this field or setting it to - zero or one means there are no alignment issues. - - -4) OFFSCREEN PIXMAPS - - XAA has the ability to store pixmap drawables in offscreen video - memory and render into them with full hardware acceleration. Placement - of pixmaps in the cache is done automatically on a first-come basis and - only if there is room. To enable this feature, set the OFFSCREEN_PIXMAPS - flag in the XAAInfoRec.Flags field. This is only available when a - ScreenToScreenCopy function is provided, when the Offscreen memory - manager has been initialized and when the LINEAR_FRAMEBUFFER flag is - also set. - - int maxOffPixWidth - int maxOffPixHeight - - These two fields allow the driver to limit the maximum dimensions - of an offscreen pixmap. If one of these is not set, it is assumed - that there is no limit on that dimension. Note that if an offscreen - pixmap with a particular dimension is allowed, then your driver will be - expected to render primitives as large as that pixmap. - -$XFree86: xc/programs/Xserver/hw/xfree86/xaa/XAA.HOWTO,v 1.12 2000/04/12 14:44:42 tsi Exp $ diff --git a/xserver/hw/xfree86/xaa/xaa.h b/xserver/hw/xfree86/xaa/xaa.h deleted file mode 100644 index b530037c9..000000000 --- a/xserver/hw/xfree86/xaa/xaa.h +++ /dev/null @@ -1,1038 +0,0 @@ - -#ifndef _XAA_H -#define _XAA_H - -#define XAA_VERSION_MAJOR 1 -#define XAA_VERSION_MINOR 2 -#define XAA_VERSION_RELEASE 1 - -/* - - ******** OPERATION SPECIFIC FLAGS ********* - - **** solid/dashed line flags **** - ---------- -------- -23 LINE_PATTERN_LSBFIRST_MSBJUSTIFIED -22 LINE_PATTERN_LSBFIRST_LSBJUSTIFIED -21 LINE_PATTERN_MSBFIRST_MSBJUSTIFIED -20 LINE_PATTERN_MSBFIRST_LSBJUSTIFIED -19 LINE_PATTERN_POWER_OF_2_ONLY -18 LINE_LIMIT_COORDS -17 . -16 . ---------- ------- - - **** screen to screen copy flags **** - ---------- -------- -23 ONLY_LEFT_TO_RIGHT_BITBLT -22 ONLY_TWO_BITBLT_DIRECTIONS -21 . -20 . -19 . -18 . -17 . -16 . ---------- ------- - - **** clipping flags **** - ---------- -------- -23 . -22 HARDWARE_CLIP_SCREEN_TO_SCREEN_COLOR_EXPAND -21 HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY -20 HARDWARE_CLIP_MONO_8x8_FILL -19 HARDWARE_CLIP_COLOR_8x8_FILL -18 HARDWARE_CLIP_SOLID_FILL -17 HARDWARE_CLIP_DASHED_LINE -16 HARDWARE_CLIP_SOLID_LINE ---------- ------- - - **** hardware pattern flags **** - ---------- -------- -23 . -22 . -21 HARDWARE_PATTERN_SCREEN_ORIGIN -20 . -19 . -18 . -17 HARDWARE_PATTERN_PROGRAMMED_ORIGIN -16 HARDWARE_PATTERN_PROGRAMMED_BITS ---------- ------- - - **** write pixmap flags **** - ---------- -------- -23 . -22 . -21 . -20 . -19 . -18 . -17 . -16 CONVERT_32BPP_TO_24BPP ---------- ------- - - ******** GENERIC FLAGS ********* - ---------- ------- -15 SYNC_AFTER_COLOR_EXPAND -14 CPU_TRANSFER_PAD_QWORD -13 . -12 LEFT_EDGE_CLIPPING_NEGATIVE_X -11 LEFT_EDGE_CLIPPING -10 CPU_TRANSFER_BASE_FIXED - 9 BIT_ORDER_IN_BYTE_MSBFIRST - 8 TRANSPARENCY_GXCOPY_ONLY ---------- ------- - 7 NO_TRANSPARENCY - 6 TRANSPARENCY_ONLY - 5 ROP_NEEDS_SOURCE - 4 TRIPLE_BITS_24BPP - 3 RGB_EQUAL - 2 NO_PLANEMASK - 1 NO_GXCOPY - 0 GXCOPY_ONLY ---------- ------- - - -*/ - -#include "gcstruct.h" -#include "pixmapstr.h" -#include "xf86str.h" -#include "regionstr.h" -#include "xf86fbman.h" - -#include "picturestr.h" - -/* Flags */ -#define PIXMAP_CACHE 0x00000001 -#define MICROSOFT_ZERO_LINE_BIAS 0x00000002 -#define OFFSCREEN_PIXMAPS 0x00000004 -#define LINEAR_FRAMEBUFFER 0x00000008 - -/* GC fg, bg, and planemask restrictions */ -#define GXCOPY_ONLY 0x00000001 -#define NO_GXCOPY 0x00000002 -#define NO_PLANEMASK 0x00000004 -#define RGB_EQUAL 0x00000008 -#define TRIPLE_BITS_24BPP 0x00000010 -#define ROP_NEEDS_SOURCE 0x00000020 - -/* transparency restrictions */ -#define TRANSPARENCY_ONLY 0x00000040 -#define NO_TRANSPARENCY 0x00000080 -#define TRANSPARENCY_GXCOPY_ONLY 0x00000100 - -/* bit order restrictions */ -#define BIT_ORDER_IN_BYTE_MSBFIRST 0x00000200 -#define BIT_ORDER_IN_BYTE_LSBFIRST 0x00000000 - -/* transfer base restriction */ -#define CPU_TRANSFER_BASE_FIXED 0x00000400 - -/* skipleft restrictions */ -#define LEFT_EDGE_CLIPPING 0x00000800 -#define LEFT_EDGE_CLIPPING_NEGATIVE_X 0x00001000 - -/* data padding */ -#define CPU_TRANSFER_PAD_DWORD 0x00000000 -#define CPU_TRANSFER_PAD_QWORD 0x00004000 -#define SCANLINE_PAD_DWORD 0x00000000 - -#define SYNC_AFTER_COLOR_EXPAND 0x00008000 -#define SYNC_AFTER_IMAGE_WRITE SYNC_AFTER_COLOR_EXPAND - -/* hardware pattern */ -#define HARDWARE_PATTERN_PROGRAMMED_BITS 0x00010000 -#define HARDWARE_PATTERN_PROGRAMMED_ORIGIN 0x00020000 -#define HARDWARE_PATTERN_SCREEN_ORIGIN 0x00200000 - -/* copyarea flags */ -#define ONLY_TWO_BITBLT_DIRECTIONS 0x00400000 -#define ONLY_LEFT_TO_RIGHT_BITBLT 0x00800000 - -/* line flags */ -#define LINE_PATTERN_LSBFIRST_MSBJUSTIFIED 0x00800000 -#define LINE_PATTERN_LSBFIRST_LSBJUSTIFIED 0x00400000 -#define LINE_PATTERN_MSBFIRST_MSBJUSTIFIED 0x00200000 -#define LINE_PATTERN_MSBFIRST_LSBJUSTIFIED 0x00100000 -#define LINE_PATTERN_POWER_OF_2_ONLY 0x00080000 -#define LINE_LIMIT_COORDS 0x00040000 - -/* clipping flags */ -#define HARDWARE_CLIP_SCREEN_TO_SCREEN_COLOR_EXPAND 0x00400000 -#define HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY 0x00200000 -#define HARDWARE_CLIP_MONO_8x8_FILL 0x00100000 -#define HARDWARE_CLIP_COLOR_8x8_FILL 0x00080000 -#define HARDWARE_CLIP_SOLID_FILL 0x00040000 -#define HARDWARE_CLIP_DASHED_LINE 0x00020000 -#define HARDWARE_CLIP_SOLID_LINE 0x00010000 - -#define HARDWARE_CLIP_LINE 0x00000000 - -/* image write flags */ -#define CONVERT_32BPP_TO_24BPP 0x00010000 - -/* pixmap cache flags */ -#define CACHE_MONO_8x8 0x00000001 -#define CACHE_COLOR_8x8 0x00000002 -#define DO_NOT_BLIT_STIPPLES 0x00000004 -#define DO_NOT_TILE_MONO_DATA 0x00000008 -#define DO_NOT_TILE_COLOR_DATA 0x00000010 - -#define DEGREES_0 0 -#define DEGREES_90 1 -#define DEGREES_180 2 -#define DEGREES_270 3 - -#define OMIT_LAST 1 - -/* render flags */ - -#define XAA_RENDER_POWER_OF_2_TILE_ONLY 0x00000008 -#define XAA_RENDER_NO_SRC_ALPHA 0x00000004 -#define XAA_RENDER_IMPRECISE_ONLY 0x00000002 -#define XAA_RENDER_NO_TILE 0x00000001 - -#define XAA_RENDER_REPEAT 0x00000001 - -typedef void (*ValidateGCProcPtr) (GCPtr pGC, - unsigned long changes, DrawablePtr pDraw); - -typedef struct { - unsigned char *bits; - int width; - int height; - int yoff; - int srcwidth; - int start; - int end; -} NonTEGlyphInfo, *NonTEGlyphPtr; - -typedef struct { - int x; - int y; - int w; - int h; - int orig_w; - int orig_h; - unsigned long serialNumber; - int pat0; - int pat1; - int fg; - int bg; - int trans_color; - DDXPointPtr offsets; - DevUnion devPrivate; -} XAACacheInfoRec, *XAACacheInfoPtr; - -typedef struct _PixmapLink { - PixmapPtr pPix; - struct _PixmapLink *next; - FBAreaPtr area; -} PixmapLink, *PixmapLinkPtr; - -typedef struct _XAAInfoRec { - ScrnInfoPtr pScrn; - int Flags; - - void (*Sync) (ScrnInfoPtr pScrn); - - /* Restore Accel State is a driver callback that is used - * when another screen on the same device has been active. - * This allows multihead on a single device to work. - * If The entityProp has IS_SHARED_ACCEL defined then this - * function is required. - */ - - void (*RestoreAccelState) (ScrnInfoPtr pScrn); - - /***************** Low Level *****************/ - -/* Blits */ - void (*SetupForScreenToScreenCopy) (ScrnInfoPtr pScrn, - int xdir, int ydir, - int rop, - unsigned int planemask, - int trans_color); - int ScreenToScreenCopyFlags; - - void (*SubsequentScreenToScreenCopy) (ScrnInfoPtr pScrn, - int xsrc, int ysrc, - int xdst, int ydst, int w, int h); - -/* Solid fills */ - void (*SetupForSolidFill) (ScrnInfoPtr pScrn, - int color, int rop, unsigned int planemask); - int SolidFillFlags; - - void (*SubsequentSolidFillRect) (ScrnInfoPtr pScrn, - int x, int y, int w, int h); - - void (*SubsequentSolidFillTrap) (ScrnInfoPtr pScrn, - int y, int h, - int left, int dxL, int dyL, int eL, - int right, int dxR, int dyR, int eR); - -/* Solid lines */ - - void (*SetupForSolidLine) (ScrnInfoPtr pScrn, - int color, int rop, unsigned int planemask); - int SolidLineFlags; - - void (*SubsequentSolidTwoPointLine) (ScrnInfoPtr pScrn, - int xa, int ya, int xb, int yb, - int flags); - - void (*SubsequentSolidBresenhamLine) (ScrnInfoPtr pScrn, - int x, int y, int absmaj, int absmin, - int err, int len, int octant); - int SolidBresenhamLineErrorTermBits; - - void (*SubsequentSolidHorVertLine) (ScrnInfoPtr pScrn, - int x, int y, int len, int dir); - -/* Dashed lines */ - - void (*SetupForDashedLine) (ScrnInfoPtr pScrn, - int fg, int bg, - int rop, - unsigned int planemask, - int length, unsigned char *pattern); - int DashedLineFlags; - int DashPatternMaxLength; - - void (*SubsequentDashedTwoPointLine) (ScrnInfoPtr pScrn, - int xa, int ya, int xb, int yb, - int flags, int phase); - - void (*SubsequentDashedBresenhamLine) (ScrnInfoPtr pScrn, - int x, int y, int absmaj, int absmin, - int err, int len, int flags, - int phase); - int DashedBresenhamLineErrorTermBits; - -/* Clipper */ - - void (*SetClippingRectangle) (ScrnInfoPtr pScrn, - int left, int top, int right, int bottom); - int ClippingFlags; - - void (*DisableClipping) (ScrnInfoPtr pScrn); - -/* 8x8 mono pattern fills */ - void (*SetupForMono8x8PatternFill) (ScrnInfoPtr pScrn, - int patx, int paty, - int fg, int bg, - int rop, unsigned int planemask); - int Mono8x8PatternFillFlags; - - void (*SubsequentMono8x8PatternFillRect) (ScrnInfoPtr pScrn, - int patx, int paty, - int x, int y, int w, int h); - - void (*SubsequentMono8x8PatternFillTrap) (ScrnInfoPtr pScrn, - int patx, int paty, - int y, int h, - int left, int dxL, int dyL, - int eL, int right, int dxR, - int dyR, int eR); - -/* 8x8 color pattern fills */ - - void (*SetupForColor8x8PatternFill) (ScrnInfoPtr pScrn, - int patx, int paty, - int rop, - unsigned int planemask, - int transparency_color); - int Color8x8PatternFillFlags; - - void (*SubsequentColor8x8PatternFillRect) (ScrnInfoPtr pScrn, - int patx, int paty, - int x, int y, int w, int h); - - void (*SubsequentColor8x8PatternFillTrap) (ScrnInfoPtr pScrn, - int patx, int paty, - int y, int h, - int left, int dxL, int dyL, - int eL, int right, int dxR, - int dyR, int eR); - -/* Color expansion */ - - void (*SetupForCPUToScreenColorExpandFill) (ScrnInfoPtr pScrn, - int fg, int bg, - int rop, - unsigned int planemask); - int CPUToScreenColorExpandFillFlags; - - void (*SubsequentCPUToScreenColorExpandFill) (ScrnInfoPtr pScrn, - int x, int y, int w, int h, - int skipleft); - - unsigned char *ColorExpandBase; - int ColorExpandRange; - -/* Scanline color expansion */ - - void (*SetupForScanlineCPUToScreenColorExpandFill) (ScrnInfoPtr pScrn, - int fg, int bg, - int rop, - unsigned int planemask); - int ScanlineCPUToScreenColorExpandFillFlags; - - void (*SubsequentScanlineCPUToScreenColorExpandFill) (ScrnInfoPtr pScrn, - int x, int y, int w, - int h, int skipleft); - - void (*SubsequentColorExpandScanline) (ScrnInfoPtr pScrn, int bufno); - - int NumScanlineColorExpandBuffers; - unsigned char **ScanlineColorExpandBuffers; - -/* Screen to screen color expansion */ - - void (*SetupForScreenToScreenColorExpandFill) (ScrnInfoPtr pScrn, - int fg, int bg, - int rop, - unsigned int planemask); - int ScreenToScreenColorExpandFillFlags; - - void (*SubsequentScreenToScreenColorExpandFill) (ScrnInfoPtr pScrn, - int x, int y, int w, int h, - int srcx, int srcy, - int skipleft); - -/* Image transfers */ - - void (*SetupForImageWrite) (ScrnInfoPtr pScrn, - int rop, - unsigned int planemask, - int transparency_color, int bpp, int depth); - int ImageWriteFlags; - - void (*SubsequentImageWriteRect) (ScrnInfoPtr pScrn, - int x, int y, int w, int h, int skipleft); - unsigned char *ImageWriteBase; - int ImageWriteRange; - -/* Scanline Image transfers */ - - void (*SetupForScanlineImageWrite) (ScrnInfoPtr pScrn, - int rop, - unsigned int planemask, - int transparency_color, - int bpp, int depth); - int ScanlineImageWriteFlags; - - void (*SubsequentScanlineImageWriteRect) (ScrnInfoPtr pScrn, - int x, int y, int w, int h, - int skipleft); - - void (*SubsequentImageWriteScanline) (ScrnInfoPtr pScrn, int bufno); - - int NumScanlineImageWriteBuffers; - unsigned char **ScanlineImageWriteBuffers; - - /* Image Reads - OBSOLETE AND NOT USED */ - - void (*SetupForImageRead) (ScrnInfoPtr pScrn, int bpp, int depth); - int ImageReadFlags; - - unsigned char *ImageReadBase; - int ImageReadRange; - - void (*SubsequentImageReadRect) (ScrnInfoPtr pScrn, - int x, int y, int w, int h); - - /***************** Mid Level *****************/ - void (*ScreenToScreenBitBlt) (ScrnInfoPtr pScrn, - int nbox, - DDXPointPtr pptSrc, - BoxPtr pbox, - int xdir, int ydir, - int alu, unsigned int planmask); - int ScreenToScreenBitBltFlags; - - void (*WriteBitmap) (ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, - int srcwidth, - int skipleft, - int fg, int bg, int rop, unsigned int planemask); - int WriteBitmapFlags; - - void (*FillSolidRects) (ScrnInfoPtr pScrn, - int fg, int rop, - unsigned int planemask, int nBox, BoxPtr pBox); - int FillSolidRectsFlags; - - void (*FillMono8x8PatternRects) (ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, - int pat0, int pat1, int xorg, int yorg); - int FillMono8x8PatternRectsFlags; - - void (*FillColor8x8PatternRects) (ScrnInfoPtr pScrn, - int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, - int xorg, int yorg, - XAACacheInfoPtr pCache); - int FillColor8x8PatternRectsFlags; - - void (*FillCacheBltRects) (ScrnInfoPtr pScrn, - int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, - int xorg, int yorg, XAACacheInfoPtr pCache); - int FillCacheBltRectsFlags; - - void (*FillColorExpandRects) (ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, - int xorg, int yorg, PixmapPtr pPix); - int FillColorExpandRectsFlags; - - void (*FillCacheExpandRects) (ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, - int xorg, int yorg, PixmapPtr pPix); - int FillCacheExpandRectsFlags; - - void (*FillImageWriteRects) (ScrnInfoPtr pScrn, - int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, - int xorg, int yorg, PixmapPtr pPix); - int FillImageWriteRectsFlags; - - void (*FillSolidSpans) (ScrnInfoPtr pScrn, - int fg, int rop, - unsigned int planemask, - int n, - DDXPointPtr points, int *widths, int fSorted); - int FillSolidSpansFlags; - - void (*FillMono8x8PatternSpans) (ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int n, - DDXPointPtr points, - int *widths, - int fSorted, - int pat0, int pat1, int xorg, int yorg); - int FillMono8x8PatternSpansFlags; - - void (*FillColor8x8PatternSpans) (ScrnInfoPtr pScrn, - int rop, - unsigned int planemask, - int n, - DDXPointPtr points, - int *widths, - int fSorted, - XAACacheInfoPtr pCache, - int xorg, int yorg); - int FillColor8x8PatternSpansFlags; - - void (*FillCacheBltSpans) (ScrnInfoPtr pScrn, - int rop, - unsigned int planemask, - int n, - DDXPointPtr points, - int *widths, - int fSorted, - XAACacheInfoPtr pCache, int xorg, int yorg); - int FillCacheBltSpansFlags; - - void (*FillColorExpandSpans) (ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int n, - DDXPointPtr points, - int *widths, - int fSorted, - int xorg, int yorg, PixmapPtr pPix); - int FillColorExpandSpansFlags; - - void (*FillCacheExpandSpans) (ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int n, - DDXPointPtr ppt, - int *pwidth, - int fSorted, - int xorg, int yorg, PixmapPtr pPix); - int FillCacheExpandSpansFlags; - - void (*TEGlyphRenderer) (ScrnInfoPtr pScrn, - int x, int y, int w, int h, int skipleft, - int startline, unsigned int **glyphs, - int glyphWidth, int fg, int bg, int rop, - unsigned planemask); - int TEGlyphRendererFlags; - - void (*NonTEGlyphRenderer) (ScrnInfoPtr pScrn, - int x, int y, int n, - NonTEGlyphPtr glyphs, - BoxPtr pbox, - int fg, int rop, unsigned int planemask); - int NonTEGlyphRendererFlags; - - void (*WritePixmap) (ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, - int srcwidth, - int rop, - unsigned int planemask, - int transparency_color, int bpp, int depth); - int WritePixmapFlags; - - void (*ReadPixmap) (ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *dst, int dstwidth, int bpp, int depth); - int ReadPixmapFlags; - - /***************** GC Level *****************/ - RegionPtr (*CopyArea) (DrawablePtr pSrcDrawable, - DrawablePtr pDstDrawable, - GC * pGC, - int srcx, int srcy, - int width, int height, int dstx, int dsty); - int CopyAreaFlags; - - RegionPtr (*CopyPlane) (DrawablePtr pSrc, - DrawablePtr pDst, - GCPtr pGC, - int srcx, int srcy, - int width, int height, - int dstx, int dsty, unsigned long bitPlane); - int CopyPlaneFlags; - - void (*PushPixelsSolid) (GCPtr pGC, - PixmapPtr pBitMap, - DrawablePtr pDrawable, - int dx, int dy, int xOrg, int yOrg); - int PushPixelsFlags; - - /** PolyFillRect **/ - - void (*PolyFillRectSolid) (DrawablePtr pDraw, - GCPtr pGC, int nrectFill, xRectangle *prectInit); - int PolyFillRectSolidFlags; - - void (*PolyFillRectStippled) (DrawablePtr pDraw, - GCPtr pGC, - int nrectFill, xRectangle *prectInit); - int PolyFillRectStippledFlags; - - void (*PolyFillRectOpaqueStippled) (DrawablePtr pDraw, - GCPtr pGC, - int nrectFill, xRectangle *prectInit); - int PolyFillRectOpaqueStippledFlags; - - void (*PolyFillRectTiled) (DrawablePtr pDraw, - GCPtr pGC, int nrectFill, xRectangle *prectInit); - int PolyFillRectTiledFlags; - - /** FillSpans **/ - - void (*FillSpansSolid) (DrawablePtr pDraw, - GCPtr pGC, - int nInit, - DDXPointPtr ppt, int *pwidth, int fSorted); - int FillSpansSolidFlags; - - void (*FillSpansStippled) (DrawablePtr pDraw, - GCPtr pGC, - int nInit, - DDXPointPtr ppt, int *pwidth, int fSorted); - int FillSpansStippledFlags; - - void (*FillSpansOpaqueStippled) (DrawablePtr pDraw, - GCPtr pGC, - int nInit, - DDXPointPtr ppt, int *pwidth, int fSorted); - int FillSpansOpaqueStippledFlags; - - void (*FillSpansTiled) (DrawablePtr pDraw, - GCPtr pGC, - int nInit, - DDXPointPtr ppt, int *pwidth, int fSorted); - int FillSpansTiledFlags; - - int (*PolyText8TE) (DrawablePtr pDraw, - GCPtr pGC, int x, int y, int count, char *chars); - int PolyText8TEFlags; - - int (*PolyText16TE) (DrawablePtr pDraw, - GCPtr pGC, - int x, int y, int count, unsigned short *chars); - int PolyText16TEFlags; - - void (*ImageText8TE) (DrawablePtr pDraw, - GCPtr pGC, int x, int y, int count, char *chars); - int ImageText8TEFlags; - - void (*ImageText16TE) (DrawablePtr pDraw, - GCPtr pGC, - int x, int y, int count, unsigned short *chars); - int ImageText16TEFlags; - - void (*ImageGlyphBltTE) (DrawablePtr pDrawable, - GCPtr pGC, - int xInit, int yInit, - unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase); - int ImageGlyphBltTEFlags; - - void (*PolyGlyphBltTE) (DrawablePtr pDrawable, - GCPtr pGC, - int xInit, int yInit, - unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase); - int PolyGlyphBltTEFlags; - - int (*PolyText8NonTE) (DrawablePtr pDraw, - GCPtr pGC, int x, int y, int count, char *chars); - int PolyText8NonTEFlags; - - int (*PolyText16NonTE) (DrawablePtr pDraw, - GCPtr pGC, - int x, int y, int count, unsigned short *chars); - int PolyText16NonTEFlags; - - void (*ImageText8NonTE) (DrawablePtr pDraw, - GCPtr pGC, int x, int y, int count, char *chars); - int ImageText8NonTEFlags; - - void (*ImageText16NonTE) (DrawablePtr pDraw, - GCPtr pGC, - int x, int y, int count, unsigned short *chars); - int ImageText16NonTEFlags; - - void (*ImageGlyphBltNonTE) (DrawablePtr pDrawable, - GCPtr pGC, - int xInit, int yInit, - unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase); - int ImageGlyphBltNonTEFlags; - - void (*PolyGlyphBltNonTE) (DrawablePtr pDrawable, - GCPtr pGC, - int xInit, int yInit, - unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase); - int PolyGlyphBltNonTEFlags; - - void (*PolyRectangleThinSolid) (DrawablePtr pDrawable, - GCPtr pGC, - int nRectsInit, xRectangle *pRectsInit); - int PolyRectangleThinSolidFlags; - - void (*PolylinesWideSolid) (DrawablePtr pDrawable, - GCPtr pGC, int mode, int npt, DDXPointPtr pPts); - int PolylinesWideSolidFlags; - - void (*PolylinesThinSolid) (DrawablePtr pDrawable, - GCPtr pGC, int mode, int npt, DDXPointPtr pPts); - int PolylinesThinSolidFlags; - - void (*PolySegmentThinSolid) (DrawablePtr pDrawable, - GCPtr pGC, int nseg, xSegment * pSeg); - int PolySegmentThinSolidFlags; - - void (*PolylinesThinDashed) (DrawablePtr pDrawable, - GCPtr pGC, - int mode, int npt, DDXPointPtr pPts); - int PolylinesThinDashedFlags; - - void (*PolySegmentThinDashed) (DrawablePtr pDrawable, - GCPtr pGC, int nseg, xSegment * pSeg); - int PolySegmentThinDashedFlags; - - void (*FillPolygonSolid) (DrawablePtr pDrawable, - GCPtr pGC, - int shape, - int mode, int count, DDXPointPtr ptsIn); - int FillPolygonSolidFlags; - - void (*FillPolygonStippled) (DrawablePtr pDrawable, - GCPtr pGC, - int shape, - int mode, int count, DDXPointPtr ptsIn); - int FillPolygonStippledFlags; - - void (*FillPolygonOpaqueStippled) (DrawablePtr pDrawable, - GCPtr pGC, - int shape, - int mode, int count, DDXPointPtr ptsIn); - int FillPolygonOpaqueStippledFlags; - - void (*FillPolygonTiled) (DrawablePtr pDrawable, - GCPtr pGC, - int shape, - int mode, int count, DDXPointPtr ptsIn); - int FillPolygonTiledFlags; - - void (*PolyFillArcSolid) (DrawablePtr pDraw, - GCPtr pGC, int narcs, xArc * parcs); - int PolyFillArcSolidFlags; - - void (*PutImage) (DrawablePtr pDraw, - GCPtr pGC, - int depth, - int x, - int y, - int w, int h, int leftPad, int format, char *pImage); - int PutImageFlags; - - /* Validation masks */ - - unsigned long FillSpansMask; - ValidateGCProcPtr ValidateFillSpans; - unsigned long SetSpansMask; - ValidateGCProcPtr ValidateSetSpans; - unsigned long PutImageMask; - ValidateGCProcPtr ValidatePutImage; - unsigned long CopyAreaMask; - ValidateGCProcPtr ValidateCopyArea; - unsigned long CopyPlaneMask; - ValidateGCProcPtr ValidateCopyPlane; - unsigned long PolyPointMask; - ValidateGCProcPtr ValidatePolyPoint; - unsigned long PolylinesMask; - ValidateGCProcPtr ValidatePolylines; - unsigned long PolySegmentMask; - ValidateGCProcPtr ValidatePolySegment; - unsigned long PolyRectangleMask; - ValidateGCProcPtr ValidatePolyRectangle; - unsigned long PolyArcMask; - ValidateGCProcPtr ValidatePolyArc; - unsigned long FillPolygonMask; - ValidateGCProcPtr ValidateFillPolygon; - unsigned long PolyFillRectMask; - ValidateGCProcPtr ValidatePolyFillRect; - unsigned long PolyFillArcMask; - ValidateGCProcPtr ValidatePolyFillArc; - unsigned long PolyText8Mask; - ValidateGCProcPtr ValidatePolyText8; - unsigned long PolyText16Mask; - ValidateGCProcPtr ValidatePolyText16; - unsigned long ImageText8Mask; - ValidateGCProcPtr ValidateImageText8; - unsigned long ImageText16Mask; - ValidateGCProcPtr ValidateImageText16; - unsigned long PolyGlyphBltMask; - ValidateGCProcPtr ValidatePolyGlyphBlt; - unsigned long ImageGlyphBltMask; - ValidateGCProcPtr ValidateImageGlyphBlt; - unsigned long PushPixelsMask; - ValidateGCProcPtr ValidatePushPixels; - - void (*ComputeDash) (GCPtr pGC); - - /* Pixmap Cache */ - - int PixmapCacheFlags; - Bool UsingPixmapCache; - Bool CanDoMono8x8; - Bool CanDoColor8x8; - - void (*InitPixmapCache) (ScreenPtr pScreen, RegionPtr areas, pointer data); - void (*ClosePixmapCache) (ScreenPtr pScreen); - - int (*StippledFillChooser) (GCPtr pGC); - int (*OpaqueStippledFillChooser) (GCPtr pGC); - int (*TiledFillChooser) (GCPtr pGC); - - int CachePixelGranularity; - int MaxCacheableTileWidth; - int MaxCacheableTileHeight; - int MaxCacheableStippleWidth; - int MaxCacheableStippleHeight; - - XAACacheInfoPtr(*CacheTile) (ScrnInfoPtr Scrn, PixmapPtr pPix); - XAACacheInfoPtr(*CacheStipple) (ScrnInfoPtr Scrn, PixmapPtr pPix, - int fg, int bg); - XAACacheInfoPtr(*CacheMonoStipple) (ScrnInfoPtr Scrn, PixmapPtr pPix); - XAACacheInfoPtr(*CacheMono8x8Pattern) (ScrnInfoPtr Scrn, int pat0, - int pat1); - XAACacheInfoPtr(*CacheColor8x8Pattern) (ScrnInfoPtr Scrn, PixmapPtr pPix, - int fg, int bg); - - int MonoPatternPitch; - int CacheWidthMono8x8Pattern; - int CacheHeightMono8x8Pattern; - - int ColorPatternPitch; - int CacheWidthColor8x8Pattern; - int CacheHeightColor8x8Pattern; - - int CacheColorExpandDensity; - - void (*WriteBitmapToCache) (ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, - int srcwidth, int fg, int bg); - void (*WritePixmapToCache) (ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, - int srcwidth, int bpp, int depth); - void (*WriteMono8x8PatternToCache) (ScrnInfoPtr pScrn, - XAACacheInfoPtr pCache); - void (*WriteColor8x8PatternToCache) (ScrnInfoPtr pScrn, - PixmapPtr pPix, - XAACacheInfoPtr pCache); - - char *PixmapCachePrivate; - - /* Miscellaneous */ - - GC ScratchGC; - int PreAllocSize; - unsigned char *PreAllocMem; - - CharInfoPtr CharInfo[255]; - NonTEGlyphInfo GlyphInfo[255]; - - unsigned int FullPlanemask; /* deprecated */ - - PixmapLinkPtr OffscreenPixmaps; - int maxOffPixWidth; - int maxOffPixHeight; - - XAACacheInfoRec ScratchCacheInfoRec; - - BoxPtr ClipBox; - - Bool NeedToSync; - - char *dgaSaves; - - /* These can be supplied to override the defaults */ - - GetImageProcPtr GetImage; - GetSpansProcPtr GetSpans; - CopyWindowProcPtr CopyWindow; - - unsigned int offscreenDepths; - Bool offscreenDepthsInitialized; - - CARD32 FullPlanemasks[32]; - - Bool (*Composite) (CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, INT16 yDst, CARD16 width, CARD16 height); - - Bool (*Glyphs) (CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, - int nlist, GlyphListPtr list, GlyphPtr * glyphs); - - /* The old SetupForCPUToScreenAlphaTexture function is no longer used because - * it doesn't pass in enough information to write a conforming - * implementation. See SetupForCPUToScreenAlphaTexture2. - */ - Bool (*SetupForCPUToScreenAlphaTexture) (ScrnInfoPtr pScrn, - int op, - CARD16 red, - CARD16 green, - CARD16 blue, - CARD16 alpha, - int alphaType, - CARD8 *alphaPtr, - int alphaPitch, - int width, int height, int flags); - void (*SubsequentCPUToScreenAlphaTexture) (ScrnInfoPtr pScrn, - int dstx, - int dsty, - int srcx, - int srcy, int width, int height); - int CPUToScreenAlphaTextureFlags; - CARD32 *CPUToScreenAlphaTextureFormats; - - /* The old SetupForCPUToScreenTexture function is no longer used because - * it doesn't pass in enough information to write a conforming - * implementation. See SetupForCPUToScreenTexture2. - */ - Bool (*SetupForCPUToScreenTexture) (ScrnInfoPtr pScrn, - int op, - int texType, - CARD8 *texPtr, - int texPitch, - int width, int height, int flags); - void (*SubsequentCPUToScreenTexture) (ScrnInfoPtr pScrn, - int dstx, - int dsty, - int srcx, - int srcy, int width, int height); - int CPUToScreenTextureFlags; - CARD32 *CPUToScreenTextureFormats; - - /* these were added for 4.3.0 */ - BoxRec SolidLineLimits; - BoxRec DashedLineLimits; - - /* These were added for X.Org 6.8.0 */ - Bool (*SetupForCPUToScreenAlphaTexture2) (ScrnInfoPtr pScrn, - int op, - CARD16 red, - CARD16 green, - CARD16 blue, - CARD16 alpha, - CARD32 maskFormat, - CARD32 dstFormat, - CARD8 *alphaPtr, - int alphaPitch, - int width, int height, int flags); - CARD32 *CPUToScreenAlphaTextureDstFormats; - - Bool (*SetupForCPUToScreenTexture2) (ScrnInfoPtr pScrn, - int op, - CARD32 srcFormat, - CARD32 dstFormat, - CARD8 *texPtr, - int texPitch, - int width, int height, int flags); - CARD32 *CPUToScreenTextureDstFormats; -} XAAInfoRec, *XAAInfoRecPtr; - -#define SET_SYNC_FLAG(infoRec) (infoRec)->NeedToSync = TRUE - -extern _X_EXPORT Bool - XAAInit(ScreenPtr pScreen, XAAInfoRecPtr infoRec); - -extern _X_EXPORT XAAInfoRecPtr XAACreateInfoRec(void); - -extern _X_EXPORT void - XAADestroyInfoRec(XAAInfoRecPtr infoRec); - -typedef void (*DepthChangeFuncPtr) (ScrnInfoPtr pScrn, int depth); - -extern _X_EXPORT Bool - XAAInitDualFramebufferOverlay(ScreenPtr pScreen, DepthChangeFuncPtr callback); - -#endif /* _XAA_H */ diff --git a/xserver/hw/xfree86/xaa/xaaBitBlt.c b/xserver/hw/xfree86/xaa/xaaBitBlt.c deleted file mode 100644 index c1595c497..000000000 --- a/xserver/hw/xfree86/xaa/xaaBitBlt.c +++ /dev/null @@ -1,229 +0,0 @@ - -/* - This is a lighter version of cfbBitBlt. We calculate the boxes - when accelerating pixmap->screen and screen->screen copies. - We also pass the GC to the doBitBlt function so that it has access - to the fg and bg so CopyPlane can use this. -*/ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" - -#include -#include "mi.h" -#include "pixmapstr.h" -#include "gcstruct.h" -#include "windowstr.h" -#include "xaalocal.h" - -RegionPtr -XAABitBlt(DrawablePtr pSrcDrawable, - DrawablePtr pDstDrawable, - GC * pGC, - int srcx, int srcy, - int width, int height, - int dstx, int dsty, - void (*doBitBlt) (DrawablePtr, DrawablePtr, GCPtr, RegionPtr, - DDXPointPtr), unsigned long bitPlane) -{ - - RegionPtr prgnSrcClip = NULL; /* may be a new region, or just a copy */ - RegionPtr prgnExposed; - Bool freeSrcClip = FALSE; - RegionRec rgnDst; - DDXPointPtr pptSrc, ppt; - DDXPointRec origDest; - BoxPtr pbox; - BoxRec fastBox; - int i, dx, dy, numRects; - xRectangle origSource; - int fastClip = 0; /* for fast clipping with pixmap source */ - int fastExpose = 0; /* for fast exposures with pixmap source */ - - origSource.x = srcx; - origSource.y = srcy; - origSource.width = width; - origSource.height = height; - origDest.x = dstx; - origDest.y = dsty; - - if (pSrcDrawable->pScreen->SourceValidate) { - (*pSrcDrawable->pScreen->SourceValidate) (pSrcDrawable, srcx, srcy, - width, height, - pGC->subWindowMode); - } - - srcx += pSrcDrawable->x; - srcy += pSrcDrawable->y; - - /* clip the source */ - if (pSrcDrawable->type == DRAWABLE_PIXMAP) { - if ((pSrcDrawable == pDstDrawable) && (pGC->clientClipType == CT_NONE)) - prgnSrcClip = pGC->pCompositeClip; - else - fastClip = 1; - } - else { /* Window */ - if (pGC->subWindowMode == IncludeInferiors) { - if (!((WindowPtr) pSrcDrawable)->parent) { - /* - * special case bitblt from root window in - * IncludeInferiors mode; just like from a pixmap - */ - fastClip = 1; - } - else if ((pSrcDrawable == pDstDrawable) && - (pGC->clientClipType == CT_NONE)) { - prgnSrcClip = pGC->pCompositeClip; - } - else { - prgnSrcClip = NotClippedByChildren((WindowPtr) pSrcDrawable); - freeSrcClip = TRUE; - } - } - else { - prgnSrcClip = &((WindowPtr) pSrcDrawable)->clipList; - } - } - - fastBox.x1 = srcx; - fastBox.y1 = srcy; - fastBox.x2 = srcx + width; - fastBox.y2 = srcy + height; - - /* Don't create a source region if we are doing a fast clip */ - if (fastClip) { - fastExpose = 1; - /* - * clip the source; if regions extend beyond the source size, - * make sure exposure events get sent - */ - if (fastBox.x1 < pSrcDrawable->x) { - fastBox.x1 = pSrcDrawable->x; - fastExpose = 0; - } - if (fastBox.y1 < pSrcDrawable->y) { - fastBox.y1 = pSrcDrawable->y; - fastExpose = 0; - } - if (fastBox.x2 > pSrcDrawable->x + (int) pSrcDrawable->width) { - fastBox.x2 = pSrcDrawable->x + (int) pSrcDrawable->width; - fastExpose = 0; - } - if (fastBox.y2 > pSrcDrawable->y + (int) pSrcDrawable->height) { - fastBox.y2 = pSrcDrawable->y + (int) pSrcDrawable->height; - fastExpose = 0; - } - } - else { - RegionInit(&rgnDst, &fastBox, 1); - RegionIntersect(&rgnDst, &rgnDst, prgnSrcClip); - } - - dstx += pDstDrawable->x; - dsty += pDstDrawable->y; - - if (pDstDrawable->type == DRAWABLE_WINDOW) { - if (!((WindowPtr) pDstDrawable)->realized) { - if (!fastClip) - RegionUninit(&rgnDst); - if (freeSrcClip) - RegionDestroy(prgnSrcClip); - return NULL; - } - } - - dx = srcx - dstx; - dy = srcy - dsty; - - /* Translate and clip the dst to the destination composite clip */ - if (fastClip) { - RegionPtr cclip; - - /* Translate the region directly */ - fastBox.x1 -= dx; - fastBox.x2 -= dx; - fastBox.y1 -= dy; - fastBox.y2 -= dy; - - /* If the destination composite clip is one rectangle we can - do the clip directly. Otherwise we have to create a full - blown region and call intersect */ - - cclip = pGC->pCompositeClip; - if (RegionNumRects(cclip) == 1) { - BoxPtr pBox = RegionRects(cclip); - - if (fastBox.x1 < pBox->x1) - fastBox.x1 = pBox->x1; - if (fastBox.x2 > pBox->x2) - fastBox.x2 = pBox->x2; - if (fastBox.y1 < pBox->y1) - fastBox.y1 = pBox->y1; - if (fastBox.y2 > pBox->y2) - fastBox.y2 = pBox->y2; - - /* Check to see if the region is empty */ - if (fastBox.x1 >= fastBox.x2 || fastBox.y1 >= fastBox.y2) { - RegionNull(&rgnDst); - } - else { - RegionInit(&rgnDst, &fastBox, 1); - } - } - else { - /* We must turn off fastClip now, since we must create - a full blown region. It is intersected with the - composite clip below. */ - fastClip = 0; - RegionInit(&rgnDst, &fastBox, 1); - } - } - else { - RegionTranslate(&rgnDst, -dx, -dy); - } - - if (!fastClip) { - RegionIntersect(&rgnDst, &rgnDst, pGC->pCompositeClip); - } - - /* Do bit blitting */ - numRects = RegionNumRects(&rgnDst); - if (numRects && width && height) { - if (!(pptSrc = (DDXPointPtr) malloc(numRects * sizeof(DDXPointRec)))) { - RegionUninit(&rgnDst); - if (freeSrcClip) - RegionDestroy(prgnSrcClip); - return NULL; - } - pbox = RegionRects(&rgnDst); - ppt = pptSrc; - for (i = numRects; --i >= 0; pbox++, ppt++) { - ppt->x = pbox->x1 + dx; - ppt->y = pbox->y1 + dy; - } - - (*doBitBlt) (pSrcDrawable, pDstDrawable, pGC, &rgnDst, pptSrc); - free(pptSrc); - } - - prgnExposed = NULL; - if (pGC->fExpose) { - /* Pixmap sources generate a NoExposed (we return NULL to do this) */ - if (!fastExpose) - prgnExposed = miHandleExposures(pSrcDrawable, pDstDrawable, pGC, - origSource.x, origSource.y, - (int) origSource.width, - (int) origSource.height, - origDest.x, origDest.y, bitPlane); - } - RegionUninit(&rgnDst); - if (freeSrcClip) - RegionDestroy(prgnSrcClip); - return prgnExposed; -} diff --git a/xserver/hw/xfree86/xaa/xaaBitOrder.c b/xserver/hw/xfree86/xaa/xaaBitOrder.c deleted file mode 100644 index 3d9b980e1..000000000 --- a/xserver/hw/xfree86/xaa/xaaBitOrder.c +++ /dev/null @@ -1,16 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include -#include "xaalocal.h" - -CARD32 -XAAReverseBitOrder(CARD32 v) -{ - return (((0x01010101 & v) << 7) | ((0x02020202 & v) << 5) | - ((0x04040404 & v) << 3) | ((0x08080808 & v) << 1) | - ((0x10101010 & v) >> 1) | ((0x20202020 & v) >> 3) | - ((0x40404040 & v) >> 5) | ((0x80808080 & v) >> 7)); -} diff --git a/xserver/hw/xfree86/xaa/xaaBitmap.c b/xserver/hw/xfree86/xaa/xaaBitmap.c deleted file mode 100644 index 45d5a09be..000000000 --- a/xserver/hw/xfree86/xaa/xaaBitmap.c +++ /dev/null @@ -1,477 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xaa.h" -#include "xaalocal.h" -#include "xaacexp.h" -#include "xf86.h" - -/********** byte swapping ***************/ - -#ifdef FIXEDBASE -#define DEST(i) *dest -#define RETURN(i) return(dest) -#else -#define DEST(i) dest[i] -#define RETURN(i) return(dest + i) -#endif - -#ifdef MSBFIRST -#define SOURCE(i) SWAP_BITS_IN_BYTES(src[i]) -#else -#define SOURCE(i) src[i] -#endif - -typedef CARD32 *(*BitmapScanlineProcPtr) (CARD32 *, CARD32 *, int, int); - -#ifdef TRIPLE_BITS -static CARD32 * -BitmapScanline(CARD32 *src, CARD32 *base, int count, int skipleft) -{ - CARD32 bits; - - while (count >= 3) { - bits = *src; - WRITE_BITS3(bits); - src++; - count -= 3; - } - if (count == 2) { - bits = *src; - WRITE_BITS2(bits); - } - else if (count == 1) { - bits = *src; - WRITE_BITS1(bits); - } - - return base; -} - -static CARD32 * -BitmapScanline_Inverted(CARD32 *src, CARD32 *base, int count, int skipleft) -{ - CARD32 bits; - - while (count >= 3) { - bits = ~(*src); - WRITE_BITS3(bits); - src++; - count -= 3; - } - if (count == 2) { - bits = ~(*src); - WRITE_BITS2(bits); - } - else if (count == 1) { - bits = ~(*src); - WRITE_BITS1(bits); - } - - return base; -} - -static CARD32 * -BitmapScanline_Shifted(CARD32 *src, CARD32 *base, int count, int skipleft) -{ - CARD32 bits; - - while (count >= 3) { - bits = SHIFT_R(*src, skipleft) | SHIFT_L(*(src + 1), (32 - skipleft)); - WRITE_BITS3(bits); - src++; - count -= 3; - } - if (count == 2) { - bits = SHIFT_R(*src, skipleft) | SHIFT_L(*(src + 1), (32 - skipleft)); - WRITE_BITS2(bits); - } - else if (count == 1) { - bits = SHIFT_R(*src, skipleft) | SHIFT_L(*(src + 1), (32 - skipleft)); - WRITE_BITS1(bits); - } - - return base; -} - -static CARD32 * -BitmapScanline_Shifted_Inverted(CARD32 *src, CARD32 *base, - int count, int skipleft) -{ - CARD32 bits; - - while (count >= 3) { - bits = - ~(SHIFT_R(*src, skipleft) | SHIFT_L(*(src + 1), (32 - skipleft))); - WRITE_BITS3(bits); - src++; - count -= 3; - } - if (count == 2) { - bits = - ~(SHIFT_R(*src, skipleft) | SHIFT_L(*(src + 1), (32 - skipleft))); - WRITE_BITS2(bits); - } - else if (count == 1) { - bits = - ~(SHIFT_R(*src, skipleft) | SHIFT_L(*(src + 1), (32 - skipleft))); - WRITE_BITS1(bits); - } - - return base; -} - -#define BitmapScanline_Shifted_Careful BitmapScanline_Shifted -#define BitmapScanline_Shifted_Inverted_Careful BitmapScanline_Shifted_Inverted - -#else -static CARD32 * -BitmapScanline(CARD32 *src, CARD32 *dest, int count, int skipleft) -{ - while (count >= 4) { - DEST(0) = SOURCE(0); - DEST(1) = SOURCE(1); - DEST(2) = SOURCE(2); - DEST(3) = SOURCE(3); - count -= 4; - src += 4; -#ifndef FIXEDBASE - dest += 4; -#endif - } - - if (!count) - return dest; - DEST(0) = SOURCE(0); - if (count == 1) - RETURN(1); - DEST(1) = SOURCE(1); - if (count == 2) - RETURN(2); - DEST(2) = SOURCE(2); - RETURN(3); -} - -static CARD32 * -BitmapScanline_Inverted(CARD32 *src, CARD32 *dest, int count, int skipleft) -{ - while (count >= 4) { - DEST(0) = ~SOURCE(0); - DEST(1) = ~SOURCE(1); - DEST(2) = ~SOURCE(2); - DEST(3) = ~SOURCE(3); - count -= 4; - src += 4; -#ifndef FIXEDBASE - dest += 4; -#endif - } - - if (!count) - return dest; - DEST(0) = ~SOURCE(0); - if (count == 1) - RETURN(1); - DEST(1) = ~SOURCE(1); - if (count == 2) - RETURN(2); - DEST(2) = ~SOURCE(2); - RETURN(3); -} - -static CARD32 * -BitmapScanline_Shifted(CARD32 *bits, CARD32 *base, int count, int skipleft) -{ - while (count--) { - register CARD32 tmp = SHIFT_R(*bits, skipleft) | - SHIFT_L(*(bits + 1), (32 - skipleft)); - WRITE_BITS(tmp); - bits++; - } - return base; -} - -static CARD32 * -BitmapScanline_Shifted_Inverted(CARD32 *bits, CARD32 *base, - int count, int skipleft) -{ - while (count--) { - register CARD32 tmp = ~(SHIFT_R(*bits, skipleft) | - SHIFT_L(*(bits + 1), (32 - skipleft))); - WRITE_BITS(tmp); - bits++; - } - return base; -} - -static CARD32 * -BitmapScanline_Shifted_Careful(CARD32 *bits, CARD32 *base, - int count, int skipleft) -{ - register CARD32 tmp; - - while (--count) { - tmp = SHIFT_R(*bits, skipleft) | SHIFT_L(*(bits + 1), (32 - skipleft)); - WRITE_BITS(tmp); - bits++; - } - tmp = SHIFT_R(*bits, skipleft); - WRITE_BITS(tmp); - - return base; -} - -static CARD32 * -BitmapScanline_Shifted_Inverted_Careful(CARD32 *bits, CARD32 *base, - int count, int skipleft) -{ - register CARD32 tmp; - - while (--count) { - tmp = - ~(SHIFT_R(*bits, skipleft) | SHIFT_L(*(bits + 1), (32 - skipleft))); - WRITE_BITS(tmp); - bits++; - } - tmp = ~(SHIFT_R(*bits, skipleft)); - WRITE_BITS(tmp); - return base; -} - -#endif - -/* - When the accelerator is TRANSPARENCY_ONLY, WriteBitmap can do - the fill in two passes, inverting the source on the second pass. - For GXcopy we can fill the backing rectangle as a solid rect and - avoid the invert. -*/ - -void -#ifdef TRIPLE_BITS - EXPNAME(XAAWriteBitmapColorExpand3) ( -#else - EXPNAME(XAAWriteBitmapColorExpand) ( -#endif - ScrnInfoPtr pScrn, - int x, int y, int w, int H, - unsigned char *src, - int srcwidth, - int skipleft, - int fg, int bg, - int rop, unsigned int planemask) { - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - CARD32 *base; - unsigned char *srcp = src; - int SecondPassColor = -1; - int shift = 0, dwords; - BitmapScanlineProcPtr firstFunc; - BitmapScanlineProcPtr secondFunc; - int flag; - int h = H; - -#ifdef TRIPLE_BITS - if ((bg != -1) && - ((infoRec->CPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY) || - ((infoRec->CPUToScreenColorExpandFillFlags & RGB_EQUAL) && - (!CHECK_RGB_EQUAL(bg))))) { -#else - if ((bg != -1) && - (infoRec->CPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)) { -#endif - if ((rop == GXcopy) && infoRec->SetupForSolidFill) { - (*infoRec->SetupForSolidFill) (pScrn, bg, rop, planemask); - (*infoRec->SubsequentSolidFillRect) (pScrn, x, y, w, h); - } - else - SecondPassColor = bg; - bg = -1; - } - -#ifdef TRIPLE_BITS - if (skipleft) { -#else - if (skipleft && - (!(infoRec->CPUToScreenColorExpandFillFlags & LEFT_EDGE_CLIPPING) || - (!(infoRec-> - CPUToScreenColorExpandFillFlags & LEFT_EDGE_CLIPPING_NEGATIVE_X) && - (skipleft > x)))) { -#endif - if ((skipleft + ((w + 31) & ~31)) > ((skipleft + w + 31) & ~31)) { - /* don't read past the end */ - firstFunc = BitmapScanline_Shifted_Careful; - secondFunc = BitmapScanline_Shifted_Inverted_Careful; - } - else { - firstFunc = BitmapScanline_Shifted; - secondFunc = BitmapScanline_Shifted_Inverted; - } - shift = skipleft; - skipleft = 0; - } - else { - firstFunc = BitmapScanline; - secondFunc = BitmapScanline_Inverted; - w += skipleft; - x -= skipleft; - } - -#ifdef TRIPLE_BITS - dwords = (3 * w + 31) >> 5; -#else - dwords = (w + 31) >> 5; -#endif - - SECOND_PASS: - - flag = (infoRec->CPUToScreenColorExpandFillFlags - & CPU_TRANSFER_PAD_QWORD) && ((dwords * h) & 0x01); - (*infoRec->SetupForCPUToScreenColorExpandFill) (pScrn, fg, bg, rop, - planemask); - (*infoRec->SubsequentCPUToScreenColorExpandFill) (pScrn, x, y, w, h, - skipleft); - - base = (CARD32 *) infoRec->ColorExpandBase; - -#ifndef FIXEDBASE - if ((dwords * h) <= infoRec->ColorExpandRange) - while (h--) { - base = (*firstFunc) ((CARD32 *) srcp, base, dwords, shift); - srcp += srcwidth; - } - else -#endif - while (h--) { - (*firstFunc) ((CARD32 *) srcp, base, dwords, shift); - srcp += srcwidth; - } - - if (flag) { - base = (CARD32 *) infoRec->ColorExpandBase; - base[0] = 0x00000000; - } - - if (SecondPassColor != -1) { - h = H; /* Reset height */ - fg = SecondPassColor; - SecondPassColor = -1; - firstFunc = secondFunc; - srcp = src; - goto SECOND_PASS; - } - - if (infoRec->CPUToScreenColorExpandFillFlags & SYNC_AFTER_COLOR_EXPAND) - (*infoRec->Sync) (pScrn); - else - SET_SYNC_FLAG(infoRec); -} - -#ifndef FIXEDBASE - -void -#ifdef TRIPLE_BITS - EXPNAME(XAAWriteBitmapScanlineColorExpand3) ( -#else - EXPNAME(XAAWriteBitmapScanlineColorExpand) ( -#endif - ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, - int srcwidth, - int skipleft, - int fg, int bg, - int rop, - unsigned int planemask) { - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - CARD32 *base; - unsigned char *srcp = src; - int SecondPassColor = -1; - int shift = 0, dwords, bufferNo; - BitmapScanlineProcPtr firstFunc; - BitmapScanlineProcPtr secondFunc; - -#ifdef TRIPLE_BITS - if ((bg != -1) && - ((infoRec->ScanlineCPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY) - || ((infoRec->ScanlineCPUToScreenColorExpandFillFlags & RGB_EQUAL) && - (!CHECK_RGB_EQUAL(bg))))) { -#else - if ((bg != -1) && - (infoRec-> - ScanlineCPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)) { -#endif - if ((rop == GXcopy) && infoRec->SetupForSolidFill) { - (*infoRec->SetupForSolidFill) (pScrn, bg, rop, planemask); - (*infoRec->SubsequentSolidFillRect) (pScrn, x, y, w, h); - } - else - SecondPassColor = bg; - bg = -1; - } - -#ifdef TRIPLE_BITS - if (skipleft) { -#else - if (skipleft && - (!(infoRec->ScanlineCPUToScreenColorExpandFillFlags & - LEFT_EDGE_CLIPPING) || - (!(infoRec->ScanlineCPUToScreenColorExpandFillFlags & - LEFT_EDGE_CLIPPING_NEGATIVE_X) && (skipleft > x)))) { -#endif - if ((skipleft + ((w + 31) & ~31)) > ((skipleft + w + 31) & ~31)) { - /* don't read past the end */ - firstFunc = BitmapScanline_Shifted_Careful; - secondFunc = BitmapScanline_Shifted_Inverted_Careful; - } - else { - firstFunc = BitmapScanline_Shifted; - secondFunc = BitmapScanline_Shifted_Inverted; - } - shift = skipleft; - skipleft = 0; - } - else { - firstFunc = BitmapScanline; - secondFunc = BitmapScanline_Inverted; - w += skipleft; - x -= skipleft; - } - -#ifdef TRIPLE_BITS - dwords = (3 * w + 31) >> 5; -#else - dwords = (w + 31) >> 5; -#endif - - SECOND_PASS: - - (*infoRec->SetupForScanlineCPUToScreenColorExpandFill) (pScrn, fg, bg, rop, - planemask); - (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill) (pScrn, x, y, w, h, - skipleft); - - bufferNo = 0; - - while (h--) { - base = (CARD32 *) infoRec->ScanlineColorExpandBuffers[bufferNo]; - (*firstFunc) ((CARD32 *) srcp, base, dwords, shift); - (*infoRec->SubsequentColorExpandScanline) (pScrn, bufferNo++); - srcp += srcwidth; - if (bufferNo >= infoRec->NumScanlineColorExpandBuffers) - bufferNo = 0; - } - - if (SecondPassColor != -1) { - fg = SecondPassColor; - SecondPassColor = -1; - firstFunc = secondFunc; - srcp = src; - goto SECOND_PASS; - } - - SET_SYNC_FLAG(infoRec); -} - -#endif diff --git a/xserver/hw/xfree86/xaa/xaaCpyArea.c b/xserver/hw/xfree86/xaa/xaaCpyArea.c deleted file mode 100644 index 0b11b810e..000000000 --- a/xserver/hw/xfree86/xaa/xaaCpyArea.c +++ /dev/null @@ -1,409 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" - -#include -#include "scrnintstr.h" -#include "xf86str.h" -#include "xaa.h" -#include "xaalocal.h" -#include "migc.h" -#include "gcstruct.h" -#include "pixmapstr.h" - -/* - Written mostly by Harm Hanemaayer (H.Hanemaayer@inter.nl.net). - */ - -RegionPtr -XAACopyArea(DrawablePtr pSrcDrawable, - DrawablePtr pDstDrawable, - GC * pGC, - int srcx, int srcy, int width, int height, int dstx, int dsty) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - - if (pDstDrawable->type == DRAWABLE_WINDOW) { - if ((pSrcDrawable->type == DRAWABLE_WINDOW) || - IS_OFFSCREEN_PIXMAP(pSrcDrawable)) { - if (infoRec->ScreenToScreenBitBlt && - CHECK_ROP(pGC, infoRec->ScreenToScreenBitBltFlags) && - CHECK_ROPSRC(pGC, infoRec->ScreenToScreenBitBltFlags) && - CHECK_PLANEMASK(pGC, infoRec->ScreenToScreenBitBltFlags)) - return (XAABitBlt(pSrcDrawable, pDstDrawable, - pGC, srcx, srcy, width, height, dstx, dsty, - XAADoBitBlt, 0L)); - } - else { - if (infoRec->WritePixmap && - ((pDstDrawable->bitsPerPixel == pSrcDrawable->bitsPerPixel) || - ((pDstDrawable->bitsPerPixel == 24) && - (pSrcDrawable->bitsPerPixel == 32) && - (infoRec->WritePixmapFlags & CONVERT_32BPP_TO_24BPP))) && - CHECK_ROP(pGC, infoRec->WritePixmapFlags) && - CHECK_ROPSRC(pGC, infoRec->WritePixmapFlags) && - CHECK_PLANEMASK(pGC, infoRec->WritePixmapFlags) && - CHECK_NO_GXCOPY(pGC, infoRec->WritePixmapFlags)) - return (XAABitBlt(pSrcDrawable, pDstDrawable, - pGC, srcx, srcy, width, height, dstx, dsty, - XAADoImageWrite, 0L)); - } - } - else if (IS_OFFSCREEN_PIXMAP(pDstDrawable)) { - if ((pSrcDrawable->type == DRAWABLE_WINDOW) || - IS_OFFSCREEN_PIXMAP(pSrcDrawable)) { - if (infoRec->ScreenToScreenBitBlt && - CHECK_ROP(pGC, infoRec->ScreenToScreenBitBltFlags) && - CHECK_ROPSRC(pGC, infoRec->ScreenToScreenBitBltFlags) && - CHECK_PLANEMASK(pGC, infoRec->ScreenToScreenBitBltFlags)) - return (XAABitBlt(pSrcDrawable, pDstDrawable, - pGC, srcx, srcy, width, height, dstx, dsty, - XAADoBitBlt, 0L)); - } - } - - return (XAAFallbackOps.CopyArea(pSrcDrawable, pDstDrawable, pGC, - srcx, srcy, width, height, dstx, dsty)); -} - -void -XAADoBitBlt(DrawablePtr pSrc, - DrawablePtr pDst, GC * pGC, RegionPtr prgnDst, DDXPointPtr pptSrc) -{ - int nbox, careful; - BoxPtr pbox, pboxTmp, pboxNext, pboxBase, pboxNew1, pboxNew2; - DDXPointPtr pptTmp, pptNew1, pptNew2; - int xdir, ydir; - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - - /* XXX we have to err on the side of safety when both are windows, - * because we don't know if IncludeInferiors is being used. - */ - careful = ((pSrc == pDst) || - ((pSrc->type == DRAWABLE_WINDOW) && - (pDst->type == DRAWABLE_WINDOW))); - - pbox = RegionRects(prgnDst); - nbox = RegionNumRects(prgnDst); - - pboxNew1 = NULL; - pptNew1 = NULL; - pboxNew2 = NULL; - pptNew2 = NULL; - if (careful && (pptSrc->y < pbox->y1)) { - /* walk source botttom to top */ - ydir = -1; - - if (nbox > 1) { - /* keep ordering in each band, reverse order of bands */ - pboxNew1 = (BoxPtr) malloc(sizeof(BoxRec) * nbox); - if (!pboxNew1) - return; - pptNew1 = (DDXPointPtr) malloc(sizeof(DDXPointRec) * nbox); - if (!pptNew1) { - free(pboxNew1); - return; - } - pboxBase = pboxNext = pbox + nbox - 1; - while (pboxBase >= pbox) { - while ((pboxNext >= pbox) && (pboxBase->y1 == pboxNext->y1)) - pboxNext--; - pboxTmp = pboxNext + 1; - pptTmp = pptSrc + (pboxTmp - pbox); - while (pboxTmp <= pboxBase) { - *pboxNew1++ = *pboxTmp++; - *pptNew1++ = *pptTmp++; - } - pboxBase = pboxNext; - } - pboxNew1 -= nbox; - pbox = pboxNew1; - pptNew1 -= nbox; - pptSrc = pptNew1; - } - } - else { - /* walk source top to bottom */ - ydir = 1; - } - - if (careful && (pptSrc->x < pbox->x1)) { - /* walk source right to left */ - xdir = -1; - - if (nbox > 1) { - /* reverse order of rects in each band */ - pboxNew2 = (BoxPtr) malloc(sizeof(BoxRec) * nbox); - pptNew2 = (DDXPointPtr) malloc(sizeof(DDXPointRec) * nbox); - if (!pboxNew2 || !pptNew2) { - free(pptNew2); - free(pboxNew2); - if (pboxNew1) { - free(pptNew1); - free(pboxNew1); - } - return; - } - pboxBase = pboxNext = pbox; - while (pboxBase < pbox + nbox) { - while ((pboxNext < pbox + nbox) && - (pboxNext->y1 == pboxBase->y1)) - pboxNext++; - pboxTmp = pboxNext; - pptTmp = pptSrc + (pboxTmp - pbox); - while (pboxTmp != pboxBase) { - *pboxNew2++ = *--pboxTmp; - *pptNew2++ = *--pptTmp; - } - pboxBase = pboxNext; - } - pboxNew2 -= nbox; - pbox = pboxNew2; - pptNew2 -= nbox; - pptSrc = pptNew2; - } - } - else { - /* walk source left to right */ - xdir = 1; - } - - (*infoRec->ScreenToScreenBitBlt) (infoRec->pScrn, nbox, pptSrc, pbox, - xdir, ydir, pGC->alu, pGC->planemask); - - if (pboxNew2) { - free(pptNew2); - free(pboxNew2); - } - if (pboxNew1) { - free(pptNew1); - free(pboxNew1); - } - -} - -void -XAADoImageWrite(DrawablePtr pSrc, - DrawablePtr pDst, - GC * pGC, RegionPtr prgnDst, DDXPointPtr pptSrc) -{ - int srcwidth; - unsigned char *psrcBase; /* start of image */ - unsigned char *srcPntr; /* index into the image */ - BoxPtr pbox = RegionRects(prgnDst); - int nbox = RegionNumRects(prgnDst); - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - int Bpp = pSrc->bitsPerPixel >> 3; - - psrcBase = (unsigned char *) ((PixmapPtr) pSrc)->devPrivate.ptr; - srcwidth = (int) ((PixmapPtr) pSrc)->devKind; - - for (; nbox; pbox++, pptSrc++, nbox--) { - srcPntr = psrcBase + (pptSrc->y * srcwidth) + (pptSrc->x * Bpp); - - (*infoRec->WritePixmap) (infoRec->pScrn, pbox->x1, pbox->y1, - pbox->x2 - pbox->x1, pbox->y2 - pbox->y1, - srcPntr, srcwidth, pGC->alu, pGC->planemask, - -1, pSrc->bitsPerPixel, pSrc->depth); - } -} - -void -XAADoImageRead(DrawablePtr pSrc, - DrawablePtr pDst, - GC * pGC, RegionPtr prgnDst, DDXPointPtr pptSrc) -{ - int dstwidth; - unsigned char *pdstBase; /* start of image */ - unsigned char *dstPntr; /* index into the image */ - BoxPtr pbox = RegionRects(prgnDst); - int nbox = RegionNumRects(prgnDst); - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - int Bpp = pSrc->bitsPerPixel >> 3; /* wouldn't get here unless both - src and dst have same bpp */ - - pdstBase = (unsigned char *) ((PixmapPtr) pDst)->devPrivate.ptr; - dstwidth = (int) ((PixmapPtr) pDst)->devKind; - - for (; nbox; pbox++, pptSrc++, nbox--) { - dstPntr = pdstBase + (pbox->y1 * dstwidth) + (pbox->x1 * Bpp); - - (*infoRec->ReadPixmap) (infoRec->pScrn, pptSrc->x, pptSrc->y, - pbox->x2 - pbox->x1, pbox->y2 - pbox->y1, - dstPntr, dstwidth, pSrc->bitsPerPixel, - pSrc->depth); - } -} - -void -XAAScreenToScreenBitBlt(ScrnInfoPtr pScrn, - int nbox, - DDXPointPtr pptSrc, - BoxPtr pbox, - int xdir, int ydir, int alu, unsigned int planemask) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - int dirsetup; - - if ((!(infoRec->CopyAreaFlags & ONLY_TWO_BITBLT_DIRECTIONS) - || (xdir == ydir)) && - (!(infoRec->CopyAreaFlags & ONLY_LEFT_TO_RIGHT_BITBLT) - || (xdir == 1))) { - (*infoRec->SetupForScreenToScreenCopy) (pScrn, - xdir, ydir, alu, planemask, -1); - for (; nbox; pbox++, pptSrc++, nbox--) - (*infoRec->SubsequentScreenToScreenCopy) (pScrn, pptSrc->x, - pptSrc->y, pbox->x1, - pbox->y1, - pbox->x2 - pbox->x1, - pbox->y2 - pbox->y1); - SET_SYNC_FLAG(infoRec); - return; - } - - if (infoRec->CopyAreaFlags & ONLY_LEFT_TO_RIGHT_BITBLT) { - /* - * This is the case of a chip that only supports xdir = 1, - * with ydir = 1 or ydir = -1, but we have xdir = -1. - */ - (*infoRec->SetupForScreenToScreenCopy) (pScrn, - 1, ydir, alu, planemask, -1); - for (; nbox; pbox++, pptSrc++, nbox--) - if (pptSrc->y != pbox->y1 || pptSrc->x >= pbox->x1) - /* No problem. Do a xdir = 1 blit instead. */ - (*infoRec->SubsequentScreenToScreenCopy) (pScrn, - pptSrc->x, pptSrc->y, - pbox->x1, pbox->y1, - pbox->x2 - pbox->x1, - pbox->y2 - pbox->y1); - else { - /* - * This is the difficult case. Needs striping into - * non-overlapping horizontal chunks. - */ - int stripeWidth, w, fullStripes, extra, i; - - stripeWidth = 16; - w = pbox->x2 - pbox->x1; - if (pbox->x1 - pptSrc->x < stripeWidth) - stripeWidth = pbox->x1 - pptSrc->x; - fullStripes = w / stripeWidth; - extra = w % stripeWidth; - - /* First, take care of the little bit on the far right */ - if (extra) - (*infoRec->SubsequentScreenToScreenCopy) (pScrn, - pptSrc->x + - fullStripes * - stripeWidth, - pptSrc->y, - pbox->x1 + - fullStripes * - stripeWidth, - pbox->y1, extra, - pbox->y2 - - pbox->y1); - - /* Now, take care of the rest of the blit */ - for (i = fullStripes - 1; i >= 0; i--) - (*infoRec->SubsequentScreenToScreenCopy) (pScrn, - pptSrc->x + - i * stripeWidth, - pptSrc->y, - pbox->x1 + - i * stripeWidth, - pbox->y1, - stripeWidth, - pbox->y2 - - pbox->y1); - } - SET_SYNC_FLAG(infoRec); - return; - } - - /* - * Now the case of a chip that only supports xdir = ydir = 1 or - * xdir = ydir = -1, but we have xdir != ydir. - */ - dirsetup = 0; /* No direction set up yet. */ - for (; nbox; pbox++, pptSrc++, nbox--) { - if (xdir == 1 && pptSrc->y != pbox->y1) { - /* Do a xdir = ydir = -1 blit instead. */ - if (dirsetup != -1) { - (*infoRec->SetupForScreenToScreenCopy) (pScrn, - -1, -1, alu, planemask, - -1); - dirsetup = -1; - } - (*infoRec->SubsequentScreenToScreenCopy) (pScrn, pptSrc->x, - pptSrc->y, pbox->x1, - pbox->y1, - pbox->x2 - pbox->x1, - pbox->y2 - pbox->y1); - } - else if (xdir == -1 && pptSrc->y != pbox->y1) { - /* Do a xdir = ydir = 1 blit instead. */ - if (dirsetup != 1) { - (*infoRec->SetupForScreenToScreenCopy) (pScrn, - 1, 1, alu, planemask, - -1); - dirsetup = 1; - } - (*infoRec->SubsequentScreenToScreenCopy) (pScrn, pptSrc->x, - pptSrc->y, pbox->x1, - pbox->y1, - pbox->x2 - pbox->x1, - pbox->y2 - pbox->y1); - } - else if (xdir == 1) { - /* - * xdir = 1, ydir = -1. - * Perform line-by-line xdir = ydir = 1 blits, going up. - */ - int i; - - if (dirsetup != 1) { - (*infoRec->SetupForScreenToScreenCopy) (pScrn, - 1, 1, alu, planemask, - -1); - dirsetup = 1; - } - for (i = pbox->y2 - pbox->y1 - 1; i >= 0; i--) - (*infoRec->SubsequentScreenToScreenCopy) (pScrn, - pptSrc->x, - pptSrc->y + i, - pbox->x1, - pbox->y1 + i, - pbox->x2 - pbox->x1, - 1); - } - else { - /* - * xdir = -1, ydir = 1. - * Perform line-by-line xdir = ydir = -1 blits, going down. - */ - int i; - - if (dirsetup != -1) { - (*infoRec->SetupForScreenToScreenCopy) (pScrn, - -1, -1, alu, planemask, - -1); - dirsetup = -1; - } - for (i = 0; i < pbox->y2 - pbox->y1; i++) - (*infoRec->SubsequentScreenToScreenCopy) (pScrn, - pptSrc->x, - pptSrc->y + i, - pbox->x1, - pbox->y1 + i, - pbox->x2 - pbox->x1, - 1); - } - } /* next box */ - SET_SYNC_FLAG(infoRec); -} diff --git a/xserver/hw/xfree86/xaa/xaaCpyPlane.c b/xserver/hw/xfree86/xaa/xaaCpyPlane.c deleted file mode 100644 index b9197e41f..000000000 --- a/xserver/hw/xfree86/xaa/xaaCpyPlane.c +++ /dev/null @@ -1,204 +0,0 @@ - -/* - A CopyPlane function that handles bitmap->screen copies and - sends anything else to the Fallback. - - Also, a PushPixels for solid fill styles. - - Written by Mark Vojkovich (markv@valinux.com) - -*/ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include - -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" -#include "servermd.h" - -#include -#include "scrnintstr.h" -#include "mi.h" -#include "pixmapstr.h" -#include "xf86str.h" -#include "xaa.h" -#include "xaalocal.h" -#include "xaawrap.h" - -static void XAACopyPlane1toNColorExpand(DrawablePtr pSrc, DrawablePtr pDst, - GCPtr pGC, RegionPtr rgnDst, - DDXPointPtr pptSrc); -static void XAACopyPlaneNtoNColorExpand(DrawablePtr pSrc, DrawablePtr pDst, - GCPtr pGC, RegionPtr rgnDst, - DDXPointPtr pptSrc); - -static unsigned long TmpBitPlane; - -RegionPtr -XAACopyPlaneColorExpansion(DrawablePtr pSrc, - DrawablePtr pDst, - GCPtr pGC, - int srcx, int srcy, - int width, int height, - int dstx, int dsty, unsigned long bitPlane) -{ - if ((pSrc->type == DRAWABLE_PIXMAP) && !XAA_DEPTH_BUG(pGC)) { - if (pSrc->bitsPerPixel == 1) { - return (XAABitBlt(pSrc, pDst, pGC, srcx, srcy, - width, height, dstx, dsty, - XAACopyPlane1toNColorExpand, bitPlane)); - } - else if (bitPlane < (1 << pDst->depth)) { - TmpBitPlane = bitPlane; - return (XAABitBlt(pSrc, pDst, pGC, srcx, srcy, - width, height, dstx, dsty, - XAACopyPlaneNtoNColorExpand, bitPlane)); - } - } - - return (XAAFallbackOps.CopyPlane(pSrc, pDst, pGC, srcx, srcy, - width, height, dstx, dsty, bitPlane)); -} - -static void -XAACopyPlane1toNColorExpand(DrawablePtr pSrc, - DrawablePtr pDst, - GCPtr pGC, RegionPtr rgnDst, DDXPointPtr pptSrc) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - BoxPtr pbox = RegionRects(rgnDst); - int numrects = RegionNumRects(rgnDst); - unsigned char *src = ((PixmapPtr) pSrc)->devPrivate.ptr; - int srcwidth = ((PixmapPtr) pSrc)->devKind; - - while (numrects--) { - (*infoRec->WriteBitmap) (infoRec->pScrn, pbox->x1, pbox->y1, - pbox->x2 - pbox->x1, pbox->y2 - pbox->y1, - src + (srcwidth * pptSrc->y) + - ((pptSrc->x >> 5) << 2), srcwidth, - pptSrc->x & 31, pGC->fgPixel, pGC->bgPixel, - pGC->alu, pGC->planemask); - pbox++; - pptSrc++; - } -} - -static void -XAACopyPlaneNtoNColorExpand(DrawablePtr pSrc, - DrawablePtr pDst, - GCPtr pGC, RegionPtr rgnDst, DDXPointPtr pptSrc) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - BoxPtr pbox = RegionRects(rgnDst); - int numrects = RegionNumRects(rgnDst); - unsigned char *src = ((PixmapPtr) pSrc)->devPrivate.ptr; - unsigned char *data, *srcPtr, *dataPtr; - int srcwidth = ((PixmapPtr) pSrc)->devKind; - int pitch, width, height, h, i, index, offset; - int Bpp = pSrc->bitsPerPixel >> 3; - unsigned long mask = TmpBitPlane; - - if (TmpBitPlane < (1 << 8)) { - offset = 0; - } - else if (TmpBitPlane < (1 << 16)) { - offset = 1; - mask >>= 8; - } - else if (TmpBitPlane < (1 << 24)) { - offset = 2; - mask >>= 16; - } - else { - offset = 3; - mask >>= 24; - } - - if (IS_OFFSCREEN_PIXMAP(pSrc)) - SYNC_CHECK(pSrc); - - while (numrects--) { - width = pbox->x2 - pbox->x1; - h = height = pbox->y2 - pbox->y1; - pitch = BitmapBytePad(width); - - if (!(data = calloc(height, pitch))) - goto ALLOC_FAILED; - - dataPtr = data; - srcPtr = ((pptSrc->y) * srcwidth) + src + ((pptSrc->x) * Bpp) + offset; - - while (h--) { - for (i = index = 0; i < width; i++, index += Bpp) { - if (mask & srcPtr[index]) - dataPtr[i >> 3] |= (1 << (i & 7)); - } - dataPtr += pitch; - srcPtr += srcwidth; - } - - (*infoRec->WriteBitmap) (infoRec->pScrn, - pbox->x1, pbox->y1, width, height, data, pitch, - 0, pGC->fgPixel, pGC->bgPixel, pGC->alu, - pGC->planemask); - - free(data); - - ALLOC_FAILED: - - pbox++; - pptSrc++; - } -} - -void -XAAPushPixelsSolidColorExpansion(GCPtr pGC, - PixmapPtr pBitMap, - DrawablePtr pDraw, - int dx, int dy, int xOrg, int yOrg) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - int MaxBoxes = RegionNumRects(pGC->pCompositeClip); - BoxPtr pbox, pClipBoxes; - int nboxes, srcx, srcy; - xRectangle TheRect; - unsigned char *src = pBitMap->devPrivate.ptr; - int srcwidth = pBitMap->devKind; - - if (!RegionNumRects(pGC->pCompositeClip)) - return; - - TheRect.x = xOrg; - TheRect.y = yOrg; - TheRect.width = dx; - TheRect.height = dy; - - if (MaxBoxes > (infoRec->PreAllocSize / sizeof(BoxRec))) { - pClipBoxes = malloc(MaxBoxes * sizeof(BoxRec)); - if (!pClipBoxes) - return; - } - else - pClipBoxes = (BoxPtr) infoRec->PreAllocMem; - - nboxes = XAAGetRectClipBoxes(pGC, pClipBoxes, 1, &TheRect); - pbox = pClipBoxes; - - while (nboxes--) { - srcx = pbox->x1 - xOrg; - srcy = pbox->y1 - yOrg; - (*infoRec->WriteBitmap) (infoRec->pScrn, pbox->x1, pbox->y1, - pbox->x2 - pbox->x1, pbox->y2 - pbox->y1, - src + (srcwidth * srcy) + ((srcx >> 5) << 2), - srcwidth, srcx & 31, - pGC->fgPixel, -1, pGC->alu, pGC->planemask); - pbox++; - } - - if (pClipBoxes != (BoxPtr) infoRec->PreAllocMem) - free(pClipBoxes); -} diff --git a/xserver/hw/xfree86/xaa/xaaCpyWin.c b/xserver/hw/xfree86/xaa/xaaCpyWin.c deleted file mode 100644 index e851f4a37..000000000 --- a/xserver/hw/xfree86/xaa/xaaCpyWin.c +++ /dev/null @@ -1,78 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" - -#include -#include "scrnintstr.h" -#include "windowstr.h" -#include "xf86str.h" -#include "xaa.h" -#include "xaalocal.h" -#include "gcstruct.h" -#include "pixmapstr.h" -#include "xaawrap.h" - -/* - Written by Harm Hanemaayer (H.Hanemaayer@inter.nl.net). -*/ - -void -XAACopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) -{ - DDXPointPtr pptSrc, ppt; - RegionRec rgnDst; - BoxPtr pbox; - int dx, dy, nbox; - WindowPtr pwinRoot; - ScreenPtr pScreen = pWin->drawable.pScreen; - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_DRAWABLE((&pWin->drawable)); - - if (!infoRec->pScrn->vtSema || !infoRec->ScreenToScreenBitBlt) { - XAA_SCREEN_PROLOGUE(pScreen, CopyWindow); - if (infoRec->pScrn->vtSema && infoRec->NeedToSync) { - (*infoRec->Sync) (infoRec->pScrn); - infoRec->NeedToSync = FALSE; - } - (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc); - XAA_SCREEN_EPILOGUE(pScreen, CopyWindow, XAACopyWindow); - return; - } - - pwinRoot = pScreen->root; - - RegionNull(&rgnDst); - - dx = ptOldOrg.x - pWin->drawable.x; - dy = ptOldOrg.y - pWin->drawable.y; - RegionTranslate(prgnSrc, -dx, -dy); - RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc); - - pbox = RegionRects(&rgnDst); - nbox = RegionNumRects(&rgnDst); - if (!nbox || !(pptSrc = (DDXPointPtr) malloc(nbox * sizeof(DDXPointRec)))) { - RegionUninit(&rgnDst); - return; - } - ppt = pptSrc; - - while (nbox--) { - ppt->x = pbox->x1 + dx; - ppt->y = pbox->y1 + dy; - ppt++; - pbox++; - } - - infoRec->ScratchGC.planemask = ~0L; - infoRec->ScratchGC.alu = GXcopy; - - XAADoBitBlt((DrawablePtr) pwinRoot, (DrawablePtr) pwinRoot, - &(infoRec->ScratchGC), &rgnDst, pptSrc); - - free(pptSrc); - RegionUninit(&rgnDst); -} diff --git a/xserver/hw/xfree86/xaa/xaaDashLine.c b/xserver/hw/xfree86/xaa/xaaDashLine.c deleted file mode 100644 index c7e52cd0b..000000000 --- a/xserver/hw/xfree86/xaa/xaaDashLine.c +++ /dev/null @@ -1,353 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include - -#include -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" - -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "miline.h" -#include "xf86str.h" -#include "xaa.h" -#include "xaalocal.h" - -void -#ifdef POLYSEGMENT - XAAPolySegmentDashed(DrawablePtr pDrawable, - GCPtr pGC, int nseg, xSegment * pSeg -#else -XAAPolyLinesDashed(DrawablePtr pDrawable, GCPtr pGC, int mode, /* Origin or Previous */ - int npt, /* number of points */ - DDXPointPtr pptInit -#endif - ) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - XAAGCPtr pGCPriv = (XAAGCPtr) dixLookupPrivate(&pGC->devPrivates, - XAAGetGCKey()); - BoxPtr pboxInit = RegionRects(pGC->pCompositeClip); - int nboxInit = RegionNumRects(pGC->pCompositeClip); - unsigned int bias = miGetZeroLineBias(pDrawable->pScreen); - int xorg = pDrawable->x; - int yorg = pDrawable->y; - int nbox; - BoxPtr pbox; - -#ifndef POLYSEGMENT - DDXPointPtr ppt; -#endif - unsigned int oc1, oc2; - int dmin, dmaj, e, octant; - int x1, x2, y1, y2, tmp, len, offset; - int PatternLength, PatternOffset; - - if (!nboxInit) - return; - - if (infoRec->DashedLineFlags & LINE_LIMIT_COORDS) { - int minValX = infoRec->DashedLineLimits.x1; - int maxValX = infoRec->DashedLineLimits.x2; - int minValY = infoRec->DashedLineLimits.y1; - int maxValY = infoRec->DashedLineLimits.y2; - -#ifdef POLYSEGMENT - int n = nseg; - xSegment *s = pSeg; - - while (n--) -#else - int n = npt; - int xorgtmp = xorg; - int yorgtmp = yorg; - - ppt = pptInit; - x2 = ppt->x + xorgtmp; - y2 = ppt->y + yorgtmp; - while (--n) -#endif - { -#ifdef POLYSEGMENT - x1 = s->x1 + xorg; - y1 = s->y1 + yorg; - x2 = s->x2 + xorg; - y2 = s->y2 + yorg; - s++; -#else - x1 = x2; - y1 = y2; - ++ppt; - if (mode == CoordModePrevious) { - xorgtmp = x1; - yorgtmp = y1; - } - x2 = ppt->x + xorgtmp; - y2 = ppt->y + yorgtmp; -#endif - if (x1 > maxValX || x1 < minValX || - x2 > maxValX || x2 < minValX || - y1 > maxValY || y1 < minValY || y2 > maxValY || y2 < minValY) { -#ifdef POLYSEGMENT - XAAFallbackOps.PolySegment(pDrawable, pGC, nseg, pSeg); -#else - XAAFallbackOps.Polylines(pDrawable, pGC, mode, npt, pptInit); -#endif - return; - } - } - } - - PatternLength = pGCPriv->DashLength; - PatternOffset = pGC->dashOffset % PatternLength; - - (*infoRec->SetupForDashedLine) (infoRec->pScrn, pGC->fgPixel, - (pGC->lineStyle == - LineDoubleDash) ? pGC->bgPixel : -1, - pGC->alu, pGC->planemask, PatternLength, - pGCPriv->DashPattern); - -#ifdef POLYSEGMENT - while (nseg--) -#else - ppt = pptInit; - x2 = ppt->x + xorg; - y2 = ppt->y + yorg; - while (--npt) -#endif - { - nbox = nboxInit; - pbox = pboxInit; - -#ifdef POLYSEGMENT - x1 = pSeg->x1 + xorg; - y1 = pSeg->y1 + yorg; - x2 = pSeg->x2 + xorg; - y2 = pSeg->y2 + yorg; - pSeg++; -#else - x1 = x2; - y1 = y2; - ++ppt; - if (mode == CoordModePrevious) { - xorg = x1; - yorg = y1; - } - x2 = ppt->x + xorg; - y2 = ppt->y + yorg; -#endif - - if (infoRec->SubsequentDashedBresenhamLine) { - if ((dmaj = x2 - x1) < 0) { - dmaj = -dmaj; - octant = XDECREASING; - } - else - octant = 0; - - if ((dmin = y2 - y1) < 0) { - dmin = -dmin; - octant |= YDECREASING; - } - - if (dmin >= dmaj) { - tmp = dmin; - dmin = dmaj; - dmaj = tmp; - octant |= YMAJOR; - } - - e = -dmaj - ((bias >> octant) & 1); - len = dmaj; - dmin <<= 1; - dmaj <<= 1; - } - else { /* Muffle compiler */ - dmin = dmaj = e = octant = len = 0; - } - - while (nbox--) { - oc1 = oc2 = 0; - OUTCODES(oc1, x1, y1, pbox); - OUTCODES(oc2, x2, y2, pbox); - if (!(oc1 | oc2)) { /* uncliped */ - if (infoRec->SubsequentDashedTwoPointLine) { - (*infoRec->SubsequentDashedTwoPointLine) (infoRec->pScrn, - x1, y1, x2, y2, -#ifdef POLYSEGMENT - (pGC->capStyle != - CapNotLast) ? 0 : -#endif - OMIT_LAST, - PatternOffset); - } - else { - (*infoRec->SubsequentDashedBresenhamLine) (infoRec->pScrn, - x1, y1, dmaj, - dmin, e, -#ifdef POLYSEGMENT - (pGC->capStyle != - CapNotLast) - ? (len + 1) : -#endif - len, octant, - PatternOffset); - } - break; - } - else if (oc1 & oc2) { /* completely clipped */ - pbox++; - } - else if (infoRec->ClippingFlags & HARDWARE_CLIP_DASHED_LINE) { - (*infoRec->SetClippingRectangle) (infoRec->pScrn, - pbox->x1, pbox->y1, - pbox->x2 - 1, pbox->y2 - 1); - - if (infoRec->SubsequentDashedBresenhamLine) { - (*infoRec->SubsequentDashedBresenhamLine) (infoRec->pScrn, - x1, y1, dmaj, - dmin, e, -#ifdef POLYSEGMENT - (pGC->capStyle != - CapNotLast) - ? (len + 1) : -#endif - len, octant, - PatternOffset); - } - else { - (*infoRec->SubsequentDashedTwoPointLine) (infoRec->pScrn, - x1, y1, x2, y2, -#ifdef POLYSEGMENT - (pGC->capStyle != - CapNotLast) ? 0 : -#endif - OMIT_LAST, - PatternOffset); - } - (*infoRec->DisableClipping) (infoRec->pScrn); - pbox++; - } - else { - int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2; - int clip1 = 0, clip2 = 0; - int err, adx, ady; - - if (octant & YMAJOR) { - ady = dmaj >> 1; - adx = dmin >> 1; - } - else { - ady = dmin >> 1; - adx = dmaj >> 1; - } - - if (miZeroClipLine(pbox->x1, pbox->y1, - pbox->x2 - 1, pbox->y2 - 1, - &new_x1, &new_y1, &new_x2, &new_y2, - adx, ady, &clip1, &clip2, - octant, bias, oc1, oc2) == -1) { - pbox++; - continue; - } - - if (octant & YMAJOR) - len = abs(new_y2 - new_y1); - else - len = abs(new_x2 - new_x1); -#ifdef POLYSEGMENT - if (clip2 != 0 || pGC->capStyle != CapNotLast) - len++; -#else - len += (clip2 != 0); -#endif - if (len) { - int abserr, clipdx, clipdy; - - /* unwind bresenham error term to first point */ - if (clip1) { - clipdx = abs(new_x1 - x1); - clipdy = abs(new_y1 - y1); - - if (octant & YMAJOR) - err = e + clipdy * dmin - clipdx * dmaj; - else - err = e + clipdx * dmin - clipdy * dmaj; - } - else - err = e; - -#define range infoRec->DashedBresenhamLineErrorTermBits - abserr = abs(err); - while ((abserr & range) || (dmaj & range) || (dmin & range)) { - dmin >>= 1; - dmaj >>= 1; - abserr >>= 1; - err /= 2; - } - - if (octant & YMAJOR) - offset = abs(new_y1 - y1); - else - offset = abs(new_x1 - x1); - - offset += PatternOffset; - offset %= PatternLength; - - (*infoRec->SubsequentDashedBresenhamLine) (infoRec->pScrn, - new_x1, new_y1, - dmaj, dmin, err, - len, octant, - offset); - } - pbox++; - } - } /* while (nbox--) */ -#ifndef POLYSEGMENT - len = abs(y2 - y1); - tmp = abs(x2 - x1); - PatternOffset += (len > tmp) ? len : tmp; - PatternOffset %= PatternLength; -#endif - } /* while (nline--) */ - -#ifndef POLYSEGMENT - /* paint the last point if the end style isn't CapNotLast. - (Assume that a projecting, butt, or round cap that is one - pixel wide is the same as the single pixel of the endpoint.) - */ - - if ((pGC->capStyle != CapNotLast) && - ((ppt->x + xorg != pptInit->x + pDrawable->x) || - (ppt->y + yorg != pptInit->y + pDrawable->y) || - (ppt == pptInit + 1))) { - nbox = nboxInit; - pbox = pboxInit; - while (nbox--) { - if ((x2 >= pbox->x1) && (y2 >= pbox->y1) && - (x2 < pbox->x2) && (y2 < pbox->y2)) { - if (infoRec->SubsequentDashedTwoPointLine) { - (*infoRec->SubsequentDashedTwoPointLine) (infoRec->pScrn, - x2, y2, x2, y2, 0, - PatternOffset); - } - else { - (*infoRec->SubsequentDashedBresenhamLine) (infoRec->pScrn, - x2, y2, 2, 0, -1, - 1, 0, - PatternOffset); - } - break; - } - else - pbox++; - } - } -#endif - - SET_SYNC_FLAG(infoRec); -} diff --git a/xserver/hw/xfree86/xaa/xaaFallback.c b/xserver/hw/xfree86/xaa/xaaFallback.c deleted file mode 100644 index f7604ef90..000000000 --- a/xserver/hw/xfree86/xaa/xaaFallback.c +++ /dev/null @@ -1,281 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" - -#include -#include "scrnintstr.h" -#include "xf86str.h" -#include "xaa.h" -#include "xaalocal.h" -#include "gcstruct.h" -#include "pixmapstr.h" -#include "xaawrap.h" - -static void -XAAFillSpansFallback(DrawablePtr pDraw, - GC * pGC, - int nInit, - DDXPointPtr pptInit, int *pwidthInit, int fSorted) -{ - XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC); - SYNC_CHECK(pGC); - (*pGC->ops->FillSpans) (pDraw, pGC, nInit, pptInit, pwidthInit, fSorted); - XAA_GC_OP_EPILOGUE(pGC); -} - -static void -XAASetSpansFallback(DrawablePtr pDraw, - GCPtr pGC, - char *pcharsrc, - register DDXPointPtr ppt, - int *pwidth, int nspans, int fSorted) -{ - XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC); - SYNC_CHECK(pGC); - (*pGC->ops->SetSpans) (pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted); - XAA_GC_OP_EPILOGUE(pGC); -} - -static void -XAAPutImageFallback(DrawablePtr pDraw, - GCPtr pGC, - int depth, - int x, int y, int w, int h, - int leftPad, int format, char *pImage) -{ - XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC); - SYNC_CHECK(pGC); - (*pGC->ops->PutImage) (pDraw, pGC, depth, x, y, w, h, - leftPad, format, pImage); - XAA_GC_OP_EPILOGUE(pGC); -} - -static RegionPtr -XAACopyAreaFallback(DrawablePtr pSrc, - DrawablePtr pDst, - GC * pGC, - int srcx, int srcy, - int width, int height, int dstx, int dsty) -{ - RegionPtr ret; - - XAA_GC_OP_PROLOGUE(pGC); - if ((pSrc->type == DRAWABLE_WINDOW) || (pDst->type == DRAWABLE_WINDOW) || - IS_OFFSCREEN_PIXMAP(pSrc) || IS_OFFSCREEN_PIXMAP(pDst)) { - SYNC_CHECK(pGC); - } - ret = (*pGC->ops->CopyArea) (pSrc, pDst, - pGC, srcx, srcy, width, height, dstx, dsty); - XAA_GC_OP_EPILOGUE(pGC); - return ret; -} - -static RegionPtr -XAACopyPlaneFallback(DrawablePtr pSrc, - DrawablePtr pDst, - GCPtr pGC, - int srcx, int srcy, - int width, int height, - int dstx, int dsty, unsigned long bitPlane) -{ - RegionPtr ret; - - XAA_GC_OP_PROLOGUE(pGC); - if ((pSrc->type == DRAWABLE_WINDOW) || (pDst->type == DRAWABLE_WINDOW) || - IS_OFFSCREEN_PIXMAP(pSrc) || IS_OFFSCREEN_PIXMAP(pDst)) { - SYNC_CHECK(pGC); - } - ret = (*pGC->ops->CopyPlane) (pSrc, pDst, - pGC, srcx, srcy, width, height, dstx, dsty, - bitPlane); - XAA_GC_OP_EPILOGUE(pGC); - return ret; -} - -static void -XAAPolyPointFallback(DrawablePtr pDraw, - GCPtr pGC, int mode, int npt, xPoint * pptInit) -{ - XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC); - SYNC_CHECK(pGC); - (*pGC->ops->PolyPoint) (pDraw, pGC, mode, npt, pptInit); - XAA_GC_OP_EPILOGUE(pGC); -} - -static void -XAAPolylinesFallback(DrawablePtr pDraw, - GCPtr pGC, int mode, int npt, DDXPointPtr pptInit) -{ - XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC); - SYNC_CHECK(pGC); - (*pGC->ops->Polylines) (pDraw, pGC, mode, npt, pptInit); - XAA_GC_OP_EPILOGUE(pGC); -} - -static void -XAAPolySegmentFallback(DrawablePtr pDraw, GCPtr pGC, int nseg, xSegment * pSeg) -{ - XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC); - SYNC_CHECK(pGC); - (*pGC->ops->PolySegment) (pDraw, pGC, nseg, pSeg); - XAA_GC_OP_EPILOGUE(pGC); -} - -static void -XAAPolyRectangleFallback(DrawablePtr pDraw, - GCPtr pGC, int nRectsInit, xRectangle *pRectsInit) -{ - XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC); - SYNC_CHECK(pGC); - (*pGC->ops->PolyRectangle) (pDraw, pGC, nRectsInit, pRectsInit); - XAA_GC_OP_EPILOGUE(pGC); -} - -static void -XAAPolyArcFallback(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) -{ - XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC); - SYNC_CHECK(pGC); - (*pGC->ops->PolyArc) (pDraw, pGC, narcs, parcs); - XAA_GC_OP_EPILOGUE(pGC); -} - -static void -XAAFillPolygonFallback(DrawablePtr pDraw, - GCPtr pGC, - int shape, int mode, int count, DDXPointPtr ptsIn) -{ - XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC); - SYNC_CHECK(pGC); - (*pGC->ops->FillPolygon) (pDraw, pGC, shape, mode, count, ptsIn); - XAA_GC_OP_EPILOGUE(pGC); -} - -static void -XAAPolyFillRectFallback(DrawablePtr pDraw, - GCPtr pGC, int nrectFill, xRectangle *prectInit) -{ - XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC); - SYNC_CHECK(pGC); - (*pGC->ops->PolyFillRect) (pDraw, pGC, nrectFill, prectInit); - XAA_GC_OP_EPILOGUE(pGC); -} - -static void -XAAPolyFillArcFallback(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) -{ - XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC); - SYNC_CHECK(pGC); - (*pGC->ops->PolyFillArc) (pDraw, pGC, narcs, parcs); - XAA_GC_OP_EPILOGUE(pGC); -} - -static int -XAAPolyText8Fallback(DrawablePtr pDraw, - GCPtr pGC, int x, int y, int count, char *chars) -{ - int ret; - - XAA_GC_OP_PROLOGUE(pGC); - SYNC_CHECK(pGC); - ret = (*pGC->ops->PolyText8) (pDraw, pGC, x, y, count, chars); - XAA_GC_OP_EPILOGUE(pGC); - return ret; -} - -static int -XAAPolyText16Fallback(DrawablePtr pDraw, - GCPtr pGC, int x, int y, int count, unsigned short *chars) -{ - int ret; - - XAA_GC_OP_PROLOGUE(pGC); - SYNC_CHECK(pGC); - ret = (*pGC->ops->PolyText16) (pDraw, pGC, x, y, count, chars); - XAA_GC_OP_EPILOGUE(pGC); - return ret; -} - -static void -XAAImageText8Fallback(DrawablePtr pDraw, - GCPtr pGC, int x, int y, int count, char *chars) -{ - XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC); - SYNC_CHECK(pGC); - (*pGC->ops->ImageText8) (pDraw, pGC, x, y, count, chars); - XAA_GC_OP_EPILOGUE(pGC); -} - -static void -XAAImageText16Fallback(DrawablePtr pDraw, - GCPtr pGC, - int x, int y, int count, unsigned short *chars) -{ - XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC); - SYNC_CHECK(pGC); - (*pGC->ops->ImageText16) (pDraw, pGC, x, y, count, chars); - XAA_GC_OP_EPILOGUE(pGC); -} - -static void -XAAImageGlyphBltFallback(DrawablePtr pDraw, - GCPtr pGC, - int xInit, int yInit, - unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase) -{ - XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC); - SYNC_CHECK(pGC); - (*pGC->ops->ImageGlyphBlt) (pDraw, pGC, xInit, yInit, nglyph, ppci, - pglyphBase); - XAA_GC_OP_EPILOGUE(pGC); -} - -static void -XAAPolyGlyphBltFallback(DrawablePtr pDraw, - GCPtr pGC, - int xInit, int yInit, - unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase) -{ - XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC); - SYNC_CHECK(pGC); - (*pGC->ops->PolyGlyphBlt) (pDraw, pGC, xInit, yInit, nglyph, ppci, - pglyphBase); - XAA_GC_OP_EPILOGUE(pGC); -} - -static void -XAAPushPixelsFallback(GCPtr pGC, - PixmapPtr pBitMap, - DrawablePtr pDraw, int dx, int dy, int xOrg, int yOrg) -{ - XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC); - SYNC_CHECK(pGC); - (*pGC->ops->PushPixels) (pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg); - XAA_GC_OP_EPILOGUE(pGC); -} - -GCOps XAAFallbackOps = { - XAAFillSpansFallback, XAASetSpansFallback, - XAAPutImageFallback, XAACopyAreaFallback, - XAACopyPlaneFallback, XAAPolyPointFallback, - XAAPolylinesFallback, XAAPolySegmentFallback, - XAAPolyRectangleFallback, XAAPolyArcFallback, - XAAFillPolygonFallback, XAAPolyFillRectFallback, - XAAPolyFillArcFallback, XAAPolyText8Fallback, - XAAPolyText16Fallback, XAAImageText8Fallback, - XAAImageText16Fallback, XAAImageGlyphBltFallback, - XAAPolyGlyphBltFallback, XAAPushPixelsFallback, -}; - -GCOps * -XAAGetFallbackOps(void) -{ - return &XAAFallbackOps; -} diff --git a/xserver/hw/xfree86/xaa/xaaFillArc.c b/xserver/hw/xfree86/xaa/xaaFillArc.c deleted file mode 100644 index fb7e7201f..000000000 --- a/xserver/hw/xfree86/xaa/xaaFillArc.c +++ /dev/null @@ -1,202 +0,0 @@ -/* - * Copyright 1996 The XFree86 Project - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * HARM HANEMAAYER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * Written by Harm Hanemaayer (H.Hanemaayer@inter.nl.net). - */ - -/* - * Filled solid arcs, based on cfbfillarc.c. - * - * Fill arc using calls to low-level span fill. Because the math for - * each span can be done concurrently with the drawing of the span - * with a graphics coprocessor operation, this is faster than just - * using miPolyFillArc, which first calculates all the spans and then - * calls FillSpans. - * - * Clipped arcs are dispatched to FillSpans. - */ -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include - -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" - -#include -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "xf86str.h" -#include "xaa.h" -#include "xaalocal.h" -#include "mifillarc.h" -#include "mi.h" - -/* - * This is based on the integer-math versions from mi. Perhaps on a - * Pentium, the floating-point (double)-math version is faster. - */ - -static void -XAAFillEllipseSolid(DrawablePtr pDraw, GCPtr pGC, xArc * arc) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - register int x, y, e; - int yk, xk, ym, xm, dx, dy, xorg, yorg; - int slw; - miFillArcRec info; - - (*infoRec->SetupForSolidFill) (infoRec->pScrn, pGC->fgPixel, pGC->alu, - pGC->planemask); - - miFillArcSetup(arc, &info); - MIFILLARCSETUP(); - if (pGC->miTranslate) { - xorg += pDraw->x; - yorg += pDraw->y; - } - while (y > 0) { - MIFILLARCSTEP(slw); - if (slw > 0) { - (*infoRec->SubsequentSolidFillRect) (infoRec->pScrn, xorg - x, - yorg - y, slw, 1); - if (miFillArcLower(slw)) - (*infoRec->SubsequentSolidFillRect) (infoRec->pScrn, - xorg - x, yorg + y + dy, - slw, 1); - } - } - - SET_SYNC_FLAG(infoRec); -} - -#define ADDSPAN(l,r) \ - if (r >= l) \ - (*infoRec->SubsequentSolidFillRect)( \ - infoRec->pScrn, l, ya, r - l + 1, 1); - -#define ADDSLICESPANS(flip) \ - if (!flip) \ - { \ - ADDSPAN(xl, xr); \ - } \ - else \ - { \ - xc = xorg - x; \ - ADDSPAN(xc, xr); \ - xc += slw - 1; \ - ADDSPAN(xl, xc); \ - } - -static void -XAAFillArcSliceSolid(DrawablePtr pDraw, GCPtr pGC, xArc * arc) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - int yk, xk, ym, xm, dx, dy, xorg, yorg, slw; - register int x, y, e; - miFillArcRec info; - miArcSliceRec slice; - int ya, xl, xr, xc; - - (*infoRec->SetupForSolidFill) (infoRec->pScrn, pGC->fgPixel, pGC->alu, - pGC->planemask); - - miFillArcSetup(arc, &info); - miFillArcSliceSetup(arc, &slice, pGC); - MIFILLARCSETUP(); - slw = arc->height; - if (slice.flip_top || slice.flip_bot) - slw += (arc->height >> 1) + 1; - if (pGC->miTranslate) { - xorg += pDraw->x; - yorg += pDraw->y; - slice.edge1.x += pDraw->x; - slice.edge2.x += pDraw->x; - } - while (y > 0) { - MIFILLARCSTEP(slw); - MIARCSLICESTEP(slice.edge1); - MIARCSLICESTEP(slice.edge2); - if (miFillSliceUpper(slice)) { - ya = yorg - y; - MIARCSLICEUPPER(xl, xr, slice, slw); - - ADDSLICESPANS(slice.flip_top); - } - if (miFillSliceLower(slice)) { - ya = yorg + y + dy; - MIARCSLICELOWER(xl, xr, slice, slw); - ADDSLICESPANS(slice.flip_bot); - } - } - - SET_SYNC_FLAG(infoRec); -} - -void -XAAPolyFillArcSolid(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) -{ - register xArc *arc; - register int i; - int x2, y2; - BoxRec box; - RegionPtr cclip; - - cclip = pGC->pCompositeClip; - - if (!RegionNumRects(cclip)) - return; - - for (arc = parcs, i = narcs; --i >= 0; arc++) { - if (miFillArcEmpty(arc)) - continue; - if (miCanFillArc(arc)) { - box.x1 = arc->x + pDraw->x; - box.y1 = arc->y + pDraw->y; - /* - * Because box.x2 and box.y2 get truncated to 16 bits, and the - * RECT_IN_REGION test treats the resulting number as a signed - * integer, the RECT_IN_REGION test alone can go the wrong way. - * This can result in a server crash because the rendering - * routines in this file deal directly with cpu addresses - * of pixels to be stored, and do not clip or otherwise check - * that all such addresses are within their respective pixmaps. - * So we only allow the RECT_IN_REGION test to be used for - * values that can be expressed correctly in a signed short. - */ - x2 = box.x1 + (int) arc->width + 1; - box.x2 = x2; - y2 = box.y1 + (int) arc->height + 1; - box.y2 = y2; - if ((x2 <= SHRT_MAX) && (y2 <= SHRT_MAX) && - (RegionContainsRect(cclip, &box) == rgnIN)) { - if ((arc->angle2 >= FULLCIRCLE) || (arc->angle2 <= -FULLCIRCLE)) - XAAFillEllipseSolid(pDraw, pGC, arc); - else - XAAFillArcSliceSolid(pDraw, pGC, arc); - continue; - } - } - miPolyFillArc(pDraw, pGC, 1, arc); - } -} diff --git a/xserver/hw/xfree86/xaa/xaaFillPoly.c b/xserver/hw/xfree86/xaa/xaaFillPoly.c deleted file mode 100644 index 0cdedf57e..000000000 --- a/xserver/hw/xfree86/xaa/xaaFillPoly.c +++ /dev/null @@ -1,991 +0,0 @@ - -/* - * Copyright 1996 The XFree86 Project - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * HARM HANEMAAYER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF - * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - */ - -/* - * Written by Mark Vojkovich. Loosly based on an original version - * written by Harm Hanemaayer (H.Hanemaayer@inter.nl.net) which - * only did solid rectangles and didn't have trapezoid support. - * - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" - -#include -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "xf86str.h" -#include "mi.h" -#include "micoord.h" - -#include "xaa.h" -#include "xaalocal.h" - -#define POLY_USE_MI 0 -#define POLY_FULLY_CLIPPED 1 -#define POLY_IS_EASY 2 - -#define Setup(c,x,vertex,dx,dy,e,sign,step,DX) {\ - x = intToX(vertex); \ - if ((dy = intToY(c) - y)) { \ - DX = dx = intToX(c) - x; \ - step = 0; \ - if (dx >= 0) \ - { \ - e = 0; \ - sign = 1; \ - if (dx >= dy) {\ - step = dx / dy; \ - dx %= dy; \ - } \ - } \ - else \ - { \ - e = 1 - dy; \ - sign = -1; \ - dx = -dx; \ - if (dx >= dy) { \ - step = - (dx / dy); \ - dx %= dy; \ - } \ - } \ - } \ - x += origin; \ - vertex = c; \ -} - -#define Step(x,dx,dy,e,sign,step) {\ - x += step; \ - if ((e += dx) > 0) \ - { \ - x += sign; \ - e -= dy; \ - } \ -} - -#define FixError(x, dx, dy, e, sign, step, h) { \ - e += (h) * dx; \ - x += (h) * step; \ - if(e > 0) { \ - x += e * sign/dy; \ - e %= dy; \ - if(e) { \ - x += sign; \ - e -= dy; \ - } \ - } \ -} - -/* - XAAIsEasyPoly - - - Checks CoordModeOrigin one rect polygons to see if we need - to use Mi. - Returns: POLY_USE_MI, POLY_FULLY_CLIPPED or POLY_IS_EASY - as well as the pointer to the "top" point and the y - extents. -*/ - -int -XAAIsEasyPolygon(DDXPointPtr ptsIn, int count, BoxPtr extents, int origin, DDXPointPtr * topPoint, /* return */ - int *topY, int *bottomY, /* return */ - int shape) -{ - int c = 0, vertex1, vertex2; - - *topY = 32767; - *bottomY = 0; - - origin -= (origin & 0x8000) << 1; - vertex1 = extents->x1 - origin; - vertex2 = extents->x2 - origin /* - 0x00010001 */ ; - /* I think this was an error in cfb ^ */ - - if (shape == Convex) { - while (count--) { - c = *((int *) ptsIn); - if (((c - vertex1) | (vertex2 - c)) & 0x80008000) - return POLY_USE_MI; - - c = intToY(c); - if (c < *topY) { - *topY = c; - *topPoint = ptsIn; - } - ptsIn++; - if (c > *bottomY) - *bottomY = c; - } - } - else { - int yFlip = 0; - int dx2, dx1, x1, x2; - - x2 = x1 = -1; - dx2 = dx1 = 1; - - while (count--) { - c = *((int *) ptsIn); - if (((c - vertex1) | (vertex2 - c)) & 0x80008000) - return POLY_USE_MI; - c = intToY(c); - if (c < *topY) { - *topY = c; - *topPoint = ptsIn; - } - ptsIn++; - if (c > *bottomY) - *bottomY = c; - if (c == x1) - continue; - if (dx1 > 0) { - if (x2 < 0) - x2 = c; - else - dx2 = dx1 = (c - x1) >> 31; - } - else if ((c - x1) >> 31 != dx1) { - dx1 = ~dx1; - yFlip++; - } - x1 = c; - } - x1 = (x2 - c) >> 31; - if (x1 != dx1) - yFlip++; - if (x1 != dx2) - yFlip++; - if (yFlip != 2) { - if (*topY == *bottomY) - return POLY_FULLY_CLIPPED; - else - return POLY_USE_MI; - } - } - if (*topY == *bottomY) - return POLY_FULLY_CLIPPED; - - return POLY_IS_EASY; -} - -void -XAAFillPolygonSolid(DrawablePtr pDraw, - GCPtr pGC, - int shape, int mode, int count, DDXPointPtr ptsIn) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - int origin, vertex1, vertex2; - int *vertex1p, *vertex2p, *endp; - int x1 = 0, x2 = 0; - int dx1 = 0, dx2 = 0, dy1 = 0, dy2 = 0; - int DX1 = 0, DX2 = 0, e1 = 0, e2 = 0; - int step1 = 0, step2 = 0, sign1 = 0, sign2 = 0; - int c, y, maxy, h, yoffset; - DDXPointPtr topPoint; - - if (!RegionNumRects(pGC->pCompositeClip)) - return; - - if (mode == CoordModePrevious) { - register DDXPointPtr ppt = ptsIn + 1; - - for (origin = 1; origin < count; origin++, ppt++) { - ppt->x += (ppt - 1)->x; - ppt->y += (ppt - 1)->y; - } - mode = CoordModeOrigin; - } - - if (RegionNumRects(pGC->pCompositeClip) != 1) { - miFillPolygon(pDraw, pGC, shape, mode, count, ptsIn); - return; - } - - origin = coordToInt(pDraw->x, pDraw->y); - - switch (XAAIsEasyPolygon(ptsIn, count, &pGC->pCompositeClip->extents, - origin, &topPoint, &y, &maxy, shape)) { - case POLY_USE_MI: - miFillPolygon(pDraw, pGC, shape, mode, count, ptsIn); - case POLY_FULLY_CLIPPED: - return; - } - - endp = (int *) ptsIn + count; - vertex2p = vertex1p = (int *) topPoint; - origin = pDraw->x; - yoffset = pDraw->y; - vertex2 = vertex1 = *vertex2p++; - if (vertex2p == endp) - vertex2p = (int *) ptsIn; - - (*infoRec->SetupForSolidFill) (infoRec->pScrn, pGC->fgPixel, pGC->alu, - pGC->planemask); - - while (1) { - if (y == intToY(vertex1)) { - do { - if (vertex1p == (int *) ptsIn) - vertex1p = endp; - c = *--vertex1p; - Setup(c, x1, vertex1, dx1, dy1, e1, sign1, step1, DX1) - } while (y >= intToY(vertex1)); - h = dy1; - } - else { - Step(x1, dx1, dy1, e1, sign1, step1) - h = intToY(vertex1) - y; - } - if (y == intToY(vertex2)) { - do { - c = *vertex2p++; - if (vertex2p == endp) - vertex2p = (int *) ptsIn; - Setup(c, x2, vertex2, dx2, dy2, e2, sign2, step2, DX2) - } while (y >= intToY(vertex2)); - if (dy2 < h) - h = dy2; - } - else { - Step(x2, dx2, dy2, e2, sign2, step2) - if ((c = (intToY(vertex2) - y)) < h) - h = c; - } - - /* fill spans for this segment */ - if (DX1 | DX2) { - if (infoRec->SubsequentSolidFillTrap && (h > 6)) { - if (x1 == x2) { - while (x1 == x2) { - y++; - if (!--h) - break; - Step(x1, dx1, dy1, e1, sign1, step1) - Step(x2, dx2, dy2, e2, sign2, step2) - } - if (y == maxy) - break; - if (!h) - continue; - } - - if (x1 < x2) - (*infoRec->SubsequentSolidFillTrap) (infoRec->pScrn, - y + yoffset, h, - x1, DX1, dy1, e1, - x2 - 1, DX2, dy2, e2); - else - (*infoRec->SubsequentSolidFillTrap) (infoRec->pScrn, - y + yoffset, h, - x2, DX2, dy2, e2, - x1 - 1, DX1, dy1, e1); - y += h; - if (--h) { - FixError(x1, dx1, dy1, e1, sign1, step1, h); - FixError(x2, dx2, dy2, e2, sign2, step2, h); - h = 0; - } - } - else { - while (1) { - if (x2 > x1) - (*infoRec->SubsequentSolidFillRect) (infoRec->pScrn, - x1, y + yoffset, - x2 - x1, 1); - else if (x1 > x2) - (*infoRec->SubsequentSolidFillRect) (infoRec->pScrn, - x2, y + yoffset, - x1 - x2, 1); - y++; - if (!--h) - break; - Step(x1, dx1, dy1, e1, sign1, step1) - Step(x2, dx2, dy2, e2, sign2, step2) - } - } - } - else { - if (x2 > x1) - (*infoRec->SubsequentSolidFillRect) (infoRec->pScrn, - x1, y + yoffset, x2 - x1, - h); - else if (x1 > x2) - (*infoRec->SubsequentSolidFillRect) (infoRec->pScrn, - x2, y + yoffset, x1 - x2, - h); - - y += h; - h = 0; - } - if (y == maxy) - break; - } - SET_SYNC_FLAG(infoRec); -} - -void -XAAFillPolygonHelper(ScrnInfoPtr pScrn, - DDXPointPtr ptsIn, - int count, - DDXPointPtr topPoint, - int y, - int maxy, - int origin, - RectFuncPtr RectFunc, - TrapFuncPtr TrapFunc, - int xorg, int yorg, XAACacheInfoPtr pCache) -{ - int *vertex1p, *vertex2p, *endp; - int vertex1, vertex2; - int x1 = 0, x2 = 0; - int dx1 = 0, dx2 = 0, dy1 = 0, dy2 = 0; - int DX1 = 0, DX2 = 0, e1 = 0, e2 = 0; - int step1 = 0, step2 = 0, sign1 = 0, sign2 = 0; - int c, h, yoffset; - - endp = (int *) ptsIn + count; - vertex2p = vertex1p = (int *) topPoint; - yoffset = intToY(origin); - origin = intToX(origin); - vertex2 = vertex1 = *vertex2p++; - if (vertex2p == endp) - vertex2p = (int *) ptsIn; - - while (1) { - if (y == intToY(vertex1)) { - do { - if (vertex1p == (int *) ptsIn) - vertex1p = endp; - c = *--vertex1p; - Setup(c, x1, vertex1, dx1, dy1, e1, sign1, step1, DX1) - } while (y >= intToY(vertex1)); - h = dy1; - } - else { - Step(x1, dx1, dy1, e1, sign1, step1) - h = intToY(vertex1) - y; - } - if (y == intToY(vertex2)) { - do { - c = *vertex2p++; - if (vertex2p == endp) - vertex2p = (int *) ptsIn; - Setup(c, x2, vertex2, dx2, dy2, e2, sign2, step2, DX2) - } while (y >= intToY(vertex2)); - if (dy2 < h) - h = dy2; - } - else { - Step(x2, dx2, dy2, e2, sign2, step2) - if ((c = (intToY(vertex2) - y)) < h) - h = c; - } - - /* fill spans for this segment */ - if (DX1 | DX2) { - if (TrapFunc && (h > 6)) { - if (x1 == x2) { - while (x1 == x2) { - y++; - if (!--h) - break; - Step(x1, dx1, dy1, e1, sign1, step1) - Step(x2, dx2, dy2, e2, sign2, step2) - } - if (y == maxy) - break; - if (!h) - continue; - } - - if (x1 < x2) - (*TrapFunc) (pScrn, y + yoffset, h, - x1, DX1, dy1, e1, - x2 - 1, DX2, dy2, e2, xorg, yorg, pCache); - else - (*TrapFunc) (pScrn, y + yoffset, h, - x2, DX2, dy2, e2, - x1 - 1, DX1, dy1, e1, xorg, yorg, pCache); - y += h; - if (--h) { - FixError(x1, dx1, dy1, e1, sign1, step1, h); - FixError(x2, dx2, dy2, e2, sign2, step2, h); - h = 0; - } - } - else { - while (1) { - if (x2 > x1) - (*RectFunc) (pScrn, - x1, y + yoffset, x2 - x1, 1, xorg, yorg, - pCache); - else if (x1 > x2) - (*RectFunc) (pScrn, - x2, y + yoffset, x1 - x2, 1, xorg, yorg, - pCache); - y++; - if (!--h) - break; - Step(x1, dx1, dy1, e1, sign1, step1) - Step(x2, dx2, dy2, e2, sign2, step2) - } - } - } - else { - if (x2 > x1) - (*RectFunc) (pScrn, - x1, y + yoffset, x2 - x1, h, xorg, yorg, pCache); - else if (x1 > x2) - (*RectFunc) (pScrn, - x2, y + yoffset, x1 - x2, h, xorg, yorg, pCache); - - y += h; - h = 0; - } - if (y == maxy) - break; - } -} - - /*****************\ - | Solid Helpers | - \*****************/ - -static void -SolidTrapHelper(ScrnInfoPtr pScrn, - int y, int h, - int x1, int dx1, int dy1, int e1, - int x2, int dx2, int dy2, int e2, - int xorg, int yorg, XAACacheInfoPtr pCache) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - - (*infoRec->SubsequentSolidFillTrap) (pScrn, - y, h, x1, dx1, dy1, e1, x2, dx2, dy2, - e2); -} - -static void -SolidRectHelper(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - int xorg, int yorg, XAACacheInfoPtr pCache) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - - (*infoRec->SubsequentSolidFillRect) (pScrn, x, y, w, h); -} - - /*********************\ - | Mono 8x8 Patterns | - \*********************/ - -static void -Mono8x8PatternTrapHelper_ScreenOrigin(ScrnInfoPtr pScrn, - int y, int h, - int x1, int dx1, int dy1, int e1, - int x2, int dx2, int dy2, int e2, - int xorg, int yorg, - XAACacheInfoPtr pCache) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - - (*infoRec->SubsequentMono8x8PatternFillTrap) (pScrn, xorg, yorg, - y, h, x1, dx1, dy1, e1, x2, - dx2, dy2, e2); -} - -static void -Mono8x8PatternRectHelper_ScreenOrigin(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - int xorg, int yorg, - XAACacheInfoPtr pCache) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - - (*infoRec->SubsequentMono8x8PatternFillRect) (pScrn, xorg, yorg, - x, y, w, h); -} - -static void -Mono8x8PatternRectHelper(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - int xorg, int yorg, XAACacheInfoPtr pCache) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - - xorg = (x - xorg) & 0x07; - yorg = (y - yorg) & 0x07; - - if (!(infoRec->Mono8x8PatternFillFlags & - HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) { - if (infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_PROGRAMMED_BITS) { - int patx = pCache->pat0; - int paty = pCache->pat1; - - XAARotateMonoPattern(&patx, &paty, xorg, yorg, - (infoRec->Mono8x8PatternFillFlags & - BIT_ORDER_IN_BYTE_MSBFIRST)); - xorg = patx; - yorg = paty; - } - else { - int slot = (yorg << 3) + xorg; - - xorg = pCache->x + pCache->offsets[slot].x; - yorg = pCache->y + pCache->offsets[slot].y; - } - } - - (*infoRec->SubsequentMono8x8PatternFillRect) (pScrn, xorg, yorg, - x, y, w, h); -} - - /****************\ - | Cache Expand | - \****************/ - -static void -CacheExpandRectHelper(ScrnInfoPtr pScrn, - int X, int Y, int Width, int Height, - int xorg, int yorg, XAACacheInfoPtr pCache) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - int x, phaseY, phaseX, skipleft, w, blit_w, blit_h; - int cacheWidth; - - cacheWidth = (pCache->w * pScrn->bitsPerPixel) / - infoRec->CacheColorExpandDensity; - - phaseY = (Y - yorg) % pCache->orig_h; - if (phaseY < 0) - phaseY += pCache->orig_h; - phaseX = (X - xorg) % pCache->orig_w; - if (phaseX < 0) - phaseX += pCache->orig_w; - - while (1) { - w = Width; - skipleft = phaseX; - x = X; - blit_h = pCache->h - phaseY; - if (blit_h > Height) - blit_h = Height; - - while (1) { - blit_w = cacheWidth - skipleft; - if (blit_w > w) - blit_w = w; - (*infoRec->SubsequentScreenToScreenColorExpandFill) (pScrn, x, Y, - blit_w, blit_h, - pCache->x, - pCache->y + - phaseY, - skipleft); - w -= blit_w; - if (!w) - break; - x += blit_w; - skipleft = (skipleft + blit_w) % pCache->orig_w; - } - Height -= blit_h; - if (!Height) - break; - Y += blit_h; - phaseY = (phaseY + blit_h) % pCache->orig_h; - } -} - - /**************\ - | Cache Blit | - \**************/ - -static void -CacheBltRectHelper(ScrnInfoPtr pScrn, - int X, int Y, int Width, int Height, - int xorg, int yorg, XAACacheInfoPtr pCache) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - int x, phaseY, phaseX, skipleft, w, blit_w, blit_h; - - phaseY = (Y - yorg) % pCache->orig_h; - if (phaseY < 0) - phaseY += pCache->orig_h; - phaseX = (X - xorg) % pCache->orig_w; - if (phaseX < 0) - phaseX += pCache->orig_w; - - while (1) { - w = Width; - skipleft = phaseX; - x = X; - blit_h = pCache->h - phaseY; - if (blit_h > Height) - blit_h = Height; - - while (1) { - blit_w = pCache->w - skipleft; - if (blit_w > w) - blit_w = w; - (*infoRec->SubsequentScreenToScreenCopy) (pScrn, - pCache->x + skipleft, - pCache->y + phaseY, x, Y, - blit_w, blit_h); - w -= blit_w; - if (!w) - break; - x += blit_w; - skipleft = (skipleft + blit_w) % pCache->orig_w; - } - Height -= blit_h; - if (!Height) - break; - Y += blit_h; - phaseY = (phaseY + blit_h) % pCache->orig_h; - } -} - - /**********************\ - | Stippled Polygons | - \**********************/ - -void -XAAFillPolygonStippled(DrawablePtr pDraw, - GCPtr pGC, - int shape, int mode, int count, DDXPointPtr ptsIn) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple); - int origin, type, patx, paty, fg, bg; - int y, maxy, xorg, yorg; - DDXPointPtr topPoint; - XAACacheInfoPtr pCache = NULL; - RectFuncPtr RectFunc = NULL; - TrapFuncPtr TrapFunc = NULL; - - if (!RegionNumRects(pGC->pCompositeClip)) - return; - - if (mode == CoordModePrevious) { - register DDXPointPtr ppt = ptsIn + 1; - - for (origin = 1; origin < count; origin++, ppt++) { - ppt->x += (ppt - 1)->x; - ppt->y += (ppt - 1)->y; - } - mode = CoordModeOrigin; - } - - if (RegionNumRects(pGC->pCompositeClip) != 1) { - miFillPolygon(pDraw, pGC, shape, mode, count, ptsIn); - return; - } - - if (pGC->fillStyle == FillStippled) { - type = (*infoRec->StippledFillChooser) (pGC); - fg = pGC->fgPixel; - bg = -1; - } - else { - type = (*infoRec->OpaqueStippledFillChooser) (pGC); - fg = pGC->fgPixel; - bg = pGC->bgPixel; - } - - if (!type) { - (*XAAFallbackOps.FillPolygon) (pDraw, pGC, shape, mode, count, ptsIn); - return; - } - - if ((type == DO_COLOR_EXPAND) || (type == DO_COLOR_8x8)) { - miFillPolygon(pDraw, pGC, shape, mode, count, ptsIn); - return; - } - - origin = pDraw->x; - - switch (XAAIsEasyPolygon(ptsIn, count, &pGC->pCompositeClip->extents, - origin, &topPoint, &y, &maxy, shape)) { - case POLY_USE_MI: - miFillPolygon(pDraw, pGC, shape, mode, count, ptsIn); - case POLY_FULLY_CLIPPED: - return; - } - - xorg = (pDraw->x + pGC->patOrg.x); - yorg = (pDraw->y + pGC->patOrg.y); - - if ((fg == bg) && (bg != -1) && infoRec->SetupForSolidFill) { - - (*infoRec->SetupForSolidFill) (infoRec->pScrn, fg, - pGC->alu, pGC->planemask); - - RectFunc = SolidRectHelper; - TrapFunc = infoRec->SubsequentSolidFillTrap ? SolidTrapHelper : NULL; - } - else - switch (type) { - case DO_MONO_8x8: - patx = pPriv->pattern0; - paty = pPriv->pattern1; - if (infoRec->Mono8x8PatternFillFlags & - HARDWARE_PATTERN_SCREEN_ORIGIN) { - xorg = (-xorg) & 0x07; - yorg = (-yorg) & 0x07; - if (infoRec->Mono8x8PatternFillFlags & - HARDWARE_PATTERN_PROGRAMMED_BITS) { - if (!(infoRec->Mono8x8PatternFillFlags & - HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) { - XAARotateMonoPattern(&patx, &paty, xorg, yorg, - (infoRec->Mono8x8PatternFillFlags & - BIT_ORDER_IN_BYTE_MSBFIRST)); - xorg = patx; - yorg = paty; - } - } - else { - XAACacheInfoPtr pCache = - (*infoRec->CacheMono8x8Pattern) (infoRec->pScrn, patx, - paty); - patx = pCache->x; - paty = pCache->y; - if (!(infoRec->Mono8x8PatternFillFlags & - HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) { - int slot = (yorg << 3) + xorg; - - patx += pCache->offsets[slot].x; - paty += pCache->offsets[slot].y; - xorg = patx; - yorg = paty; - } - } - RectFunc = Mono8x8PatternRectHelper_ScreenOrigin; - if (infoRec->SubsequentMono8x8PatternFillTrap) - TrapFunc = Mono8x8PatternTrapHelper_ScreenOrigin; - } - else { /* !HARDWARE_PATTERN_SCREEN_ORIGIN */ - if (!(infoRec->Mono8x8PatternFillFlags & - HARDWARE_PATTERN_PROGRAMMED_BITS)) { - pCache = - (*infoRec->CacheMono8x8Pattern) (infoRec->pScrn, patx, - paty); - patx = pCache->x; - paty = pCache->y; - } - else { - pCache = &(infoRec->ScratchCacheInfoRec); - pCache->pat0 = patx; - pCache->pat1 = paty; - } - RectFunc = Mono8x8PatternRectHelper; - } - - (*infoRec->SetupForMono8x8PatternFill) (infoRec->pScrn, - patx, paty, fg, bg, - pGC->alu, pGC->planemask); - break; - case DO_CACHE_EXPAND: - pCache = - (*infoRec->CacheMonoStipple) (infoRec->pScrn, pGC->stipple); - - (*infoRec->SetupForScreenToScreenColorExpandFill) (infoRec->pScrn, - fg, bg, pGC->alu, - pGC->planemask); - - RectFunc = CacheExpandRectHelper; - break; - case DO_CACHE_BLT: - pCache = (*infoRec->CacheStipple) (infoRec->pScrn, pGC->stipple, - fg, bg); - (*infoRec->SetupForScreenToScreenCopy) (infoRec->pScrn, 1, 1, - pGC->alu, pGC->planemask, - pCache->trans_color); - - RectFunc = CacheBltRectHelper; - break; - default: - return; - } - - XAAFillPolygonHelper(infoRec->pScrn, ptsIn, count, topPoint, - y, maxy, origin, RectFunc, TrapFunc, xorg, yorg, - pCache); - - SET_SYNC_FLAG(infoRec); -} - - /*******************\ - | Tiled Polygons | - \*******************/ - -void -XAAFillPolygonTiled(DrawablePtr pDraw, - GCPtr pGC, - int shape, int mode, int count, DDXPointPtr ptsIn) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap); - int origin, type, patx, paty; - int y, maxy, xorg, yorg; - DDXPointPtr topPoint; - XAACacheInfoPtr pCache = NULL; - RectFuncPtr RectFunc = NULL; - TrapFuncPtr TrapFunc = NULL; - - if (!RegionNumRects(pGC->pCompositeClip)) - return; - - if (mode == CoordModePrevious) { - register DDXPointPtr ppt = ptsIn + 1; - - for (origin = 1; origin < count; origin++, ppt++) { - ppt->x += (ppt - 1)->x; - ppt->y += (ppt - 1)->y; - } - mode = CoordModeOrigin; - } - - if (RegionNumRects(pGC->pCompositeClip) != 1) { - miFillPolygon(pDraw, pGC, shape, mode, count, ptsIn); - return; - } - - type = (*infoRec->TiledFillChooser) (pGC); - - if (!type || (type == DO_IMAGE_WRITE)) { - (*XAAFallbackOps.FillPolygon) (pDraw, pGC, shape, mode, count, ptsIn); - return; - } - - if (type == DO_COLOR_8x8) { - miFillPolygon(pDraw, pGC, shape, mode, count, ptsIn); - return; - } - - origin = pDraw->x; - - switch (XAAIsEasyPolygon(ptsIn, count, &pGC->pCompositeClip->extents, - origin, &topPoint, &y, &maxy, shape)) { - case POLY_USE_MI: - miFillPolygon(pDraw, pGC, shape, mode, count, ptsIn); - case POLY_FULLY_CLIPPED: - return; - } - - xorg = (pDraw->x + pGC->patOrg.x); - yorg = (pDraw->y + pGC->patOrg.y); - - switch (type) { - case DO_MONO_8x8: - patx = pPriv->pattern0; - paty = pPriv->pattern1; - if (infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_SCREEN_ORIGIN) { - xorg = (-xorg) & 0x07; - yorg = (-yorg) & 0x07; - if (infoRec->Mono8x8PatternFillFlags & - HARDWARE_PATTERN_PROGRAMMED_BITS) { - if (!(infoRec->Mono8x8PatternFillFlags & - HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) { - XAARotateMonoPattern(&patx, &paty, xorg, yorg, - (infoRec->Mono8x8PatternFillFlags & - BIT_ORDER_IN_BYTE_MSBFIRST)); - xorg = patx; - yorg = paty; - } - } - else { - XAACacheInfoPtr pCache = - (*infoRec->CacheMono8x8Pattern) (infoRec->pScrn, patx, - paty); - patx = pCache->x; - paty = pCache->y; - if (!(infoRec->Mono8x8PatternFillFlags & - HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) { - int slot = (yorg << 3) + xorg; - - patx += pCache->offsets[slot].x; - paty += pCache->offsets[slot].y; - xorg = patx; - yorg = paty; - } - } - RectFunc = Mono8x8PatternRectHelper_ScreenOrigin; - if (infoRec->SubsequentMono8x8PatternFillTrap) - TrapFunc = Mono8x8PatternTrapHelper_ScreenOrigin; - } - else { /* !HARDWARE_PATTERN_SCREEN_ORIGIN */ - if (!(infoRec->Mono8x8PatternFillFlags & - HARDWARE_PATTERN_PROGRAMMED_BITS)) { - pCache = - (*infoRec->CacheMono8x8Pattern) (infoRec->pScrn, patx, - paty); - patx = pCache->x; - paty = pCache->y; - } - else { - pCache = &(infoRec->ScratchCacheInfoRec); - pCache->pat0 = patx; - pCache->pat1 = paty; - } - RectFunc = Mono8x8PatternRectHelper; - } - - (*infoRec->SetupForMono8x8PatternFill) (infoRec->pScrn, - patx, paty, pPriv->fg, - pPriv->bg, pGC->alu, - pGC->planemask); - break; - case DO_CACHE_BLT: - pCache = (*infoRec->CacheTile) (infoRec->pScrn, pGC->tile.pixmap); - (*infoRec->SetupForScreenToScreenCopy) (infoRec->pScrn, 1, 1, - pGC->alu, pGC->planemask, -1); - - RectFunc = CacheBltRectHelper; - break; - case DO_PIXMAP_COPY: - pCache = &(infoRec->ScratchCacheInfoRec); - pCache->x = pPriv->offscreenArea->box.x1; - pCache->y = pPriv->offscreenArea->box.y1; - pCache->w = pCache->orig_w = pPriv->offscreenArea->box.x2 - pCache->x; - pCache->h = pCache->orig_h = pPriv->offscreenArea->box.y2 - pCache->y; - - (*infoRec->SetupForScreenToScreenCopy) (infoRec->pScrn, 1, 1, - pGC->alu, pGC->planemask, -1); - - RectFunc = CacheBltRectHelper; - break; - default: - return; - } - - XAAFillPolygonHelper(infoRec->pScrn, ptsIn, count, topPoint, - y, maxy, origin, RectFunc, TrapFunc, xorg, yorg, - pCache); - - SET_SYNC_FLAG(infoRec); -} diff --git a/xserver/hw/xfree86/xaa/xaaFillRect.c b/xserver/hw/xfree86/xaa/xaaFillRect.c deleted file mode 100644 index ec0fb9df7..000000000 --- a/xserver/hw/xfree86/xaa/xaaFillRect.c +++ /dev/null @@ -1,1101 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" - -#include -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "xf86str.h" -#include "xaa.h" -#include "xaalocal.h" - -static void XAARenderSolidRects(GCPtr, int, BoxPtr, int, int); -static void XAARenderColor8x8Rects(GCPtr, int, BoxPtr, int, int); -static void XAARenderMono8x8Rects(GCPtr, int, BoxPtr, int, int); -static void XAARenderColorExpandRects(GCPtr, int, BoxPtr, int, int); -static void XAARenderCacheExpandRects(GCPtr, int, BoxPtr, int, int); -static void XAARenderCacheBltRects(GCPtr, int, BoxPtr, int, int); -static void XAARenderImageWriteRects(GCPtr, int, BoxPtr, int, int); -static void XAARenderPixmapCopyRects(GCPtr, int, BoxPtr, int, int); - -void -XAAPolyFillRect(DrawablePtr pDraw, GCPtr pGC, int nrectFill, /* number of rectangles to fill */ - xRectangle *prectInit /* Pointer to first rectangle to fill */ - ) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - int xorg = pDraw->x; - int yorg = pDraw->y; - int type = 0; - ClipAndRenderRectsFunc function; - - if ((nrectFill <= 0) || !pGC->planemask) - return; - - if (!RegionNumRects(pGC->pCompositeClip)) - return; - - switch (pGC->fillStyle) { - case FillSolid: - type = DO_SOLID; - break; - case FillStippled: - type = (*infoRec->StippledFillChooser) (pGC); - break; - case FillOpaqueStippled: - if ((pGC->fgPixel == pGC->bgPixel) && infoRec->FillSolidRects && - CHECK_PLANEMASK(pGC, infoRec->FillSolidRectsFlags) && - CHECK_ROP(pGC, infoRec->FillSolidRectsFlags) && - CHECK_ROPSRC(pGC, infoRec->FillSolidRectsFlags) && - CHECK_FG(pGC, infoRec->FillSolidRectsFlags)) - type = DO_SOLID; - else - type = (*infoRec->OpaqueStippledFillChooser) (pGC); - break; - case FillTiled: - type = (*infoRec->TiledFillChooser) (pGC); - break; - } - - switch (type) { - case DO_SOLID: - function = XAARenderSolidRects; - break; - case DO_COLOR_8x8: - function = XAARenderColor8x8Rects; - break; - case DO_MONO_8x8: - function = XAARenderMono8x8Rects; - break; - case DO_CACHE_BLT: - function = XAARenderCacheBltRects; - break; - case DO_COLOR_EXPAND: - function = XAARenderColorExpandRects; - break; - case DO_CACHE_EXPAND: - function = XAARenderCacheExpandRects; - break; - case DO_IMAGE_WRITE: - function = XAARenderImageWriteRects; - break; - case DO_PIXMAP_COPY: - function = XAARenderPixmapCopyRects; - break; - default: - (*XAAFallbackOps.PolyFillRect) (pDraw, pGC, nrectFill, prectInit); - return; - } - - if (xorg | yorg) { - int n = nrectFill; - xRectangle *prect = prectInit; - - while (n--) { - prect->x += xorg; - prect->y += yorg; - prect++; - } - } - - XAAClipAndRenderRects(pGC, function, nrectFill, prectInit, xorg, yorg); -} - - /*********************\ - | Solid Rects | - \*********************/ - -static void -XAARenderSolidRects(GCPtr pGC, - int nboxes, BoxPtr pClipBoxes, int xorg, int yorg) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - - (*infoRec->FillSolidRects) (infoRec->pScrn, - pGC->fgPixel, pGC->alu, pGC->planemask, nboxes, - pClipBoxes); -} - - /************************\ - | Mono 8x8 Rects | - \************************/ - -static void -XAARenderMono8x8Rects(GCPtr pGC, - int nboxes, BoxPtr pClipBoxes, int xorg, int yorg) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - XAAPixmapPtr pPriv; - int fg, bg; - - switch (pGC->fillStyle) { - case FillStippled: - pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple); - fg = pGC->fgPixel; - bg = -1; - break; - case FillOpaqueStippled: - pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple); - fg = pGC->fgPixel; - bg = pGC->bgPixel; - break; - case FillTiled: - pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap); - fg = pPriv->fg; - bg = pPriv->bg; - break; - default: /* Muffle compiler */ - pPriv = NULL; /* Kaboom */ - fg = -1; - bg = -1; - break; - } - - (*infoRec->FillMono8x8PatternRects) (infoRec->pScrn, - fg, bg, pGC->alu, pGC->planemask, - nboxes, pClipBoxes, pPriv->pattern0, - pPriv->pattern1, - (xorg + pGC->patOrg.x), - (yorg + pGC->patOrg.y)); -} - - /*************************\ - | Color 8x8 Rects | - \*************************/ - -static void -XAARenderColor8x8Rects(GCPtr pGC, - int nboxes, BoxPtr pClipBoxes, int xorg, int yorg) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - XAACacheInfoPtr pCache; - PixmapPtr pPix; - int fg, bg; - - switch (pGC->fillStyle) { - case FillStippled: - pPix = pGC->stipple; - fg = pGC->fgPixel; - bg = -1; - break; - case FillOpaqueStippled: - pPix = pGC->stipple; - fg = pGC->fgPixel; - bg = pGC->bgPixel; - break; - case FillTiled: - pPix = pGC->tile.pixmap; - fg = -1; - bg = -1; - break; - default: /* Muffle compiler */ - pPix = NULL; - fg = -1; - bg = -1; - break; - } - - pCache = (*infoRec->CacheColor8x8Pattern) (infoRec->pScrn, pPix, fg, bg); - (*infoRec->FillColor8x8PatternRects) (infoRec->pScrn, - pGC->alu, pGC->planemask, nboxes, - pClipBoxes, (xorg + pGC->patOrg.x), - (yorg + pGC->patOrg.y), pCache); -} - - /****************************\ - | Color Expand Rects | - \****************************/ - -static void -XAARenderColorExpandRects(GCPtr pGC, - int nboxes, BoxPtr pClipBoxes, int xorg, int yorg) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - int fg, bg; - - switch (pGC->fillStyle) { - case FillStippled: - fg = pGC->fgPixel; - bg = -1; - break; - case FillOpaqueStippled: - fg = pGC->fgPixel; - bg = pGC->bgPixel; - break; - default: /* Muffle compiler */ - fg = -1; - bg = -1; - break; - } - - (*infoRec->FillColorExpandRects) (infoRec->pScrn, fg, bg, - pGC->alu, pGC->planemask, nboxes, - pClipBoxes, (xorg + pGC->patOrg.x), - (yorg + pGC->patOrg.y), pGC->stipple); -} - - /*************************\ - | Cache Blt Rects | - \*************************/ - -static void -XAARenderCacheBltRects(GCPtr pGC, - int nboxes, BoxPtr pClipBoxes, int xorg, int yorg) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - XAACacheInfoPtr pCache; - - switch (pGC->fillStyle) { - case FillStippled: - pCache = (*infoRec->CacheStipple) (infoRec->pScrn, pGC->stipple, - pGC->fgPixel, -1); - break; - case FillOpaqueStippled: - pCache = (*infoRec->CacheStipple) (infoRec->pScrn, pGC->stipple, - pGC->fgPixel, pGC->bgPixel); - break; - case FillTiled: - pCache = (*infoRec->CacheTile) (infoRec->pScrn, pGC->tile.pixmap); - break; - default: /* Muffle compiler */ - pCache = NULL; - break; - } - - (*infoRec->FillCacheBltRects) (infoRec->pScrn, pGC->alu, - pGC->planemask, nboxes, pClipBoxes, - (xorg + pGC->patOrg.x), - (yorg + pGC->patOrg.y), pCache); -} - - /****************************\ - | Cache Expand Rects | - \****************************/ - -static void -XAARenderCacheExpandRects(GCPtr pGC, - int nboxes, BoxPtr pClipBoxes, int xorg, int yorg) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - int fg, bg; - - switch (pGC->fillStyle) { - case FillStippled: - fg = pGC->fgPixel; - bg = -1; - break; - case FillOpaqueStippled: - fg = pGC->fgPixel; - bg = pGC->bgPixel; - break; - default: /* Muffle compiler */ - fg = -1; - bg = -1; - break; - } - - (*infoRec->FillCacheExpandRects) (infoRec->pScrn, fg, bg, - pGC->alu, pGC->planemask, nboxes, - pClipBoxes, (xorg + pGC->patOrg.x), - (yorg + pGC->patOrg.y), pGC->stipple); -} - - /***************************\ - | Image Write Rects | - \***************************/ - -static void -XAARenderImageWriteRects(GCPtr pGC, - int nboxes, BoxPtr pClipBoxes, int xorg, int yorg) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - - (*infoRec->FillImageWriteRects) (infoRec->pScrn, pGC->alu, - pGC->planemask, nboxes, pClipBoxes, - (xorg + pGC->patOrg.x), - (yorg + pGC->patOrg.y), pGC->tile.pixmap); -} - - /***************************\ - | Pixmap Copy Rects | - \***************************/ - -static void -XAARenderPixmapCopyRects(GCPtr pGC, - int nboxes, BoxPtr pClipBoxes, int xorg, int yorg) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - XAACacheInfoPtr pCache = &(infoRec->ScratchCacheInfoRec); - XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap); - - pCache->x = pPriv->offscreenArea->box.x1; - pCache->y = pPriv->offscreenArea->box.y1; - pCache->w = pCache->orig_w = pPriv->offscreenArea->box.x2 - pCache->x; - pCache->h = pCache->orig_h = pPriv->offscreenArea->box.y2 - pCache->y; - pCache->trans_color = -1; - - (*infoRec->FillCacheBltRects) (infoRec->pScrn, pGC->alu, - pGC->planemask, nboxes, pClipBoxes, - (xorg + pGC->patOrg.x), - (yorg + pGC->patOrg.y), pCache); -} - - /************\ - | Solid | - \************/ - -void -XAAFillSolidRects(ScrnInfoPtr pScrn, int fg, int rop, unsigned int planemask, int nBox, /* number of rectangles to fill */ - BoxPtr pBox /* Pointer to first rectangle to fill */ - ) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - - (*infoRec->SetupForSolidFill) (pScrn, fg, rop, planemask); - while (nBox--) { - (*infoRec->SubsequentSolidFillRect) (pScrn, pBox->x1, pBox->y1, - pBox->x2 - pBox->x1, - pBox->y2 - pBox->y1); - pBox++; - } - SET_SYNC_FLAG(infoRec); -} - - /*********************\ - | 8x8 Mono Patterns | - \*********************/ - -void -XAAFillMono8x8PatternRectsScreenOrigin(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, - int pattern0, int pattern1, - int xorigin, int yorigin) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - int patx = pattern0, paty = pattern1; - int xorg = (-xorigin) & 0x07; - int yorg = (-yorigin) & 0x07; - - if (infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_PROGRAMMED_BITS) { - if (!(infoRec->Mono8x8PatternFillFlags & - HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) { - XAARotateMonoPattern(&patx, &paty, xorg, yorg, - (infoRec->Mono8x8PatternFillFlags & - BIT_ORDER_IN_BYTE_MSBFIRST)); - xorg = patx; - yorg = paty; - } - } - else { - XAACacheInfoPtr pCache = - (*infoRec->CacheMono8x8Pattern) (pScrn, pattern0, pattern1); - patx = pCache->x; - paty = pCache->y; - if (!(infoRec->Mono8x8PatternFillFlags & - HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) { - int slot = (yorg << 3) + xorg; - - patx += pCache->offsets[slot].x; - paty += pCache->offsets[slot].y; - xorg = patx; - yorg = paty; - } - } - - (*infoRec->SetupForMono8x8PatternFill) (pScrn, patx, paty, - fg, bg, rop, planemask); - - while (nBox--) { - (*infoRec->SubsequentMono8x8PatternFillRect) (pScrn, - xorg, yorg, pBox->x1, - pBox->y1, - pBox->x2 - pBox->x1, - pBox->y2 - pBox->y1); - pBox++; - } - SET_SYNC_FLAG(infoRec); -} - -void -XAAFillMono8x8PatternRects(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, - int pattern0, int pattern1, int xorigin, int yorigin) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - int patx = pattern0, paty = pattern1; - int xorg, yorg; - XAACacheInfoPtr pCache = NULL; - - if (!(infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_PROGRAMMED_BITS)) { - pCache = (*infoRec->CacheMono8x8Pattern) (pScrn, pattern0, pattern1); - patx = pCache->x; - paty = pCache->y; - } - - (*infoRec->SetupForMono8x8PatternFill) (pScrn, patx, paty, - fg, bg, rop, planemask); - - while (nBox--) { - xorg = (pBox->x1 - xorigin) & 0x07; - yorg = (pBox->y1 - yorigin) & 0x07; - - if (!(infoRec->Mono8x8PatternFillFlags & - HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) { - if (infoRec->Mono8x8PatternFillFlags & - HARDWARE_PATTERN_PROGRAMMED_BITS) { - patx = pattern0; - paty = pattern1; - XAARotateMonoPattern(&patx, &paty, xorg, yorg, - (infoRec->Mono8x8PatternFillFlags & - BIT_ORDER_IN_BYTE_MSBFIRST)); - xorg = patx; - yorg = paty; - } - else { - int slot = (yorg << 3) + xorg; - - xorg = patx + pCache->offsets[slot].x; - yorg = paty + pCache->offsets[slot].y; - } - } - - (*infoRec->SubsequentMono8x8PatternFillRect) (pScrn, - xorg, yorg, pBox->x1, - pBox->y1, - pBox->x2 - pBox->x1, - pBox->y2 - pBox->y1); - pBox++; - } - - SET_SYNC_FLAG(infoRec); -} - - /**********************\ - | 8x8 Color Patterns | - \**********************/ - -void -XAAFillColor8x8PatternRectsScreenOrigin(ScrnInfoPtr pScrn, - int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, - int xorigin, int yorigin, - XAACacheInfoPtr pCache) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - int patx = pCache->x, paty = pCache->y; - int xorg = (-xorigin) & 0x07; - int yorg = (-yorigin) & 0x07; - - if (!(infoRec->Color8x8PatternFillFlags & - HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) { - int slot = (yorg << 3) + xorg; - - paty += pCache->offsets[slot].y; - patx += pCache->offsets[slot].x; - xorg = patx; - yorg = paty; - } - - (*infoRec->SetupForColor8x8PatternFill) (pScrn, patx, paty, - rop, planemask, - pCache->trans_color); - - while (nBox--) { - (*infoRec->SubsequentColor8x8PatternFillRect) (pScrn, - xorg, yorg, pBox->x1, - pBox->y1, - pBox->x2 - pBox->x1, - pBox->y2 - pBox->y1); - pBox++; - } - SET_SYNC_FLAG(infoRec); -} - -void -XAAFillColor8x8PatternRects(ScrnInfoPtr pScrn, - int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, - int xorigin, int yorigin, XAACacheInfoPtr pCache) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - int xorg, yorg; - - (*infoRec->SetupForColor8x8PatternFill) (pScrn, pCache->x, pCache->y, - rop, planemask, - pCache->trans_color); - - while (nBox--) { - xorg = (pBox->x1 - xorigin) & 0x07; - yorg = (pBox->y1 - yorigin) & 0x07; - - if (!(infoRec->Color8x8PatternFillFlags & - HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) { - int slot = (yorg << 3) + xorg; - - yorg = pCache->y + pCache->offsets[slot].y; - xorg = pCache->x + pCache->offsets[slot].x; - } - - (*infoRec->SubsequentColor8x8PatternFillRect) (pScrn, - xorg, yorg, pBox->x1, - pBox->y1, - pBox->x2 - pBox->x1, - pBox->y2 - pBox->y1); - pBox++; - } - - SET_SYNC_FLAG(infoRec); -} - - /***************\ - | Cache Blits | - \***************/ - -void -XAAFillCacheBltRects(ScrnInfoPtr pScrn, - int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, int xorg, int yorg, XAACacheInfoPtr pCache) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - int x, y, phaseY, phaseX, skipleft, height, width, w, blit_w, blit_h; - - (*infoRec->SetupForScreenToScreenCopy) (pScrn, 1, 1, rop, planemask, - pCache->trans_color); - - while (nBox--) { - y = pBox->y1; - phaseY = (y - yorg) % pCache->orig_h; - if (phaseY < 0) - phaseY += pCache->orig_h; - phaseX = (pBox->x1 - xorg) % pCache->orig_w; - if (phaseX < 0) - phaseX += pCache->orig_w; - height = pBox->y2 - y; - width = pBox->x2 - pBox->x1; - -#if 0 - if (rop == GXcopy) { - while (1) { - w = width; - skipleft = phaseX; - x = pBox->x1; - blit_h = pCache->h - phaseY; - if (blit_h > height) - blit_h = height; - - while (1) { - blit_w = pCache->w - skipleft; - if (blit_w > w) - blit_w = w; - (*infoRec->SubsequentScreenToScreenCopy) (pScrn, - pCache->x + - skipleft, - pCache->y + - phaseY, x, y, - blit_w, blit_h); - w -= blit_w; - if (!w) - break; - x += blit_w; - skipleft = (skipleft + blit_w) % pCache->orig_w; - if (blit_w >= pCache->orig_w) - break; - } - - /* Expand horizontally */ - if (w) { - skipleft -= phaseX; - if (skipleft < 0) - skipleft += pCache->orig_w; - blit_w = x - pBox->x1 - skipleft; - while (w) { - if (blit_w > w) - blit_w = w; - (*infoRec->SubsequentScreenToScreenCopy) (pScrn, - pBox->x1 + - skipleft, y, - x, y, blit_w, - blit_h); - w -= blit_w; - x += blit_w; - blit_w <<= 1; - } - } - - height -= blit_h; - if (!height) - break; - y += blit_h; - phaseY = (phaseY + blit_h) % pCache->orig_h; - if (blit_h >= pCache->orig_h) - break; - } - - /* Expand vertically */ - if (height) { - blit_w = pBox->x2 - pBox->x1; - phaseY -= (pBox->y1 - yorg) % pCache->orig_h; - if (phaseY < 0) - phaseY += pCache->orig_h; - blit_h = y - pBox->y1 - phaseY; - while (height) { - if (blit_h > height) - blit_h = height; - (*infoRec->SubsequentScreenToScreenCopy) (pScrn, pBox->x1, - pBox->y1 + phaseY, - pBox->x1, y, - blit_w, blit_h); - height -= blit_h; - y += blit_h; - blit_h <<= 1; - } - } - } - else -#endif - { - while (1) { - w = width; - skipleft = phaseX; - x = pBox->x1; - blit_h = pCache->h - phaseY; - if (blit_h > height) - blit_h = height; - - while (1) { - blit_w = pCache->w - skipleft; - if (blit_w > w) - blit_w = w; - (*infoRec->SubsequentScreenToScreenCopy) (pScrn, - pCache->x + - skipleft, - pCache->y + - phaseY, x, y, - blit_w, blit_h); - w -= blit_w; - if (!w) - break; - x += blit_w; - skipleft = (skipleft + blit_w) % pCache->orig_w; - } - height -= blit_h; - if (!height) - break; - y += blit_h; - phaseY = (phaseY + blit_h) % pCache->orig_h; - } - } - pBox++; - } - - SET_SYNC_FLAG(infoRec); -} - - /*******************\ - | Cache Expansion | - \*******************/ - -void -XAAFillCacheExpandRects(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, int xorg, int yorg, PixmapPtr pPix) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - int x, y, phaseY, phaseX, skipleft, height, width, w, blit_w, blit_h; - int cacheWidth; - XAACacheInfoPtr pCache; - - pCache = (*infoRec->CacheMonoStipple) (pScrn, pPix); - - cacheWidth = (pCache->w * pScrn->bitsPerPixel) / - infoRec->CacheColorExpandDensity; - - (*infoRec->SetupForScreenToScreenColorExpandFill) (pScrn, fg, bg, rop, - planemask); - - while (nBox--) { - y = pBox->y1; - phaseY = (y - yorg) % pCache->orig_h; - if (phaseY < 0) - phaseY += pCache->orig_h; - phaseX = (pBox->x1 - xorg) % pCache->orig_w; - if (phaseX < 0) - phaseX += pCache->orig_w; - height = pBox->y2 - y; - width = pBox->x2 - pBox->x1; - - while (1) { - w = width; - skipleft = phaseX; - x = pBox->x1; - blit_h = pCache->h - phaseY; - if (blit_h > height) - blit_h = height; - - while (1) { - blit_w = cacheWidth - skipleft; - if (blit_w > w) - blit_w = w; - (*infoRec->SubsequentScreenToScreenColorExpandFill) (pScrn, x, - y, blit_w, - blit_h, - pCache->x, - pCache->y + - phaseY, - skipleft); - w -= blit_w; - if (!w) - break; - x += blit_w; - skipleft = (skipleft + blit_w) % pCache->orig_w; - } - height -= blit_h; - if (!height) - break; - y += blit_h; - phaseY = (phaseY + blit_h) % pCache->orig_h; - } - pBox++; - } - - SET_SYNC_FLAG(infoRec); -} - - /******************\ - | Image Writes | - \******************/ - -/* This requires all LEFT_EDGE clipping. You get too many problems - with reading past the edge of the pattern otherwise */ - -static void -WriteColumn(ScrnInfoPtr pScrn, - unsigned char *pSrc, - int x, int y, int w, int h, - int xoff, int yoff, int pHeight, int srcwidth, int Bpp) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - unsigned char *src; - Bool PlusOne = FALSE; - int skipleft, dwords; - - pSrc += (Bpp * xoff); - - if ((skipleft = (long) pSrc & 0x03L)) { - if (Bpp == 3) - skipleft = 4 - skipleft; - else - skipleft /= Bpp; - - x -= skipleft; - w += skipleft; - - if (Bpp == 3) - pSrc -= 3 * skipleft; - else /* is this Alpha friendly ? */ - pSrc = (unsigned char *) ((long) pSrc & ~0x03L); - } - - src = pSrc + (yoff * srcwidth); - - dwords = bytes_to_int32(w * Bpp); - - if ((infoRec->ImageWriteFlags & CPU_TRANSFER_PAD_QWORD) && - ((dwords * h) & 0x01)) { - PlusOne = TRUE; - } - - (*infoRec->SubsequentImageWriteRect) (pScrn, x, y, w, h, skipleft); - - if (dwords > infoRec->ImageWriteRange) { - while (h--) { - XAAMoveDWORDS_FixedBase((CARD32 *) infoRec->ImageWriteBase, - (CARD32 *) src, dwords); - src += srcwidth; - yoff++; - if (yoff >= pHeight) { - yoff = 0; - src = pSrc; - } - } - } - else { - if (srcwidth == (dwords << 2)) { - int maxLines = infoRec->ImageWriteRange / dwords; - int step; - - while (h) { - step = pHeight - yoff; - if (step > maxLines) - step = maxLines; - if (step > h) - step = h; - - XAAMoveDWORDS((CARD32 *) infoRec->ImageWriteBase, - (CARD32 *) src, dwords * step); - - src += (srcwidth * step); - yoff += step; - if (yoff >= pHeight) { - yoff = 0; - src = pSrc; - } - h -= step; - } - } - else { - while (h--) { - XAAMoveDWORDS((CARD32 *) infoRec->ImageWriteBase, - (CARD32 *) src, dwords); - src += srcwidth; - yoff++; - if (yoff >= pHeight) { - yoff = 0; - src = pSrc; - } - } - } - } - - if (PlusOne) { - CARD32 *base = (CARD32 *) infoRec->ImageWriteBase; - - *base = 0x00000000; - } -} - -void -XAAFillImageWriteRects(ScrnInfoPtr pScrn, - int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, int xorg, int yorg, PixmapPtr pPix) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - int x, phaseY, phaseX, height, width, blit_w; - int pHeight = pPix->drawable.height; - int pWidth = pPix->drawable.width; - int Bpp = pPix->drawable.bitsPerPixel >> 3; - int srcwidth = pPix->devKind; - - (*infoRec->SetupForImageWrite) (pScrn, rop, planemask, -1, - pPix->drawable.bitsPerPixel, - pPix->drawable.depth); - - while (nBox--) { - x = pBox->x1; - phaseY = (pBox->y1 - yorg) % pHeight; - if (phaseY < 0) - phaseY += pHeight; - phaseX = (x - xorg) % pWidth; - if (phaseX < 0) - phaseX += pWidth; - height = pBox->y2 - pBox->y1; - width = pBox->x2 - x; - - while (1) { - blit_w = pWidth - phaseX; - if (blit_w > width) - blit_w = width; - - WriteColumn(pScrn, pPix->devPrivate.ptr, x, pBox->y1, - blit_w, height, phaseX, phaseY, pHeight, srcwidth, Bpp); - - width -= blit_w; - if (!width) - break; - x += blit_w; - phaseX = (phaseX + blit_w) % pWidth; - } - pBox++; - } - - if (infoRec->ImageWriteFlags & SYNC_AFTER_IMAGE_WRITE) - (*infoRec->Sync) (pScrn); - else - SET_SYNC_FLAG(infoRec); -} - - /*************\ - | Utilities | - \*************/ - -void -XAAClipAndRenderRects(GCPtr pGC, - ClipAndRenderRectsFunc BoxFunc, - int nrectFill, xRectangle *prect, int xorg, int yorg) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - int Right, Bottom, MaxBoxes; - BoxPtr pextent, pboxClipped, pboxClippedBase; - - MaxBoxes = infoRec->PreAllocSize / sizeof(BoxRec); - pboxClippedBase = (BoxPtr) infoRec->PreAllocMem; - pboxClipped = pboxClippedBase; - - if (RegionNumRects(pGC->pCompositeClip) == 1) { - pextent = RegionRects(pGC->pCompositeClip); - while (nrectFill--) { - pboxClipped->x1 = max(pextent->x1, prect->x); - pboxClipped->y1 = max(pextent->y1, prect->y); - - Right = (int) prect->x + (int) prect->width; - pboxClipped->x2 = min(pextent->x2, Right); - - Bottom = (int) prect->y + (int) prect->height; - pboxClipped->y2 = min(pextent->y2, Bottom); - - prect++; - if ((pboxClipped->x1 < pboxClipped->x2) && - (pboxClipped->y1 < pboxClipped->y2)) { - pboxClipped++; - if (pboxClipped >= (pboxClippedBase + MaxBoxes)) { - (*BoxFunc) (pGC, MaxBoxes, pboxClippedBase, xorg, yorg); - pboxClipped = pboxClippedBase; - } - } - } - } - else { - pextent = RegionExtents(pGC->pCompositeClip); - while (nrectFill--) { - int n; - BoxRec box, *pbox; - - box.x1 = max(pextent->x1, prect->x); - box.y1 = max(pextent->y1, prect->y); - - Right = (int) prect->x + (int) prect->width; - box.x2 = min(pextent->x2, Right); - - Bottom = (int) prect->y + (int) prect->height; - box.y2 = min(pextent->y2, Bottom); - - prect++; - - if ((box.x1 >= box.x2) || (box.y1 >= box.y2)) - continue; - - n = RegionNumRects(pGC->pCompositeClip); - pbox = RegionRects(pGC->pCompositeClip); - - /* clip the rectangle to each box in the clip region - this is logically equivalent to calling Intersect() - */ - while (n--) { - pboxClipped->x1 = max(box.x1, pbox->x1); - pboxClipped->y1 = max(box.y1, pbox->y1); - pboxClipped->x2 = min(box.x2, pbox->x2); - pboxClipped->y2 = min(box.y2, pbox->y2); - pbox++; - - /* see if clipping left anything */ - if (pboxClipped->x1 < pboxClipped->x2 && - pboxClipped->y1 < pboxClipped->y2) { - pboxClipped++; - if (pboxClipped >= (pboxClippedBase + MaxBoxes)) { - (*BoxFunc) (pGC, MaxBoxes, pboxClippedBase, xorg, yorg); - pboxClipped = pboxClippedBase; - } - } - } - } - } - - if (pboxClipped != pboxClippedBase) - (*BoxFunc) (pGC, pboxClipped - pboxClippedBase, pboxClippedBase, - xorg, yorg); -} - -int -XAAGetRectClipBoxes(GCPtr pGC, - BoxPtr pboxClippedBase, - int nrectFill, xRectangle *prectInit) -{ - int Right, Bottom; - BoxPtr pextent, pboxClipped = pboxClippedBase; - xRectangle *prect = prectInit; - RegionPtr prgnClip = pGC->pCompositeClip; - - if (RegionNumRects(prgnClip) == 1) { - pextent = RegionRects(prgnClip); - while (nrectFill--) { - pboxClipped->x1 = max(pextent->x1, prect->x); - pboxClipped->y1 = max(pextent->y1, prect->y); - - Right = (int) prect->x + (int) prect->width; - pboxClipped->x2 = min(pextent->x2, Right); - - Bottom = (int) prect->y + (int) prect->height; - pboxClipped->y2 = min(pextent->y2, Bottom); - - prect++; - if ((pboxClipped->x1 < pboxClipped->x2) && - (pboxClipped->y1 < pboxClipped->y2)) { - pboxClipped++; - } - } - } - else { - pextent = RegionExtents(prgnClip); - while (nrectFill--) { - int n; - BoxRec box, *pbox; - - box.x1 = max(pextent->x1, prect->x); - box.y1 = max(pextent->y1, prect->y); - - Right = (int) prect->x + (int) prect->width; - box.x2 = min(pextent->x2, Right); - - Bottom = (int) prect->y + (int) prect->height; - box.y2 = min(pextent->y2, Bottom); - - prect++; - - if ((box.x1 >= box.x2) || (box.y1 >= box.y2)) - continue; - - n = RegionNumRects(prgnClip); - pbox = RegionRects(prgnClip); - - /* clip the rectangle to each box in the clip region - this is logically equivalent to calling Intersect() - */ - while (n--) { - pboxClipped->x1 = max(box.x1, pbox->x1); - pboxClipped->y1 = max(box.y1, pbox->y1); - pboxClipped->x2 = min(box.x2, pbox->x2); - pboxClipped->y2 = min(box.y2, pbox->y2); - pbox++; - - /* see if clipping left anything */ - if (pboxClipped->x1 < pboxClipped->x2 && - pboxClipped->y1 < pboxClipped->y2) { - pboxClipped++; - } - } - } - } - - return pboxClipped - pboxClippedBase; -} diff --git a/xserver/hw/xfree86/xaa/xaaGC.c b/xserver/hw/xfree86/xaa/xaaGC.c deleted file mode 100644 index d55f1e445..000000000 --- a/xserver/hw/xfree86/xaa/xaaGC.c +++ /dev/null @@ -1,564 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include - -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" - -#include -#include "scrnintstr.h" -#include "xf86str.h" -#include "xaa.h" -#include "xaalocal.h" -#include "migc.h" -#include "gcstruct.h" -#include "pixmapstr.h" -#include "xaawrap.h" - -static void XAAValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDraw); -static void XAAChangeGC(GCPtr pGC, unsigned long mask); -static void XAACopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst); -static void XAADestroyGC(GCPtr pGC); -static void XAAChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects); -static void XAADestroyClip(GCPtr pGC); -static void XAACopyClip(GCPtr pgcDst, GCPtr pgcSrc); - -GCFuncs XAAGCFuncs = { - XAAValidateGC, XAAChangeGC, XAACopyGC, XAADestroyGC, - XAAChangeClip, XAADestroyClip, XAACopyClip -}; - -extern GCOps XAAPixmapOps; - -Bool -XAACreateGC(GCPtr pGC) -{ - ScreenPtr pScreen = pGC->pScreen; - XAAGCPtr pGCPriv = (XAAGCPtr) dixLookupPrivate(&pGC->devPrivates, - XAAGetGCKey()); - Bool ret; - - XAA_SCREEN_PROLOGUE(pScreen, CreateGC); - - if ((ret = (*pScreen->CreateGC) (pGC))) { - pGCPriv->wrapOps = NULL; - pGCPriv->wrapFuncs = pGC->funcs; - pGCPriv->XAAOps = &XAAFallbackOps; - pGC->funcs = &XAAGCFuncs; - } - - XAA_SCREEN_EPILOGUE(pScreen, CreateGC, XAACreateGC); - - return ret; -} - -static void -XAAValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDraw) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - - XAA_GC_FUNC_PROLOGUE(pGC); - - (*pGC->funcs->ValidateGC) (pGC, changes, pDraw); - - if ((changes & GCPlaneMask) && - ((pGC->planemask & infoRec->FullPlanemasks[pGC->depth - 1]) == - infoRec->FullPlanemasks[pGC->depth - 1])) { - pGC->planemask = ~0; - } - - if (pGC->depth != 32) { - /* 0xffffffff is reserved for transparency */ - if (pGC->bgPixel == 0xffffffff) - pGC->bgPixel = 0x7fffffff; - if (pGC->fgPixel == 0xffffffff) - pGC->fgPixel = 0x7fffffff; - } - - if ((pDraw->type == DRAWABLE_PIXMAP) && !IS_OFFSCREEN_PIXMAP(pDraw)) { - pGCPriv->flags = OPS_ARE_PIXMAP; - pGCPriv->changes |= changes; - - /* make sure we're not using videomemory pixmaps to render - onto system memory drawables */ - - if ((pGC->fillStyle == FillTiled) && - IS_OFFSCREEN_PIXMAP(pGC->tile.pixmap) && - !OFFSCREEN_PIXMAP_LOCKED(pGC->tile.pixmap)) { - - XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap); - FBAreaPtr area = pPriv->offscreenArea; - - XAARemoveAreaCallback(area); /* clobbers pPriv->offscreenArea */ - xf86FreeOffscreenArea(area); - } - } - else if (!infoRec->pScrn->vtSema && (pDraw->type == DRAWABLE_WINDOW)) { - pGCPriv->flags = 0; - pGCPriv->changes |= changes; - } - else { - if (!(pGCPriv->flags & OPS_ARE_ACCEL)) { - changes |= pGCPriv->changes; - pGCPriv->changes = 0; - } - pGCPriv->flags = OPS_ARE_ACCEL; - -#if 1 - /* Ugh. If we can't use the blitter on offscreen pixmaps used - as tiles, then we need to move them out as cfb can't handle - tiles with non-zero origins */ - - if ((pGC->fillStyle == FillTiled) && - IS_OFFSCREEN_PIXMAP(pGC->tile.pixmap) && - (DO_PIXMAP_COPY != (*infoRec->TiledFillChooser) (pGC))) { - - XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap); - FBAreaPtr area = pPriv->offscreenArea; - - XAARemoveAreaCallback(area); /* clobbers pPriv->offscreenArea */ - xf86FreeOffscreenArea(area); - } -#endif - } - - XAA_GC_FUNC_EPILOGUE(pGC); - - if (!(pGCPriv->flags & OPS_ARE_ACCEL)) - return; - - if ((changes & GCTile) && !pGC->tileIsPixel && pGC->tile.pixmap) { - XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap); - - if (pixPriv->flags & DIRTY) { - pixPriv->flags &= ~(DIRTY | REDUCIBILITY_MASK); - pGC->tile.pixmap->drawable.serialNumber = NEXT_SERIAL_NUMBER; - } - } - if ((changes & GCStipple) && pGC->stipple) { - XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple); - - if (pixPriv->flags & DIRTY) { - pixPriv->flags &= ~(DIRTY | REDUCIBILITY_MASK); - pGC->stipple->drawable.serialNumber = NEXT_SERIAL_NUMBER; - } - } - - /* If our Ops are still the default ones we need to allocate new ones */ - if (pGC->ops == &XAAFallbackOps) { - if (!(pGCPriv->XAAOps = malloc(sizeof(GCOps)))) { - pGCPriv->XAAOps = &XAAFallbackOps; - return; - } - /* make a modifiable copy of the default ops */ - memcpy(pGCPriv->XAAOps, &XAAFallbackOps, sizeof(GCOps)); - pGC->ops = pGCPriv->XAAOps; - changes = ~0; - } - - if (!changes) - return; - - if ((changes & GCDashList) && infoRec->ComputeDash) - infoRec->ComputeDash(pGC); - - if (changes & infoRec->FillSpansMask) - (*infoRec->ValidateFillSpans) (pGC, changes, pDraw); - - if (changes & infoRec->SetSpansMask) - (*infoRec->ValidateSetSpans) (pGC, changes, pDraw); - - if (changes & infoRec->PutImageMask) - (*infoRec->ValidatePutImage) (pGC, changes, pDraw); - - if (changes & infoRec->CopyAreaMask) - (*infoRec->ValidateCopyArea) (pGC, changes, pDraw); - - if (changes & infoRec->CopyPlaneMask) - (*infoRec->ValidateCopyPlane) (pGC, changes, pDraw); - - if (changes & infoRec->PolyPointMask) - (*infoRec->ValidatePolyPoint) (pGC, changes, pDraw); - - if (changes & infoRec->PolylinesMask) - (*infoRec->ValidatePolylines) (pGC, changes, pDraw); - - if (changes & infoRec->PolySegmentMask) - (*infoRec->ValidatePolySegment) (pGC, changes, pDraw); - - if (changes & infoRec->PolyRectangleMask) - (*infoRec->ValidatePolyRectangle) (pGC, changes, pDraw); - - if (changes & infoRec->PolyArcMask) - (*infoRec->ValidatePolyArc) (pGC, changes, pDraw); - - if (changes & infoRec->FillPolygonMask) - (*infoRec->ValidateFillPolygon) (pGC, changes, pDraw); - - if (changes & infoRec->PolyFillRectMask) - (*infoRec->ValidatePolyFillRect) (pGC, changes, pDraw); - - if (changes & infoRec->PolyFillArcMask) - (*infoRec->ValidatePolyFillArc) (pGC, changes, pDraw); - - if (changes & infoRec->PolyGlyphBltMask) - (*infoRec->ValidatePolyGlyphBlt) (pGC, changes, pDraw); - - if (changes & infoRec->ImageGlyphBltMask) - (*infoRec->ValidateImageGlyphBlt) (pGC, changes, pDraw); - - if (changes & infoRec->PolyText8Mask) - (*infoRec->ValidatePolyText8) (pGC, changes, pDraw); - - if (changes & infoRec->PolyText16Mask) - (*infoRec->ValidatePolyText16) (pGC, changes, pDraw); - - if (changes & infoRec->ImageText8Mask) - (*infoRec->ValidateImageText8) (pGC, changes, pDraw); - - if (changes & infoRec->ImageText16Mask) - (*infoRec->ValidateImageText16) (pGC, changes, pDraw); - - if (changes & infoRec->PushPixelsMask) - (*infoRec->ValidatePushPixels) (pGC, changes, pDraw); -} - -static void -XAADestroyGC(GCPtr pGC) -{ - XAA_GC_FUNC_PROLOGUE(pGC); - - if (pGCPriv->XAAOps != &XAAFallbackOps) - free(pGCPriv->XAAOps); - - free(pGCPriv->DashPattern); - pGCPriv->flags = 0; - - (*pGC->funcs->DestroyGC) (pGC); - XAA_GC_FUNC_EPILOGUE(pGC); -} - -static void -XAAChangeGC(GCPtr pGC, unsigned long mask) -{ - XAA_GC_FUNC_PROLOGUE(pGC); - (*pGC->funcs->ChangeGC) (pGC, mask); - XAA_GC_FUNC_EPILOGUE(pGC); - - /* we have to assume that shared memory pixmaps are dirty - because we can't wrap all operations on them */ - - if ((mask & GCTile) && !pGC->tileIsPixel && - PIXMAP_IS_SHARED(pGC->tile.pixmap)) { - XAAPixmapPtr pPixPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap); - - pPixPriv->flags |= DIRTY; - } - - if ((mask & GCStipple) && PIXMAP_IS_SHARED(pGC->stipple)) { - XAAPixmapPtr pPixPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple); - - pPixPriv->flags |= DIRTY; - } -} - -static void -XAACopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst) -{ - XAA_GC_FUNC_PROLOGUE(pGCDst); - (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst); - XAA_GC_FUNC_EPILOGUE(pGCDst); -} - -static void -XAAChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects) -{ - XAA_GC_FUNC_PROLOGUE(pGC); - (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects); - XAA_GC_FUNC_EPILOGUE(pGC); -} - -static void -XAACopyClip(GCPtr pgcDst, GCPtr pgcSrc) -{ - XAA_GC_FUNC_PROLOGUE(pgcDst); - (*pgcDst->funcs->CopyClip) (pgcDst, pgcSrc); - XAA_GC_FUNC_EPILOGUE(pgcDst); -} - -static void -XAADestroyClip(GCPtr pGC) -{ - XAA_GC_FUNC_PROLOGUE(pGC); - (*pGC->funcs->DestroyClip) (pGC); - XAA_GC_FUNC_EPILOGUE(pGC); -} - -/**** Pixmap Wrappers ****/ - -static void -XAAFillSpansPixmap(DrawablePtr pDraw, - GC * pGC, - int nInit, DDXPointPtr pptInit, int *pwidthInit, int fSorted) -{ - XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw); - (*pGC->ops->FillSpans) (pDraw, pGC, nInit, pptInit, pwidthInit, fSorted); - XAA_PIXMAP_OP_EPILOGUE(pGC); -} - -static void -XAASetSpansPixmap(DrawablePtr pDraw, - GCPtr pGC, - char *pcharsrc, - register DDXPointPtr ppt, - int *pwidth, int nspans, int fSorted) -{ - XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw); - (*pGC->ops->SetSpans) (pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted); - XAA_PIXMAP_OP_EPILOGUE(pGC); -} - -static void -XAAPutImagePixmap(DrawablePtr pDraw, - GCPtr pGC, - int depth, - int x, int y, int w, int h, - int leftPad, int format, char *pImage) -{ - XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw); - (*pGC->ops->PutImage) (pDraw, pGC, depth, x, y, w, h, - leftPad, format, pImage); - XAA_PIXMAP_OP_EPILOGUE(pGC); -} - -static RegionPtr -XAACopyAreaPixmap(DrawablePtr pSrc, - DrawablePtr pDst, - GC * pGC, - int srcx, int srcy, int width, int height, int dstx, int dsty) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - RegionPtr ret; - - if (infoRec->pScrn->vtSema && - ((pSrc->type == DRAWABLE_WINDOW) || IS_OFFSCREEN_PIXMAP(pSrc))) { - if (infoRec->ReadPixmap && (pGC->alu == GXcopy) && - (pSrc->bitsPerPixel == pDst->bitsPerPixel) && - ((pGC->planemask & infoRec->FullPlanemasks[pSrc->depth - 1]) - == infoRec->FullPlanemasks[pSrc->depth - 1])) { - XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE((PixmapPtr) (pDst)); - - pixPriv->flags |= DIRTY; - - return (XAABitBlt(pSrc, pDst, pGC, - srcx, srcy, width, height, dstx, dsty, - XAADoImageRead, 0L)); - } - else if (infoRec->NeedToSync) { - (*infoRec->Sync) (infoRec->pScrn); - infoRec->NeedToSync = FALSE; - } - } - - { - XAA_PIXMAP_OP_PROLOGUE(pGC, pDst); - ret = (*pGC->ops->CopyArea) (pSrc, pDst, - pGC, srcx, srcy, width, height, dstx, - dsty); - XAA_PIXMAP_OP_EPILOGUE(pGC); - } - return ret; -} - -static RegionPtr -XAACopyPlanePixmap(DrawablePtr pSrc, - DrawablePtr pDst, - GCPtr pGC, - int srcx, int srcy, - int width, int height, - int dstx, int dsty, unsigned long bitPlane) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - RegionPtr ret; - - XAA_PIXMAP_OP_PROLOGUE(pGC, pDst); - - if (infoRec->pScrn->vtSema && - ((pSrc->type == DRAWABLE_WINDOW) || IS_OFFSCREEN_PIXMAP(pSrc))) { - if (infoRec->NeedToSync) { - (*infoRec->Sync) (infoRec->pScrn); - infoRec->NeedToSync = FALSE; - } - } - - ret = (*pGC->ops->CopyPlane) (pSrc, pDst, - pGC, srcx, srcy, width, height, dstx, dsty, - bitPlane); - XAA_PIXMAP_OP_EPILOGUE(pGC); - return ret; -} - -static void -XAAPolyPointPixmap(DrawablePtr pDraw, - GCPtr pGC, int mode, int npt, xPoint * pptInit) -{ - XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw); - (*pGC->ops->PolyPoint) (pDraw, pGC, mode, npt, pptInit); - XAA_PIXMAP_OP_EPILOGUE(pGC); -} - -static void -XAAPolylinesPixmap(DrawablePtr pDraw, - GCPtr pGC, int mode, int npt, DDXPointPtr pptInit) -{ - XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw); - (*pGC->ops->Polylines) (pDraw, pGC, mode, npt, pptInit); - XAA_PIXMAP_OP_EPILOGUE(pGC); -} - -static void -XAAPolySegmentPixmap(DrawablePtr pDraw, GCPtr pGC, int nseg, xSegment * pSeg) -{ - XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw); - (*pGC->ops->PolySegment) (pDraw, pGC, nseg, pSeg); - XAA_PIXMAP_OP_EPILOGUE(pGC); -} - -static void -XAAPolyRectanglePixmap(DrawablePtr pDraw, - GCPtr pGC, int nRectsInit, xRectangle *pRectsInit) -{ - XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw); - (*pGC->ops->PolyRectangle) (pDraw, pGC, nRectsInit, pRectsInit); - XAA_PIXMAP_OP_EPILOGUE(pGC); -} - -static void -XAAPolyArcPixmap(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) -{ - XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw); - (*pGC->ops->PolyArc) (pDraw, pGC, narcs, parcs); - XAA_PIXMAP_OP_EPILOGUE(pGC); -} - -static void -XAAFillPolygonPixmap(DrawablePtr pDraw, - GCPtr pGC, - int shape, int mode, int count, DDXPointPtr ptsIn) -{ - XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw); - (*pGC->ops->FillPolygon) (pDraw, pGC, shape, mode, count, ptsIn); - XAA_PIXMAP_OP_EPILOGUE(pGC); -} - -static void -XAAPolyFillRectPixmap(DrawablePtr pDraw, - GCPtr pGC, int nrectFill, xRectangle *prectInit) -{ - XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw); - (*pGC->ops->PolyFillRect) (pDraw, pGC, nrectFill, prectInit); - XAA_PIXMAP_OP_EPILOGUE(pGC); -} - -static void -XAAPolyFillArcPixmap(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) -{ - XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw); - (*pGC->ops->PolyFillArc) (pDraw, pGC, narcs, parcs); - XAA_PIXMAP_OP_EPILOGUE(pGC); -} - -static int -XAAPolyText8Pixmap(DrawablePtr pDraw, - GCPtr pGC, int x, int y, int count, char *chars) -{ - int ret; - - XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw); - ret = (*pGC->ops->PolyText8) (pDraw, pGC, x, y, count, chars); - XAA_PIXMAP_OP_EPILOGUE(pGC); - return ret; -} - -static int -XAAPolyText16Pixmap(DrawablePtr pDraw, - GCPtr pGC, int x, int y, int count, unsigned short *chars) -{ - int ret; - - XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw); - ret = (*pGC->ops->PolyText16) (pDraw, pGC, x, y, count, chars); - XAA_PIXMAP_OP_EPILOGUE(pGC); - return ret; -} - -static void -XAAImageText8Pixmap(DrawablePtr pDraw, - GCPtr pGC, int x, int y, int count, char *chars) -{ - XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw); - (*pGC->ops->ImageText8) (pDraw, pGC, x, y, count, chars); - XAA_PIXMAP_OP_EPILOGUE(pGC); -} - -static void -XAAImageText16Pixmap(DrawablePtr pDraw, - GCPtr pGC, int x, int y, int count, unsigned short *chars) -{ - XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw); - (*pGC->ops->ImageText16) (pDraw, pGC, x, y, count, chars); - XAA_PIXMAP_OP_EPILOGUE(pGC); -} - -static void -XAAImageGlyphBltPixmap(DrawablePtr pDraw, - GCPtr pGC, - int xInit, int yInit, - unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase) -{ - XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw); - (*pGC->ops->ImageGlyphBlt) (pDraw, pGC, xInit, yInit, nglyph, - ppci, pglyphBase); - XAA_PIXMAP_OP_EPILOGUE(pGC); -} - -static void -XAAPolyGlyphBltPixmap(DrawablePtr pDraw, - GCPtr pGC, - int xInit, int yInit, - unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase) -{ - XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw); - (*pGC->ops->PolyGlyphBlt) (pDraw, pGC, xInit, yInit, nglyph, - ppci, pglyphBase); - XAA_PIXMAP_OP_EPILOGUE(pGC); -} - -static void -XAAPushPixelsPixmap(GCPtr pGC, - PixmapPtr pBitMap, - DrawablePtr pDraw, int dx, int dy, int xOrg, int yOrg) -{ - XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw); - (*pGC->ops->PushPixels) (pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg); - XAA_PIXMAP_OP_EPILOGUE(pGC); -} - -GCOps XAAPixmapOps = { - XAAFillSpansPixmap, XAASetSpansPixmap, - XAAPutImagePixmap, XAACopyAreaPixmap, - XAACopyPlanePixmap, XAAPolyPointPixmap, - XAAPolylinesPixmap, XAAPolySegmentPixmap, - XAAPolyRectanglePixmap, XAAPolyArcPixmap, - XAAFillPolygonPixmap, XAAPolyFillRectPixmap, - XAAPolyFillArcPixmap, XAAPolyText8Pixmap, - XAAPolyText16Pixmap, XAAImageText8Pixmap, - XAAImageText16Pixmap, XAAImageGlyphBltPixmap, - XAAPolyGlyphBltPixmap, XAAPushPixelsPixmap, -}; diff --git a/xserver/hw/xfree86/xaa/xaaGCmisc.c b/xserver/hw/xfree86/xaa/xaaGCmisc.c deleted file mode 100644 index ca69aae74..000000000 --- a/xserver/hw/xfree86/xaa/xaaGCmisc.c +++ /dev/null @@ -1,412 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" - -#include -#include "scrnintstr.h" -#include -#include "dixfontstr.h" -#include "xf86str.h" -#include "xaa.h" -#include "xaalocal.h" -#include "migc.h" -#include "mi.h" -#include "gcstruct.h" -#include "pixmapstr.h" - -void -XAAValidateCopyArea(GCPtr pGC, unsigned long changes, DrawablePtr pDraw) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - - if (infoRec->CopyArea && - CHECK_PLANEMASK(pGC, infoRec->CopyAreaFlags) && - CHECK_ROP(pGC, infoRec->CopyAreaFlags) && - CHECK_ROPSRC(pGC, infoRec->CopyAreaFlags) - ) - pGC->ops->CopyArea = infoRec->CopyArea; - else - pGC->ops->CopyArea = XAAFallbackOps.CopyArea; -} - -void -XAAValidatePutImage(GCPtr pGC, unsigned long changes, DrawablePtr pDraw) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - - if (infoRec->PutImage && - CHECK_PLANEMASK(pGC, infoRec->PutImageFlags) && - CHECK_ROP(pGC, infoRec->PutImageFlags) && - CHECK_ROPSRC(pGC, infoRec->PutImageFlags) && - CHECK_COLORS(pGC, infoRec->PutImageFlags) - ) - pGC->ops->PutImage = infoRec->PutImage; - else - pGC->ops->PutImage = XAAFallbackOps.PutImage; -} - -void -XAAValidateCopyPlane(GCPtr pGC, unsigned long changes, DrawablePtr pDraw) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - - if (infoRec->CopyPlane && - CHECK_PLANEMASK(pGC, infoRec->CopyPlaneFlags) && - CHECK_ROP(pGC, infoRec->CopyPlaneFlags) && - CHECK_ROPSRC(pGC, infoRec->CopyPlaneFlags) && - CHECK_COLORS(pGC, infoRec->CopyPlaneFlags) - ) - pGC->ops->CopyPlane = infoRec->CopyPlane; - else - pGC->ops->CopyPlane = XAAFallbackOps.CopyPlane; -} - -void -XAAValidatePushPixels(GCPtr pGC, unsigned long changes, DrawablePtr pDraw) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - - if (infoRec->PushPixelsSolid && - (pGC->fillStyle == FillSolid) && - CHECK_PLANEMASK(pGC, infoRec->PushPixelsFlags) && - CHECK_ROP(pGC, infoRec->PushPixelsFlags) && - CHECK_ROPSRC(pGC, infoRec->PushPixelsFlags) && - CHECK_FG(pGC, infoRec->PushPixelsFlags) && - (!(infoRec->PushPixelsFlags & TRANSPARENCY_GXCOPY_ONLY) || - (pGC->alu == GXcopy)) - ) - pGC->ops->PushPixels = infoRec->PushPixelsSolid; - else - pGC->ops->PushPixels = XAAFallbackOps.PushPixels; - -} - -/* We make the assumption that the FillSpans, PolyFillRect, FillPolygon - and PolyFillArc functions are linked in a way that they all have - the same rop/color/planemask restrictions. If the driver provides - a GC level replacement for these, it will need to supply a new - Validate functions if it breaks this assumption */ - -void -XAAValidateFillSpans(GCPtr pGC, unsigned long changes, DrawablePtr pDraw) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - - if (pGC->fillStyle != FillTiled) - changes &= ~GCTile; - if ((pGC->fillStyle == FillTiled) || (pGC->fillStyle == FillSolid)) - changes &= ~GCStipple; - if (!changes) - return; - - pGC->ops->FillSpans = XAAFallbackOps.FillSpans; - pGC->ops->PolyFillRect = XAAFallbackOps.PolyFillRect; - pGC->ops->FillPolygon = XAAFallbackOps.FillPolygon; - pGC->ops->PolyFillArc = XAAFallbackOps.PolyFillArc; - - switch (pGC->fillStyle) { - case FillSolid: - if (infoRec->FillSpansSolid && - CHECK_PLANEMASK(pGC, infoRec->FillSpansSolidFlags) && - CHECK_ROP(pGC, infoRec->FillSpansSolidFlags) && - CHECK_ROPSRC(pGC, infoRec->FillSpansSolidFlags) && - CHECK_FG(pGC, infoRec->FillSpansSolidFlags) - ) { - pGC->ops->FillSpans = infoRec->FillSpansSolid; - pGC->ops->PolyFillRect = infoRec->PolyFillRectSolid; - pGC->ops->FillPolygon = infoRec->FillPolygonSolid; - pGC->ops->PolyFillArc = infoRec->PolyFillArcSolid; - } - break; - /* The [Stippled/OpaqueStippled/Tiled]FillChooser - functions do the validating */ - case FillStippled: - if (infoRec->FillSpansStippled) { - pGC->ops->FillSpans = infoRec->FillSpansStippled; - pGC->ops->PolyFillRect = infoRec->PolyFillRectStippled; - if (infoRec->FillPolygonStippled) - pGC->ops->FillPolygon = infoRec->FillPolygonStippled; - else - pGC->ops->FillPolygon = miFillPolygon; - pGC->ops->PolyFillArc = miPolyFillArc; - } - break; - case FillOpaqueStippled: - if (infoRec->FillSpansOpaqueStippled) { - pGC->ops->FillSpans = infoRec->FillSpansOpaqueStippled; - pGC->ops->PolyFillRect = infoRec->PolyFillRectOpaqueStippled; - if (infoRec->FillPolygonOpaqueStippled) - pGC->ops->FillPolygon = infoRec->FillPolygonOpaqueStippled; - else - pGC->ops->FillPolygon = miFillPolygon; - pGC->ops->PolyFillArc = miPolyFillArc; - } - break; - case FillTiled: - if (infoRec->FillSpansTiled) { - pGC->ops->FillSpans = infoRec->FillSpansTiled; - pGC->ops->PolyFillRect = infoRec->PolyFillRectTiled; - if (infoRec->FillPolygonTiled) - pGC->ops->FillPolygon = infoRec->FillPolygonTiled; - else - pGC->ops->FillPolygon = miFillPolygon; - pGC->ops->PolyFillArc = miPolyFillArc; - } - break; - default: - return; - } -} - -/* We make the assumption that these Text8/16 and GlyphBlt functions - are linked in a way that they all have the same rop/color/planemask - restrictions. If the driver provides a GC level replacement for - these, it will need to supply a new Validate functions if it breaks - this assumption */ - -void -XAAValidatePolyGlyphBlt(GCPtr pGC, unsigned long changes, DrawablePtr pDraw) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - Bool BigFont = FALSE; - - pGC->ops->PolyText8 = XAAFallbackOps.PolyText8; - pGC->ops->PolyText16 = XAAFallbackOps.PolyText16; - pGC->ops->PolyGlyphBlt = XAAFallbackOps.PolyGlyphBlt; - - if (!pGC->font) - return; - if (pGC->fillStyle != FillSolid) - return; - - if ((FONTMAXBOUNDS(pGC->font, rightSideBearing) - - FONTMINBOUNDS(pGC->font, leftSideBearing) > 32)) - BigFont = TRUE; - - /* no funny business */ - if ((FONTMINBOUNDS(pGC->font, characterWidth) <= 0) || - ((FONTASCENT(pGC->font) + FONTDESCENT(pGC->font)) <= 0)) - return; - - /* Check for TE Fonts */ - if (!TERMINALFONT(pGC->font) || BigFont) { - if (infoRec->PolyGlyphBltNonTE && - CHECK_PLANEMASK(pGC, infoRec->PolyGlyphBltNonTEFlags) && - CHECK_ROP(pGC, infoRec->PolyGlyphBltNonTEFlags) && - CHECK_ROPSRC(pGC, infoRec->PolyGlyphBltNonTEFlags) && - CHECK_FG(pGC, infoRec->PolyGlyphBltNonTEFlags) && - (!(infoRec->PolyGlyphBltNonTEFlags & TRANSPARENCY_GXCOPY_ONLY) || - (pGC->alu == GXcopy)) - ) { - pGC->ops->PolyText8 = infoRec->PolyText8NonTE; - pGC->ops->PolyText16 = infoRec->PolyText16NonTE; - pGC->ops->PolyGlyphBlt = infoRec->PolyGlyphBltNonTE; - } - } - else { - if (infoRec->PolyGlyphBltTE && - CHECK_PLANEMASK(pGC, infoRec->PolyGlyphBltTEFlags) && - CHECK_ROP(pGC, infoRec->PolyGlyphBltTEFlags) && - CHECK_ROPSRC(pGC, infoRec->PolyGlyphBltNonTEFlags) && - CHECK_FG(pGC, infoRec->PolyGlyphBltTEFlags) && - (!(infoRec->PolyGlyphBltTEFlags & TRANSPARENCY_GXCOPY_ONLY) || - (pGC->alu == GXcopy)) - ) { - pGC->ops->PolyText8 = infoRec->PolyText8TE; - pGC->ops->PolyText16 = infoRec->PolyText16TE; - pGC->ops->PolyGlyphBlt = infoRec->PolyGlyphBltTE; - } - } -} - -void -XAAValidateImageGlyphBlt(GCPtr pGC, unsigned long changes, DrawablePtr pDraw) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - Bool BigFont = FALSE; - - pGC->ops->ImageText8 = XAAFallbackOps.ImageText8; - pGC->ops->ImageText16 = XAAFallbackOps.ImageText16; - pGC->ops->ImageGlyphBlt = XAAFallbackOps.ImageGlyphBlt; - - if (!pGC->font) - return; - - if ((FONTMAXBOUNDS(pGC->font, rightSideBearing) - - FONTMINBOUNDS(pGC->font, leftSideBearing) > 32)) - BigFont = TRUE; - - /* no funny business */ - if ((FONTMINBOUNDS(pGC->font, characterWidth) <= 0) || - ((FONTASCENT(pGC->font) + FONTDESCENT(pGC->font)) <= 0)) - return; - - /* Check for TE Fonts */ - if (!TERMINALFONT(pGC->font) || BigFont || (pGC->depth == 32)) { - if (infoRec->ImageGlyphBltNonTE && - CHECK_PLANEMASK(pGC, infoRec->ImageGlyphBltNonTEFlags) && - CHECK_FG(pGC, infoRec->ImageGlyphBltNonTEFlags) && - infoRec->SetupForSolidFill && - CHECK_PLANEMASK(pGC, infoRec->SolidFillFlags) && - CHECK_BG(pGC, infoRec->SolidFillFlags)) { - pGC->ops->ImageText8 = infoRec->ImageText8NonTE; - pGC->ops->ImageText16 = infoRec->ImageText16NonTE; - pGC->ops->ImageGlyphBlt = infoRec->ImageGlyphBltNonTE; - } - } - else if (infoRec->ImageGlyphBltTE && - CHECK_PLANEMASK(pGC, infoRec->ImageGlyphBltTEFlags)) { - if (!(infoRec->ImageGlyphBltTEFlags & TRANSPARENCY_ONLY) && - CHECK_COLORS(pGC, infoRec->ImageGlyphBltTEFlags)) { - pGC->ops->ImageText8 = infoRec->ImageText8TE; - pGC->ops->ImageText16 = infoRec->ImageText16TE; - pGC->ops->ImageGlyphBlt = infoRec->ImageGlyphBltTE; - } - else { - if (CHECK_FG(pGC, infoRec->ImageGlyphBltTEFlags) && - infoRec->SetupForSolidFill && - CHECK_PLANEMASK(pGC, infoRec->SolidFillFlags) && - CHECK_BG(pGC, infoRec->SolidFillFlags)) { - pGC->ops->ImageText8 = infoRec->ImageText8TE; - pGC->ops->ImageText16 = infoRec->ImageText16TE; - pGC->ops->ImageGlyphBlt = infoRec->ImageGlyphBltTE; - } - } - } -} - -void -XAAValidatePolylines(GCPtr pGC, unsigned long changes, DrawablePtr pDraw) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - XAAGCPtr pGCPriv = (XAAGCPtr) dixLookupPrivate(&pGC->devPrivates, - XAAGetGCKey()); - - if (pGC->lineStyle == LineSolid) - changes &= ~GCDashList; - if (!changes) - return; - - pGC->ops->PolySegment = XAAFallbackOps.PolySegment; - pGC->ops->Polylines = XAAFallbackOps.Polylines; - pGC->ops->PolyRectangle = XAAFallbackOps.PolyRectangle; - pGC->ops->PolyArc = XAAFallbackOps.PolyArc; - - if ((pGC->ops->FillSpans != XAAFallbackOps.FillSpans) && - (pGC->lineWidth > 0)) { - - pGC->ops->PolyArc = miPolyArc; - pGC->ops->PolySegment = miPolySegment; - pGC->ops->PolyRectangle = miPolyRectangle; - if (pGC->lineStyle == LineSolid) - pGC->ops->Polylines = miWideLine; - else - pGC->ops->Polylines = miWideDash; - } - - if ((pGC->lineWidth == 0) && (pGC->fillStyle == FillSolid)) { - - if (pGC->lineStyle == LineSolid) { - - if (infoRec->PolyRectangleThinSolid && - CHECK_PLANEMASK(pGC, infoRec->PolyRectangleThinSolidFlags) && - CHECK_ROP(pGC, infoRec->PolyRectangleThinSolidFlags) && - CHECK_ROPSRC(pGC, infoRec->PolyRectangleThinSolidFlags) && - CHECK_FG(pGC, infoRec->PolyRectangleThinSolidFlags)) { - - pGC->ops->PolyRectangle = infoRec->PolyRectangleThinSolid; - } - - if (infoRec->PolySegmentThinSolid && - CHECK_PLANEMASK(pGC, infoRec->PolySegmentThinSolidFlags) && - CHECK_ROP(pGC, infoRec->PolySegmentThinSolidFlags) && - CHECK_ROPSRC(pGC, infoRec->PolySegmentThinSolidFlags) && - CHECK_FG(pGC, infoRec->PolySegmentThinSolidFlags)) { - - pGC->ops->PolySegment = infoRec->PolySegmentThinSolid; - } - - if (infoRec->PolylinesThinSolid && - CHECK_PLANEMASK(pGC, infoRec->PolylinesThinSolidFlags) && - CHECK_ROP(pGC, infoRec->PolylinesThinSolidFlags) && - CHECK_ROPSRC(pGC, infoRec->PolylinesThinSolidFlags) && - CHECK_FG(pGC, infoRec->PolylinesThinSolidFlags)) { - - pGC->ops->Polylines = infoRec->PolylinesThinSolid; - } - } - else if ((pGC->lineStyle == LineOnOffDash) && pGCPriv->DashPattern) { - - if (infoRec->PolySegmentThinDashed && - !(infoRec->PolySegmentThinDashedFlags & NO_TRANSPARENCY) && - ((pGC->alu == GXcopy) || !(infoRec->PolySegmentThinDashedFlags & - TRANSPARENCY_GXCOPY_ONLY)) && - CHECK_PLANEMASK(pGC, infoRec->PolySegmentThinDashedFlags) && - CHECK_ROP(pGC, infoRec->PolySegmentThinDashedFlags) && - CHECK_ROPSRC(pGC, infoRec->PolySegmentThinDashedFlags) && - CHECK_FG(pGC, infoRec->PolySegmentThinDashedFlags)) { - - pGC->ops->PolySegment = infoRec->PolySegmentThinDashed; - } - - if (infoRec->PolylinesThinDashed && - !(infoRec->PolylinesThinDashedFlags & NO_TRANSPARENCY) && - ((pGC->alu == GXcopy) || !(infoRec->PolylinesThinDashedFlags & - TRANSPARENCY_GXCOPY_ONLY)) && - CHECK_PLANEMASK(pGC, infoRec->PolylinesThinDashedFlags) && - CHECK_ROP(pGC, infoRec->PolylinesThinDashedFlags) && - CHECK_ROPSRC(pGC, infoRec->PolylinesThinDashedFlags) && - CHECK_FG(pGC, infoRec->PolylinesThinDashedFlags)) { - - pGC->ops->Polylines = infoRec->PolylinesThinDashed; - } - - if (pGC->ops->Polylines != XAAFallbackOps.Polylines) - pGC->ops->PolyRectangle = miPolyRectangle; - - } - else if (pGCPriv->DashPattern && (pGC->depth != 32)) { - /* LineDoubleDash */ - if (infoRec->PolySegmentThinDashed && - !(infoRec->PolySegmentThinDashedFlags & TRANSPARENCY_ONLY) && - CHECK_PLANEMASK(pGC, infoRec->PolySegmentThinDashedFlags) && - CHECK_ROP(pGC, infoRec->PolySegmentThinDashedFlags) && - CHECK_ROPSRC(pGC, infoRec->PolySegmentThinDashedFlags) && - CHECK_COLORS(pGC, infoRec->PolySegmentThinDashedFlags)) { - - pGC->ops->PolySegment = infoRec->PolySegmentThinDashed; - } - - if (infoRec->PolylinesThinDashed && - !(infoRec->PolylinesThinDashedFlags & TRANSPARENCY_ONLY) && - CHECK_PLANEMASK(pGC, infoRec->PolylinesThinDashedFlags) && - CHECK_ROP(pGC, infoRec->PolylinesThinDashedFlags) && - CHECK_ROPSRC(pGC, infoRec->PolylinesThinDashedFlags) && - CHECK_COLORS(pGC, infoRec->PolylinesThinDashedFlags)) { - - pGC->ops->Polylines = infoRec->PolylinesThinDashed; - } - - if (pGC->ops->Polylines != XAAFallbackOps.Polylines) - pGC->ops->PolyRectangle = miPolyRectangle; - - } - } - - if (infoRec->PolylinesWideSolid && - (pGC->lineWidth > 0) && - (pGC->fillStyle == FillSolid) && - (pGC->lineStyle == LineSolid) && - CHECK_PLANEMASK(pGC, infoRec->PolylinesWideSolidFlags) && - CHECK_ROP(pGC, infoRec->PolylinesWideSolidFlags) && - CHECK_ROPSRC(pGC, infoRec->PolylinesWideSolidFlags) && - CHECK_FG(pGC, infoRec->PolylinesWideSolidFlags)) { - - pGC->ops->Polylines = infoRec->PolylinesWideSolid; - } -} diff --git a/xserver/hw/xfree86/xaa/xaaImage.c b/xserver/hw/xfree86/xaa/xaaImage.c deleted file mode 100644 index 4457c9efa..000000000 --- a/xserver/hw/xfree86/xaa/xaaImage.c +++ /dev/null @@ -1,534 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" -#include "servermd.h" - -#include -#include "scrnintstr.h" -#include "mi.h" -#include "pixmapstr.h" -#include "xf86str.h" -#include "xaa.h" -#include "xaalocal.h" - -void -XAAMoveDWORDS_FixedBase(register CARD32 *dest, - register CARD32 *src, register int dwords) -{ - while (dwords & ~0x03) { - *dest = *src; - *dest = *(src + 1); - *dest = *(src + 2); - *dest = *(src + 3); - dwords -= 4; - src += 4; - } - - if (!dwords) - return; - *dest = *src; - if (dwords == 1) - return; - *dest = *(src + 1); - if (dwords == 2) - return; - *dest = *(src + 2); -} - -void -XAAMoveDWORDS(register CARD32 *dest, register CARD32 *src, register int dwords) -{ - while (dwords & ~0x03) { - *dest = *src; - *(dest + 1) = *(src + 1); - *(dest + 2) = *(src + 2); - *(dest + 3) = *(src + 3); - src += 4; - dest += 4; - dwords -= 4; - } - if (!dwords) - return; - *dest = *src; - if (dwords == 1) - return; - *(dest + 1) = *(src + 1); - if (dwords == 2) - return; - *(dest + 2) = *(src + 2); -} - -void -XAAMoveDWORDS_FixedSrc(register CARD32 *dest, - register CARD32 *src, register int dwords) -{ - while (dwords & ~0x03) { - *dest = *src; - *(dest + 1) = *src; - *(dest + 2) = *src; - *(dest + 3) = *src; - dest += 4; - dwords -= 4; - } - if (!dwords) - return; - *dest = *src; - if (dwords == 1) - return; - *(dest + 1) = *src; - if (dwords == 2) - return; - *(dest + 2) = *src; -} - -static void -XAAWritePixmap32To24(ScrnInfoPtr pScrn, int x, int y, int w, int h, unsigned char *srcInit, int srcwidth, /* bytes */ - int rop, unsigned int planemask, int trans) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - int count, dwords = bytes_to_int32(w * 3); - CARD32 *src, *dst; - Bool PlusOne = FALSE; - - if ((infoRec->ImageWriteFlags & CPU_TRANSFER_PAD_QWORD) && - ((dwords * h) & 0x01)) { - PlusOne = TRUE; - } - - (*infoRec->SetupForImageWrite) (pScrn, rop, planemask, trans, 24, 24); - (*infoRec->SubsequentImageWriteRect) (pScrn, x, y, w, h, 0); - - if (dwords > infoRec->ImageWriteRange) { - dst = (CARD32 *) infoRec->ImageWriteBase; - while (h--) { - src = (CARD32 *) srcInit; - count = w; - - while (count >= 4) { - *dst = (src[0] & 0x00ffffff) | (src[1] << 24); - *dst = ((src[1] >> 8) & 0x0000ffff) | (src[2] << 16); - *dst = ((src[2] >> 16) & 0x000000ff) | (src[3] << 8); - src += 4; - count -= 4; - } - switch (count) { - case 0: - break; - case 1: - *dst = src[0]; - break; - case 2: - *dst = (src[0] & 0x00ffffff) | (src[1] << 24); - *dst = src[1] >> 8; - break; - default: - *dst = (src[0] & 0x00ffffff) | (src[1] << 24); - *dst = ((src[1] >> 8) & 0x0000ffff) | (src[2] << 16); - *dst = src[2] >> 16; - break; - } - srcInit += srcwidth; - } - } - else { - while (h--) { - dst = (CARD32 *) infoRec->ImageWriteBase; - src = (CARD32 *) srcInit; - count = w; - - while (count >= 4) { - dst[0] = (src[0] & 0x00ffffff) | (src[1] << 24); - dst[1] = ((src[1] >> 8) & 0x0000ffff) | (src[2] << 16); - dst[2] = ((src[2] >> 16) & 0x000000ff) | (src[3] << 8); - dst += 3; - src += 4; - count -= 4; - } - switch (count) { - case 0: - break; - case 1: - dst[0] = src[0]; - break; - case 2: - dst[0] = (src[0] & 0x00ffffff) | (src[1] << 24); - dst[1] = src[1] >> 8; - break; - default: - dst[0] = (src[0] & 0x00ffffff) | (src[1] << 24); - dst[1] = ((src[1] >> 8) & 0x0000ffff) | (src[2] << 16); - dst[2] = src[2] >> 16; - break; - } - srcInit += srcwidth; - } - } - - if (PlusOne) { - CARD32 *base = (CARD32 *) infoRec->ImageWriteBase; - - *base = 0x00000000; - } - - if (infoRec->ImageWriteFlags & SYNC_AFTER_IMAGE_WRITE) - (*infoRec->Sync) (pScrn); - else - SET_SYNC_FLAG(infoRec); - -} - -void -XAAWritePixmap(ScrnInfoPtr pScrn, int x, int y, int w, int h, unsigned char *src, int srcwidth, /* bytes */ - int rop, unsigned int planemask, int trans, int bpp, int depth) -{ - XAAInfoRecPtr infoRec; - int dwords, skipleft, Bpp; - Bool beCareful, PlusOne; - - if ((bpp == 32) && (pScrn->bitsPerPixel == 24)) { - XAAWritePixmap32To24(pScrn, x, y, w, h, src, srcwidth, - rop, planemask, trans); - return; - } - - infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - beCareful = PlusOne = FALSE; - Bpp = bpp >> 3; - - if ((skipleft = (long) src & 0x03L)) { - if (!(infoRec->ImageWriteFlags & LEFT_EDGE_CLIPPING)) { - skipleft = 0; - beCareful = TRUE; - goto BAD_ALIGNMENT; - } - - if (Bpp == 3) - skipleft = 4 - skipleft; - else - skipleft /= Bpp; - - if ((x < skipleft) && !(infoRec->ImageWriteFlags & - LEFT_EDGE_CLIPPING_NEGATIVE_X)) { - skipleft = 0; - beCareful = TRUE; - goto BAD_ALIGNMENT; - } - - x -= skipleft; - w += skipleft; - - if (Bpp == 3) - src -= 3 * skipleft; - else /* is this Alpha friendly ? */ - src = (unsigned char *) ((long) src & ~0x03L); - } - - BAD_ALIGNMENT: - - dwords = bytes_to_int32(w * Bpp); - - if ((infoRec->ImageWriteFlags & CPU_TRANSFER_PAD_QWORD) && - ((dwords * h) & 0x01)) { - PlusOne = TRUE; - } - - (*infoRec->SetupForImageWrite) (pScrn, rop, planemask, trans, bpp, depth); - (*infoRec->SubsequentImageWriteRect) (pScrn, x, y, w, h, skipleft); - - if (beCareful) { - /* in cases with bad alignment we have to be careful not - to read beyond the end of the source */ - if (((x * Bpp) + (dwords << 2)) > srcwidth) - h--; - else - beCareful = FALSE; - } - - if (dwords > infoRec->ImageWriteRange) { - while (h--) { - XAAMoveDWORDS_FixedBase((CARD32 *) infoRec->ImageWriteBase, - (CARD32 *) src, dwords); - src += srcwidth; - } - if (beCareful) { - int shift = ((long) src & 0x03L) << 3; - - if (--dwords) - XAAMoveDWORDS_FixedBase((CARD32 *) infoRec->ImageWriteBase, - (CARD32 *) src, dwords); - src = (unsigned char *) ((long) (src + (dwords << 2)) & ~0x03L); - *((CARD32 *) infoRec->ImageWriteBase) = *((CARD32 *) src) >> shift; - } - } - else { - if (srcwidth == (dwords << 2)) { - int decrement = infoRec->ImageWriteRange / dwords; - - while (h > decrement) { - XAAMoveDWORDS((CARD32 *) infoRec->ImageWriteBase, - (CARD32 *) src, dwords * decrement); - src += (srcwidth * decrement); - h -= decrement; - } - if (h) { - XAAMoveDWORDS((CARD32 *) infoRec->ImageWriteBase, - (CARD32 *) src, dwords * h); - if (beCareful) - src += (srcwidth * h); - } - } - else { - while (h--) { - XAAMoveDWORDS((CARD32 *) infoRec->ImageWriteBase, - (CARD32 *) src, dwords); - src += srcwidth; - } - } - - if (beCareful) { - int shift = ((long) src & 0x03L) << 3; - - if (--dwords) - XAAMoveDWORDS((CARD32 *) infoRec->ImageWriteBase, - (CARD32 *) src, dwords); - src = (unsigned char *) ((long) (src + (dwords << 2)) & ~0x03L); - - ((CARD32 *) infoRec->ImageWriteBase)[dwords] = - *((CARD32 *) src) >> shift; - } - } - - if (PlusOne) { - CARD32 *base = (CARD32 *) infoRec->ImageWriteBase; - - *base = 0x00000000; - } - - if (infoRec->ImageWriteFlags & SYNC_AFTER_IMAGE_WRITE) - (*infoRec->Sync) (pScrn); - else - SET_SYNC_FLAG(infoRec); -} - -void -XAAWritePixmapScanline(ScrnInfoPtr pScrn, int x, int y, int w, int h, unsigned char *src, int srcwidth, /* bytes */ - int rop, - unsigned int planemask, int trans, int bpp, int depth) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - int dwords, skipleft, bufferNo = 0, Bpp = bpp >> 3; - Bool beCareful = FALSE; - CARD32 *base; - - if ((skipleft = (long) src & 0x03L)) { - if (!(infoRec->ScanlineImageWriteFlags & LEFT_EDGE_CLIPPING)) { - skipleft = 0; - beCareful = TRUE; - goto BAD_ALIGNMENT; - } - - if (Bpp == 3) - skipleft = 4 - skipleft; - else - skipleft /= Bpp; - - if ((x < skipleft) && !(infoRec->ScanlineImageWriteFlags & - LEFT_EDGE_CLIPPING_NEGATIVE_X)) { - skipleft = 0; - beCareful = TRUE; - goto BAD_ALIGNMENT; - } - - x -= skipleft; - w += skipleft; - - if (Bpp == 3) - src -= 3 * skipleft; - else - src = (unsigned char *) ((long) src & ~0x03L); - } - - BAD_ALIGNMENT: - - dwords = bytes_to_int32(w * Bpp); - - (*infoRec->SetupForScanlineImageWrite) (pScrn, rop, planemask, trans, bpp, - depth); - (*infoRec->SubsequentScanlineImageWriteRect) (pScrn, x, y, w, h, skipleft); - - if (beCareful) { - /* in cases with bad alignment we have to be careful not - to read beyond the end of the source */ - if (((x * Bpp) + (dwords << 2)) > srcwidth) - h--; - else - beCareful = FALSE; - } - - while (h--) { - base = (CARD32 *) infoRec->ScanlineImageWriteBuffers[bufferNo]; - XAAMoveDWORDS(base, (CARD32 *) src, dwords); - (*infoRec->SubsequentImageWriteScanline) (pScrn, bufferNo++); - src += srcwidth; - if (bufferNo >= infoRec->NumScanlineImageWriteBuffers) - bufferNo = 0; - } - - if (beCareful) { - int shift = ((long) src & 0x03L) << 3; - - base = (CARD32 *) infoRec->ScanlineImageWriteBuffers[bufferNo]; - if (--dwords) - XAAMoveDWORDS(base, (CARD32 *) src, dwords); - src = (unsigned char *) ((long) (src + (dwords << 2)) & ~0x03L); - - base[dwords] = *((CARD32 *) src) >> shift; - (*infoRec->SubsequentImageWriteScanline) (pScrn, bufferNo); - } - - SET_SYNC_FLAG(infoRec); -} - -void -XAAPutImage(DrawablePtr pDraw, - GCPtr pGC, - int depth, - int x, int y, int w, int h, int leftPad, int format, char *pImage) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - int bpp = BitsPerPixel(depth); - Bool depthBug = FALSE; - - if (!w || !h) - return; - - if (!RegionNumRects(pGC->pCompositeClip)) - return; - - depthBug = XAA_DEPTH_BUG(pGC); - - if (((format == ZPixmap) && infoRec->WritePixmap && - ((pDraw->bitsPerPixel == bpp) || - ((pDraw->bitsPerPixel == 24) && (bpp == 32) && - (infoRec->WritePixmapFlags & CONVERT_32BPP_TO_24BPP))) && - CHECK_ROP(pGC, infoRec->WritePixmapFlags) && - CHECK_ROPSRC(pGC, infoRec->WritePixmapFlags) && - CHECK_PLANEMASK(pGC, infoRec->WritePixmapFlags) && - CHECK_NO_GXCOPY(pGC, infoRec->WritePixmapFlags)) || - ((format == XYBitmap) && !depthBug && infoRec->WriteBitmap && - CHECK_ROP(pGC, infoRec->WriteBitmapFlags) && - CHECK_ROPSRC(pGC, infoRec->WriteBitmapFlags) && - CHECK_PLANEMASK(pGC, infoRec->WriteBitmapFlags) && - CHECK_COLORS(pGC, infoRec->WriteBitmapFlags) && - !(infoRec->WriteBitmapFlags & TRANSPARENCY_ONLY)) || - ((format == XYPixmap) && !depthBug && infoRec->WriteBitmap && - CHECK_ROP(pGC, infoRec->WriteBitmapFlags) && - CHECK_ROPSRC(pGC, infoRec->WriteBitmapFlags) && - !(infoRec->WriteBitmapFlags & NO_PLANEMASK) && - !(infoRec->WriteBitmapFlags & TRANSPARENCY_ONLY))) { - - int MaxBoxes = RegionNumRects(pGC->pCompositeClip); - BoxPtr pbox, pClipBoxes; - int nboxes, srcx, srcy, srcwidth; - xRectangle TheRect; - - TheRect.x = pDraw->x + x; - TheRect.y = pDraw->y + y; - TheRect.width = w; - TheRect.height = h; - - if (MaxBoxes > (infoRec->PreAllocSize / sizeof(BoxRec))) { - pClipBoxes = malloc(MaxBoxes * sizeof(BoxRec)); - if (!pClipBoxes) - return; - } - else - pClipBoxes = (BoxPtr) infoRec->PreAllocMem; - - nboxes = XAAGetRectClipBoxes(pGC, pClipBoxes, 1, &TheRect); - pbox = pClipBoxes; - - if (format == XYBitmap) { - srcwidth = BitmapBytePad(leftPad + w); - while (nboxes--) { - srcx = pbox->x1 - TheRect.x + leftPad; - srcy = pbox->y1 - TheRect.y; - (*infoRec->WriteBitmap) (infoRec->pScrn, pbox->x1, pbox->y1, - pbox->x2 - pbox->x1, - pbox->y2 - pbox->y1, - (unsigned char *) pImage + - (srcwidth * srcy) + ((srcx >> 5) << 2), - srcwidth, srcx & 31, pGC->fgPixel, - pGC->bgPixel, pGC->alu, - pGC->planemask); - pbox++; - } - } - else if (format == ZPixmap) { - int Bpp = bpp >> 3; - - srcwidth = PixmapBytePad(leftPad + w, depth); - while (nboxes--) { - srcx = pbox->x1 - TheRect.x + leftPad; - srcy = pbox->y1 - TheRect.y; - (*infoRec->WritePixmap) (infoRec->pScrn, pbox->x1, pbox->y1, - pbox->x2 - pbox->x1, - pbox->y2 - pbox->y1, - (unsigned char *) pImage + - (srcwidth * srcy) + (srcx * Bpp), - srcwidth, pGC->alu, pGC->planemask, -1, - Bpp << 3, depth); - pbox++; - } - } - else { /* XYPixmap */ - int depth = pGC->depth; - int numBox, increment; - unsigned long i, mask; - BoxPtr pntBox; - - srcwidth = BitmapBytePad(w + leftPad); - increment = h * srcwidth; - i = 1 << (depth - 1); - mask = ~0; - - if ((infoRec->pScrn->overlayFlags & OVERLAY_8_32_PLANAR) && - (pGC->depth == 8)) { - i = 0x80000000; - mask = 0xff000000; - } - - for (; i & mask; i >>= 1, pImage += increment) { - if (i & pGC->planemask) { - pntBox = pbox; - numBox = nboxes; - while (numBox--) { - srcx = pntBox->x1 - TheRect.x + leftPad; - srcy = pntBox->y1 - TheRect.y; - (*infoRec->WriteBitmap) (infoRec->pScrn, - pntBox->x1, pntBox->y1, - pntBox->x2 - pntBox->x1, - pntBox->y2 - pntBox->y1, - (unsigned char *) pImage + - (srcwidth * srcy) + - ((srcx >> 5) << 2), srcwidth, - srcx & 31, ~0, 0, pGC->alu, i); - pntBox++; - } - } - } - - } - - if (pClipBoxes != (BoxPtr) infoRec->PreAllocMem) - free(pClipBoxes); - } - else - XAAFallbackOps.PutImage(pDraw, pGC, depth, x, y, w, h, leftPad, - format, pImage); -} diff --git a/xserver/hw/xfree86/xaa/xaaInit.c b/xserver/hw/xfree86/xaa/xaaInit.c deleted file mode 100644 index 661fa90ab..000000000 --- a/xserver/hw/xfree86/xaa/xaaInit.c +++ /dev/null @@ -1,637 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" - -#include -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "windowstr.h" -#include "xf86str.h" -#include "mi.h" -#include "miline.h" -#include "xaa.h" -#include "xaalocal.h" -#include "xaawrap.h" -#include "xf86fbman.h" -#include "servermd.h" -#ifdef COMPOSITE -#include "cw.h" -#endif - -#define MAX_PREALLOC_MEM 65536 /* MUST be >= 1024 */ - -#define MIN_OFFPIX_SIZE (320*200) - -static Bool XAACloseScreen(int i, ScreenPtr pScreen); -static void XAAGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h, - unsigned int format, unsigned long planemask, - char *pdstLine); -static void XAAGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, - int *pwidth, int nspans, char *pdstStart); -static PixmapPtr XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, - unsigned usage_hint); -static Bool XAADestroyPixmap(PixmapPtr pPixmap); -static Bool XAAEnterVT(int index, int flags); -static void XAALeaveVT(int index, int flags); -static int XAASetDGAMode(int index, int num, DGADevicePtr devRet); -static void XAAEnableDisableFBAccess(int index, Bool enable); -static Bool XAAChangeWindowAttributes(WindowPtr pWin, unsigned long mask); - -static DevPrivateKeyRec XAAScreenKeyRec; - -#define XAAScreenKey (&XAAScreenKeyRec) -static DevPrivateKeyRec XAAGCKeyRec; - -#define XAAGCKey (&XAAGCKeyRec) -static DevPrivateKeyRec XAAPixmapKeyRec; - -#define XAAPixmapKey (&XAAPixmapKeyRec) - -DevPrivateKey -XAAGetScreenKey(void) -{ - return XAAScreenKey; -} - -DevPrivateKey -XAAGetGCKey(void) -{ - return XAAGCKey; -} - -DevPrivateKey -XAAGetPixmapKey(void) -{ - return XAAPixmapKey; -} - -/* temp kludge */ -static Bool SwitchedOut = FALSE; - -XAAInfoRecPtr -XAACreateInfoRec(void) -{ - XAAInfoRecPtr infoRec; - - infoRec = calloc(1, sizeof(XAAInfoRec)); - if (infoRec) - infoRec->CachePixelGranularity = -1; - - return infoRec; -} - -void -XAADestroyInfoRec(XAAInfoRecPtr infoRec) -{ - if (!infoRec) - return; - - if (infoRec->ClosePixmapCache) - (*infoRec->ClosePixmapCache) (infoRec->pScrn->pScreen); - - free(infoRec->PreAllocMem); - - free(infoRec->PixmapCachePrivate); - - free(infoRec); -} - -Bool -XAAInit(ScreenPtr pScreen, XAAInfoRecPtr infoRec) -{ - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - XAAScreenPtr pScreenPriv; - int i; - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); - - /* Return successfully if no acceleration wanted */ - if (!infoRec) - return TRUE; - - if (!dixRegisterPrivateKey(&XAAGCKeyRec, PRIVATE_GC, sizeof(XAAGCRec))) - return FALSE; - - if (!dixRegisterPrivateKey - (&XAAPixmapKeyRec, PRIVATE_PIXMAP, sizeof(XAAPixmapRec))) - return FALSE; - - if (!dixRegisterPrivateKey(&XAAScreenKeyRec, PRIVATE_SCREEN, 0)) - return FALSE; - - if (!(pScreenPriv = malloc(sizeof(XAAScreenRec)))) - return FALSE; - - dixSetPrivate(&pScreen->devPrivates, XAAScreenKey, pScreenPriv); - - if (!xf86FBManagerRunning(pScreen)) - infoRec->Flags &= ~(PIXMAP_CACHE | OFFSCREEN_PIXMAPS); - if (!(infoRec->Flags & LINEAR_FRAMEBUFFER)) - infoRec->Flags &= ~OFFSCREEN_PIXMAPS; - - if (!infoRec->FullPlanemask) { /* for backwards compatibility */ - infoRec->FullPlanemask = (1 << pScrn->depth) - 1; - infoRec->FullPlanemasks[pScrn->depth - 1] = infoRec->FullPlanemask; - } - - for (i = 0; i < 32; i++) { - if (!infoRec->FullPlanemasks[i]) /* keep any set by caller */ - infoRec->FullPlanemasks[i] = (1 << (i + 1)) - 1; - } - - if (!XAAInitAccel(pScreen, infoRec)) - return FALSE; - pScreenPriv->AccelInfoRec = infoRec; - infoRec->ScratchGC.pScreen = pScreen; - - if (!infoRec->GetImage) - infoRec->GetImage = XAAGetImage; - if (!infoRec->GetSpans) - infoRec->GetSpans = XAAGetSpans; - if (!infoRec->CopyWindow) - infoRec->CopyWindow = XAACopyWindow; - - pScreenPriv->CreateGC = pScreen->CreateGC; - pScreen->CreateGC = XAACreateGC; - pScreenPriv->CloseScreen = pScreen->CloseScreen; - pScreen->CloseScreen = XAACloseScreen; - pScreenPriv->GetImage = pScreen->GetImage; - pScreen->GetImage = infoRec->GetImage; - pScreenPriv->GetSpans = pScreen->GetSpans; - pScreen->GetSpans = infoRec->GetSpans; - pScreenPriv->CopyWindow = pScreen->CopyWindow; - pScreen->CopyWindow = infoRec->CopyWindow; - pScreenPriv->CreatePixmap = pScreen->CreatePixmap; - pScreen->CreatePixmap = XAACreatePixmap; - pScreenPriv->DestroyPixmap = pScreen->DestroyPixmap; - pScreen->DestroyPixmap = XAADestroyPixmap; - pScreenPriv->ChangeWindowAttributes = pScreen->ChangeWindowAttributes; - pScreen->ChangeWindowAttributes = XAAChangeWindowAttributes; - - pScreenPriv->EnterVT = pScrn->EnterVT; - pScrn->EnterVT = XAAEnterVT; - pScreenPriv->LeaveVT = pScrn->LeaveVT; - pScrn->LeaveVT = XAALeaveVT; - pScreenPriv->SetDGAMode = pScrn->SetDGAMode; - pScrn->SetDGAMode = XAASetDGAMode; - pScreenPriv->EnableDisableFBAccess = pScrn->EnableDisableFBAccess; - pScrn->EnableDisableFBAccess = XAAEnableDisableFBAccess; - - pScreenPriv->WindowExposures = pScreen->WindowExposures; - if (ps) { - pScreenPriv->Composite = ps->Composite; - ps->Composite = XAAComposite; - pScreenPriv->Glyphs = ps->Glyphs; - ps->Glyphs = XAAGlyphs; - } - if (pScrn->overlayFlags & OVERLAY_8_32_PLANAR) - XAASetupOverlay8_32Planar(pScreen); - - infoRec->PreAllocMem = malloc(MAX_PREALLOC_MEM); - if (infoRec->PreAllocMem) - infoRec->PreAllocSize = MAX_PREALLOC_MEM; - - if (infoRec->Flags & PIXMAP_CACHE) - xf86RegisterFreeBoxCallback(pScreen, infoRec->InitPixmapCache, - (pointer) infoRec); - - if (infoRec->Flags & MICROSOFT_ZERO_LINE_BIAS) - miSetZeroLineBias(pScreen, OCTANT1 | OCTANT2 | OCTANT3 | OCTANT4); - -#ifdef COMPOSITE - /* Initialize the composite wrapper. This needs to happen after the - * wrapping above (so it comes before us), but before all other extensions, - * so it doesn't confuse them. (particularly damage). - */ - miInitializeCompositeWrapper(pScreen); -#endif - - return TRUE; -} - -static Bool -XAACloseScreen(int i, ScreenPtr pScreen) -{ - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - XAAScreenPtr pScreenPriv = - (XAAScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XAAScreenKey); - - pScrn->EnterVT = pScreenPriv->EnterVT; - pScrn->LeaveVT = pScreenPriv->LeaveVT; - pScrn->EnableDisableFBAccess = pScreenPriv->EnableDisableFBAccess; - - pScreen->CreateGC = pScreenPriv->CreateGC; - pScreen->CloseScreen = pScreenPriv->CloseScreen; - pScreen->GetImage = pScreenPriv->GetImage; - pScreen->GetSpans = pScreenPriv->GetSpans; - pScreen->CopyWindow = pScreenPriv->CopyWindow; - pScreen->WindowExposures = pScreenPriv->WindowExposures; - pScreen->CreatePixmap = pScreenPriv->CreatePixmap; - pScreen->DestroyPixmap = pScreenPriv->DestroyPixmap; - pScreen->ChangeWindowAttributes = pScreenPriv->ChangeWindowAttributes; - - /* We leave it up to the client to free the XAAInfoRec */ - - free((pointer) pScreenPriv); - - return (*pScreen->CloseScreen) (i, pScreen); -} - -static void -XAAGetImage(DrawablePtr pDraw, - int sx, int sy, int w, int h, - unsigned int format, unsigned long planemask, char *pdstLine) -{ - ScreenPtr pScreen = pDraw->pScreen; - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); - ScrnInfoPtr pScrn = infoRec->pScrn; - - if (pScrn->vtSema && - ((pDraw->type == DRAWABLE_WINDOW) || IS_OFFSCREEN_PIXMAP(pDraw))) { - if (infoRec->ReadPixmap && (format == ZPixmap) && - ((planemask & infoRec->FullPlanemasks[pDraw->depth - 1]) == - infoRec->FullPlanemasks[pDraw->depth - 1]) && - (pDraw->bitsPerPixel == BitsPerPixel(pDraw->depth))) { - (*infoRec->ReadPixmap) (pScrn, - sx + pDraw->x, sy + pDraw->y, w, h, - (unsigned char *) pdstLine, - PixmapBytePad(w, pDraw->depth), - pDraw->bitsPerPixel, pDraw->depth); - return; - } - SYNC_CHECK(pDraw); - } - - XAA_SCREEN_PROLOGUE(pScreen, GetImage); - (*pScreen->GetImage) (pDraw, sx, sy, w, h, format, planemask, pdstLine); - XAA_SCREEN_EPILOGUE(pScreen, GetImage, XAAGetImage); -} - -static void -XAAGetSpans(DrawablePtr pDraw, - int wMax, DDXPointPtr ppt, int *pwidth, int nspans, char *pdstStart) -{ - ScreenPtr pScreen = pDraw->pScreen; - - XAA_SCREEN_PROLOGUE(pScreen, GetSpans); - if (xf86Screens[pScreen->myNum]->vtSema && - ((pDraw->type == DRAWABLE_WINDOW) || IS_OFFSCREEN_PIXMAP(pDraw))) { - SYNC_CHECK(pDraw); - } - (*pScreen->GetSpans) (pDraw, wMax, ppt, pwidth, nspans, pdstStart); - XAA_SCREEN_EPILOGUE(pScreen, GetSpans, XAAGetSpans); -} - -static int -XAAPixmapBPP(ScreenPtr pScreen, int depth) -{ - PixmapPtr pPix; - int bpp; - DestroyPixmapProcPtr destroyPixmap; - - XAA_SCREEN_PROLOGUE(pScreen, CreatePixmap); - pPix = (*pScreen->CreatePixmap) (pScreen, 1, 1, depth, - CREATE_PIXMAP_USAGE_SCRATCH); - XAA_SCREEN_EPILOGUE(pScreen, CreatePixmap, XAACreatePixmap); - if (!pPix) - return 0; - bpp = pPix->drawable.bitsPerPixel; - destroyPixmap = pScreen->DestroyPixmap; - XAA_SCREEN_PROLOGUE(pScreen, DestroyPixmap); - (*pScreen->DestroyPixmap) (pPix); - XAA_SCREEN_EPILOGUE(pScreen, DestroyPixmap, destroyPixmap); - return bpp; -} - -static void -XAAInitializeOffscreenDepths(ScreenPtr pScreen) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - int d, dep; - - infoRec->offscreenDepthsInitialized = TRUE; - infoRec->offscreenDepths = 0; - if (infoRec->Flags & OFFSCREEN_PIXMAPS) { - for (d = 0; d < pScreen->numDepths; d++) { - dep = pScreen->allowedDepths[d].depth; - if (XAAPixmapBPP(pScreen, dep) == pScrn->bitsPerPixel) - infoRec->offscreenDepths |= (1 << (dep - 1)); - } - } -} - -static PixmapPtr -XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - XAAPixmapPtr pPriv; - PixmapPtr pPix = NULL; - int size = w * h; - - if (w > 32767 || h > 32767) - return NullPixmap; - - if (!infoRec->offscreenDepthsInitialized) - XAAInitializeOffscreenDepths(pScreen); - - if (pScrn->vtSema && - (usage_hint != CREATE_PIXMAP_USAGE_GLYPH_PICTURE) && - (infoRec->offscreenDepths & (1 << (depth - 1))) && - (size >= MIN_OFFPIX_SIZE) && !SwitchedOut && - (!infoRec->maxOffPixWidth || (w <= infoRec->maxOffPixWidth)) && - (!infoRec->maxOffPixHeight || (h <= infoRec->maxOffPixHeight))) { - PixmapLinkPtr pLink; - PixmapPtr pScreenPix; - FBAreaPtr area; - int gran = 0; - - switch (pScrn->bitsPerPixel) { - case 24: - case 8: - gran = 4; - break; - case 16: - gran = 2; - break; - case 32: - gran = 1; - break; - default: - break; - } - - if (BITMAP_SCANLINE_PAD == 64) - gran *= 2; - - if (!(area = xf86AllocateOffscreenArea(pScreen, w, h, gran, 0, - XAARemoveAreaCallback, NULL))) { - goto BAILOUT; - } - - if (!(pLink = malloc(sizeof(PixmapLink)))) { - xf86FreeOffscreenArea(area); - goto BAILOUT; - } - - XAA_SCREEN_PROLOGUE(pScreen, CreatePixmap); - pPix = (*pScreen->CreatePixmap) (pScreen, 0, 0, depth, usage_hint); - XAA_SCREEN_EPILOGUE(pScreen, CreatePixmap, XAACreatePixmap); - - if (!pPix) { - free(pLink); - xf86FreeOffscreenArea(area); - goto BAILOUT; - } - - pScreenPix = (*pScreen->GetScreenPixmap) (pScreen); - - pPriv = XAA_GET_PIXMAP_PRIVATE(pPix); - pPix->drawable.x = area->box.x1; - pPix->drawable.y = area->box.y1; - pPix->drawable.width = w; - pPix->drawable.height = h; - pPix->drawable.bitsPerPixel = pScrn->bitsPerPixel; - pPix->devKind = pScreenPix->devKind; - pPix->devPrivate.ptr = pScreenPix->devPrivate.ptr; - area->devPrivate.ptr = pPix; - - pPriv->flags = OFFSCREEN; - pPriv->offscreenArea = area; - pPriv->freeData = FALSE; - - pLink->next = infoRec->OffscreenPixmaps; - pLink->pPix = pPix; - infoRec->OffscreenPixmaps = pLink; - return pPix; - } - BAILOUT: - XAA_SCREEN_PROLOGUE(pScreen, CreatePixmap); - pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, usage_hint); - XAA_SCREEN_EPILOGUE(pScreen, CreatePixmap, XAACreatePixmap); - - if (pPix) { - pPriv = XAA_GET_PIXMAP_PRIVATE(pPix); - pPriv->flags = 0; - pPriv->offscreenArea = NULL; - pPriv->freeData = FALSE; - if (!w || !h) /* either scratch or shared memory */ - pPriv->flags |= SHARED_PIXMAP; - } - - return pPix; -} - -static Bool -XAADestroyPixmap(PixmapPtr pPix) -{ - ScreenPtr pScreen = pPix->drawable.pScreen; - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); - XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPix); - Bool ret; - - if (pPix->refcnt == 1) { - if (pPriv->flags & OFFSCREEN) { - if (pPriv->flags & DGA_PIXMAP) - free(pPriv->offscreenArea); - else { - FBAreaPtr area = pPriv->offscreenArea; - PixmapLinkPtr pLink = infoRec->OffscreenPixmaps; - PixmapLinkPtr prev = NULL; - - while (pLink->pPix != pPix) { - prev = pLink; - pLink = pLink->next; - } - - if (prev) - prev->next = pLink->next; - else - infoRec->OffscreenPixmaps = pLink->next; - - if (!area) - area = pLink->area; - - xf86FreeOffscreenArea(area); - pPriv->offscreenArea = NULL; - free(pLink); - } - } - - if (pPriv->freeData) { /* pixmaps that were once in video ram */ - free(pPix->devPrivate.ptr); - pPix->devPrivate.ptr = NULL; - } - } - - XAA_SCREEN_PROLOGUE(pScreen, DestroyPixmap); - ret = (*pScreen->DestroyPixmap) (pPix); - XAA_SCREEN_EPILOGUE(pScreen, DestroyPixmap, XAADestroyPixmap); - - return ret; -} - -static Bool -XAAChangeWindowAttributes(WindowPtr pWin, unsigned long mask) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - Bool ret; - - XAA_SCREEN_PROLOGUE(pScreen, ChangeWindowAttributes); - ret = (*pScreen->ChangeWindowAttributes) (pWin, mask); - XAA_SCREEN_EPILOGUE(pScreen, ChangeWindowAttributes, - XAAChangeWindowAttributes); - - /* we have to assume that shared memory pixmaps are dirty - because we can't wrap operations on them */ - - if ((mask & CWBackPixmap) && (pWin->backgroundState == BackgroundPixmap) && - PIXMAP_IS_SHARED(pWin->background.pixmap)) { - XAAPixmapPtr pPixPriv = XAA_GET_PIXMAP_PRIVATE(pWin->background.pixmap); - - pPixPriv->flags |= DIRTY; - } - if ((mask & CWBorderPixmap) && !(pWin->borderIsPixel) && - PIXMAP_IS_SHARED(pWin->border.pixmap)) { - XAAPixmapPtr pPixPriv = XAA_GET_PIXMAP_PRIVATE(pWin->border.pixmap); - - pPixPriv->flags |= DIRTY; - } - - return ret; -} - -/* These two aren't really needed for anything */ - -static Bool -XAAEnterVT(int index, int flags) -{ - ScrnInfoPtr pScrn = xf86Screens[index]; - Bool ret; - ScreenPtr pScreen = screenInfo.screens[index]; - XAAScreenPtr pScreenPriv = - (XAAScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XAAScreenKey); - - pScrn->EnterVT = pScreenPriv->EnterVT; - ret = ((*pScreenPriv->EnterVT) (index, flags)); - pScreenPriv->EnterVT = pScrn->EnterVT; - pScrn->EnterVT = XAAEnterVT; - return ret; -} - -static void -XAALeaveVT(int index, int flags) -{ - ScrnInfoPtr pScrn = xf86Screens[index]; - ScreenPtr pScreen = screenInfo.screens[index]; - XAAScreenPtr pScreenPriv = - (XAAScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XAAScreenKey); - XAAInfoRecPtr infoRec = pScreenPriv->AccelInfoRec; - - if (infoRec->NeedToSync) { - (*infoRec->Sync) (infoRec->pScrn); - infoRec->NeedToSync = FALSE; - } - - pScrn->LeaveVT = pScreenPriv->LeaveVT; - (*pScreenPriv->LeaveVT) (index, flags); - pScreenPriv->LeaveVT = pScrn->LeaveVT; - pScrn->LeaveVT = XAALeaveVT; -} - -typedef struct { - Bool UsingPixmapCache; - Bool CanDoColor8x8; - Bool CanDoMono8x8; -} SavedCacheState, *SavedCacheStatePtr; - -static int -XAASetDGAMode(int index, int num, DGADevicePtr devRet) -{ - ScreenPtr pScreen = screenInfo.screens[index]; - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); - XAAScreenPtr pScreenPriv = - (XAAScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XAAScreenKey); - int ret; - - if (!num && infoRec->dgaSaves) { /* restore old pixmap cache state */ - SavedCacheStatePtr state = (SavedCacheStatePtr) infoRec->dgaSaves; - - infoRec->UsingPixmapCache = state->UsingPixmapCache; - infoRec->CanDoColor8x8 = state->CanDoColor8x8; - infoRec->CanDoMono8x8 = state->CanDoMono8x8; - free(infoRec->dgaSaves); - infoRec->dgaSaves = NULL; - } - - ret = (*pScreenPriv->SetDGAMode) (index, num, devRet); - if (ret != Success) - return ret; - - if (num && devRet->pPix) { /* accelerate this pixmap */ - XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE(devRet->pPix); - FBAreaPtr area; - - if ((area = malloc(sizeof(FBArea)))) { - area->pScreen = pScreen; - area->box.x1 = 0; - area->box.x2 = 0; - area->box.y1 = devRet->mode->pixmapWidth; - area->box.y2 = devRet->mode->pixmapHeight; - area->granularity = 0; - area->MoveAreaCallback = 0; - area->RemoveAreaCallback = 0; - area->devPrivate.ptr = 0; - - pixPriv->flags |= OFFSCREEN | DGA_PIXMAP; - pixPriv->offscreenArea = area; - - if (!infoRec->dgaSaves) { /* save pixmap cache state */ - SavedCacheStatePtr state = malloc(sizeof(SavedCacheState)); - - state->UsingPixmapCache = infoRec->UsingPixmapCache; - state->CanDoColor8x8 = infoRec->CanDoColor8x8; - state->CanDoMono8x8 = infoRec->CanDoMono8x8; - infoRec->dgaSaves = (char *) state; - - infoRec->UsingPixmapCache = FALSE; - if (infoRec->PixmapCacheFlags & CACHE_MONO_8x8) - infoRec->CanDoMono8x8 = FALSE; - if (infoRec->PixmapCacheFlags & CACHE_COLOR_8x8) - infoRec->CanDoColor8x8 = FALSE; - } - } - } - - return ret; -} - -static void -XAAEnableDisableFBAccess(int index, Bool enable) -{ - ScreenPtr pScreen = screenInfo.screens[index]; - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); - XAAScreenPtr pScreenPriv = - (XAAScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XAAScreenKey); - - if (!enable) { - if ((infoRec->Flags & OFFSCREEN_PIXMAPS) && (infoRec->OffscreenPixmaps)) - XAAMoveOutOffscreenPixmaps(pScreen); - if (infoRec->Flags & PIXMAP_CACHE) - XAAInvalidatePixmapCache(pScreen); - SwitchedOut = TRUE; - } - - (*pScreenPriv->EnableDisableFBAccess) (index, enable); - - if (enable) { - if ((infoRec->Flags & OFFSCREEN_PIXMAPS) && (infoRec->OffscreenPixmaps)) - XAAMoveInOffscreenPixmaps(pScreen); - SwitchedOut = FALSE; - } -} diff --git a/xserver/hw/xfree86/xaa/xaaInitAccel.c b/xserver/hw/xfree86/xaa/xaaInitAccel.c deleted file mode 100644 index 2a85a1996..000000000 --- a/xserver/hw/xfree86/xaa/xaaInitAccel.c +++ /dev/null @@ -1,1571 +0,0 @@ -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include - -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" - -#include -#include "scrnintstr.h" -#include "xf86str.h" -#include "xaa.h" -#include "xaalocal.h" -#include "xf86fbman.h" -#include "servermd.h" - -/* - * XAA Config options - */ - -typedef enum { - XAAOPT_SCREEN_TO_SCREEN_COPY, - XAAOPT_SOLID_FILL_RECT, - XAAOPT_SOLID_FILL_TRAP, - XAAOPT_SOLID_TWO_POINT_LINE, - XAAOPT_SOLID_BRESENHAM_LINE, - XAAOPT_SOLID_HORVERT_LINE, - XAAOPT_DASHED_TWO_POINT_LINE, - XAAOPT_DASHED_BRESENHAM_LINE, - XAAOPT_MONO_8x8_PATTERN_FILL_RECT, - XAAOPT_MONO_8x8_PATTERN_FILL_TRAP, - XAAOPT_COL_8x8_PATTERN_FILL_RECT, - XAAOPT_COL_8x8_PATTERN_FILL_TRAP, - XAAOPT_CPU_TO_SCREEN_COL_EXP_FILL, - XAAOPT_SCANLINE_CPU_TO_SCREEN_COL_EXP_FILL, - XAAOPT_SCREEN_TO_SCREEN_COL_EXP_FILL, - XAAOPT_IMAGE_WRITE_RECT, - XAAOPT_SCANLINE_IMAGE_WRITE_RECT, - XAAOPT_WRITE_BITMAP, - XAAOPT_WRITE_PIXMAP, - XAAOPT_PIXMAP_CACHE, - XAAOPT_OFFSCREEN_PIXMAPS, - XAAOPT_HAS_DUMB_INVERTED_OPTION_SENSE -} XAAOpts; - -static const OptionInfoRec XAAOptions[] = { - {XAAOPT_SCREEN_TO_SCREEN_COPY, "XaaNoScreenToScreenCopy", - OPTV_BOOLEAN, {0}, FALSE}, - {XAAOPT_SOLID_FILL_RECT, "XaaNoSolidFillRect", - OPTV_BOOLEAN, {0}, FALSE}, - {XAAOPT_SOLID_FILL_TRAP, "XaaNoSolidFillTrap", - OPTV_BOOLEAN, {0}, FALSE}, - {XAAOPT_SOLID_TWO_POINT_LINE, "XaaNoSolidTwoPointLine", - OPTV_BOOLEAN, {0}, FALSE}, - {XAAOPT_SOLID_BRESENHAM_LINE, "XaaNoSolidBresenhamLine", - OPTV_BOOLEAN, {0}, FALSE}, - {XAAOPT_SOLID_HORVERT_LINE, "XaaNoSolidHorVertLine", - OPTV_BOOLEAN, {0}, FALSE}, - {XAAOPT_DASHED_TWO_POINT_LINE, "XaaNoDashedTwoPointLine", - OPTV_BOOLEAN, {0}, FALSE}, - {XAAOPT_DASHED_BRESENHAM_LINE, "XaaNoDashedBresenhamLine", - OPTV_BOOLEAN, {0}, FALSE}, - {XAAOPT_MONO_8x8_PATTERN_FILL_RECT, "XaaNoMono8x8PatternFillRect", - OPTV_BOOLEAN, {0}, FALSE}, - {XAAOPT_MONO_8x8_PATTERN_FILL_TRAP, "XaaNoMono8x8PatternFillTrap", - OPTV_BOOLEAN, {0}, FALSE}, - {XAAOPT_COL_8x8_PATTERN_FILL_RECT, "XaaNoColor8x8PatternFillRect", - OPTV_BOOLEAN, {0}, FALSE}, - {XAAOPT_COL_8x8_PATTERN_FILL_TRAP, "XaaNoColor8x8PatternFillTrap", - OPTV_BOOLEAN, {0}, FALSE}, - {XAAOPT_CPU_TO_SCREEN_COL_EXP_FILL, "XaaNoCPUToScreenColorExpandFill", - OPTV_BOOLEAN, {0}, FALSE}, - {XAAOPT_SCANLINE_CPU_TO_SCREEN_COL_EXP_FILL, - "XaaNoScanlineCPUToScreenColorExpandFill", - OPTV_BOOLEAN, {0}, FALSE}, - {XAAOPT_SCREEN_TO_SCREEN_COL_EXP_FILL, "XaaNoScreenToScreenColorExpandFill", - OPTV_BOOLEAN, {0}, FALSE}, - {XAAOPT_IMAGE_WRITE_RECT, "XaaNoImageWriteRect", - OPTV_BOOLEAN, {0}, FALSE}, - {XAAOPT_SCANLINE_IMAGE_WRITE_RECT, "XaaNoScanlineImageWriteRect", - OPTV_BOOLEAN, {0}, FALSE}, - {XAAOPT_WRITE_BITMAP, "XaaNoWriteBitmap", - OPTV_BOOLEAN, {0}, FALSE}, - {XAAOPT_WRITE_PIXMAP, "XaaNoWritePixmap", - OPTV_BOOLEAN, {0}, FALSE}, - {XAAOPT_PIXMAP_CACHE, "XaaNoPixmapCache", - OPTV_BOOLEAN, {0}, FALSE}, - {XAAOPT_OFFSCREEN_PIXMAPS, "XaaNoOffscreenPixmaps", - OPTV_BOOLEAN, {0}, FALSE}, - {XAAOPT_HAS_DUMB_INVERTED_OPTION_SENSE, "XaaOffscreenPixmaps", - OPTV_BOOLEAN, {0}, FALSE}, - {-1, NULL, - OPTV_NONE, {0}, FALSE} -}; - -static XF86ModuleVersionInfo xaaVersRec = { - "xaa", - MODULEVENDORSTRING, - MODINFOSTRING1, - MODINFOSTRING2, - XORG_VERSION_CURRENT, - XAA_VERSION_MAJOR, - XAA_VERSION_MINOR, - XAA_VERSION_RELEASE, - ABI_CLASS_VIDEODRV, /* requires the video driver ABI */ - ABI_VIDEODRV_VERSION, - MOD_CLASS_NONE, - {0, 0, 0, 0} -}; - -_X_EXPORT XF86ModuleData xaaModuleData = { &xaaVersRec, NULL, NULL }; - -Bool -XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec) -{ - int index = pScreen->myNum; - ScrnInfoPtr pScrn = xf86Screens[index]; - Bool HaveScreenToScreenCopy = FALSE; - Bool HaveColorExpansion = FALSE; - Bool HaveScanlineColorExpansion = FALSE; - Bool HaveSolidFillRect = FALSE; - Bool HaveMono8x8PatternFillRect = FALSE; - Bool HaveColor8x8PatternFillRect = FALSE; - Bool HaveSolidFillTrap = FALSE; - Bool HaveMono8x8PatternFillTrap = FALSE; - Bool HaveColor8x8PatternFillTrap = FALSE; - Bool HaveSolidTwoPointLine = FALSE; - Bool HaveSolidBresenhamLine = FALSE; - Bool HaveSolidHorVertLine = FALSE; - Bool HaveDashedTwoPointLine = FALSE; - Bool HaveDashedBresenhamLine = FALSE; - Bool HaveImageWriteRect = FALSE; - Bool HaveScanlineImageWriteRect = FALSE; - Bool HaveScreenToScreenColorExpandFill = FALSE; - OptionInfoPtr options; - int is_shared = 0; - int i; - - options = xnfalloc(sizeof(XAAOptions)); - (void) memcpy(options, XAAOptions, sizeof(XAAOptions)); - xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, options); - - infoRec->pScrn = pScrn; - infoRec->NeedToSync = FALSE; - - /* must have a Sync function */ - if (!infoRec->Sync) - return FALSE; - for (i = 0; i < pScrn->numEntities; i++) { - if (xf86IsEntityShared(pScrn->entityList[i])) - is_shared = 1; - } - - /* If this PCI entity has IS_SHARED_ACCEL set in entityProp - * then a RestoreAccelState function is required - */ - if (!infoRec->RestoreAccelState && is_shared) - return FALSE; - - if (infoRec->RestoreAccelState) { - if (!XAAInitStateWrap(pScreen, infoRec)) - return FALSE; - } - - if (serverGeneration == 1) - xf86DrvMsg(index, X_INFO, - "Using XFree86 Acceleration Architecture (XAA)\n"); - - /************** Low Level *************/ - - if (!infoRec->SetClippingRectangle || !infoRec->DisableClipping) { - infoRec->ClippingFlags = 0; - infoRec->SetClippingRectangle = NULL; - infoRec->DisableClipping = NULL; - } - - /**** CopyArea ****/ - - if (infoRec->SetupForScreenToScreenCopy && - infoRec->SubsequentScreenToScreenCopy && - !xf86ReturnOptValBool(options, XAAOPT_SCREEN_TO_SCREEN_COPY, FALSE)) { - HaveScreenToScreenCopy = TRUE; - } - else { - infoRec->ScreenToScreenCopyFlags = 0; - infoRec->SetupForScreenToScreenCopy = NULL; - infoRec->SubsequentScreenToScreenCopy = NULL; - } - - /**** Solid Filled Rects ****/ - - if (infoRec->SetupForSolidFill && infoRec->SubsequentSolidFillRect && - !xf86ReturnOptValBool(options, XAAOPT_SOLID_FILL_RECT, FALSE)) { - HaveSolidFillRect = TRUE; - if (infoRec->SubsequentSolidFillTrap && - !xf86ReturnOptValBool(options, XAAOPT_SOLID_FILL_TRAP, FALSE)) - HaveSolidFillTrap = TRUE; - else - infoRec->SubsequentSolidFillTrap = NULL; - } - else { - infoRec->SolidFillFlags = 0; - infoRec->SetupForSolidFill = NULL; - infoRec->SubsequentSolidFillRect = NULL; - infoRec->SubsequentSolidFillTrap = NULL; - } - - /**** Solid lines ****/ - - if (infoRec->SetupForSolidLine) { - if (infoRec->SubsequentSolidTwoPointLine && - !xf86ReturnOptValBool(options, XAAOPT_SOLID_TWO_POINT_LINE, FALSE)) - HaveSolidTwoPointLine = TRUE; - if (infoRec->SubsequentSolidBresenhamLine && - !xf86ReturnOptValBool(options, XAAOPT_SOLID_BRESENHAM_LINE, - FALSE)) { - HaveSolidBresenhamLine = TRUE; - - if (infoRec->SolidBresenhamLineErrorTermBits) - infoRec->SolidBresenhamLineErrorTermBits = - ~((1 << infoRec->SolidBresenhamLineErrorTermBits) - 1); - } - - if (infoRec->SubsequentSolidHorVertLine && - !xf86ReturnOptValBool(options, XAAOPT_SOLID_HORVERT_LINE, FALSE)) - HaveSolidHorVertLine = TRUE; - else if (HaveSolidTwoPointLine) { - infoRec->SubsequentSolidHorVertLine = XAASolidHorVertLineAsTwoPoint; - HaveSolidHorVertLine = TRUE; - } - else if (HaveSolidBresenhamLine) { - infoRec->SubsequentSolidHorVertLine = - XAASolidHorVertLineAsBresenham; - HaveSolidHorVertLine = TRUE; - } - } - - /* XXX Should this also check for XAAOPT_SOLID_HORVERT_LINE? */ - if (!HaveSolidTwoPointLine && - !HaveSolidBresenhamLine && !HaveSolidHorVertLine && HaveSolidFillRect) { - infoRec->SetupForSolidLine = infoRec->SetupForSolidFill; - infoRec->SubsequentSolidHorVertLine = XAASolidHorVertLineAsRects; - infoRec->SolidLineFlags = infoRec->SolidFillFlags; - HaveSolidHorVertLine = TRUE; - } - - if (!HaveSolidTwoPointLine) - infoRec->SubsequentSolidTwoPointLine = NULL; - if (!HaveSolidBresenhamLine) - infoRec->SubsequentSolidBresenhamLine = NULL; - if (!HaveSolidHorVertLine) - infoRec->SubsequentSolidHorVertLine = NULL; - - /* Disable all if nothing left over */ - if (!HaveSolidTwoPointLine && - !HaveSolidBresenhamLine && !HaveSolidHorVertLine) { - infoRec->SolidLineFlags = 0; - infoRec->SetupForSolidLine = NULL; - } - - /**** 8x8 Mono Pattern Filled Rects ****/ - - if (infoRec->SetupForMono8x8PatternFill && - infoRec->SubsequentMono8x8PatternFillRect && - !xf86ReturnOptValBool(options, - XAAOPT_MONO_8x8_PATTERN_FILL_RECT, FALSE)) { - HaveMono8x8PatternFillRect = TRUE; - if (infoRec->SubsequentMono8x8PatternFillTrap && - !xf86ReturnOptValBool(options, - XAAOPT_MONO_8x8_PATTERN_FILL_TRAP, FALSE)) - HaveMono8x8PatternFillTrap = TRUE; - - if (infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_PROGRAMMED_BITS) { - infoRec->CanDoMono8x8 = TRUE; - } - else { /* others require caching */ - int min_pitch; - - infoRec->PixmapCacheFlags |= CACHE_MONO_8x8; - - switch (pScrn->bitsPerPixel) { - case 32: - min_pitch = 2; - break; - case 24: - min_pitch = 3; - break; - case 16: - min_pitch = 4; - break; - default: - min_pitch = 8; - break; - } - - if (min_pitch > infoRec->MonoPatternPitch) - infoRec->MonoPatternPitch = min_pitch; - - if (infoRec->Mono8x8PatternFillFlags & - HARDWARE_PATTERN_PROGRAMMED_ORIGIN) { - if (!infoRec->CacheWidthMono8x8Pattern || - !infoRec->CacheHeightMono8x8Pattern) { - infoRec->CacheWidthMono8x8Pattern = - infoRec->MonoPatternPitch; - infoRec->CacheHeightMono8x8Pattern = 1; - } - } - else { - int numPerLine = 128 / infoRec->MonoPatternPitch; - - if (!infoRec->CacheWidthMono8x8Pattern || - !infoRec->CacheHeightMono8x8Pattern) { - infoRec->CacheWidthMono8x8Pattern = - numPerLine * infoRec->MonoPatternPitch; - infoRec->CacheHeightMono8x8Pattern = - (64 + numPerLine - 1) / numPerLine; - } - } - } - } - else { - infoRec->Mono8x8PatternFillFlags = 0; - infoRec->SetupForMono8x8PatternFill = NULL; - infoRec->SubsequentMono8x8PatternFillRect = NULL; - } - - /**** Dashed lines ****/ - - if (infoRec->SetupForDashedLine && infoRec->DashPatternMaxLength) { - if (infoRec->SubsequentDashedTwoPointLine && - !xf86ReturnOptValBool(options, XAAOPT_DASHED_TWO_POINT_LINE, FALSE)) - HaveDashedTwoPointLine = TRUE; - if (infoRec->SubsequentDashedBresenhamLine && - !xf86ReturnOptValBool(options, XAAOPT_DASHED_BRESENHAM_LINE, - FALSE)) { - HaveDashedBresenhamLine = TRUE; - - if (infoRec->DashedBresenhamLineErrorTermBits) - infoRec->DashedBresenhamLineErrorTermBits = - ~((1 << infoRec->DashedBresenhamLineErrorTermBits) - 1); - } - } - - if (!HaveDashedTwoPointLine) - infoRec->SubsequentDashedTwoPointLine = NULL; - if (!HaveDashedBresenhamLine) - infoRec->SubsequentDashedBresenhamLine = NULL; - - /* Disable all if nothing left over */ - if (!HaveDashedTwoPointLine && !HaveDashedBresenhamLine) { - infoRec->DashedLineFlags = 0; - infoRec->SetupForDashedLine = NULL; - } - - /**** 8x8 Color Pattern Filled Rects ****/ - - if (infoRec->SetupForColor8x8PatternFill && - infoRec->SubsequentColor8x8PatternFillRect && - !xf86ReturnOptValBool(options, XAAOPT_COL_8x8_PATTERN_FILL_RECT, - FALSE)) { - HaveColor8x8PatternFillRect = TRUE; - if (infoRec->SubsequentColor8x8PatternFillTrap && - !xf86ReturnOptValBool(options, XAAOPT_COL_8x8_PATTERN_FILL_TRAP, - FALSE)) - HaveColor8x8PatternFillTrap = TRUE; - else - infoRec->SubsequentColor8x8PatternFillTrap = NULL; - - infoRec->PixmapCacheFlags |= CACHE_COLOR_8x8; - - if (infoRec->Color8x8PatternFillFlags & - HARDWARE_PATTERN_PROGRAMMED_ORIGIN) { - if (!infoRec->CacheWidthColor8x8Pattern || - !infoRec->CacheHeightColor8x8Pattern) { - infoRec->CacheWidthColor8x8Pattern = 64; - infoRec->CacheHeightColor8x8Pattern = 1; - } - } - else { - if (!infoRec->CacheWidthColor8x8Pattern || - !infoRec->CacheHeightColor8x8Pattern) { - infoRec->CacheWidthColor8x8Pattern = 128; - infoRec->CacheHeightColor8x8Pattern = 8; - } - } - } - else { - infoRec->Color8x8PatternFillFlags = 0; - infoRec->SetupForColor8x8PatternFill = NULL; - infoRec->SubsequentColor8x8PatternFillRect = NULL; - infoRec->SubsequentColor8x8PatternFillTrap = NULL; - } - - /**** Color Expansion ****/ - - if (infoRec->SetupForCPUToScreenColorExpandFill && - infoRec->ColorExpandBase && - infoRec->SubsequentCPUToScreenColorExpandFill && - !xf86ReturnOptValBool(options, XAAOPT_CPU_TO_SCREEN_COL_EXP_FILL, - FALSE)) { - int dwordsNeeded = pScrn->virtualX; - - infoRec->ColorExpandRange >>= 2; /* convert to DWORDS */ - HaveColorExpansion = TRUE; - - if (infoRec->CPUToScreenColorExpandFillFlags & - LEFT_EDGE_CLIPPING_NEGATIVE_X) - dwordsNeeded += 31; - dwordsNeeded = (dwordsNeeded + 31) >> 5; - if (dwordsNeeded > infoRec->ColorExpandRange) - infoRec->CPUToScreenColorExpandFillFlags |= CPU_TRANSFER_BASE_FIXED; - } - else { - infoRec->CPUToScreenColorExpandFillFlags = 0; - infoRec->SetupForCPUToScreenColorExpandFill = NULL; - infoRec->SubsequentCPUToScreenColorExpandFill = NULL; - } - - /**** Scanline Color Expansion ****/ - - if (infoRec->SetupForScanlineCPUToScreenColorExpandFill && - infoRec->SubsequentScanlineCPUToScreenColorExpandFill && - infoRec->SubsequentColorExpandScanline && - infoRec->ScanlineColorExpandBuffers && - (infoRec->NumScanlineColorExpandBuffers > 0) && - !xf86ReturnOptValBool(options, - XAAOPT_SCANLINE_CPU_TO_SCREEN_COL_EXP_FILL, - FALSE)) { - HaveScanlineColorExpansion = TRUE; - } - else { - infoRec->ScanlineCPUToScreenColorExpandFillFlags = 0; - infoRec->SetupForScanlineCPUToScreenColorExpandFill = NULL; - infoRec->SubsequentScanlineCPUToScreenColorExpandFill = NULL; - infoRec->SubsequentColorExpandScanline = NULL; - } - - /**** Screen to Screen Color Expansion ****/ - - if (infoRec->SetupForScreenToScreenColorExpandFill && - infoRec->SubsequentScreenToScreenColorExpandFill && - !xf86ReturnOptValBool(options, XAAOPT_SCREEN_TO_SCREEN_COL_EXP_FILL, - FALSE)) { - HaveScreenToScreenColorExpandFill = TRUE; - if (!infoRec->CacheColorExpandDensity) - infoRec->CacheColorExpandDensity = 1; - } - else { - infoRec->ScreenToScreenColorExpandFillFlags = 0; - infoRec->SetupForScreenToScreenColorExpandFill = NULL; - infoRec->SubsequentScreenToScreenColorExpandFill = NULL; - } - - /**** Image Writes ****/ - - if (infoRec->SetupForImageWrite && infoRec->ImageWriteBase && - infoRec->SubsequentImageWriteRect && - !xf86ReturnOptValBool(options, XAAOPT_IMAGE_WRITE_RECT, FALSE)) { - - infoRec->ImageWriteRange >>= 2; /* convert to DWORDS */ - if (infoRec->ImageWriteFlags & CPU_TRANSFER_BASE_FIXED) - infoRec->ImageWriteRange = 0; - HaveImageWriteRect = TRUE; - } - else { - infoRec->ImageWriteFlags = 0; - infoRec->SetupForImageWrite = NULL; - infoRec->SubsequentImageWriteRect = NULL; - } - - /**** Scanline Image Writes ****/ - - if (infoRec->SetupForScanlineImageWrite && - infoRec->SubsequentScanlineImageWriteRect && - infoRec->SubsequentImageWriteScanline && - infoRec->ScanlineImageWriteBuffers && - (infoRec->NumScanlineImageWriteBuffers > 0) && - !xf86ReturnOptValBool(options, XAAOPT_SCANLINE_IMAGE_WRITE_RECT, - FALSE)) { - HaveScanlineImageWriteRect = TRUE; - } - else { - infoRec->ScanlineImageWriteFlags = 0; - infoRec->SetupForScanlineImageWrite = NULL; - infoRec->SubsequentScanlineImageWriteRect = NULL; - infoRec->SubsequentImageWriteScanline = NULL; - } - -#ifndef __i386__ - /* XAA makes some unaligned accesses when clipping is not available */ -#define CLIP_FLAGS (LEFT_EDGE_CLIPPING | LEFT_EDGE_CLIPPING_NEGATIVE_X) - if (HaveImageWriteRect && - ((infoRec->ImageWriteFlags & CLIP_FLAGS) != CLIP_FLAGS)) { - HaveImageWriteRect = FALSE; - } - if (HaveScanlineImageWriteRect && - ((infoRec->ScanlineImageWriteFlags & CLIP_FLAGS) != CLIP_FLAGS)) { - HaveScanlineImageWriteRect = FALSE; - } -#endif - - if (serverGeneration == 1) { - if (HaveScreenToScreenCopy) - xf86ErrorF("\tScreen to screen bit blits\n"); - if (HaveSolidFillRect) - xf86ErrorF("\tSolid filled rectangles\n"); - if (HaveSolidFillTrap) - xf86ErrorF("\tSolid filled trapezoids\n"); - if (HaveMono8x8PatternFillRect) - xf86ErrorF("\t8x8 mono pattern filled rectangles\n"); - if (HaveMono8x8PatternFillTrap) - xf86ErrorF("\t8x8 mono pattern filled trapezoids\n"); - if (HaveColor8x8PatternFillRect) - xf86ErrorF("\t8x8 color pattern filled rectangles\n"); - if (HaveColor8x8PatternFillTrap) - xf86ErrorF("\t8x8 color pattern filled trapezoids\n"); - - if (HaveColorExpansion) - xf86ErrorF("\tCPU to Screen color expansion\n"); - else if (HaveScanlineColorExpansion) - xf86ErrorF("\tIndirect CPU to Screen color expansion\n"); - - if (HaveScreenToScreenColorExpandFill) - xf86ErrorF("\tScreen to Screen color expansion\n"); - - if (HaveSolidTwoPointLine || HaveSolidBresenhamLine) - xf86ErrorF("\tSolid Lines\n"); - else if (HaveSolidHorVertLine) - xf86ErrorF("\tSolid Horizontal and Vertical Lines\n"); - - if (HaveDashedTwoPointLine || HaveDashedBresenhamLine) - xf86ErrorF("\tDashed Lines\n"); - - if (HaveImageWriteRect) - xf86ErrorF("\tImage Writes\n"); - else if (HaveScanlineImageWriteRect) - xf86ErrorF("\tScanline Image Writes\n"); - - } - -#define XAAMSG(s) do { if (serverGeneration == 1) xf86ErrorF(s); } while (0) - - if ((infoRec->Flags & OFFSCREEN_PIXMAPS) && HaveScreenToScreenCopy && - xf86ReturnOptValBool(options, - XAAOPT_HAS_DUMB_INVERTED_OPTION_SENSE, FALSE)) { - XAAMSG("\tOffscreen Pixmaps\n"); - } - else { - infoRec->Flags &= ~OFFSCREEN_PIXMAPS; - } - - /************** Mid Level *************/ - - /**** ScreenToScreenBitBlt ****/ - - if (infoRec->ScreenToScreenBitBlt) { - XAAMSG("\tDriver provided ScreenToScreenBitBlt replacement\n"); - } - else if (HaveScreenToScreenCopy) { - infoRec->ScreenToScreenBitBlt = XAAScreenToScreenBitBlt; - infoRec->ScreenToScreenBitBltFlags = infoRec->ScreenToScreenCopyFlags; - } - - /**** FillSolidRects ****/ - - if (infoRec->FillSolidRects) { - XAAMSG("\tDriver provided FillSolidRects replacement\n"); - } - else if (HaveSolidFillRect) { - infoRec->FillSolidRects = XAAFillSolidRects; - infoRec->FillSolidRectsFlags = infoRec->SolidFillFlags; - } - - /**** FillSolidSpans ****/ - - if (infoRec->FillSolidSpans) { - XAAMSG("\tDriver provided FillSolidSpans replacement\n"); - } - else if (HaveSolidFillRect) { - infoRec->FillSolidSpans = XAAFillSolidSpans; - infoRec->FillSolidSpansFlags = infoRec->SolidFillFlags; - } - - /**** FillMono8x8PatternRects ****/ - - if (infoRec->FillMono8x8PatternRects) { - XAAMSG("\tDriver provided FillMono8x8PatternRects replacement\n"); - } - else if (HaveMono8x8PatternFillRect) { - infoRec->FillMono8x8PatternRects = - (infoRec-> - Mono8x8PatternFillFlags & HARDWARE_PATTERN_SCREEN_ORIGIN) ? - XAAFillMono8x8PatternRectsScreenOrigin : XAAFillMono8x8PatternRects; - - infoRec->FillMono8x8PatternRectsFlags = - infoRec->Mono8x8PatternFillFlags; - } - - /**** FillMono8x8PatternSpans ****/ - - if (infoRec->FillMono8x8PatternSpans) { - XAAMSG("\tDriver provided FillMono8x8PatternSpans replacement\n"); - } - else if (HaveMono8x8PatternFillRect) { - infoRec->FillMono8x8PatternSpans = - (infoRec-> - Mono8x8PatternFillFlags & HARDWARE_PATTERN_SCREEN_ORIGIN) ? - XAAFillMono8x8PatternSpansScreenOrigin : XAAFillMono8x8PatternSpans; - - infoRec->FillMono8x8PatternSpansFlags = - infoRec->Mono8x8PatternFillFlags; - } - - /**** FillColor8x8Rects ****/ - - if (infoRec->FillColor8x8PatternRects) { - XAAMSG("\tDriver provided FillColor8x8PatternRects replacement\n"); - } - else if (HaveColor8x8PatternFillRect) { - infoRec->FillColor8x8PatternRects = - (infoRec-> - Color8x8PatternFillFlags & HARDWARE_PATTERN_SCREEN_ORIGIN) ? - XAAFillColor8x8PatternRectsScreenOrigin : - XAAFillColor8x8PatternRects; - - infoRec->FillColor8x8PatternRectsFlags = - infoRec->Color8x8PatternFillFlags; - } - - /**** FillColor8x8Spans ****/ - - if (infoRec->FillColor8x8PatternSpans) { - XAAMSG("\tDriver provided FillColor8x8PatternSpans replacement\n"); - } - else if (HaveColor8x8PatternFillRect) { - infoRec->FillColor8x8PatternSpans = - (infoRec-> - Color8x8PatternFillFlags & HARDWARE_PATTERN_SCREEN_ORIGIN) ? - XAAFillColor8x8PatternSpansScreenOrigin : - XAAFillColor8x8PatternSpans; - - infoRec->FillColor8x8PatternSpansFlags = - infoRec->Color8x8PatternFillFlags; - } - - /**** FillCacheBltRects ****/ - - if (infoRec->FillCacheBltRects) { - XAAMSG("\tDriver provided FillCacheBltRects replacement\n"); - } - else if (HaveScreenToScreenCopy) { - infoRec->FillCacheBltRects = XAAFillCacheBltRects; - infoRec->FillCacheBltRectsFlags = infoRec->ScreenToScreenCopyFlags; - } - - /**** FillCacheBltSpans ****/ - - if (infoRec->FillCacheBltSpans) { - XAAMSG("\tDriver provided FillCacheBltSpans replacement\n"); - } - else if (HaveScreenToScreenCopy) { - infoRec->FillCacheBltSpans = XAAFillCacheBltSpans; - infoRec->FillCacheBltSpansFlags = infoRec->ScreenToScreenCopyFlags; - } - - /**** FillCacheExpandRects ****/ - - if (infoRec->FillCacheExpandRects) { - XAAMSG("\tDriver provided FillCacheExpandRects replacement\n"); - } - else if (HaveScreenToScreenColorExpandFill) { - infoRec->FillCacheExpandRects = XAAFillCacheExpandRects; - infoRec->FillCacheExpandRectsFlags = - infoRec->ScreenToScreenColorExpandFillFlags; - } - - /**** FillCacheExpandSpans ****/ - - if (infoRec->FillCacheExpandSpans) { - XAAMSG("\tDriver provided FillCacheExpandSpans replacement\n"); - } - else if (HaveScreenToScreenColorExpandFill) { - infoRec->FillCacheExpandSpans = XAAFillCacheExpandSpans; - infoRec->FillCacheExpandSpansFlags = - infoRec->ScreenToScreenColorExpandFillFlags; - } - - /**** FillColorExpandRects ****/ - - if (infoRec->FillColorExpandRects) { - XAAMSG("\tDriver provided FillColorExpandRects replacement\n"); - } - else if (HaveColorExpansion) { - if (infoRec->CPUToScreenColorExpandFillFlags & TRIPLE_BITS_24BPP) { - if (infoRec->CPUToScreenColorExpandFillFlags & - BIT_ORDER_IN_BYTE_MSBFIRST) { - if (infoRec->CPUToScreenColorExpandFillFlags & - CPU_TRANSFER_BASE_FIXED) - infoRec->FillColorExpandRects = - XAAFillColorExpandRects3MSBFirstFixedBase; - else - infoRec->FillColorExpandRects = - XAAFillColorExpandRects3MSBFirst; - } - else { - if (infoRec->CPUToScreenColorExpandFillFlags & - CPU_TRANSFER_BASE_FIXED) - infoRec->FillColorExpandRects = - XAAFillColorExpandRects3LSBFirstFixedBase; - else - infoRec->FillColorExpandRects = - XAAFillColorExpandRects3LSBFirst; - } - } - else { - if (infoRec->CPUToScreenColorExpandFillFlags & - BIT_ORDER_IN_BYTE_MSBFIRST) { - if (infoRec->CPUToScreenColorExpandFillFlags & - CPU_TRANSFER_BASE_FIXED) - infoRec->FillColorExpandRects = - XAAFillColorExpandRectsMSBFirstFixedBase; - else - infoRec->FillColorExpandRects = - XAAFillColorExpandRectsMSBFirst; - } - else { - if (infoRec->CPUToScreenColorExpandFillFlags & - CPU_TRANSFER_BASE_FIXED) - infoRec->FillColorExpandRects = - XAAFillColorExpandRectsLSBFirstFixedBase; - else - infoRec->FillColorExpandRects = - XAAFillColorExpandRectsLSBFirst; - } - } - infoRec->FillColorExpandRectsFlags = - infoRec->CPUToScreenColorExpandFillFlags; - } - else if (HaveScanlineColorExpansion) { - if (infoRec->ScanlineCPUToScreenColorExpandFillFlags & - TRIPLE_BITS_24BPP) { - if (infoRec->ScanlineCPUToScreenColorExpandFillFlags & - BIT_ORDER_IN_BYTE_MSBFIRST) - infoRec->FillColorExpandRects = - XAAFillScanlineColorExpandRects3MSBFirst; - else - infoRec->FillColorExpandRects = - XAAFillScanlineColorExpandRects3LSBFirst; - } - else { - if (infoRec->ScanlineCPUToScreenColorExpandFillFlags & - BIT_ORDER_IN_BYTE_MSBFIRST) - infoRec->FillColorExpandRects = - XAAFillScanlineColorExpandRectsMSBFirst; - else - infoRec->FillColorExpandRects = - XAAFillScanlineColorExpandRectsLSBFirst; - } - infoRec->FillColorExpandRectsFlags = - infoRec->ScanlineCPUToScreenColorExpandFillFlags; - } - - /**** FillColorExpandSpans ****/ - - if (infoRec->FillColorExpandSpans) { - XAAMSG("\tDriver provided FillColorExpandSpans replacement\n"); - } - else if (HaveColorExpansion) { - if (infoRec->CPUToScreenColorExpandFillFlags & TRIPLE_BITS_24BPP) { - if (infoRec->CPUToScreenColorExpandFillFlags & - BIT_ORDER_IN_BYTE_MSBFIRST) { - if (infoRec->CPUToScreenColorExpandFillFlags & - CPU_TRANSFER_BASE_FIXED) - infoRec->FillColorExpandSpans = - XAAFillColorExpandSpans3MSBFirstFixedBase; - else - infoRec->FillColorExpandSpans = - XAAFillColorExpandSpans3MSBFirst; - } - else { - if (infoRec->CPUToScreenColorExpandFillFlags & - CPU_TRANSFER_BASE_FIXED) - infoRec->FillColorExpandSpans = - XAAFillColorExpandSpans3LSBFirstFixedBase; - else - infoRec->FillColorExpandSpans = - XAAFillColorExpandSpans3LSBFirst; - } - } - else { - if (infoRec->CPUToScreenColorExpandFillFlags & - BIT_ORDER_IN_BYTE_MSBFIRST) { - if (infoRec->CPUToScreenColorExpandFillFlags & - CPU_TRANSFER_BASE_FIXED) - infoRec->FillColorExpandSpans = - XAAFillColorExpandSpansMSBFirstFixedBase; - else - infoRec->FillColorExpandSpans = - XAAFillColorExpandSpansMSBFirst; - } - else { - if (infoRec->CPUToScreenColorExpandFillFlags & - CPU_TRANSFER_BASE_FIXED) - infoRec->FillColorExpandSpans = - XAAFillColorExpandSpansLSBFirstFixedBase; - else - infoRec->FillColorExpandSpans = - XAAFillColorExpandSpansLSBFirst; - } - } - infoRec->FillColorExpandSpansFlags = - infoRec->CPUToScreenColorExpandFillFlags; - } - else if (HaveScanlineColorExpansion) { - if (infoRec->ScanlineCPUToScreenColorExpandFillFlags & - TRIPLE_BITS_24BPP) { - if (infoRec->ScanlineCPUToScreenColorExpandFillFlags & - BIT_ORDER_IN_BYTE_MSBFIRST) - infoRec->FillColorExpandSpans = - XAAFillScanlineColorExpandSpans3MSBFirst; - else - infoRec->FillColorExpandSpans = - XAAFillScanlineColorExpandSpans3LSBFirst; - } - else { - if (infoRec->ScanlineCPUToScreenColorExpandFillFlags & - BIT_ORDER_IN_BYTE_MSBFIRST) - infoRec->FillColorExpandSpans = - XAAFillScanlineColorExpandSpansMSBFirst; - else - infoRec->FillColorExpandSpans = - XAAFillScanlineColorExpandSpansLSBFirst; - } - infoRec->FillColorExpandSpansFlags = - infoRec->ScanlineCPUToScreenColorExpandFillFlags; - } - - /**** FillImageWriteRects ****/ - - if (infoRec->FillImageWriteRects) { - XAAMSG("\tDriver provided FillImageWriteRects replacement\n"); - } - else if (HaveImageWriteRect && - (infoRec->ImageWriteFlags & LEFT_EDGE_CLIPPING_NEGATIVE_X) && - (infoRec->ImageWriteFlags & LEFT_EDGE_CLIPPING)) { - infoRec->FillImageWriteRects = XAAFillImageWriteRects; - infoRec->FillImageWriteRectsFlags = infoRec->ImageWriteFlags; - } - - /**** WriteBitmap ****/ - - if (infoRec->WriteBitmap && - !xf86ReturnOptValBool(options, XAAOPT_WRITE_BITMAP, FALSE)) { - XAAMSG("\tDriver provided WriteBitmap replacement\n"); - } - else if (HaveColorExpansion) { - if (infoRec->CPUToScreenColorExpandFillFlags & TRIPLE_BITS_24BPP) { - if (infoRec->CPUToScreenColorExpandFillFlags & - BIT_ORDER_IN_BYTE_MSBFIRST) { - if (infoRec->CPUToScreenColorExpandFillFlags & - CPU_TRANSFER_BASE_FIXED) - infoRec->WriteBitmap = - XAAWriteBitmapColorExpand3MSBFirstFixedBase; - else - infoRec->WriteBitmap = XAAWriteBitmapColorExpand3MSBFirst; - } - else { - if (infoRec->CPUToScreenColorExpandFillFlags & - CPU_TRANSFER_BASE_FIXED) - infoRec->WriteBitmap = - XAAWriteBitmapColorExpand3LSBFirstFixedBase; - else - infoRec->WriteBitmap = XAAWriteBitmapColorExpand3LSBFirst; - } - } - else { - if (infoRec->CPUToScreenColorExpandFillFlags & - BIT_ORDER_IN_BYTE_MSBFIRST) { - if (infoRec->CPUToScreenColorExpandFillFlags & - CPU_TRANSFER_BASE_FIXED) - infoRec->WriteBitmap = - XAAWriteBitmapColorExpandMSBFirstFixedBase; - else - infoRec->WriteBitmap = XAAWriteBitmapColorExpandMSBFirst; - } - else { - if (infoRec->CPUToScreenColorExpandFillFlags & - CPU_TRANSFER_BASE_FIXED) - infoRec->WriteBitmap = - XAAWriteBitmapColorExpandLSBFirstFixedBase; - else - infoRec->WriteBitmap = XAAWriteBitmapColorExpandLSBFirst; - } - } - infoRec->WriteBitmapFlags = infoRec->CPUToScreenColorExpandFillFlags; - } - else if (HaveScanlineColorExpansion) { - if (infoRec->ScanlineCPUToScreenColorExpandFillFlags & - TRIPLE_BITS_24BPP) { - if (infoRec->ScanlineCPUToScreenColorExpandFillFlags & - BIT_ORDER_IN_BYTE_MSBFIRST) - infoRec->WriteBitmap = - XAAWriteBitmapScanlineColorExpand3MSBFirst; - else - infoRec->WriteBitmap = - XAAWriteBitmapScanlineColorExpand3LSBFirst; - } - else { - if (infoRec->ScanlineCPUToScreenColorExpandFillFlags & - BIT_ORDER_IN_BYTE_MSBFIRST) - infoRec->WriteBitmap = - XAAWriteBitmapScanlineColorExpandMSBFirst; - else - infoRec->WriteBitmap = - XAAWriteBitmapScanlineColorExpandLSBFirst; - } - infoRec->WriteBitmapFlags = - infoRec->ScanlineCPUToScreenColorExpandFillFlags; - } - else - infoRec->WriteBitmap = NULL; - - /**** TE Glyphs ****/ - - if (infoRec->TEGlyphRenderer) { - XAAMSG("\tDriver provided TEGlyphRenderer replacement\n"); - } - else if (HaveColorExpansion) { - infoRec->TEGlyphRendererFlags = - infoRec->CPUToScreenColorExpandFillFlags; - - if (infoRec->TEGlyphRendererFlags & TRIPLE_BITS_24BPP) { - if (infoRec->TEGlyphRendererFlags & BIT_ORDER_IN_BYTE_MSBFIRST) { - if (infoRec->TEGlyphRendererFlags & CPU_TRANSFER_BASE_FIXED) - infoRec->TEGlyphRenderer = - XAATEGlyphRenderer3MSBFirstFixedBase; - else - infoRec->TEGlyphRenderer = XAATEGlyphRenderer3MSBFirst; - } - else { - if (infoRec->TEGlyphRendererFlags & CPU_TRANSFER_BASE_FIXED) - infoRec->TEGlyphRenderer = - XAATEGlyphRenderer3LSBFirstFixedBase; - else - infoRec->TEGlyphRenderer = XAATEGlyphRenderer3LSBFirst; - } - - if (!HaveSolidFillRect && - (infoRec->TEGlyphRendererFlags & RGB_EQUAL)) { - infoRec->TEGlyphRendererFlags &= ~RGB_EQUAL; - XAAMSG("WARNING: TEGlyphRenderer cannot support RGB_EQUAL" - " without solid fills\n"); - } - } - else { - if (infoRec->TEGlyphRendererFlags & BIT_ORDER_IN_BYTE_MSBFIRST) { - if (infoRec->TEGlyphRendererFlags & CPU_TRANSFER_BASE_FIXED) - infoRec->TEGlyphRenderer = - XAATEGlyphRendererMSBFirstFixedBase; - else - infoRec->TEGlyphRenderer = XAATEGlyphRendererMSBFirst; - } - else { - if (infoRec->TEGlyphRendererFlags & CPU_TRANSFER_BASE_FIXED) - infoRec->TEGlyphRenderer = - XAATEGlyphRendererLSBFirstFixedBase; - else - infoRec->TEGlyphRenderer = XAATEGlyphRendererLSBFirst; - } - } - - if (!HaveSolidFillRect && - (infoRec->TEGlyphRendererFlags & TRANSPARENCY_ONLY)) { - infoRec->TEGlyphRendererFlags &= ~TRANSPARENCY_ONLY; - XAAMSG("WARNING: TEGlyphRenderer cannot support TRANPARENCY_ONLY" - " without solid fills\n"); - } - - } - else if (HaveScanlineColorExpansion) { - infoRec->TEGlyphRendererFlags = - infoRec->ScanlineCPUToScreenColorExpandFillFlags; - - if (infoRec->TEGlyphRendererFlags & TRIPLE_BITS_24BPP) { - if (infoRec->TEGlyphRendererFlags & BIT_ORDER_IN_BYTE_MSBFIRST) - infoRec->TEGlyphRenderer = XAATEGlyphRendererScanline3MSBFirst; - else - infoRec->TEGlyphRenderer = XAATEGlyphRendererScanline3LSBFirst; - - if (!HaveSolidFillRect && - (infoRec->TEGlyphRendererFlags & RGB_EQUAL)) { - infoRec->TEGlyphRendererFlags &= ~RGB_EQUAL; - XAAMSG("WARNING: TEGlyphRenderer cannot support RGB_EQUAL" - " without solid fills\n"); - } - } - else { - if (infoRec->TEGlyphRendererFlags & BIT_ORDER_IN_BYTE_MSBFIRST) - infoRec->TEGlyphRenderer = XAATEGlyphRendererScanlineMSBFirst; - else - infoRec->TEGlyphRenderer = XAATEGlyphRendererScanlineLSBFirst; - } - - if (!HaveSolidFillRect && - (infoRec->TEGlyphRendererFlags & TRANSPARENCY_ONLY)) { - infoRec->TEGlyphRendererFlags &= ~TRANSPARENCY_ONLY; - XAAMSG("WARNING: TEGlyphRenderer cannot support TRANPARENCY_ONLY" - " without solid fills\n"); - } - } - - /**** NonTE Glyphs ****/ - - if (infoRec->NonTEGlyphRenderer) { - XAAMSG("\tDriver provided NonTEGlyphRenderer replacement\n"); - } - else if (infoRec->WriteBitmap && - !(infoRec->WriteBitmapFlags & NO_TRANSPARENCY)) { - infoRec->NonTEGlyphRenderer = XAANonTEGlyphRenderer; - infoRec->NonTEGlyphRendererFlags = infoRec->WriteBitmapFlags; - } - - /**** WritePixmap ****/ - - if (infoRec->WritePixmap && - !xf86ReturnOptValBool(options, XAAOPT_WRITE_PIXMAP, FALSE)) { - XAAMSG("\tDriver provided WritePixmap replacement\n"); - } - else if (HaveImageWriteRect) { - infoRec->WritePixmap = XAAWritePixmap; - infoRec->WritePixmapFlags = - infoRec->ImageWriteFlags | CONVERT_32BPP_TO_24BPP; - } - else if (HaveScanlineImageWriteRect) { - infoRec->WritePixmap = XAAWritePixmapScanline; - infoRec->WritePixmapFlags = infoRec->ScanlineImageWriteFlags; - } - else - infoRec->WritePixmap = NULL; - - /**** ReadPixmap ****/ - - if (infoRec->ReadPixmap) { - XAAMSG("\tDriver provided ReadPixmap replacement\n"); - } - - /************** GC Level *************/ - - /**** CopyArea ****/ - - if (infoRec->CopyArea) { - XAAMSG("\tDriver provided GC level CopyArea replacement\n"); - } - else if (infoRec->ScreenToScreenBitBlt) { - infoRec->CopyArea = XAACopyArea; - infoRec->CopyAreaFlags = infoRec->ScreenToScreenBitBltFlags; - - /* most GC level primitives use one mid-level primitive so - the GC level primitive gets the mid-level primitive flag - and we use that at GC validation time. But CopyArea uses - more than one mid-level primitive so we have to essentially - do a GC validation every time that primitive is used. - The CopyAreaFlags would only be used for filtering out the - common denominators. Here we assume that if you don't do - ScreenToScreenBitBlt you aren't going to do the others. - We also assume that ScreenToScreenBitBlt has the least - restrictions. */ - } - - if (infoRec->CopyPlane) { - XAAMSG("\tDriver provided GC level CopyPlane replacement\n"); - } - else if (infoRec->WriteBitmap && - !(infoRec->WriteBitmapFlags & TRANSPARENCY_ONLY)) { - infoRec->CopyPlane = XAACopyPlaneColorExpansion; - infoRec->CopyPlaneFlags = infoRec->WriteBitmapFlags; - } - - if (infoRec->PushPixelsSolid) { - XAAMSG("\tDriver provided GC level PushPixelsSolid replacement\n"); - } - else if (infoRec->WriteBitmap && - !(infoRec->WriteBitmapFlags & NO_TRANSPARENCY)) { - infoRec->PushPixelsSolid = XAAPushPixelsSolidColorExpansion; - infoRec->PushPixelsFlags = infoRec->WriteBitmapFlags; - } - - if (infoRec->FillSolidRects) { - if (!infoRec->PolyFillRectSolid) { - infoRec->PolyFillRectSolid = XAAPolyFillRect; - infoRec->PolyFillRectSolidFlags = infoRec->FillSolidRectsFlags; - } - } - if (infoRec->FillSolidSpans) { - if (!infoRec->FillSpansSolid) { - infoRec->FillSpansSolid = XAAFillSpans; - infoRec->FillSpansSolidFlags = infoRec->FillSolidSpansFlags; - } - } - - if (infoRec->FillMono8x8PatternRects || infoRec->FillColor8x8PatternRects || - infoRec->FillCacheBltRects || infoRec->FillColorExpandRects || - infoRec->FillCacheExpandRects) { - if (!infoRec->PolyFillRectStippled) { - - infoRec->PolyFillRectStippled = XAAPolyFillRect; - infoRec->PolyFillRectStippledFlags = 0; - } - } - - if (infoRec->FillMono8x8PatternSpans || infoRec->FillColor8x8PatternSpans || - infoRec->FillCacheBltSpans || infoRec->FillColorExpandSpans || - infoRec->FillCacheExpandSpans) { - if (!infoRec->FillSpansStippled) { - - infoRec->FillSpansStippled = XAAFillSpans; - infoRec->FillSpansStippledFlags = 0; - } - } - - if (infoRec->FillMono8x8PatternRects || infoRec->FillColor8x8PatternRects || - infoRec->FillCacheBltRects || infoRec->FillColorExpandRects || - infoRec->FillCacheExpandRects) { - if (!infoRec->PolyFillRectOpaqueStippled) { - - infoRec->PolyFillRectOpaqueStippled = XAAPolyFillRect; - infoRec->PolyFillRectOpaqueStippledFlags = 0; - } - } - - if (infoRec->FillMono8x8PatternSpans || infoRec->FillColor8x8PatternSpans || - infoRec->FillCacheBltSpans || infoRec->FillColorExpandSpans || - infoRec->FillCacheExpandSpans) { - if (!infoRec->FillSpansOpaqueStippled) { - - infoRec->FillSpansOpaqueStippled = XAAFillSpans; - infoRec->FillSpansOpaqueStippledFlags = 0; - } - } - - if (infoRec->FillMono8x8PatternRects || infoRec->FillColor8x8PatternRects || - infoRec->FillCacheBltRects || infoRec->FillImageWriteRects) { - if (!infoRec->PolyFillRectTiled) { - - infoRec->PolyFillRectTiled = XAAPolyFillRect; - infoRec->PolyFillRectTiledFlags = 0; - } - } - - if (infoRec->FillMono8x8PatternSpans || infoRec->FillColor8x8PatternSpans || - infoRec->FillCacheBltSpans) { - if (!infoRec->FillSpansTiled) { - - infoRec->FillSpansTiled = XAAFillSpans; - infoRec->FillSpansTiledFlags = 0; - } - } - - if (infoRec->TEGlyphRenderer && - !(infoRec->TEGlyphRendererFlags & NO_TRANSPARENCY)) { - - if (!infoRec->PolyText8TE) { - infoRec->PolyText8TE = XAAPolyText8TEColorExpansion; - infoRec->PolyText8TEFlags = infoRec->TEGlyphRendererFlags; - } - - if (!infoRec->PolyText16TE) { - infoRec->PolyText16TE = XAAPolyText16TEColorExpansion; - infoRec->PolyText16TEFlags = infoRec->TEGlyphRendererFlags; - } - - if (!infoRec->PolyGlyphBltTE) { - infoRec->PolyGlyphBltTE = XAAPolyGlyphBltTEColorExpansion; - infoRec->PolyGlyphBltTEFlags = infoRec->TEGlyphRendererFlags; - } - } - - if (infoRec->TEGlyphRenderer && - !(infoRec->TEGlyphRendererFlags & TRANSPARENCY_ONLY)) { - - if (!infoRec->ImageText8TE) { - infoRec->ImageText8TE = XAAImageText8TEColorExpansion; - infoRec->ImageText8TEFlags = infoRec->TEGlyphRendererFlags; - } - - if (!infoRec->ImageText16TE) { - infoRec->ImageText16TE = XAAImageText16TEColorExpansion; - infoRec->ImageText16TEFlags = infoRec->TEGlyphRendererFlags; - } - - if (!infoRec->ImageGlyphBltTE) { - infoRec->ImageGlyphBltTE = XAAImageGlyphBltTEColorExpansion; - infoRec->ImageGlyphBltTEFlags = infoRec->TEGlyphRendererFlags; - } - } - - if (infoRec->NonTEGlyphRenderer) { - if (!infoRec->PolyText8NonTE) { - infoRec->PolyText8NonTE = XAAPolyText8NonTEColorExpansion; - infoRec->PolyText8NonTEFlags = infoRec->NonTEGlyphRendererFlags; - } - - if (!infoRec->PolyText16NonTE) { - infoRec->PolyText16NonTE = XAAPolyText16NonTEColorExpansion; - infoRec->PolyText16NonTEFlags = infoRec->NonTEGlyphRendererFlags; - } - if (!infoRec->PolyGlyphBltNonTE) { - infoRec->PolyGlyphBltNonTE = XAAPolyGlyphBltNonTEColorExpansion; - infoRec->PolyGlyphBltNonTEFlags = infoRec->NonTEGlyphRendererFlags; - } - } - - if (infoRec->NonTEGlyphRenderer && HaveSolidFillRect) { - if (!infoRec->ImageText8NonTE) { - infoRec->ImageText8NonTE = XAAImageText8NonTEColorExpansion; - infoRec->ImageText8NonTEFlags = infoRec->NonTEGlyphRendererFlags; - } - - if (!infoRec->ImageText16NonTE) { - infoRec->ImageText16NonTE = XAAImageText16NonTEColorExpansion; - infoRec->ImageText16NonTEFlags = infoRec->NonTEGlyphRendererFlags; - } - - if (!infoRec->ImageGlyphBltNonTE) { - infoRec->ImageGlyphBltNonTE = XAAImageGlyphBltNonTEColorExpansion; - infoRec->ImageGlyphBltNonTEFlags = infoRec->NonTEGlyphRendererFlags; - } - } - - if (!infoRec->PolyRectangleThinSolid && HaveSolidHorVertLine) { - infoRec->PolyRectangleThinSolid = XAAPolyRectangleThinSolid; - infoRec->PolyRectangleThinSolidFlags = infoRec->SolidLineFlags; - } - - if (!infoRec->FillPolygonSolid && HaveSolidFillRect) { - infoRec->FillPolygonSolid = XAAFillPolygonSolid; - infoRec->FillPolygonSolidFlags = infoRec->SolidFillFlags; - } - - if (!infoRec->FillPolygonStippled && (HaveMono8x8PatternFillRect || - HaveScreenToScreenColorExpandFill || - HaveScreenToScreenCopy)) { - infoRec->FillPolygonStippled = XAAFillPolygonStippled; - infoRec->FillPolygonStippledFlags = infoRec->SolidFillFlags; - } - - if (!infoRec->FillPolygonOpaqueStippled && (HaveMono8x8PatternFillRect || - HaveScreenToScreenColorExpandFill - || HaveScreenToScreenCopy)) { - infoRec->FillPolygonOpaqueStippled = XAAFillPolygonStippled; - infoRec->FillPolygonOpaqueStippledFlags = infoRec->SolidFillFlags; - } - - if (!infoRec->FillPolygonTiled && (HaveMono8x8PatternFillRect || - HaveScreenToScreenColorExpandFill || - HaveScreenToScreenCopy)) { - infoRec->FillPolygonTiled = XAAFillPolygonTiled; - infoRec->FillPolygonTiledFlags = infoRec->SolidFillFlags; - } - - if (!infoRec->PolyFillArcSolid && HaveSolidFillRect) { - infoRec->PolyFillArcSolid = XAAPolyFillArcSolid; - infoRec->PolyFillArcSolidFlags = infoRec->SolidFillFlags; - } - - if (!infoRec->PolylinesWideSolid && HaveSolidFillRect) { - infoRec->PolylinesWideSolid = XAAPolylinesWideSolid; - infoRec->PolylinesWideSolidFlags = - infoRec->SolidFillFlags | GXCOPY_ONLY; - } - - if (!infoRec->PutImage && (infoRec->WritePixmap || - (infoRec->WriteBitmap && - !(infoRec-> - WriteBitmapFlags & TRANSPARENCY_ONLY)))) { - infoRec->PutImage = XAAPutImage; - - /* See comment for CopyArea above. But here we make fewer - assumptions. The driver can provide the PutImageFlags if - it wants too */ - } - - if (HaveSolidHorVertLine && - (HaveSolidBresenhamLine || (HaveSolidTwoPointLine && - (infoRec-> - ClippingFlags & - HARDWARE_CLIP_SOLID_LINE)))) { - if (!infoRec->PolylinesThinSolid) { - infoRec->PolylinesThinSolid = XAAPolyLines; - infoRec->PolylinesThinSolidFlags = infoRec->SolidLineFlags; - } - if (!infoRec->PolySegmentThinSolid) { - infoRec->PolySegmentThinSolid = XAAPolySegment; - infoRec->PolySegmentThinSolidFlags = infoRec->SolidLineFlags; - } - } - - if (HaveDashedBresenhamLine || (HaveDashedTwoPointLine && - (infoRec-> - ClippingFlags & - HARDWARE_CLIP_DASHED_LINE))) { - if (!infoRec->PolylinesThinDashed) { - infoRec->PolylinesThinDashed = XAAPolyLinesDashed; - infoRec->PolylinesThinDashedFlags = infoRec->DashedLineFlags; - } - if (!infoRec->PolySegmentThinDashed) { - infoRec->PolySegmentThinDashed = XAAPolySegmentDashed; - infoRec->PolySegmentThinDashedFlags = infoRec->DashedLineFlags; - } - } - - if (infoRec->PolylinesThinDashed || infoRec->PolySegmentThinDashed) { - if (!infoRec->ComputeDash) - infoRec->ComputeDash = XAAComputeDash; - } - - { - Bool haveTexture = infoRec->CPUToScreenTextureFormats && - infoRec->CPUToScreenTextureDstFormats && - infoRec->SetupForCPUToScreenTexture2 && - infoRec->SubsequentCPUToScreenTexture; - Bool haveAlphaTexture = infoRec->CPUToScreenAlphaTextureFormats && - infoRec->CPUToScreenAlphaTextureDstFormats && - infoRec->SetupForCPUToScreenAlphaTexture2 && - infoRec->SubsequentCPUToScreenAlphaTexture; - - if (!infoRec->Composite && (haveTexture || haveAlphaTexture)) - infoRec->Composite = XAADoComposite; - - if (!infoRec->Glyphs && infoRec->WriteBitmap && - !(infoRec->WriteBitmapFlags & NO_TRANSPARENCY)) { - infoRec->Glyphs = XAADoGlyphs; - } - } - - /************ Validation Functions **************/ - - if (!infoRec->ValidateCopyArea && infoRec->CopyArea) { - infoRec->CopyAreaMask = GCWhenForced; - if ((infoRec->CopyAreaFlags & GXCOPY_ONLY) || - (infoRec->CopyAreaFlags & ROP_NEEDS_SOURCE)) - infoRec->CopyAreaMask |= GCFunction; - if (infoRec->CopyAreaFlags & NO_PLANEMASK) - infoRec->CopyAreaMask |= GCPlaneMask; - infoRec->ValidateCopyArea = XAAValidateCopyArea; - } - - if (!infoRec->ValidateCopyPlane && infoRec->CopyPlane) { - infoRec->CopyPlaneMask = GCWhenForced; - if ((infoRec->CopyPlaneFlags & GXCOPY_ONLY) || - (infoRec->CopyPlaneFlags & ROP_NEEDS_SOURCE)) - infoRec->CopyPlaneMask |= GCFunction; - if (infoRec->CopyPlaneFlags & NO_PLANEMASK) - infoRec->CopyPlaneMask |= GCPlaneMask; - if (infoRec->CopyPlaneFlags & RGB_EQUAL) - infoRec->CopyPlaneMask |= GCForeground | GCBackground; - infoRec->ValidateCopyPlane = XAAValidateCopyPlane; - } - - if (!infoRec->ValidatePutImage && infoRec->PutImage) { - infoRec->PutImageMask = GCWhenForced; - if ((infoRec->PutImageFlags & GXCOPY_ONLY) || - (infoRec->PutImageFlags & ROP_NEEDS_SOURCE)) - infoRec->PutImageMask |= GCFunction; - if (infoRec->PutImageFlags & NO_PLANEMASK) - infoRec->PutImageMask |= GCPlaneMask; - if (infoRec->PutImageFlags & RGB_EQUAL) - infoRec->PutImageMask |= GCForeground | GCBackground; - infoRec->ValidatePutImage = XAAValidatePutImage; - } - - if (!infoRec->ValidatePushPixels && infoRec->PushPixelsSolid) { - infoRec->PushPixelsMask = GCFillStyle; - if ((infoRec->PushPixelsFlags & GXCOPY_ONLY) || - (infoRec->PushPixelsFlags & ROP_NEEDS_SOURCE) || - (infoRec->PushPixelsFlags & TRANSPARENCY_GXCOPY_ONLY)) - infoRec->PushPixelsMask |= GCFunction; - if (infoRec->PushPixelsFlags & NO_PLANEMASK) - infoRec->PushPixelsMask |= GCPlaneMask; - if (infoRec->PushPixelsFlags & RGB_EQUAL) - infoRec->PushPixelsMask |= GCForeground; - infoRec->ValidatePushPixels = XAAValidatePushPixels; - } - - /* By default XAA assumes the FillSpans, PolyFillRects, FillPolygon - and PolyFillArcs have the same restrictions. If you supply GC - level replacements for any of these and alter this relationship - you may need to supply replacement validation routines */ - - if (!infoRec->ValidateFillSpans && - (infoRec->FillSpansSolid || infoRec->FillSpansStippled || - infoRec->FillSpansOpaqueStippled || infoRec->FillSpansTiled)) { - - int compositeFlags = infoRec->FillSpansSolidFlags | - infoRec->FillSpansStippledFlags | - infoRec->FillSpansOpaqueStippledFlags | - infoRec->FillSpansTiledFlags; - - infoRec->FillSpansMask = GCFillStyle | GCTile | GCStipple; - - if ((compositeFlags & GXCOPY_ONLY) || - (compositeFlags & ROP_NEEDS_SOURCE)) - infoRec->FillSpansMask |= GCFunction; - if (compositeFlags & NO_PLANEMASK) - infoRec->FillSpansMask |= GCPlaneMask; - if (compositeFlags & RGB_EQUAL) - infoRec->FillSpansMask |= GCForeground; - infoRec->ValidateFillSpans = XAAValidateFillSpans; - } - - /* By default XAA only provides Validations for the GlyphBlt - functions and not the text higher up. This is because the - Text8/16 and GlyphBlt are linked. If you break this linkage, - you may need to have the driver supply its own Validation - routines */ - - if (!infoRec->ValidatePolyGlyphBlt && - (infoRec->PolyGlyphBltTE || infoRec->PolyGlyphBltNonTE)) { - int compositeFlags = infoRec->PolyGlyphBltTEFlags | - infoRec->PolyGlyphBltNonTEFlags; - - infoRec->PolyGlyphBltMask = GCFillStyle | GCFont; - if ((compositeFlags & GXCOPY_ONLY) || - (compositeFlags & ROP_NEEDS_SOURCE) || - (infoRec->PolyGlyphBltNonTEFlags & TRANSPARENCY_GXCOPY_ONLY)) - infoRec->PolyGlyphBltMask |= GCFunction; - if (compositeFlags & NO_PLANEMASK) - infoRec->PolyGlyphBltMask |= GCPlaneMask; - if (compositeFlags & RGB_EQUAL) - infoRec->PolyGlyphBltMask |= GCForeground; - infoRec->ValidatePolyGlyphBlt = XAAValidatePolyGlyphBlt; - } - - if (!infoRec->ValidateImageGlyphBlt && - (infoRec->ImageGlyphBltTE || infoRec->ImageGlyphBltNonTE)) { - int compositeFlags = infoRec->ImageGlyphBltTEFlags | - infoRec->ImageGlyphBltNonTEFlags; - - if (infoRec->ImageGlyphBltNonTE) - compositeFlags |= infoRec->SolidFillFlags; - - infoRec->ImageGlyphBltMask = GCFont; - if (compositeFlags & NO_PLANEMASK) - infoRec->ImageGlyphBltMask |= GCPlaneMask; - if (compositeFlags & RGB_EQUAL) - infoRec->ImageGlyphBltMask |= GCForeground | GCBackground; - infoRec->ValidateImageGlyphBlt = XAAValidateImageGlyphBlt; - } - - /* By default XAA only provides a Validation function for the - Polylines and does segments and polylines at the same time */ - - if (!infoRec->ValidatePolylines && infoRec->ValidateFillSpans) { - int compositeFlags = infoRec->PolyRectangleThinSolidFlags | - infoRec->PolylinesWideSolidFlags | - infoRec->PolylinesThinSolidFlags | - infoRec->PolySegmentThinSolidFlags | - infoRec->PolySegmentThinDashedFlags | - infoRec->PolylinesThinDashedFlags; - - infoRec->ValidatePolylines = XAAValidatePolylines; - infoRec->PolylinesMask = - infoRec->FillSpansMask | GCLineStyle | GCLineWidth; - - if (infoRec->PolySegmentThinDashed || infoRec->PolylinesThinDashed) - infoRec->PolylinesMask |= GCDashList; - if (compositeFlags & NO_PLANEMASK) - infoRec->PolylinesMask |= GCPlaneMask; - if ((compositeFlags & GXCOPY_ONLY) || - (compositeFlags & ROP_NEEDS_SOURCE)) - infoRec->PolylinesMask |= GCFunction; - if (compositeFlags & RGB_EQUAL) - infoRec->PolylinesMask |= GCForeground; - } - - /**** Fill choosers ****/ - - if (!infoRec->StippledFillChooser) - infoRec->StippledFillChooser = XAAStippledFillChooser; - - if (!infoRec->OpaqueStippledFillChooser) - infoRec->OpaqueStippledFillChooser = XAAOpaqueStippledFillChooser; - - if (!infoRec->TiledFillChooser) - infoRec->TiledFillChooser = XAATiledFillChooser; - - /**** Setup the pixmap cache ****/ - - if (infoRec->WriteBitmapToCache) { - } - else if (infoRec->WriteBitmap && - !(infoRec->WriteBitmapFlags & TRANSPARENCY_ONLY)) - infoRec->WriteBitmapToCache = XAAWriteBitmapToCache; - else if (infoRec->Flags & LINEAR_FRAMEBUFFER) - infoRec->WriteBitmapToCache = XAAWriteBitmapToCacheLinear; - else - infoRec->PixmapCacheFlags |= DO_NOT_BLIT_STIPPLES; - - if (infoRec->WritePixmapToCache) { - } - else if (infoRec->WritePixmap && !(infoRec->WritePixmapFlags & NO_GXCOPY)) - infoRec->WritePixmapToCache = XAAWritePixmapToCache; - else if (infoRec->Flags & LINEAR_FRAMEBUFFER) - infoRec->WritePixmapToCache = XAAWritePixmapToCacheLinear; - else - infoRec->Flags &= ~PIXMAP_CACHE; - - if (xf86ReturnOptValBool(options, XAAOPT_PIXMAP_CACHE, FALSE)) - infoRec->Flags &= ~PIXMAP_CACHE; - - if (infoRec->WriteMono8x8PatternToCache) { - } - else if (infoRec->PixmapCacheFlags & CACHE_MONO_8x8) { - if (infoRec->WritePixmapToCache) - infoRec->WriteMono8x8PatternToCache = XAAWriteMono8x8PatternToCache; - else - infoRec->PixmapCacheFlags &= ~CACHE_MONO_8x8; - } - - if (infoRec->WriteColor8x8PatternToCache) { - } - else if (infoRec->PixmapCacheFlags & CACHE_COLOR_8x8) { - if (infoRec->WritePixmapToCache && infoRec->WriteBitmapToCache) - infoRec->WriteColor8x8PatternToCache = - XAAWriteColor8x8PatternToCache; - else - infoRec->PixmapCacheFlags &= ~CACHE_COLOR_8x8; - } - - if (infoRec->CachePixelGranularity < 0) { - switch (pScrn->bitsPerPixel) { - case 24: - case 8: - infoRec->CachePixelGranularity = 4; - break; - case 16: - infoRec->CachePixelGranularity = 2; - break; - case 32: - infoRec->CachePixelGranularity = 1; - break; - default: - break; - } - - if (BITMAP_SCANLINE_PAD == 64) - infoRec->CachePixelGranularity *= 2; - } - - free(options); - - if (!infoRec->CacheTile && infoRec->WritePixmapToCache) - infoRec->CacheTile = XAACacheTile; - if (!infoRec->CacheMonoStipple && infoRec->WritePixmapToCache) - infoRec->CacheMonoStipple = XAACacheMonoStipple; - if (!infoRec->CacheStipple && infoRec->WriteBitmapToCache) - infoRec->CacheStipple = XAACacheStipple; - if (!infoRec->CacheMono8x8Pattern && infoRec->WriteMono8x8PatternToCache) - infoRec->CacheMono8x8Pattern = XAACacheMono8x8Pattern; - if (!infoRec->CacheColor8x8Pattern && infoRec->WriteColor8x8PatternToCache) - infoRec->CacheColor8x8Pattern = XAACacheColor8x8Pattern; - - if ((infoRec->Flags & PIXMAP_CACHE) && !infoRec->InitPixmapCache) { - infoRec->InitPixmapCache = XAAInitPixmapCache; - infoRec->ClosePixmapCache = XAAClosePixmapCache; - } - - return TRUE; -} diff --git a/xserver/hw/xfree86/xaa/xaaLine.c b/xserver/hw/xfree86/xaa/xaaLine.c deleted file mode 100644 index d7c60975e..000000000 --- a/xserver/hw/xfree86/xaa/xaaLine.c +++ /dev/null @@ -1,422 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include - -#include -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" - -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "miline.h" -#include "xf86str.h" -#include "xaa.h" -#include "xaalocal.h" - -void -#ifdef POLYSEGMENT - XAAPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pSeg -#else -XAAPolyLines(DrawablePtr pDrawable, GCPtr pGC, int mode, /* Origin or Previous */ - int npt, /* number of points */ - DDXPointPtr pptInit -#endif - ) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - BoxPtr pboxInit = RegionRects(pGC->pCompositeClip); - int nboxInit = RegionNumRects(pGC->pCompositeClip); - unsigned int bias = miGetZeroLineBias(pDrawable->pScreen); - int xorg = pDrawable->x; - int yorg = pDrawable->y; - int nbox; - BoxPtr pbox; - -#ifndef POLYSEGMENT - DDXPointPtr ppt; -#endif - int x1, x2, y1, y2, tmp, len; - - if (!nboxInit) - return; - - if (infoRec->SolidLineFlags & LINE_LIMIT_COORDS) { - int minValX = infoRec->SolidLineLimits.x1; - int maxValX = infoRec->SolidLineLimits.x2; - int minValY = infoRec->SolidLineLimits.y1; - int maxValY = infoRec->SolidLineLimits.y2; - -#ifdef POLYSEGMENT - int n = nseg; - xSegment *s = pSeg; - - while (n--) -#else - int n = npt; - int xorgtmp = xorg; - int yorgtmp = yorg; - - ppt = pptInit; - x2 = ppt->x + xorgtmp; - y2 = ppt->y + yorgtmp; - while (--n) -#endif - { -#ifdef POLYSEGMENT - x1 = s->x1 + xorg; - y1 = s->y1 + yorg; - x2 = s->x2 + xorg; - y2 = s->y2 + yorg; - s++; -#else - x1 = x2; - y1 = y2; - ++ppt; - if (mode == CoordModePrevious) { - xorgtmp = x1; - yorgtmp = y1; - } - x2 = ppt->x + xorgtmp; - y2 = ppt->y + yorgtmp; -#endif - if (x1 > maxValX || x1 < minValX || - x2 > maxValX || x2 < minValX || - y1 > maxValY || y1 < minValY || y2 > maxValY || y2 < minValY) { -#ifdef POLYSEGMENT - XAAFallbackOps.PolySegment(pDrawable, pGC, nseg, pSeg); -#else - XAAFallbackOps.Polylines(pDrawable, pGC, mode, npt, pptInit); -#endif - return; - } - } - } - - (*infoRec->SetupForSolidLine) (infoRec->pScrn, pGC->fgPixel, - pGC->alu, pGC->planemask); - -#ifdef POLYSEGMENT - while (nseg--) -#else - ppt = pptInit; - x2 = ppt->x + xorg; - y2 = ppt->y + yorg; - while (--npt) -#endif - { - nbox = nboxInit; - pbox = pboxInit; - -#ifdef POLYSEGMENT - x1 = pSeg->x1 + xorg; - y1 = pSeg->y1 + yorg; - x2 = pSeg->x2 + xorg; - y2 = pSeg->y2 + yorg; - pSeg++; -#else - x1 = x2; - y1 = y2; - ++ppt; - if (mode == CoordModePrevious) { - xorg = x1; - yorg = y1; - } - x2 = ppt->x + xorg; - y2 = ppt->y + yorg; -#endif - - if (x1 == x2) { /* vertical line */ - /* make the line go top to bottom of screen, keeping - endpoint semantics - */ - if (y1 > y2) { - tmp = y2; - y2 = y1 + 1; - y1 = tmp + 1; -#ifdef POLYSEGMENT - if (pGC->capStyle != CapNotLast) - y1--; -#endif - } -#ifdef POLYSEGMENT - else if (pGC->capStyle != CapNotLast) - y2++; -#endif - /* get to first band that might contain part of line */ - while (nbox && (pbox->y2 <= y1)) { - pbox++; - nbox--; - } - - /* stop when lower edge of box is beyond end of line */ - while (nbox && (y2 >= pbox->y1)) { - if ((x1 >= pbox->x1) && (x1 < pbox->x2)) { - tmp = max(y1, pbox->y1); - len = min(y2, pbox->y2) - tmp; - if (len) - (*infoRec->SubsequentSolidHorVertLine) (infoRec->pScrn, - x1, tmp, len, - DEGREES_270); - } - nbox--; - pbox++; - } -#ifndef POLYSEGMENT - y2 = ppt->y + yorg; -#endif - } - else if (y1 == y2) { /* horizontal line */ - /* force line from left to right, keeping endpoint semantics */ - if (x1 > x2) { - tmp = x2; - x2 = x1 + 1; - x1 = tmp + 1; -#ifdef POLYSEGMENT - if (pGC->capStyle != CapNotLast) - x1--; -#endif - } -#ifdef POLYSEGMENT - else if (pGC->capStyle != CapNotLast) - x2++; -#endif - - /* find the correct band */ - while (nbox && (pbox->y2 <= y1)) { - pbox++; - nbox--; - } - - /* try to draw the line, if we haven't gone beyond it */ - if (nbox && (pbox->y1 <= y1)) { - int orig_y = pbox->y1; - - /* when we leave this band, we're done */ - while (nbox && (orig_y == pbox->y1)) { - if (pbox->x2 <= x1) { - /* skip boxes until one might contain start point */ - nbox--; - pbox++; - continue; - } - - /* stop if left of box is beyond right of line */ - if (pbox->x1 >= x2) { - nbox = 0; - break; - } - - tmp = max(x1, pbox->x1); - len = min(x2, pbox->x2) - tmp; - if (len) - (*infoRec->SubsequentSolidHorVertLine) (infoRec->pScrn, - tmp, y1, len, - DEGREES_0); - nbox--; - pbox++; - } - } -#ifndef POLYSEGMENT - x2 = ppt->x + xorg; -#endif - } - else { /* sloped line */ - unsigned int oc1, oc2; - int dmin, dmaj, e, octant; - - if (infoRec->SubsequentSolidBresenhamLine) { - if ((dmaj = x2 - x1) < 0) { - dmaj = -dmaj; - octant = XDECREASING; - } - else - octant = 0; - - if ((dmin = y2 - y1) < 0) { - dmin = -dmin; - octant |= YDECREASING; - } - - if (dmin >= dmaj) { - tmp = dmin; - dmin = dmaj; - dmaj = tmp; - octant |= YMAJOR; - } - - e = -dmaj - ((bias >> octant) & 1); - len = dmaj; - dmin <<= 1; - dmaj <<= 1; - } - else { /* Muffle compiler */ - dmin = dmaj = e = octant = len = 0; - } - - while (nbox--) { - oc1 = oc2 = 0; - OUTCODES(oc1, x1, y1, pbox); - OUTCODES(oc2, x2, y2, pbox); - if (!(oc1 | oc2)) { /* unclipped */ - if (infoRec->SubsequentSolidTwoPointLine) { - (*infoRec->SubsequentSolidTwoPointLine) (infoRec->pScrn, - x1, y1, x2, y2, -#ifdef POLYSEGMENT - (pGC-> - capStyle != - CapNotLast) ? - 0 : -#endif - OMIT_LAST); - } - else { - (*infoRec->SubsequentSolidBresenhamLine) (infoRec-> - pScrn, x1, y1, - dmaj, dmin, e, -#ifdef POLYSEGMENT - (pGC-> - capStyle != - CapNotLast) - ? (len + 1) : -#endif - len, octant); - } - break; - } - else if (oc1 & oc2) { /* completely clipped */ - pbox++; - } - else if (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_LINE) { - (*infoRec->SetClippingRectangle) (infoRec->pScrn, - pbox->x1, pbox->y1, - pbox->x2 - 1, - pbox->y2 - 1); - - if (infoRec->SubsequentSolidBresenhamLine) { - (*infoRec->SubsequentSolidBresenhamLine) (infoRec-> - pScrn, x1, y1, - dmaj, dmin, e, -#ifdef POLYSEGMENT - (pGC-> - capStyle != - CapNotLast) - ? (len + 1) : -#endif - len, octant); - } - else { - (*infoRec->SubsequentSolidTwoPointLine) (infoRec->pScrn, - x1, y1, x2, y2, -#ifdef POLYSEGMENT - (pGC-> - capStyle != - CapNotLast) ? - 0 : -#endif - OMIT_LAST); - } - (*infoRec->DisableClipping) (infoRec->pScrn); - pbox++; - } - else { - int new_x1 = x1, new_y1 = y1, new_x2 = x2, new_y2 = y2; - int clip1 = 0, clip2 = 0; - int err, adx, ady; - - if (octant & YMAJOR) { - ady = dmaj >> 1; - adx = dmin >> 1; - } - else { - ady = dmin >> 1; - adx = dmaj >> 1; - } - - if (miZeroClipLine(pbox->x1, pbox->y1, - pbox->x2 - 1, pbox->y2 - 1, - &new_x1, &new_y1, &new_x2, &new_y2, - adx, ady, &clip1, &clip2, - octant, bias, oc1, oc2) == -1) { - pbox++; - continue; - } - - if (octant & YMAJOR) - len = abs(new_y2 - new_y1); - else - len = abs(new_x2 - new_x1); -#ifdef POLYSEGMENT - if (clip2 != 0 || pGC->capStyle != CapNotLast) - len++; -#else - len += (clip2 != 0); -#endif - if (len) { - int abserr, clipdx, clipdy; - - /* unwind bresenham error term to first point */ - if (clip1) { - clipdx = abs(new_x1 - x1); - clipdy = abs(new_y1 - y1); - - if (octant & YMAJOR) - err = e + clipdy * dmin - clipdx * dmaj; - else - err = e + clipdx * dmin - clipdy * dmaj; - } - else - err = e; - -#define range infoRec->SolidBresenhamLineErrorTermBits - abserr = abs(err); - while ((abserr & range) || - (dmaj & range) || (dmin & range)) { - dmin >>= 1; - dmaj >>= 1; - abserr >>= 1; - err /= 2; - } - - (*infoRec->SubsequentSolidBresenhamLine) (infoRec-> - pScrn, new_x1, - new_y1, dmaj, - dmin, err, - len, octant); - } - pbox++; - } - } /* while (nbox--) */ - } /* sloped line */ - } /* while (nline--) */ - -#ifndef POLYSEGMENT - /* paint the last point if the end style isn't CapNotLast. - (Assume that a projecting, butt, or round cap that is one - pixel wide is the same as the single pixel of the endpoint.) - */ - - if ((pGC->capStyle != CapNotLast) && - ((ppt->x + xorg != pptInit->x + pDrawable->x) || - (ppt->y + yorg != pptInit->y + pDrawable->y) || - (ppt == pptInit + 1))) { - nbox = nboxInit; - pbox = pboxInit; - while (nbox--) { - if ((x2 >= pbox->x1) && (y2 >= pbox->y1) && - (x2 < pbox->x2) && (y2 < pbox->y2)) { - (*infoRec->SubsequentSolidHorVertLine) (infoRec->pScrn, x2, y2, - 1, DEGREES_0); - break; - } - else - pbox++; - } - } -#endif - - SET_SYNC_FLAG(infoRec); -} diff --git a/xserver/hw/xfree86/xaa/xaaLineMisc.c b/xserver/hw/xfree86/xaa/xaaLineMisc.c deleted file mode 100644 index 4379778f6..000000000 --- a/xserver/hw/xfree86/xaa/xaaLineMisc.c +++ /dev/null @@ -1,149 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" - -#include -#include "scrnintstr.h" -#include "miline.h" -#include "xf86str.h" -#include "xaa.h" -#include "xaalocal.h" - -void -XAASolidHorVertLineAsRects(ScrnInfoPtr pScrn, int x, int y, int len, int dir) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - - if (dir == DEGREES_0) - (*infoRec->SubsequentSolidFillRect) (pScrn, x, y, len, 1); - else - (*infoRec->SubsequentSolidFillRect) (pScrn, x, y, 1, len); -} - -void -XAASolidHorVertLineAsTwoPoint(ScrnInfoPtr pScrn, int x, int y, int len, int dir) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - - len--; - - if (dir == DEGREES_0) - (*infoRec->SubsequentSolidTwoPointLine) (pScrn, x, y, x + len, y, 0); - else - (*infoRec->SubsequentSolidTwoPointLine) (pScrn, x, y, x, y + len, 0); -} - -void -XAASolidHorVertLineAsBresenham(ScrnInfoPtr pScrn, - int x, int y, int len, int dir) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - - if (dir == DEGREES_0) - (*infoRec->SubsequentSolidBresenhamLine) (pScrn, x, y, len << 1, 0, - -len, len, 0); - else - (*infoRec->SubsequentSolidBresenhamLine) (pScrn, x, y, len << 1, 0, - -len, len, YMAJOR); -} - -void -XAAComputeDash(GCPtr pGC) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - XAAGCPtr pGCPriv = (XAAGCPtr) dixLookupPrivate(&pGC->devPrivates, - XAAGetGCKey()); - Bool EvenDash = (pGC->numInDashList & 0x01) ? FALSE : TRUE; - int PatternLength = 0; - unsigned char *DashPtr = (unsigned char *) pGC->dash; - CARD32 *ptr; - int count = pGC->numInDashList; - int shift, value, direction; - Bool set; - - free(pGCPriv->DashPattern); - - pGCPriv->DashPattern = NULL; - pGCPriv->DashLength = 0; - - while (count--) - PatternLength += *(DashPtr++); - - if (!EvenDash) - PatternLength <<= 1; - - if (PatternLength > infoRec->DashPatternMaxLength) - return; - - if ((infoRec->DashedLineFlags & LINE_PATTERN_POWER_OF_2_ONLY) && - (PatternLength & (PatternLength - 1))) - return; - - pGCPriv->DashPattern = calloc((PatternLength + 31) >> 5, 4); - if (!pGCPriv->DashPattern) - return; - pGCPriv->DashLength = PatternLength; - - if (infoRec->DashedLineFlags & (LINE_PATTERN_LSBFIRST_MSBJUSTIFIED | - LINE_PATTERN_LSBFIRST_LSBJUSTIFIED)) { - direction = 1; - set = TRUE; - DashPtr = (unsigned char *) pGC->dash; - } - else { - direction = -1; - set = FALSE; - DashPtr = (unsigned char *) pGC->dash + pGC->numInDashList - 1; - } - - if (infoRec->DashedLineFlags & (LINE_PATTERN_LSBFIRST_MSBJUSTIFIED | - LINE_PATTERN_MSBFIRST_MSBJUSTIFIED)) - shift = 32 - (PatternLength & 31); - else - shift = 0; - - ptr = (CARD32 *) (pGCPriv->DashPattern); - - CONCATENATE: - - count = pGC->numInDashList; - - while (count--) { - value = *DashPtr; - DashPtr += direction; - while (value) { - if (value < (32 - shift)) { - if (set) - *ptr |= XAAShiftMasks[value] << shift; - shift += value; - break; - } - else { - if (set) - *ptr |= ~0L << shift; - value -= (32 - shift); - shift = 0; - ptr++; - } - } - if (set) - set = FALSE; - else - set = TRUE; - } - - if (!EvenDash) { - EvenDash = TRUE; - if (infoRec->DashedLineFlags & (LINE_PATTERN_LSBFIRST_MSBJUSTIFIED | - LINE_PATTERN_LSBFIRST_LSBJUSTIFIED)) - DashPtr = (unsigned char *) pGC->dash; - else - DashPtr = (unsigned char *) pGC->dash + pGC->numInDashList; - goto CONCATENATE; - } -} diff --git a/xserver/hw/xfree86/xaa/xaaNonTEGlyph.c b/xserver/hw/xfree86/xaa/xaaNonTEGlyph.c deleted file mode 100644 index bfe7f9a09..000000000 --- a/xserver/hw/xfree86/xaa/xaaNonTEGlyph.c +++ /dev/null @@ -1,192 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xaa.h" -#include "xaalocal.h" -#include "xaacexp.h" -#include "xf86.h" - -/* Not used anymore because the algorithm isn't correct. It doesn't - handle overlapping characters properly */ - -#ifdef TRIPLE_BITS -#define NonTEGlyphFunc EXPNAME(XAANonTEGlyphScanlineFunc3) -#else -#define NonTEGlyphFunc EXPNAME(XAANonTEGlyphScanlineFunc) -#endif - -/******************************************************************** - - Here we have NonTEGlyphRenders for a bunch of different color - expansion types. The driver may provide its own renderer, but - this is the default one which renders using lower-level primitives - exported by the chipset driver. - -********************************************************************/ - -/* Since the dimensions of the text string and the backing rectangle - do not always coincide, it is possible that wBack or wText - may be 0! The NonTEGlyphRender must always check for this. */ - -/* This gets built for MSBFIRST or LSBFIRST with FIXEDBASE or not, - with TRIPLE_BITS or not. A total of 8 versions */ - -/* if the backing rectangle and text are of the same dimensions - then we can draw in one pass */ - -void -#ifdef TRIPLE_BITS - EXPNAME(XAANonTEGlyphRenderer3) ( -#else - EXPNAME(XAANonTEGlyphRenderer) ( -#endif - ScrnInfoPtr pScrn, - int xText, int wText, - int y, int h, int skipleft, int startline, - NonTEGlyphInfo * glyphp, - int fg, int rop, unsigned int planemask) { - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - CARD32 *base = (CARD32 *) infoRec->ColorExpandBase; - -#ifdef TRIPLE_BITS - int dwords = ((3 * wText + 31) >> 5) * h; -#else - int dwords = ((wText + 31) >> 5) * h; -#endif - - (*infoRec->SetupForCPUToScreenColorExpandFill) (pScrn, fg, -1, rop, - planemask); - (*infoRec->SubsequentCPUToScreenColorExpandFill) (pScrn, xText, y, wText, h, - 0); - -#ifndef FIXEDBASE -#ifdef TRIPLE_BITS - if ((((3 * wText + 31) >> 5) * h) <= infoRec->ColorExpandRange) -#else - if ((((wText + 31) >> 5) * h) <= infoRec->ColorExpandRange) -#endif - while (h--) - base = NonTEGlyphFunc(base, glyphp, startline++, wText, skipleft); - else -#endif - while (h--) - NonTEGlyphFunc(base, glyphp, startline++, wText, skipleft); - - if ((infoRec->CPUToScreenColorExpandFillFlags & CPU_TRANSFER_PAD_QWORD) && - (dwords & 1)) { - base = (CARD32 *) infoRec->ColorExpandBase; - base[0] = 0x00000000; - } - - if (infoRec->CPUToScreenColorExpandFillFlags & SYNC_AFTER_COLOR_EXPAND) - (*infoRec->Sync) (pScrn); - else - SET_SYNC_FLAG(infoRec); -} - -#ifndef FIXEDBASE -/* Scanline version of above gets built for LSBFIRST and MSBFIRST */ - -void -#ifdef TRIPLE_BITS - EXPNAME(XAANonTEGlyphRendererScanline3) ( -#else - EXPNAME(XAANonTEGlyphRendererScanline) ( -#endif - ScrnInfoPtr pScrn, - int xText, int wText, - int y, int h, int skipleft, - int startline, - NonTEGlyphInfo * glyphp, int fg, - int rop, unsigned int planemask) { - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - int bufferNo = 0; - CARD32 *base; - - (*infoRec->SetupForScanlineCPUToScreenColorExpandFill) (pScrn, fg, -1, rop, - planemask); - (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill) (pScrn, xText, y, - wText, h, 0); - - while (h--) { - base = (CARD32 *) infoRec->ScanlineColorExpandBuffers[bufferNo]; - NonTEGlyphFunc(base, glyphp, startline++, wText, skipleft); - (*infoRec->SubsequentColorExpandScanline) (pScrn, bufferNo++); - if (bufferNo >= infoRec->NumScanlineColorExpandBuffers) - bufferNo = 0; - } - - SET_SYNC_FLAG(infoRec); -} - -#endif - -/******************************************************************** - - Generic NonTE scanline rendering code. - -********************************************************************/ - -CARD32 * -NonTEGlyphFunc(CARD32 *base, - NonTEGlyphInfo * glyphp, int line, int TotalWidth, int skipleft) -{ - CARD32 bits = 0; - int shift = glyphp->width; - - if (skipleft) { - if ((line >= glyphp->firstline) && (line <= glyphp->lastline)) - bits = SHIFT_R(glyphp->bitsp[line], skipleft); - shift -= skipleft; - } - else if ((line >= glyphp->firstline) && (line <= glyphp->lastline)) - bits = glyphp->bitsp[line]; - - while (TotalWidth > 32) { - while (shift < 32) { - glyphp++; - if ((line >= glyphp->firstline) && (line <= glyphp->lastline)) - bits |= SHIFT_L(glyphp->bitsp[line], shift); - shift += glyphp->width; - } -#ifdef TRIPLE_BITS - WRITE_BITS3(bits); -#else - WRITE_BITS(bits); -#endif - shift &= 31; - if (shift && (line >= glyphp->firstline) && (line <= glyphp->lastline)) - bits = SHIFT_R(glyphp->bitsp[line], glyphp->width - shift); - else - bits = 0; - TotalWidth -= 32; - } - - if (TotalWidth) { - TotalWidth -= shift; - while (TotalWidth > 0) { - glyphp++; - if ((line >= glyphp->firstline) && (line <= glyphp->lastline)) - bits |= SHIFT_L(glyphp->bitsp[line], shift); - shift += glyphp->width; - TotalWidth -= glyphp->width; - } -#ifdef TRIPLE_BITS - if (shift >= 22) { - WRITE_BITS3(bits); - } - else if (shift >= 11) { - WRITE_BITS2(bits); - } - else { - WRITE_BITS1(bits); - } -#else - WRITE_BITS(bits); -#endif - } - - return base; -} diff --git a/xserver/hw/xfree86/xaa/xaaNonTEText.c b/xserver/hw/xfree86/xaa/xaaNonTEText.c deleted file mode 100644 index 35b43912b..000000000 --- a/xserver/hw/xfree86/xaa/xaaNonTEText.c +++ /dev/null @@ -1,591 +0,0 @@ - -/******************************************************************** - - In this file we have GC level replacements for PolyText8/16, - ImageText8/16, ImageGlyphBlt and PolyGlyphBlt for NonTE (proportional) - fonts. The idea is that everything in this file is device independent. - The mentioned GCOps are merely wrappers for the - PolyGlyphBltNonTEColorExpansion and ImageGlyphBltNonTEColorExpansion - functions which calculate the boxes containing arbitrarily clipped - text and passes them to the NonTEGlyphRenderer which will usually - be a lower level XAA function which renders these clipped glyphs using - the basic color expansion functions exported by the chipset driver. - The NonTEGlyphRenderer itself may optionally be driver supplied to - facilitate work-arounds/optimizations at a higher level than usual. - - Written by Mark Vojkovich (mvojkovi@ucsd.edu) - -********************************************************************/ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include - -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" - -#include -#include -#include "scrnintstr.h" -#include "dixfontstr.h" -#include "xf86str.h" -#include "xaa.h" -#include "xaacexp.h" -#include "xaalocal.h" -#include "gcstruct.h" -#include "pixmapstr.h" - -static void ImageGlyphBltNonTEColorExpansion(ScrnInfoPtr pScrn, - int xInit, int yInit, FontPtr font, - int fg, int bg, unsigned planemask, - RegionPtr cclip, int nglyph, - unsigned char *gBase, - CharInfoPtr * ppci); -static int PolyGlyphBltNonTEColorExpansion(ScrnInfoPtr pScrn, int xInit, - int yInit, FontPtr font, int fg, - int rop, unsigned planemask, - RegionPtr cclip, int nglyph, - unsigned char *gBase, - CharInfoPtr * ppci); - -/******************************************************************** - - GC level replacements for PolyText8/16 and ImageText8/16 - for NonTE fonts when using color expansion. - -********************************************************************/ - -int -XAAPolyText8NonTEColorExpansion(DrawablePtr pDraw, - GCPtr pGC, int x, int y, int count, char *chars) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - unsigned long n; - int width = 0; - - (*pGC->font->get_glyphs) (pGC->font, (unsigned long) count, - (unsigned char *) chars, Linear8Bit, &n, - infoRec->CharInfo); - - if (n) { - width = PolyGlyphBltNonTEColorExpansion(infoRec->pScrn, - x + pDraw->x, y + pDraw->y, - pGC->font, pGC->fgPixel, - pGC->alu, pGC->planemask, - pGC->pCompositeClip, n, - FONTGLYPHS(pGC->font), - infoRec->CharInfo); - } - - return x + width; -} - -int -XAAPolyText16NonTEColorExpansion(DrawablePtr pDraw, - GCPtr pGC, - int x, int y, int count, unsigned short *chars) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - unsigned long n; - int width = 0; - - (*pGC->font->get_glyphs) (pGC->font, (unsigned long) count, - (unsigned char *) chars, - (FONTLASTROW(pGC->font) == - 0) ? Linear16Bit : TwoD16Bit, &n, - infoRec->CharInfo); - - if (n) { - width = PolyGlyphBltNonTEColorExpansion(infoRec->pScrn, - x + pDraw->x, y + pDraw->y, - pGC->font, pGC->fgPixel, - pGC->alu, pGC->planemask, - pGC->pCompositeClip, n, - FONTGLYPHS(pGC->font), - infoRec->CharInfo); - } - - return x + width; -} - -void -XAAImageText8NonTEColorExpansion(DrawablePtr pDraw, - GCPtr pGC, - int x, int y, int count, char *chars) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - unsigned long n; - - if (!RegionNumRects(pGC->pCompositeClip)) - return; - - (*pGC->font->get_glyphs) (pGC->font, (unsigned long) count, - (unsigned char *) chars, Linear8Bit, &n, - infoRec->CharInfo); - - if (n) - ImageGlyphBltNonTEColorExpansion(infoRec->pScrn, x + pDraw->x, - y + pDraw->y, pGC->font, pGC->fgPixel, - pGC->bgPixel, pGC->planemask, - pGC->pCompositeClip, n, - FONTGLYPHS(pGC->font), - infoRec->CharInfo); -} - -void -XAAImageText16NonTEColorExpansion(DrawablePtr pDraw, - GCPtr pGC, - int x, - int y, int count, unsigned short *chars) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - unsigned long n; - - if (!RegionNumRects(pGC->pCompositeClip)) - return; - - (*pGC->font->get_glyphs) (pGC->font, (unsigned long) count, - (unsigned char *) chars, - (FONTLASTROW(pGC->font) == - 0) ? Linear16Bit : TwoD16Bit, &n, - infoRec->CharInfo); - - if (n) - ImageGlyphBltNonTEColorExpansion(infoRec->pScrn, x + pDraw->x, - y + pDraw->y, pGC->font, pGC->fgPixel, - pGC->bgPixel, pGC->planemask, - pGC->pCompositeClip, n, - FONTGLYPHS(pGC->font), - infoRec->CharInfo); -} - -/******************************************************************** - - GC level replacements for ImageGlyphBlt and PolyGlyphBlt for - NonTE fonts when using color expansion. - -********************************************************************/ - -void -XAAImageGlyphBltNonTEColorExpansion(DrawablePtr pDraw, GCPtr pGC, int xInit, int yInit, unsigned int nglyph, CharInfoPtr * ppci, /* array of character info */ - pointer pglyphBase /* start of array of glyphs */ - ) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - - if (!RegionNumRects(pGC->pCompositeClip)) - return; - - ImageGlyphBltNonTEColorExpansion(infoRec->pScrn, xInit + pDraw->x, - yInit + pDraw->y, pGC->font, pGC->fgPixel, - pGC->bgPixel, pGC->planemask, - pGC->pCompositeClip, nglyph, - (unsigned char *) pglyphBase, ppci); -} - -void -XAAPolyGlyphBltNonTEColorExpansion(DrawablePtr pDraw, GCPtr pGC, int xInit, int yInit, unsigned int nglyph, CharInfoPtr * ppci, /* array of character info */ - pointer pglyphBase /* start of array of glyphs */ - ) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - - if (!RegionNumRects(pGC->pCompositeClip)) - return; - - PolyGlyphBltNonTEColorExpansion(infoRec->pScrn, xInit + pDraw->x, - yInit + pDraw->y, pGC->font, pGC->fgPixel, - pGC->alu, pGC->planemask, - pGC->pCompositeClip, nglyph, - (unsigned char *) pglyphBase, ppci); -} - -/******************************************************************** - - ImageGlyphBltNonTEColorExpansion - - PolyGlyphBltNonTEColorExpansion - - - These guys compute the clipped pieces of text and send it to - the lower-level function which will handle acceleration of - arbitrarily clipped text. - -********************************************************************/ - -static int -CollectCharacterInfo(NonTEGlyphPtr glyphs, - unsigned int nglyph, CharInfoPtr * ppci, FontPtr pfont) -{ - int i, w = 0; - - for (i = 0; i < nglyph; i++, ppci++, glyphs++) { - glyphs->bits = (unsigned char *) ((*ppci)->bits); - glyphs->start = w + (*ppci)->metrics.leftSideBearing; - glyphs->end = w + (*ppci)->metrics.rightSideBearing; - glyphs->yoff = (*ppci)->metrics.ascent; - glyphs->height = glyphs->yoff + (*ppci)->metrics.descent; - glyphs->srcwidth = PADGLYPHWIDTHBYTES(glyphs->end - glyphs->start); - w += (*ppci)->metrics.characterWidth; - } - return w; -} - -static void -PolyGlyphBltAsSingleBitmap(ScrnInfoPtr pScrn, - int nglyph, - FontPtr font, - int xInit, - int yInit, - int nbox, - BoxPtr pbox, int fg, int rop, unsigned planemask) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - CARD32 *block, *pntr, *bits; - int pitch, topLine, botLine, top, bot, height; - int Left, Right, Top, Bottom; - int LeftEdge, RightEdge; - int bitPitch, shift, size, i, skippix; - NonTEGlyphPtr glyphs = infoRec->GlyphInfo; - Bool extra; - - Left = xInit + infoRec->GlyphInfo[0].start; - Right = xInit + infoRec->GlyphInfo[nglyph - 1].end; - Top = yInit - FONTMAXBOUNDS(font, ascent); - Bottom = yInit + FONTMAXBOUNDS(font, descent); - - /* get into the first band that may contain part of our string */ - while (nbox && (Top >= pbox->y2)) { - pbox++; - nbox--; - } - - if (!nbox) - return; - - pitch = (Right - Left + 31) >> 5; - size = (pitch << 2) * (Bottom - Top); - block = calloc(1, size); - - topLine = 10000; - botLine = -10000; - - while (nglyph--) { - top = -glyphs->yoff; - bot = top + glyphs->height; - if (top < topLine) - topLine = top; - if (bot > botLine) - botLine = bot; - skippix = glyphs->start - infoRec->GlyphInfo[0].start; - bits = (CARD32 *) glyphs->bits; - bitPitch = glyphs->srcwidth >> 2; - pntr = block + ((FONTMAXBOUNDS(font, ascent) + top) * pitch) + - (skippix >> 5); - shift = skippix & 31; - extra = ((shift + glyphs->end - glyphs->start) > 32); - - for (i = top; i < bot; i++) { - *pntr |= SHIFT_L(*bits, shift); - if (extra) - *(pntr + 1) |= SHIFT_R(*bits, 32 - shift); - pntr += pitch; - bits += bitPitch; - } - - glyphs++; - } - - pntr = block + ((FONTMAXBOUNDS(font, ascent) + topLine) * pitch); - - Top = yInit + topLine; - Bottom = yInit + botLine; - - while (nbox && (Top >= pbox->y2)) { - pbox++; - nbox--; - } - - while (nbox && (Bottom > pbox->y1)) { - LeftEdge = max(Left, pbox->x1); - RightEdge = min(Right, pbox->x2); - - if (RightEdge > LeftEdge) { - skippix = LeftEdge - Left; - topLine = max(Top, pbox->y1); - botLine = min(Bottom, pbox->y2); - height = botLine - topLine; - - if (height > 0) - (*infoRec->WriteBitmap) (pScrn, LeftEdge, topLine, - RightEdge - LeftEdge, height, - (unsigned char *) (pntr + - ((topLine - - Top) * pitch) + - (skippix >> 5)), - pitch << 2, skippix & 31, fg, -1, rop, - planemask); - } - - nbox--; - pbox++; - } - - free(block); -} - -static void -ImageGlyphBltNonTEColorExpansion(ScrnInfoPtr pScrn, - int xInit, int yInit, - FontPtr font, - int fg, int bg, - unsigned planemask, - RegionPtr cclip, - int nglyph, - unsigned char *gBase, CharInfoPtr * ppci) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - int skippix, skipglyph, width, n, i; - int Left, Right, Top, Bottom; - int LeftEdge, RightEdge, ytop, ybot; - int nbox = RegionNumRects(cclip); - BoxPtr pbox = RegionRects(cclip); - Bool AlreadySetup = FALSE; - - width = CollectCharacterInfo(infoRec->GlyphInfo, nglyph, ppci, font); - - /* find our backing rectangle dimensions */ - Left = xInit; - Right = Left + width; - Top = yInit - FONTASCENT(font); - Bottom = yInit + FONTDESCENT(font); - - /* get into the first band that may contain part of our box */ - while (nbox && (Top >= pbox->y2)) { - pbox++; - nbox--; - } - - while (nbox && (Bottom >= pbox->y1)) { - /* handle backing rect first */ - LeftEdge = max(Left, pbox->x1); - RightEdge = min(Right, pbox->x2); - if (RightEdge > LeftEdge) { - ytop = max(Top, pbox->y1); - ybot = min(Bottom, pbox->y2); - - if (ybot > ytop) { - if (!AlreadySetup) { - (*infoRec->SetupForSolidFill) (pScrn, bg, GXcopy, - planemask); - AlreadySetup = TRUE; - } - (*infoRec->SubsequentSolidFillRect) (pScrn, - LeftEdge, ytop, - RightEdge - LeftEdge, - ybot - ytop); - } - } - nbox--; - pbox++; - } - - nbox = RegionNumRects(cclip); - pbox = RegionRects(cclip); - - if (infoRec->WriteBitmap && (nglyph > 1) && - ((FONTMAXBOUNDS(font, rightSideBearing) - - FONTMINBOUNDS(font, leftSideBearing)) <= 32)) { - PolyGlyphBltAsSingleBitmap(pScrn, nglyph, font, - xInit, yInit, nbox, pbox, - fg, GXcopy, planemask); - - return; - } - - /* compute an approximate but covering bounding box */ - Left = xInit + infoRec->GlyphInfo[0].start; - Right = xInit + infoRec->GlyphInfo[nglyph - 1].end; - Top = yInit - FONTMAXBOUNDS(font, ascent); - Bottom = yInit + FONTMAXBOUNDS(font, descent); - - /* get into the first band that may contain part of our box */ - while (nbox && (Top >= pbox->y2)) { - pbox++; - nbox--; - } - - /* stop when the lower edge of the box is beyond our string */ - while (nbox && (Bottom >= pbox->y1)) { - LeftEdge = max(Left, pbox->x1); - RightEdge = min(Right, pbox->x2); - - if (RightEdge > LeftEdge) { /* we're possibly drawing something */ - ytop = max(Top, pbox->y1); - ybot = min(Bottom, pbox->y2); - if (ybot > ytop) { - skippix = LeftEdge - xInit; - skipglyph = 0; - while (skippix >= infoRec->GlyphInfo[skipglyph].end) - skipglyph++; - - skippix = RightEdge - xInit; - n = 0; - i = skipglyph; - while ((i < nglyph) && (skippix > infoRec->GlyphInfo[i].start)) { - i++; - n++; - } - - if (n) - (*infoRec->NonTEGlyphRenderer) (pScrn, - xInit, yInit, n, - infoRec->GlyphInfo + - skipglyph, pbox, fg, GXcopy, - planemask); - } - } - - nbox--; - pbox++; - } -} - -static int -PolyGlyphBltNonTEColorExpansion(ScrnInfoPtr pScrn, - int xInit, int yInit, - FontPtr font, - int fg, int rop, - unsigned planemask, - RegionPtr cclip, - int nglyph, - unsigned char *gBase, CharInfoPtr * ppci) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - int skippix, skipglyph, width, n, i; - int Left, Right, Top, Bottom; - int LeftEdge, RightEdge; - int nbox = RegionNumRects(cclip); - BoxPtr pbox = RegionRects(cclip); - - width = CollectCharacterInfo(infoRec->GlyphInfo, nglyph, ppci, font); - - if (!nbox) - return width; - - if ((infoRec->WriteBitmap) && (rop == GXcopy) && (nglyph > 1) && - ((FONTMAXBOUNDS(font, rightSideBearing) - - FONTMINBOUNDS(font, leftSideBearing)) <= 32)) { - - PolyGlyphBltAsSingleBitmap(pScrn, nglyph, font, - xInit, yInit, nbox, pbox, - fg, rop, planemask); - - return width; - } - - /* compute an approximate but covering bounding box */ - Left = xInit + infoRec->GlyphInfo[0].start; - Right = xInit + infoRec->GlyphInfo[nglyph - 1].end; - Top = yInit - FONTMAXBOUNDS(font, ascent); - Bottom = yInit + FONTMAXBOUNDS(font, descent); - - /* get into the first band that may contain part of our string */ - while (nbox && (Top >= pbox->y2)) { - pbox++; - nbox--; - } - - /* stop when the lower edge of the box is beyond our string */ - while (nbox && (Bottom >= pbox->y1)) { - LeftEdge = max(Left, pbox->x1); - RightEdge = min(Right, pbox->x2); - - if (RightEdge > LeftEdge) { /* we're possibly drawing something */ - - skippix = LeftEdge - xInit; - skipglyph = 0; - while (skippix >= infoRec->GlyphInfo[skipglyph].end) - skipglyph++; - - skippix = RightEdge - xInit; - n = 0; - i = skipglyph; - while ((i < nglyph) && (skippix > infoRec->GlyphInfo[i].start)) { - i++; - n++; - } - - if (n) - (*infoRec->NonTEGlyphRenderer) (pScrn, - xInit, yInit, n, - infoRec->GlyphInfo + skipglyph, - pbox, fg, rop, planemask); - } - - nbox--; - pbox++; - } - return width; -} - -/* It is possible that the none of the glyphs passed to the - NonTEGlyphRenderer will be drawn. This function being called - indicates that part of the text string's bounding box is visible - but not necessarily that any of the characters are visible */ - -void -XAANonTEGlyphRenderer(ScrnInfoPtr pScrn, - int x, int y, int n, - NonTEGlyphPtr glyphs, - BoxPtr pbox, int fg, int rop, unsigned int planemask) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - int x1, x2, y1, y2, i, w, h, skipleft, skiptop; - unsigned char *src; - - for (i = 0; i < n; i++, glyphs++) { - x1 = x + glyphs->start; - x2 = x + glyphs->end; - y1 = y - glyphs->yoff; - y2 = y1 + glyphs->height; - - if (y1 < pbox->y1) { - skiptop = pbox->y1 - y1; - y1 = pbox->y1; - } - else - skiptop = 0; - if (y2 > pbox->y2) - y2 = pbox->y2; - h = y2 - y1; - if (h <= 0) - continue; - - if (x1 < pbox->x1) { - skipleft = pbox->x1 - x1; - x1 = pbox->x1; - } - else - skipleft = 0; - if (x2 > pbox->x2) - x2 = pbox->x2; - - w = x2 - x1; - - if (w > 0) { - src = glyphs->bits + (skiptop * glyphs->srcwidth); - - if (skipleft) { - src += (skipleft >> 5) << 2; - skipleft &= 31; - } - - (*infoRec->WriteBitmap) (pScrn, x1, y1, w, h, src, - glyphs->srcwidth, skipleft, fg, -1, rop, - planemask); - } - } - -} diff --git a/xserver/hw/xfree86/xaa/xaaOffscreen.c b/xserver/hw/xfree86/xaa/xaaOffscreen.c deleted file mode 100644 index 7d89fc17a..000000000 --- a/xserver/hw/xfree86/xaa/xaaOffscreen.c +++ /dev/null @@ -1,163 +0,0 @@ - -/* - Copyright (c) 1999 - The XFree86 Project Inc. - - Written by Mark Vojkovich - -*/ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" - -#include -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "windowstr.h" -#include "xf86str.h" -#include "mi.h" -#include "miline.h" -#include "xaa.h" -#include "xaalocal.h" -#include "xaawrap.h" -#include "xf86fbman.h" -#include "servermd.h" - -void -XAAMoveOutOffscreenPixmaps(ScreenPtr pScreen) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); - PixmapLinkPtr pLink = infoRec->OffscreenPixmaps; - XAAPixmapPtr pPriv; - - while (pLink) { - pPriv = XAA_GET_PIXMAP_PRIVATE(pLink->pPix); - pLink->area = pPriv->offscreenArea; - XAAMoveOutOffscreenPixmap(pLink->pPix); - pLink = pLink->next; - } -} - -void -XAAMoveInOffscreenPixmaps(ScreenPtr pScreen) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); - PixmapLinkPtr pLink = infoRec->OffscreenPixmaps; - PixmapPtr pPix, pScreenPix, tmpPix; - pointer data; - XAAPixmapPtr pPriv; - GCPtr pGC; - FBAreaPtr area; - - pScreenPix = (*pScreen->GetScreenPixmap) (pScreen); - - while (pLink) { - pPix = pLink->pPix; - pPriv = XAA_GET_PIXMAP_PRIVATE(pPix); - area = pLink->area; - - data = pPix->devPrivate.ptr; - tmpPix = GetScratchPixmapHeader(pScreen, - pPix->drawable.width, - pPix->drawable.height, - pPix->drawable.depth, - pPix->drawable.bitsPerPixel, - pPix->devKind, data); - - pPriv->freeData = FALSE; - - pPix->drawable.x = area->box.x1; - pPix->drawable.y = area->box.y1; - pPix->devKind = pScreenPix->devKind; - pPix->devPrivate.ptr = pScreenPix->devPrivate.ptr; - pPix->drawable.bitsPerPixel = infoRec->pScrn->bitsPerPixel; - pPix->drawable.serialNumber = NEXT_SERIAL_NUMBER; - - if (!tmpPix) { - pPriv->offscreenArea = area; - free(data); - pLink = pLink->next; - continue; - } - - pGC = GetScratchGC(pPix->drawable.depth, pScreen); - ValidateGC((DrawablePtr) pPix, pGC); - - (*pGC->ops->CopyArea) ((DrawablePtr) tmpPix, (DrawablePtr) pPix, pGC, - 0, 0, pPix->drawable.width, - pPix->drawable.height, 0, 0); - - free(data); - tmpPix->devPrivate.ptr = NULL; - - FreeScratchGC(pGC); - FreeScratchPixmapHeader(tmpPix); - - pPriv->offscreenArea = area; - pLink->area = NULL; - pLink = pLink->next; - } -} - -void -XAARemoveAreaCallback(FBAreaPtr area) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(area->pScreen); - PixmapPtr pPix = (PixmapPtr) area->devPrivate.ptr; - XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPix); - - XAAMoveOutOffscreenPixmap(pPix); - - pPriv->flags &= ~OFFSCREEN; - - DELIST_OFFSCREEN_PIXMAP(pPix); -} - -void -XAAMoveOutOffscreenPixmap(PixmapPtr pPix) -{ - ScreenPtr pScreen = pPix->drawable.pScreen; - XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPix); - int width, height, devKind, bitsPerPixel; - PixmapPtr tmpPix; - unsigned char *data; - GCPtr pGC; - - width = pPix->drawable.width; - height = pPix->drawable.height; - bitsPerPixel = pPix->drawable.bitsPerPixel; - - devKind = BitmapBytePad(width * bitsPerPixel); - if (!(data = malloc(devKind * height))) - FatalError("Out of memory\n"); - - tmpPix = GetScratchPixmapHeader(pScreen, width, height, - pPix->drawable.depth, bitsPerPixel, devKind, - data); - if (!tmpPix) { - free(data); - FatalError("Out of memory\n"); - } - - pGC = GetScratchGC(pPix->drawable.depth, pScreen); - ValidateGC((DrawablePtr) tmpPix, pGC); - - (*pGC->ops->CopyArea) ((DrawablePtr) pPix, (DrawablePtr) tmpPix, - pGC, 0, 0, width, height, 0, 0); - - FreeScratchGC(pGC); - FreeScratchPixmapHeader(tmpPix); - - pPix->drawable.x = 0; - pPix->drawable.y = 0; - pPix->devKind = devKind; - pPix->devPrivate.ptr = data; - pPix->drawable.serialNumber = NEXT_SERIAL_NUMBER; - - pPriv->offscreenArea = NULL; - pPriv->freeData = TRUE; -} diff --git a/xserver/hw/xfree86/xaa/xaaOverlay.c b/xserver/hw/xfree86/xaa/xaaOverlay.c deleted file mode 100644 index 25d18da96..000000000 --- a/xserver/hw/xfree86/xaa/xaaOverlay.c +++ /dev/null @@ -1,122 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" - -#include -#include "scrnintstr.h" -#include "windowstr.h" -#include "xf86str.h" -#include "xaa.h" -#include "xaalocal.h" -#include "xaawrap.h" -#include "gcstruct.h" -#include "pixmapstr.h" -#include "mioverlay.h" - -#ifdef PANORAMIX -#include "panoramiX.h" -#include "panoramiXsrv.h" -#endif - -static void -XAACopyWindow8_32(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) -{ - DDXPointPtr pptSrc, ppt; - RegionRec rgnDst; - BoxPtr pbox; - int dx, dy, nbox; - WindowPtr pwinRoot; - ScreenPtr pScreen = pWin->drawable.pScreen; - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_DRAWABLE((&pWin->drawable)); - Bool doUnderlay = miOverlayCopyUnderlay(pScreen); - RegionPtr borderClip = &pWin->borderClip; - Bool freeReg = FALSE; - - if (!infoRec->pScrn->vtSema || !infoRec->ScreenToScreenBitBlt || - (infoRec->ScreenToScreenBitBltFlags & NO_PLANEMASK)) { - XAA_SCREEN_PROLOGUE(pScreen, CopyWindow); - if (infoRec->pScrn->vtSema && infoRec->NeedToSync) { - (*infoRec->Sync) (infoRec->pScrn); - infoRec->NeedToSync = FALSE; - } - (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc); - XAA_SCREEN_EPILOGUE(pScreen, CopyWindow, XAACopyWindow8_32); - return; - } - - pwinRoot = pScreen->root; - - if (doUnderlay) - freeReg = miOverlayCollectUnderlayRegions(pWin, &borderClip); - - RegionNull(&rgnDst); - - dx = ptOldOrg.x - pWin->drawable.x; - dy = ptOldOrg.y - pWin->drawable.y; - RegionTranslate(prgnSrc, -dx, -dy); - RegionIntersect(&rgnDst, borderClip, prgnSrc); - - pbox = RegionRects(&rgnDst); - nbox = RegionNumRects(&rgnDst); - if (!nbox || !(pptSrc = (DDXPointPtr) malloc(nbox * sizeof(DDXPointRec)))) { - RegionUninit(&rgnDst); - return; - } - ppt = pptSrc; - - while (nbox--) { - ppt->x = pbox->x1 + dx; - ppt->y = pbox->y1 + dy; - ppt++; - pbox++; - } - - infoRec->ScratchGC.planemask = doUnderlay ? 0x00ffffff : 0xff000000; - infoRec->ScratchGC.alu = GXcopy; - - XAADoBitBlt((DrawablePtr) pwinRoot, (DrawablePtr) pwinRoot, - &(infoRec->ScratchGC), &rgnDst, pptSrc); - - free(pptSrc); - RegionUninit(&rgnDst); - if (freeReg) - RegionDestroy(borderClip); -} - -static void -XAASetColorKey8_32(ScreenPtr pScreen, int nbox, BoxPtr pbox) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); - ScrnInfoPtr pScrn = infoRec->pScrn; - - /* I'm counting on writes being clipped away while switched away. - If this isn't going to be true then I need to be wrapping instead. */ - if (!infoRec->pScrn->vtSema) - return; - - (*infoRec->FillSolidRects) (pScrn, pScrn->colorKey << 24, GXcopy, - 0xff000000, nbox, pbox); - - SET_SYNC_FLAG(infoRec); -} - -void -XAASetupOverlay8_32Planar(ScreenPtr pScreen) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); - int i; - - pScreen->CopyWindow = XAACopyWindow8_32; - - if (!(infoRec->FillSolidRectsFlags & NO_PLANEMASK)) - miOverlaySetTransFunction(pScreen, XAASetColorKey8_32); - - infoRec->FullPlanemask = ~0; - for (i = 0; i < 32; i++) /* haven't thought about this much */ - infoRec->FullPlanemasks[i] = ~0; -} diff --git a/xserver/hw/xfree86/xaa/xaaOverlayDF.c b/xserver/hw/xfree86/xaa/xaaOverlayDF.c deleted file mode 100644 index 5918f65a3..000000000 --- a/xserver/hw/xfree86/xaa/xaaOverlayDF.c +++ /dev/null @@ -1,906 +0,0 @@ -/* - Copyright (c) 1999 - The XFree86 Project Inc. - - Written by Mark Vojkovich -*/ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" - -#include -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "windowstr.h" -#include "xf86str.h" -#include "mi.h" -#include "miline.h" -#include "xaa.h" -#include "xaalocal.h" -#include "xaawrap.h" -#include "servermd.h" - -/* Screen funcs */ - -static void XAAOverCopyWindow(WindowPtr, DDXPointRec, RegionPtr); -static void XAAOverWindowExposures(WindowPtr, RegionPtr, RegionPtr); - -static int XAAOverStippledFillChooser(GCPtr); -static int XAAOverOpaqueStippledFillChooser(GCPtr); -static int XAAOverTiledFillChooser(GCPtr); - -/* GC funcs */ - -static RegionPtr XAAOverCopyArea(DrawablePtr, DrawablePtr, GC *, - int, int, int, int, int, int); -static RegionPtr XAAOverCopyPlane(DrawablePtr, DrawablePtr, GCPtr, - int, int, int, int, int, int, unsigned long); -static void XAAOverPushPixelsSolid(GCPtr, PixmapPtr, DrawablePtr, int, - int, int, int); -static void XAAOverPolyFillRectSolid(DrawablePtr, GCPtr, int, xRectangle *); -static void XAAOverPolyFillRectStippled(DrawablePtr, GCPtr, int, xRectangle *); -static void XAAOverPolyFillRectOpaqueStippled(DrawablePtr, GCPtr, - int, xRectangle *); -static void XAAOverPolyFillRectTiled(DrawablePtr, GCPtr, int, xRectangle *); -static void XAAOverFillSpansSolid(DrawablePtr, GCPtr, int, DDXPointPtr, - int *, int); -static void XAAOverFillSpansStippled(DrawablePtr, GCPtr, int, DDXPointPtr, - int *, int); -static void XAAOverFillSpansOpaqueStippled(DrawablePtr, GCPtr, int, - DDXPointPtr, int *, int); -static void XAAOverFillSpansTiled(DrawablePtr, GCPtr, int, DDXPointPtr, - int *, int); -static int XAAOverPolyText8TE(DrawablePtr, GCPtr, int, int, int, char *); -static int XAAOverPolyText16TE(DrawablePtr, GCPtr, int, int, int, - unsigned short *); -static void XAAOverImageText8TE(DrawablePtr, GCPtr, int, int, int, char *); -static void XAAOverImageText16TE(DrawablePtr, GCPtr, int, int, int, - unsigned short *); -static void XAAOverImageGlyphBltTE(DrawablePtr, GCPtr, int, int, - unsigned int, CharInfoPtr *, pointer); -static void XAAOverPolyGlyphBltTE(DrawablePtr, GCPtr, int, int, - unsigned int, CharInfoPtr *, pointer); -static int XAAOverPolyText8NonTE(DrawablePtr, GCPtr, int, int, int, char *); -static int XAAOverPolyText16NonTE(DrawablePtr, GCPtr, int, int, int, - unsigned short *); -static void XAAOverImageText8NonTE(DrawablePtr, GCPtr, int, int, int, char *); -static void XAAOverImageText16NonTE(DrawablePtr, GCPtr, int, int, int, - unsigned short *); -static void XAAOverImageGlyphBltNonTE(DrawablePtr, GCPtr, int, int, - unsigned int, CharInfoPtr *, pointer); -static void XAAOverPolyGlyphBltNonTE(DrawablePtr, GCPtr, int, int, - unsigned int, CharInfoPtr *, pointer); -static void XAAOverPolyRectangleThinSolid(DrawablePtr, GCPtr, int, - xRectangle *); -static void XAAOverPolylinesWideSolid(DrawablePtr, GCPtr, int, int, - DDXPointPtr); -static void XAAOverPolylinesThinSolid(DrawablePtr, GCPtr, int, int, - DDXPointPtr); -static void XAAOverPolySegmentThinSolid(DrawablePtr, GCPtr, int, xSegment *); -static void XAAOverPolylinesThinDashed(DrawablePtr, GCPtr, int, int, - DDXPointPtr); -static void XAAOverPolySegmentThinDashed(DrawablePtr, GCPtr, int, xSegment *); -static void XAAOverFillPolygonSolid(DrawablePtr, GCPtr, int, int, int, - DDXPointPtr); -static void XAAOverFillPolygonStippled(DrawablePtr, GCPtr, int, int, int, - DDXPointPtr); -static void XAAOverFillPolygonOpaqueStippled(DrawablePtr, GCPtr, int, int, int, - DDXPointPtr); -static void XAAOverFillPolygonTiled(DrawablePtr, GCPtr, int, int, int, - DDXPointPtr); -static void XAAOverPolyFillArcSolid(DrawablePtr, GCPtr, int, xArc *); -static void XAAOverPutImage(DrawablePtr, GCPtr, int, int, int, int, int, - int, int, char *); - -typedef struct { - ScrnInfoPtr pScrn; - DepthChangeFuncPtr callback; - int currentDepth; -/* GC funcs */ - RegionPtr (*CopyArea) (DrawablePtr, DrawablePtr, GC *, - int, int, int, int, int, int); - RegionPtr (*CopyPlane) (DrawablePtr, DrawablePtr, GCPtr, - int, int, int, int, int, int, unsigned long); - void (*PushPixelsSolid) (GCPtr, PixmapPtr, DrawablePtr, int, int, int, int); - void (*PolyFillRectSolid) (DrawablePtr, GCPtr, int, xRectangle *); - void (*PolyFillRectStippled) (DrawablePtr, GCPtr, int, xRectangle *); - void (*PolyFillRectOpaqueStippled) (DrawablePtr, GCPtr, int, xRectangle *); - void (*PolyFillRectTiled) (DrawablePtr, GCPtr, int, xRectangle *); - void (*FillSpansSolid) (DrawablePtr, GCPtr, int, DDXPointPtr, int *, int); - void (*FillSpansStippled) (DrawablePtr, GCPtr, int, DDXPointPtr, int *, - int); - void (*FillSpansOpaqueStippled) (DrawablePtr, GCPtr, int, DDXPointPtr, - int *, int); - void (*FillSpansTiled) (DrawablePtr, GCPtr, int, DDXPointPtr, int *, int); - int (*PolyText8TE) (DrawablePtr, GCPtr, int, int, int, char *); - int (*PolyText16TE) (DrawablePtr, GCPtr, int, int, int, unsigned short *); - void (*ImageText8TE) (DrawablePtr, GCPtr, int, int, int, char *); - void (*ImageText16TE) (DrawablePtr, GCPtr, int, int, int, unsigned short *); - void (*ImageGlyphBltTE) (DrawablePtr, GCPtr, int, int, unsigned int, - CharInfoPtr *, pointer); - void (*PolyGlyphBltTE) (DrawablePtr, GCPtr, int, int, unsigned int, - CharInfoPtr *, pointer); - int (*PolyText8NonTE) (DrawablePtr, GCPtr, int, int, int, char *); - int (*PolyText16NonTE) (DrawablePtr, GCPtr, int, int, int, - unsigned short *); - void (*ImageText8NonTE) (DrawablePtr, GCPtr, int, int, int, char *); - void (*ImageText16NonTE) (DrawablePtr, GCPtr, int, int, int, - unsigned short *); - void (*ImageGlyphBltNonTE) (DrawablePtr, GCPtr, int, int, unsigned int, - CharInfoPtr *, pointer); - void (*PolyGlyphBltNonTE) (DrawablePtr, GCPtr, int, int, unsigned int, - CharInfoPtr *, pointer); - void (*PolyRectangleThinSolid) (DrawablePtr, GCPtr, int, xRectangle *); - void (*PolylinesWideSolid) (DrawablePtr, GCPtr, int, int, DDXPointPtr); - - void (*PolylinesThinSolid) (DrawablePtr, GCPtr, int, int, DDXPointPtr); - void (*PolySegmentThinSolid) (DrawablePtr, GCPtr, int, xSegment *); - void (*PolylinesThinDashed) (DrawablePtr, GCPtr, int, int, DDXPointPtr); - void (*PolySegmentThinDashed) (DrawablePtr, GCPtr, int, xSegment *); - void (*FillPolygonSolid) (DrawablePtr, GCPtr, int, int, int, DDXPointPtr); - void (*FillPolygonStippled) (DrawablePtr, GCPtr, int, int, int, - DDXPointPtr); - void (*FillPolygonOpaqueStippled) (DrawablePtr, GCPtr, int, int, int, - DDXPointPtr); - void (*FillPolygonTiled) (DrawablePtr, GCPtr, int, int, int, DDXPointPtr); - void (*PolyFillArcSolid) (DrawablePtr, GCPtr, int, xArc *); - void (*PutImage) (DrawablePtr, GCPtr, int, int, int, int, int, int, - int, char *); - int (*StippledFillChooser) (GCPtr); - int (*OpaqueStippledFillChooser) (GCPtr); - int (*TiledFillChooser) (GCPtr); -} XAAOverlayRec, *XAAOverlayPtr; - -static DevPrivateKeyRec XAAOverlayKeyRec; - -#define XAAOverlayKey (&XAAOverlayKeyRec) - -#define GET_OVERLAY_PRIV(pScreen) \ - (XAAOverlayPtr)dixLookupPrivate(&(pScreen)->devPrivates, XAAOverlayKey) - -#define SWITCH_DEPTH(d) \ - if(pOverPriv->currentDepth != d) { \ - (*pOverPriv->callback)(pOverPriv->pScrn, d); \ - pOverPriv->currentDepth = d; \ - } - -Bool -XAAInitDualFramebufferOverlay(ScreenPtr pScreen, DepthChangeFuncPtr callback) -{ - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); - XAAOverlayPtr pOverPriv; - - if (!dixRegisterPrivateKey(&XAAOverlayKeyRec, PRIVATE_SCREEN, 0)) - return FALSE; - - if (!(pOverPriv = malloc(sizeof(XAAOverlayRec)))) - return FALSE; - - dixSetPrivate(&pScreen->devPrivates, XAAOverlayKey, pOverPriv); - - pOverPriv->pScrn = pScrn; - pOverPriv->callback = callback; - pOverPriv->currentDepth = -1; - - /* Overwrite key screen functions. The XAA core will clean up */ - - pScreen->CopyWindow = XAAOverCopyWindow; - pScreen->WindowExposures = XAAOverWindowExposures; - - pOverPriv->StippledFillChooser = infoRec->StippledFillChooser; - pOverPriv->OpaqueStippledFillChooser = infoRec->OpaqueStippledFillChooser; - pOverPriv->TiledFillChooser = infoRec->TiledFillChooser; - - infoRec->StippledFillChooser = XAAOverStippledFillChooser; - infoRec->OpaqueStippledFillChooser = XAAOverOpaqueStippledFillChooser; - infoRec->TiledFillChooser = XAAOverTiledFillChooser; - - /* wrap all XAA GC rendering */ - - pOverPriv->CopyArea = infoRec->CopyArea; - pOverPriv->CopyPlane = infoRec->CopyPlane; - pOverPriv->PushPixelsSolid = infoRec->PushPixelsSolid; - pOverPriv->PolyFillRectSolid = infoRec->PolyFillRectSolid; - pOverPriv->PolyFillRectStippled = infoRec->PolyFillRectStippled; - pOverPriv->PolyFillRectOpaqueStippled = infoRec->PolyFillRectOpaqueStippled; - pOverPriv->PolyFillRectTiled = infoRec->PolyFillRectTiled; - pOverPriv->FillSpansSolid = infoRec->FillSpansSolid; - pOverPriv->FillSpansStippled = infoRec->FillSpansStippled; - pOverPriv->FillSpansOpaqueStippled = infoRec->FillSpansOpaqueStippled; - pOverPriv->FillSpansTiled = infoRec->FillSpansTiled; - pOverPriv->PolyText8TE = infoRec->PolyText8TE; - pOverPriv->PolyText16TE = infoRec->PolyText16TE; - pOverPriv->ImageText8TE = infoRec->ImageText8TE; - pOverPriv->ImageText16TE = infoRec->ImageText16TE; - pOverPriv->ImageGlyphBltTE = infoRec->ImageGlyphBltTE; - pOverPriv->PolyGlyphBltTE = infoRec->PolyGlyphBltTE; - pOverPriv->PolyText8NonTE = infoRec->PolyText8NonTE; - pOverPriv->PolyText16NonTE = infoRec->PolyText16NonTE; - pOverPriv->ImageText8NonTE = infoRec->ImageText8NonTE; - pOverPriv->ImageText16NonTE = infoRec->ImageText16NonTE; - pOverPriv->ImageGlyphBltNonTE = infoRec->ImageGlyphBltNonTE; - pOverPriv->PolyGlyphBltNonTE = infoRec->PolyGlyphBltNonTE; - pOverPriv->PolyRectangleThinSolid = infoRec->PolyRectangleThinSolid; - pOverPriv->PolylinesWideSolid = infoRec->PolylinesWideSolid; - pOverPriv->PolylinesThinSolid = infoRec->PolylinesThinSolid; - pOverPriv->PolySegmentThinSolid = infoRec->PolySegmentThinSolid; - pOverPriv->PolylinesThinDashed = infoRec->PolylinesThinDashed; - pOverPriv->PolySegmentThinDashed = infoRec->PolySegmentThinDashed; - pOverPriv->FillPolygonSolid = infoRec->FillPolygonSolid; - pOverPriv->FillPolygonStippled = infoRec->FillPolygonStippled; - pOverPriv->FillPolygonOpaqueStippled = infoRec->FillPolygonOpaqueStippled; - pOverPriv->FillPolygonTiled = infoRec->FillPolygonTiled; - pOverPriv->PolyFillArcSolid = infoRec->PolyFillArcSolid; - pOverPriv->PutImage = infoRec->PutImage; - - if (infoRec->CopyArea) - infoRec->CopyArea = XAAOverCopyArea; - if (infoRec->CopyPlane) - infoRec->CopyPlane = XAAOverCopyPlane; - if (infoRec->PushPixelsSolid) - infoRec->PushPixelsSolid = XAAOverPushPixelsSolid; - if (infoRec->PolyFillRectSolid) - infoRec->PolyFillRectSolid = XAAOverPolyFillRectSolid; - if (infoRec->PolyFillRectStippled) - infoRec->PolyFillRectStippled = XAAOverPolyFillRectStippled; - if (infoRec->PolyFillRectOpaqueStippled) - infoRec->PolyFillRectOpaqueStippled = XAAOverPolyFillRectOpaqueStippled; - if (infoRec->PolyFillRectTiled) - infoRec->PolyFillRectTiled = XAAOverPolyFillRectTiled; - if (infoRec->FillSpansSolid) - infoRec->FillSpansSolid = XAAOverFillSpansSolid; - if (infoRec->FillSpansStippled) - infoRec->FillSpansStippled = XAAOverFillSpansStippled; - if (infoRec->FillSpansOpaqueStippled) - infoRec->FillSpansOpaqueStippled = XAAOverFillSpansOpaqueStippled; - if (infoRec->FillSpansTiled) - infoRec->FillSpansTiled = XAAOverFillSpansTiled; - if (infoRec->PolyText8TE) - infoRec->PolyText8TE = XAAOverPolyText8TE; - if (infoRec->PolyText16TE) - infoRec->PolyText16TE = XAAOverPolyText16TE; - if (infoRec->ImageText8TE) - infoRec->ImageText8TE = XAAOverImageText8TE; - if (infoRec->ImageText16TE) - infoRec->ImageText16TE = XAAOverImageText16TE; - if (infoRec->ImageGlyphBltTE) - infoRec->ImageGlyphBltTE = XAAOverImageGlyphBltTE; - if (infoRec->PolyGlyphBltTE) - infoRec->PolyGlyphBltTE = XAAOverPolyGlyphBltTE; - if (infoRec->PolyText8NonTE) - infoRec->PolyText8NonTE = XAAOverPolyText8NonTE; - if (infoRec->PolyText16NonTE) - infoRec->PolyText16NonTE = XAAOverPolyText16NonTE; - if (infoRec->ImageText8NonTE) - infoRec->ImageText8NonTE = XAAOverImageText8NonTE; - if (infoRec->ImageText16NonTE) - infoRec->ImageText16NonTE = XAAOverImageText16NonTE; - if (infoRec->ImageGlyphBltNonTE) - infoRec->ImageGlyphBltNonTE = XAAOverImageGlyphBltNonTE; - if (infoRec->PolyGlyphBltNonTE) - infoRec->PolyGlyphBltNonTE = XAAOverPolyGlyphBltNonTE; - if (infoRec->PolyRectangleThinSolid) - infoRec->PolyRectangleThinSolid = XAAOverPolyRectangleThinSolid; - if (infoRec->PolylinesWideSolid) - infoRec->PolylinesWideSolid = XAAOverPolylinesWideSolid; - if (infoRec->PolylinesThinSolid) - infoRec->PolylinesThinSolid = XAAOverPolylinesThinSolid; - if (infoRec->PolySegmentThinSolid) - infoRec->PolySegmentThinSolid = XAAOverPolySegmentThinSolid; - if (infoRec->PolylinesThinDashed) - infoRec->PolylinesThinDashed = XAAOverPolylinesThinDashed; - if (infoRec->PolySegmentThinDashed) - infoRec->PolySegmentThinDashed = XAAOverPolySegmentThinDashed; - if (infoRec->FillPolygonSolid) - infoRec->FillPolygonSolid = XAAOverFillPolygonSolid; - if (infoRec->FillPolygonStippled) - infoRec->FillPolygonStippled = XAAOverFillPolygonStippled; - if (infoRec->FillPolygonOpaqueStippled) - infoRec->FillPolygonOpaqueStippled = XAAOverFillPolygonOpaqueStippled; - if (infoRec->FillPolygonTiled) - infoRec->FillPolygonTiled = XAAOverFillPolygonTiled; - if (infoRec->PolyFillArcSolid) - infoRec->PolyFillArcSolid = XAAOverPolyFillArcSolid; - if (infoRec->PutImage) - infoRec->PutImage = XAAOverPutImage; - - return TRUE; -} - -/*********************** Screen functions ************************/ - -void -XAAOverCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pScreen); - ScrnInfoPtr pScrn = infoRec->pScrn; - DDXPointPtr ppt, pptSrc; - RegionRec rgnDst; - BoxPtr pbox; - int i, nbox, dx, dy; - WindowPtr pRoot = pScreen->root; - - if (!pScrn->vtSema || !infoRec->ScreenToScreenBitBlt) { - XAA_SCREEN_PROLOGUE(pScreen, CopyWindow); - if (pScrn->vtSema && infoRec->NeedToSync) { - (*infoRec->Sync) (pScrn); - infoRec->NeedToSync = FALSE; - } - (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc); - XAA_SCREEN_EPILOGUE(pScreen, CopyWindow, XAAOverCopyWindow); - return; - } - - infoRec->ScratchGC.alu = GXcopy; - infoRec->ScratchGC.planemask = ~0; - - RegionNull(&rgnDst); - - dx = ptOldOrg.x - pWin->drawable.x; - dy = ptOldOrg.y - pWin->drawable.y; - RegionTranslate(prgnSrc, -dx, -dy); - RegionIntersect(&rgnDst, &pWin->borderClip, prgnSrc); - - nbox = RegionNumRects(&rgnDst); - if (nbox && (pptSrc = (DDXPointPtr) malloc(nbox * sizeof(DDXPointRec)))) { - - pbox = RegionRects(&rgnDst); - for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) { - ppt->x = pbox->x1 + dx; - ppt->y = pbox->y1 + dy; - } - - SWITCH_DEPTH(8); - XAADoBitBlt((DrawablePtr) pRoot, (DrawablePtr) pRoot, - &(infoRec->ScratchGC), &rgnDst, pptSrc); - - if (pWin->drawable.bitsPerPixel != 8) { - SWITCH_DEPTH(pScrn->depth); - XAADoBitBlt((DrawablePtr) pRoot, (DrawablePtr) pRoot, - &(infoRec->ScratchGC), &rgnDst, pptSrc); - } - - free(pptSrc); - } - - RegionUninit(&rgnDst); - - if (pWin->drawable.depth == 8) { - RegionNull(&rgnDst); - miSegregateChildren(pWin, &rgnDst, pScrn->depth); - if (RegionNotEmpty(&rgnDst)) { - RegionIntersect(&rgnDst, &rgnDst, prgnSrc); - nbox = RegionNumRects(&rgnDst); - if (nbox && - (pptSrc = (DDXPointPtr) malloc(nbox * sizeof(DDXPointRec)))) { - - pbox = RegionRects(&rgnDst); - for (i = nbox, ppt = pptSrc; i--; ppt++, pbox++) { - ppt->x = pbox->x1 + dx; - ppt->y = pbox->y1 + dy; - } - - SWITCH_DEPTH(pScrn->depth); - XAADoBitBlt((DrawablePtr) pRoot, (DrawablePtr) pRoot, - &(infoRec->ScratchGC), &rgnDst, pptSrc); - free(pptSrc); - } - } - RegionUninit(&rgnDst); - } -} - -void -XAAOverWindowExposures(WindowPtr pWin, RegionPtr pReg, RegionPtr pOtherReg) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); - - if ((pWin->drawable.bitsPerPixel != 8) && infoRec->pScrn->vtSema) { - if (RegionNumRects(pReg) && infoRec->FillSolidRects) { - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pScreen); - - SWITCH_DEPTH(8); - (*infoRec->FillSolidRects) (infoRec->pScrn, - infoRec->pScrn->colorKey, GXcopy, ~0, - RegionNumRects(pReg), - RegionRects(pReg)); - miWindowExposures(pWin, pReg, pOtherReg); - return; - } - else if (infoRec->NeedToSync) { - (*infoRec->Sync) (infoRec->pScrn); - infoRec->NeedToSync = FALSE; - } - } - - XAA_SCREEN_PROLOGUE(pScreen, WindowExposures); - (*pScreen->WindowExposures) (pWin, pReg, pOtherReg); - XAA_SCREEN_EPILOGUE(pScreen, WindowExposures, XAAOverWindowExposures); -} - -/********************* Choosers *************************/ - -static int -XAAOverStippledFillChooser(GCPtr pGC) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - int ret; - - ret = (*pOverPriv->StippledFillChooser) (pGC); - - if ((pGC->depth == 8) && ((ret == DO_COLOR_8x8) || (ret == DO_CACHE_BLT))) { - ret = 0; - } - - return ret; -} - -static int -XAAOverOpaqueStippledFillChooser(GCPtr pGC) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - int ret; - - ret = (*pOverPriv->OpaqueStippledFillChooser) (pGC); - - if ((pGC->depth == 8) && ((ret == DO_COLOR_8x8) || (ret == DO_CACHE_BLT))) { - ret = 0; - } - - return ret; -} - -static int -XAAOverTiledFillChooser(GCPtr pGC) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - int ret; - - ret = (*pOverPriv->TiledFillChooser) (pGC); - - if ((pGC->depth == 8) && ((ret == DO_COLOR_8x8) || (ret == DO_CACHE_BLT))) { - ret = 0; - } - - return ret; -} - -/**************************** GC Functions **************************/ - -static RegionPtr -XAAOverCopyArea(DrawablePtr pSrc, - DrawablePtr pDst, - GC * pGC, - int srcx, int srcy, int width, int height, int dstx, int dsty) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - return (*pOverPriv->CopyArea) (pSrc, pDst, - pGC, srcx, srcy, width, height, dstx, dsty); -} - -static RegionPtr -XAAOverCopyPlane(DrawablePtr pSrc, - DrawablePtr pDst, - GCPtr pGC, - int srcx, int srcy, - int width, int height, - int dstx, int dsty, unsigned long bitPlane) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - return (*pOverPriv->CopyPlane) (pSrc, pDst, - pGC, srcx, srcy, width, height, dstx, dsty, - bitPlane); - -} - -static void -XAAOverPushPixelsSolid(GCPtr pGC, - PixmapPtr pBitMap, - DrawablePtr pDraw, int dx, int dy, int xOrg, int yOrg) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - (*pOverPriv->PushPixelsSolid) (pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg); -} - -static void -XAAOverPolyFillRectSolid(DrawablePtr pDraw, - GCPtr pGC, int nrectFill, xRectangle *prectInit) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - (*pOverPriv->PolyFillRectSolid) (pDraw, pGC, nrectFill, prectInit); -} - -static void -XAAOverPolyFillRectStippled(DrawablePtr pDraw, - GCPtr pGC, int nrectFill, xRectangle *prectInit) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - (*pOverPriv->PolyFillRectStippled) (pDraw, pGC, nrectFill, prectInit); -} - -static void -XAAOverPolyFillRectOpaqueStippled(DrawablePtr pDraw, - GCPtr pGC, - int nrectFill, xRectangle *prectInit) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - (*pOverPriv->PolyFillRectOpaqueStippled) (pDraw, pGC, nrectFill, prectInit); -} - -static void -XAAOverPolyFillRectTiled(DrawablePtr pDraw, - GCPtr pGC, int nrectFill, xRectangle *prectInit) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - (*pOverPriv->PolyFillRectTiled) (pDraw, pGC, nrectFill, prectInit); -} - -static void -XAAOverFillSpansSolid(DrawablePtr pDraw, - GCPtr pGC, - int nInit, DDXPointPtr ppt, int *pwidth, int fSorted) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - (*pOverPriv->FillSpansSolid) (pDraw, pGC, nInit, ppt, pwidth, fSorted); -} - -static void -XAAOverFillSpansStippled(DrawablePtr pDraw, - GCPtr pGC, - int nInit, DDXPointPtr ppt, int *pwidth, int fSorted) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - (*pOverPriv->FillSpansStippled) (pDraw, pGC, nInit, ppt, pwidth, fSorted); -} - -static void -XAAOverFillSpansOpaqueStippled(DrawablePtr pDraw, - GCPtr pGC, - int nInit, - DDXPointPtr ppt, int *pwidth, int fSorted) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - (*pOverPriv->FillSpansOpaqueStippled) (pDraw, pGC, nInit, ppt, pwidth, - fSorted); -} - -static void -XAAOverFillSpansTiled(DrawablePtr pDraw, - GCPtr pGC, - int nInit, DDXPointPtr ppt, int *pwidth, int fSorted) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - (*pOverPriv->FillSpansTiled) (pDraw, pGC, nInit, ppt, pwidth, fSorted); -} - -static int -XAAOverPolyText8TE(DrawablePtr pDraw, - GCPtr pGC, int x, int y, int count, char *chars) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - return (*pOverPriv->PolyText8TE) (pDraw, pGC, x, y, count, chars); -} - -static int -XAAOverPolyText16TE(DrawablePtr pDraw, - GCPtr pGC, int x, int y, int count, unsigned short *chars) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - return (*pOverPriv->PolyText16TE) (pDraw, pGC, x, y, count, chars); -} - -static void -XAAOverImageText8TE(DrawablePtr pDraw, - GCPtr pGC, int x, int y, int count, char *chars) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - (*pOverPriv->ImageText8TE) (pDraw, pGC, x, y, count, chars); -} - -static void -XAAOverImageText16TE(DrawablePtr pDraw, - GCPtr pGC, int x, int y, int count, unsigned short *chars) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - (*pOverPriv->ImageText16TE) (pDraw, pGC, x, y, count, chars); -} - -static void -XAAOverImageGlyphBltTE(DrawablePtr pDraw, - GCPtr pGC, - int xInit, int yInit, - unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - (*pOverPriv->ImageGlyphBltTE) (pDraw, pGC, xInit, yInit, nglyph, ppci, - pglyphBase); -} - -static void -XAAOverPolyGlyphBltTE(DrawablePtr pDraw, - GCPtr pGC, - int xInit, int yInit, - unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - (*pOverPriv->PolyGlyphBltTE) (pDraw, pGC, xInit, yInit, nglyph, ppci, - pglyphBase); -} - -static int -XAAOverPolyText8NonTE(DrawablePtr pDraw, - GCPtr pGC, int x, int y, int count, char *chars) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - return (*pOverPriv->PolyText8NonTE) (pDraw, pGC, x, y, count, chars); -} - -static int -XAAOverPolyText16NonTE(DrawablePtr pDraw, - GCPtr pGC, - int x, int y, int count, unsigned short *chars) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - return (*pOverPriv->PolyText16NonTE) (pDraw, pGC, x, y, count, chars); -} - -static void -XAAOverImageText8NonTE(DrawablePtr pDraw, - GCPtr pGC, int x, int y, int count, char *chars) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - (*pOverPriv->ImageText8NonTE) (pDraw, pGC, x, y, count, chars); -} - -static void -XAAOverImageText16NonTE(DrawablePtr pDraw, - GCPtr pGC, - int x, int y, int count, unsigned short *chars) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - (*pOverPriv->ImageText16NonTE) (pDraw, pGC, x, y, count, chars); -} - -static void -XAAOverImageGlyphBltNonTE(DrawablePtr pDraw, - GCPtr pGC, - int xInit, int yInit, - unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - (*pOverPriv->ImageGlyphBltNonTE) (pDraw, pGC, xInit, yInit, nglyph, ppci, - pglyphBase); -} - -static void -XAAOverPolyGlyphBltNonTE(DrawablePtr pDraw, - GCPtr pGC, - int xInit, int yInit, - unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - (*pOverPriv->PolyGlyphBltNonTE) (pDraw, pGC, xInit, yInit, nglyph, ppci, - pglyphBase); -} - -static void -XAAOverPolyRectangleThinSolid(DrawablePtr pDraw, - GCPtr pGC, int nRectsInit, xRectangle *pRectsInit) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - (*pOverPriv->PolyRectangleThinSolid) (pDraw, pGC, nRectsInit, pRectsInit); -} - -static void -XAAOverPolylinesWideSolid(DrawablePtr pDraw, - GCPtr pGC, int mode, int npt, DDXPointPtr pPts) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - (*pOverPriv->PolylinesWideSolid) (pDraw, pGC, mode, npt, pPts); -} - -static void -XAAOverPolylinesThinSolid(DrawablePtr pDraw, - GCPtr pGC, int mode, int npt, DDXPointPtr pPts) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - (*pOverPriv->PolylinesThinSolid) (pDraw, pGC, mode, npt, pPts); -} - -static void -XAAOverPolySegmentThinSolid(DrawablePtr pDraw, - GCPtr pGC, int nseg, xSegment * pSeg) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - (*pOverPriv->PolySegmentThinSolid) (pDraw, pGC, nseg, pSeg); -} - -static void -XAAOverPolylinesThinDashed(DrawablePtr pDraw, - GCPtr pGC, int mode, int npt, DDXPointPtr pPts) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - (*pOverPriv->PolylinesThinDashed) (pDraw, pGC, mode, npt, pPts); -} - -static void -XAAOverPolySegmentThinDashed(DrawablePtr pDraw, - GCPtr pGC, int nseg, xSegment * pSeg) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - (*pOverPriv->PolySegmentThinDashed) (pDraw, pGC, nseg, pSeg); -} - -static void -XAAOverFillPolygonSolid(DrawablePtr pDraw, - GCPtr pGC, - int shape, int mode, int count, DDXPointPtr ptsIn) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - (*pOverPriv->FillPolygonSolid) (pDraw, pGC, shape, mode, count, ptsIn); -} - -static void -XAAOverFillPolygonStippled(DrawablePtr pDraw, - GCPtr pGC, - int shape, int mode, int count, DDXPointPtr ptsIn) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - (*pOverPriv->FillPolygonStippled) (pDraw, pGC, shape, mode, count, ptsIn); -} - -static void -XAAOverFillPolygonOpaqueStippled(DrawablePtr pDraw, - GCPtr pGC, - int shape, - int mode, int count, DDXPointPtr ptsIn) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - (*pOverPriv->FillPolygonOpaqueStippled) (pDraw, pGC, shape, mode, count, - ptsIn); -} - -static void -XAAOverFillPolygonTiled(DrawablePtr pDraw, - GCPtr pGC, - int shape, int mode, int count, DDXPointPtr ptsIn) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - (*pOverPriv->FillPolygonTiled) (pDraw, pGC, shape, mode, count, ptsIn); -} - -static void -XAAOverPolyFillArcSolid(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - (*pOverPriv->PolyFillArcSolid) (pDraw, pGC, narcs, parcs); -} - -static void -XAAOverPutImage(DrawablePtr pDraw, - GCPtr pGC, - int depth, - int x, - int y, int w, int h, int leftPad, int format, char *pImage) -{ - XAAOverlayPtr pOverPriv = GET_OVERLAY_PRIV(pGC->pScreen); - - SWITCH_DEPTH(pGC->depth); - - (*pOverPriv->PutImage) (pDraw, pGC, depth, x, y, w, h, - leftPad, format, pImage); -} diff --git a/xserver/hw/xfree86/xaa/xaaPCache.c b/xserver/hw/xfree86/xaa/xaaPCache.c deleted file mode 100644 index 02c0cd498..000000000 --- a/xserver/hw/xfree86/xaa/xaaPCache.c +++ /dev/null @@ -1,2527 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include - -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" - -#include -#include "scrnintstr.h" -#include "gc.h" -#include "mi.h" -#include "pixmapstr.h" -#include "windowstr.h" -#include "regionstr.h" -#include "servermd.h" -#include "xf86str.h" -#include "xaa.h" -#include "xaacexp.h" -#include "xaalocal.h" -#include "xaawrap.h" - -#define MAX_COLOR 32 -#define MAX_MONO 32 -#define MAX_8 32 -#define MAX_128 32 -#define MAX_256 32 -#define MAX_512 16 - -static int CacheInitIndex = -1; - -#define CACHEINIT(p) ((p)->privates[CacheInitIndex].val) - -typedef struct _CacheLink { - int x; - int y; - int w; - int h; - struct _CacheLink *next; -} CacheLink, *CacheLinkPtr; - -static void -TransferList(CacheLinkPtr list, XAACacheInfoPtr array, int num) -{ - while (num--) { - array->x = list->x; - array->y = list->y; - array->w = list->w; - array->h = list->h; - array->serialNumber = 0; - array->fg = array->bg = -1; - list = list->next; - array++; - } -} - -static CacheLinkPtr -Enlist(CacheLinkPtr link, int x, int y, int w, int h) -{ - CacheLinkPtr newLink; - - newLink = malloc(sizeof(CacheLink)); - newLink->next = link; - newLink->x = x; - newLink->y = y; - newLink->w = w; - newLink->h = h; - return newLink; -} - -static CacheLinkPtr -Delist(CacheLinkPtr link) -{ - CacheLinkPtr ret = NULL; - - if (link) { - ret = link->next; - free(link); - } - return ret; -} - -static void -FreeList(CacheLinkPtr link) -{ - CacheLinkPtr tmp; - - while (link) { - tmp = link; - link = link->next; - free(tmp); - } -} - -static CacheLinkPtr -QuadLinks(CacheLinkPtr big, CacheLinkPtr little) -{ - /* CAUTION: This doesn't free big */ - int w1, w2, h1, h2; - - while (big) { - w1 = big->w >> 1; - w2 = big->w - w1; - h1 = big->h >> 1; - h2 = big->h - h1; - - little = Enlist(little, big->x, big->y, w1, h1); - little = Enlist(little, big->x + w1, big->y, w2, h1); - little = Enlist(little, big->x, big->y + h1, w1, h2); - little = Enlist(little, big->x + w1, big->y + h1, w2, h2); - - big = big->next; - } - return little; -} - -static void -SubdivideList(CacheLinkPtr * large, CacheLinkPtr * small) -{ - CacheLinkPtr big = *large; - CacheLinkPtr little = *small; - int size = big->w >> 1; - - little = Enlist(little, big->x, big->y, size, size); - little = Enlist(little, big->x + size, big->y, size, size); - little = Enlist(little, big->x, big->y + size, size, size); - little = Enlist(little, big->x + size, big->y + size, size, size); - *small = little; - big = Delist(big); - *large = big; -} - -static void -FreePixmapCachePrivate(XAAPixmapCachePrivatePtr pPriv) -{ - if (!pPriv) - return; - - free(pPriv->Info512); - free(pPriv->Info256); - free(pPriv->Info128); - free(pPriv->InfoColor); - free(pPriv->InfoMono); - free(pPriv->InfoPartial); - - free(pPriv); -} - -void -XAAClosePixmapCache(ScreenPtr pScreen) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); - - if (infoRec->PixmapCachePrivate) - FreePixmapCachePrivate((XAAPixmapCachePrivatePtr) infoRec-> - PixmapCachePrivate); - - infoRec->PixmapCachePrivate = NULL; -} - -static CacheLinkPtr -ThinOutPartials(CacheLinkPtr ListPartial, int *num, int *maxw, int *maxh) -{ -/* This guy's job is to get at least 4 big slots out of a list of fragments */ - - CacheLinkPtr List64, List32, List16, List8, pCur, next, ListKeepers; - int Num64, Num32, Num16, Num8, NumKeepers; - int w, h; - - List64 = List32 = List16 = List8 = ListKeepers = NULL; - Num64 = Num32 = Num16 = Num8 = NumKeepers = 0; - w = h = 0; - - /* We sort partials by how large a square tile they can cache. - If a partial can't store a 64x64, 32x32, 16x16 or 8x8 tile, - we free it. */ - - pCur = ListPartial; - while (pCur) { - next = pCur->next; - if ((pCur->w >= 64) && (pCur->h >= 64)) { - pCur->next = List64; - List64 = pCur; - Num64++; - } - else if ((pCur->w >= 32) && (pCur->h >= 32)) { - pCur->next = List32; - List32 = pCur; - Num32++; - } - else if ((pCur->w >= 16) && (pCur->h >= 16)) { - pCur->next = List16; - List16 = pCur; - Num16++; - } - else if ((pCur->w >= 8) && (pCur->h >= 8)) { - pCur->next = List8; - List8 = pCur; - Num8++; - } - else { - free(pCur); - } - - pCur = next; - } - - /* We save all the tiles from the largest bin that we can get - at least 4 of. If there are too few of a bigger slot, we - cut it in fourths to make smaller slots. */ - - if (Num64 >= 4) { - ListKeepers = List64; - List64 = NULL; - NumKeepers = Num64; - goto GOT_EM; - } - else if (Num64) { - List32 = QuadLinks(List64, List32); - Num32 += Num64 * 4; - Num64 = 0; - } - - if (Num32 >= 4) { - ListKeepers = List32; - List32 = NULL; - NumKeepers = Num32; - goto GOT_EM; - } - else if (Num32) { - List16 = QuadLinks(List32, List16); - Num16 += Num32 * 4; - Num32 = 0; - } - - if (Num16 >= 4) { - ListKeepers = List16; - List16 = NULL; - NumKeepers = Num16; - goto GOT_EM; - } - else if (Num16) { - List8 = QuadLinks(List16, List8); - Num8 += Num16 * 4; - Num16 = 0; - } - - if (Num8 >= 4) { - ListKeepers = List8; - List8 = NULL; - NumKeepers = Num8; - goto GOT_EM; - } - - GOT_EM: - - /* Free the ones we aren't using */ - - if (List64) - FreeList(List64); - if (List32) - FreeList(List32); - if (List16) - FreeList(List16); - if (List8) - FreeList(List8); - - /* Enlarge the slots if we can */ - - if (ListKeepers) { - CacheLinkPtr pLink = ListKeepers; - - w = h = 128; - - while (pLink) { - if (pLink->w < w) - w = pLink->w; - if (pLink->h < h) - h = pLink->h; - pLink = pLink->next; - } - } - - *maxw = w; - *maxh = h; - *num = NumKeepers; - return ListKeepers; -} - -static void -ConvertColorToMono(CacheLinkPtr * ColorList, - int ColorW, int ColorH, - CacheLinkPtr * MonoList, int MonoW, int MonoH) -{ - int x, y, w; - - x = (*ColorList)->x; - y = (*ColorList)->y; - *ColorList = Delist(*ColorList); - - while (ColorH) { - ColorH -= MonoH; - for (w = 0; w <= (ColorW - MonoW); w += MonoW) - *MonoList = Enlist(*MonoList, x + w, y + ColorH, MonoW, MonoH); - } -} - -static void -ConvertAllPartialsTo8x8(int *NumMono, int *NumColor, - CacheLinkPtr ListPartial, - CacheLinkPtr * ListMono, - CacheLinkPtr * ListColor, XAAInfoRecPtr infoRec) -{ -/* This guy extracts as many 8x8 slots as it can out of fragments */ - - int ColorH = infoRec->CacheHeightColor8x8Pattern; - int ColorW = infoRec->CacheWidthColor8x8Pattern; - int MonoH = infoRec->CacheHeightMono8x8Pattern; - int MonoW = infoRec->CacheWidthMono8x8Pattern; - int x, y, w, Height, Width; - Bool DoColor = (infoRec->PixmapCacheFlags & CACHE_COLOR_8x8); - Bool DoMono = (infoRec->PixmapCacheFlags & CACHE_MONO_8x8); - CacheLinkPtr pLink = ListPartial; - CacheLinkPtr MonoList = *ListMono, ColorList = *ListColor; - - if (DoColor && DoMono) { - /* we assume color patterns take more space than color ones */ - if (MonoH > ColorH) - ColorH = MonoH; - if (MonoW > ColorW) - ColorW = MonoW; - } - - /* Break up the area into as many Color and Mono slots as we can */ - - while (pLink) { - Height = pLink->h; - Width = pLink->w; - x = pLink->x; - y = pLink->y; - - if (DoColor) { - while (Height >= ColorH) { - Height -= ColorH; - for (w = 0; w <= (Width - ColorW); w += ColorW) { - ColorList = - Enlist(ColorList, x + w, y + Height, ColorW, ColorH); - (*NumColor)++; - } - } - } - - if (DoMono && (Height >= MonoH)) { - while (Height >= MonoH) { - Height -= MonoH; - for (w = 0; w <= (Width - MonoW); w += MonoW) { - MonoList = - Enlist(MonoList, x + w, y + Height, MonoW, MonoH); - (*NumMono)++; - } - } - } - - pLink = pLink->next; - } - - *ListMono = MonoList; - *ListColor = ColorList; - FreeList(ListPartial); -} - -static CacheLinkPtr -ExtractOneThatFits(CacheLinkPtr * initList, int w, int h) -{ - CacheLinkPtr list = *initList; - CacheLinkPtr prev = NULL; - - while (list) { - if ((list->w >= w) && (list->h >= h)) - break; - prev = list; - list = list->next; - } - - if (list) { - if (prev) - prev->next = list->next; - else - *initList = list->next; - - list->next = NULL; - } - - return list; -} - -static CacheLinkPtr -ConvertSomePartialsTo8x8(int *NumMono, int *NumColor, int *NumPartial, - CacheLinkPtr ListPartial, - CacheLinkPtr * ListMono, - CacheLinkPtr * ListColor, - int *maxw, int *maxh, XAAInfoRecPtr infoRec) -{ -/* This guy tries to get 4 of each type of 8x8 slot requested out of - a list of fragments all while trying to retain some big fragments - for the cache blits */ - - int ColorH = infoRec->CacheHeightColor8x8Pattern; - int ColorW = infoRec->CacheWidthColor8x8Pattern; - int MonoH = infoRec->CacheHeightMono8x8Pattern; - int MonoW = infoRec->CacheWidthMono8x8Pattern; - Bool DoColor = (infoRec->PixmapCacheFlags & CACHE_COLOR_8x8); - Bool DoMono = (infoRec->PixmapCacheFlags & CACHE_MONO_8x8); - CacheLinkPtr List64, List32, List16, List8, pCur, next, ListKeepers; - CacheLinkPtr MonoList = *ListMono, ColorList = *ListColor; - int Num64, Num32, Num16, Num8, NumKeepers; - int w, h, Width, Height; - int MonosPerColor = 1; - - if (DoColor && DoMono) { - /* we assume color patterns take more space than color ones */ - if (MonoH > ColorH) - ColorH = MonoH; - if (MonoW > ColorW) - ColorW = MonoW; - MonosPerColor = (ColorH / MonoH) * (ColorW / MonoW); - } - - List64 = List32 = List16 = List8 = ListKeepers = MonoList = ColorList = - NULL; - Num64 = Num32 = Num16 = Num8 = NumKeepers = 0; - Width = Height = 0; - - /* We sort partials by how large a square tile they can cache. - We make 8x8 patterns from the leftovers if we can. */ - - pCur = ListPartial; - while (pCur) { - next = pCur->next; - if ((pCur->w >= 64) && (pCur->h >= 64)) { - pCur->next = List64; - List64 = pCur; - Num64++; - } - else if ((pCur->w >= 32) && (pCur->h >= 32)) { - pCur->next = List32; - List32 = pCur; - Num32++; - } - else if ((pCur->w >= 16) && (pCur->h >= 16)) { - pCur->next = List16; - List16 = pCur; - Num16++; - } - else if ((pCur->w >= 8) && (pCur->h >= 8)) { - pCur->next = List8; - List8 = pCur; - Num8++; - } - else { - h = pCur->h; - if (DoColor && (pCur->w >= ColorW) && (h >= ColorH)) { - while (h >= ColorH) { - h -= ColorH; - for (w = 0; w <= (pCur->w - ColorW); w += ColorW) { - ColorList = Enlist(ColorList, - pCur->x + w, pCur->y + h, ColorW, - ColorH); - (*NumColor)++; - } - } - } - if (DoMono && (pCur->w >= MonoW) && (h >= MonoH)) { - while (h >= MonoH) { - h -= MonoH; - for (w = 0; w <= (pCur->w - MonoW); w += MonoW) { - MonoList = Enlist(MonoList, - pCur->x + w, pCur->y + h, MonoW, - MonoH); - (*NumMono)++; - } - } - } - free(pCur); - } - - pCur = next; - } - - /* Try to extract at least 4 of each type of 8x8 slot that we need */ - - if (DoColor) { - CacheLinkPtr theOne; - - while (*NumColor < 4) { - theOne = NULL; - if (Num8) { - if ((theOne = ExtractOneThatFits(&List8, ColorW, ColorH))) - Num8--; - } - if (Num16 && !theOne) { - if ((theOne = ExtractOneThatFits(&List16, ColorW, ColorH))) - Num16--; - } - if (Num32 && !theOne) { - if ((theOne = ExtractOneThatFits(&List32, ColorW, ColorH))) - Num32--; - } - if (Num64 && !theOne) { - if ((theOne = ExtractOneThatFits(&List64, ColorW, ColorH))) - Num64--; - } - - if (!theOne) - break; - - ConvertAllPartialsTo8x8(NumMono, NumColor, theOne, - &MonoList, &ColorList, infoRec); - - if (DoMono) { - while (*NumColor && (*NumMono < 4)) { - ConvertColorToMono(&ColorList, ColorW, ColorH, - &MonoList, MonoW, MonoH); - (*NumColor)--; - *NumMono += MonosPerColor; - } - } - } - } - - if (DoMono) { - CacheLinkPtr theOne; - - while (*NumMono < 4) { - theOne = NULL; - if (Num8) { - if ((theOne = ExtractOneThatFits(&List8, MonoW, MonoH))) - Num8--; - } - if (Num16 && !theOne) { - if ((theOne = ExtractOneThatFits(&List16, MonoW, MonoH))) - Num16--; - } - if (Num32 && !theOne) { - if ((theOne = ExtractOneThatFits(&List32, MonoW, MonoH))) - Num32--; - } - if (Num64 && !theOne) { - if ((theOne = ExtractOneThatFits(&List64, MonoW, MonoH))) - Num64--; - } - - if (!theOne) - break; - - ConvertAllPartialsTo8x8(NumMono, NumColor, theOne, - &MonoList, &ColorList, infoRec); - } - } - - /* We save all the tiles from the largest bin that we can get - at least 4 of. If there are too few of a bigger slot, we - cut it in fourths to make smaller slots. */ - - if (Num64 >= 4) { - ListKeepers = List64; - List64 = NULL; - NumKeepers = Num64; - goto GOT_EM; - } - else if (Num64) { - List32 = QuadLinks(List64, List32); - Num32 += Num64 * 4; - Num64 = 0; - } - - if (Num32 >= 4) { - ListKeepers = List32; - List32 = NULL; - NumKeepers = Num32; - goto GOT_EM; - } - else if (Num32) { - List16 = QuadLinks(List32, List16); - Num16 += Num32 * 4; - Num32 = 0; - } - - if (Num16 >= 4) { - ListKeepers = List16; - List16 = NULL; - NumKeepers = Num16; - goto GOT_EM; - } - else if (Num16) { - List8 = QuadLinks(List16, List8); - Num8 += Num16 * 4; - Num16 = 0; - } - - if (Num8 >= 4) { - ListKeepers = List8; - List8 = NULL; - NumKeepers = Num8; - goto GOT_EM; - } - - GOT_EM: - - /* Free the ones we aren't using */ - - if (List64) - ConvertAllPartialsTo8x8(NumMono, NumColor, List64, - &MonoList, &ColorList, infoRec); - if (List32) - ConvertAllPartialsTo8x8(NumMono, NumColor, List32, - &MonoList, &ColorList, infoRec); - if (List16) - ConvertAllPartialsTo8x8(NumMono, NumColor, List16, - &MonoList, &ColorList, infoRec); - if (List8) - ConvertAllPartialsTo8x8(NumMono, NumColor, List8, - &MonoList, &ColorList, infoRec); - - /* Enlarge the slots if we can */ - - if (ListKeepers) { - CacheLinkPtr pLink = ListKeepers; - - Width = Height = 128; - - while (pLink) { - if (pLink->w < Width) - Width = pLink->w; - if (pLink->h < Height) - Height = pLink->h; - pLink = pLink->next; - } - } - - *ListMono = MonoList; - *ListColor = ColorList; - *maxw = Width; - *maxh = Height; - *NumPartial = NumKeepers; - return ListKeepers; -} - -void -XAAInitPixmapCache(ScreenPtr pScreen, RegionPtr areas, pointer data) -{ - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - XAAInfoRecPtr infoRec = (XAAInfoRecPtr) data; - XAAPixmapCachePrivatePtr pCachePriv; - BoxPtr pBox = RegionRects(areas); - int nBox = RegionNumRects(areas); - int Num512, Num256, Num128, NumPartial, NumColor, NumMono; - int Target512, Target256; - CacheLinkPtr List512, List256, List128, ListPartial, ListColor, ListMono; - int x, y, w, h, ntotal, granularity, width, height, i; - int MaxPartialWidth, MaxPartialHeight; - - infoRec->MaxCacheableTileWidth = 0; - infoRec->MaxCacheableTileHeight = 0; - infoRec->MaxCacheableStippleHeight = 0; - infoRec->MaxCacheableStippleWidth = 0; - infoRec->UsingPixmapCache = FALSE; - - if (!nBox || !pBox || !(infoRec->Flags & PIXMAP_CACHE)) - return; - - /* Allocate a persistent per-screen init flag to control messages */ - if (CacheInitIndex < 0) - CacheInitIndex = xf86AllocateScrnInfoPrivateIndex(); - - /* free the old private data if it exists */ - if (infoRec->PixmapCachePrivate) { - FreePixmapCachePrivate((XAAPixmapCachePrivatePtr) infoRec-> - PixmapCachePrivate); - infoRec->PixmapCachePrivate = NULL; - } - - Num512 = Num256 = Num128 = NumPartial = NumMono = NumColor = 0; - List512 = List256 = List128 = ListPartial = ListMono = ListColor = NULL; - granularity = infoRec->CachePixelGranularity; - if (granularity <= 1) - granularity = 0; - - /* go through the boxes and break it into as many pieces as we can fit */ - - while (nBox--) { - x = pBox->x1; - if (granularity) { - int tmp = x % granularity; - - if (tmp) - x += (granularity - tmp); - } - width = pBox->x2 - x; - if (width <= 0) { - pBox++; - continue; - } - - y = pBox->y1; - height = pBox->y2 - y; - - for (h = 0; h <= (height - 512); h += 512) { - for (w = 0; w <= (width - 512); w += 512) { - List512 = Enlist(List512, x + w, y + h, 512, 512); - Num512++; - } - for (; w <= (width - 256); w += 256) { - List256 = Enlist(List256, x + w, y + h, 256, 256); - List256 = Enlist(List256, x + w, y + h + 256, 256, 256); - Num256 += 2; - } - for (; w <= (width - 128); w += 128) { - List128 = Enlist(List128, x + w, y + h, 128, 128); - List128 = Enlist(List128, x + w, y + h + 128, 128, 128); - List128 = Enlist(List128, x + w, y + h + 256, 128, 128); - List128 = Enlist(List128, x + w, y + h + 384, 128, 128); - Num128 += 4; - } - if (w < width) { - int d = width - w; - - ListPartial = Enlist(ListPartial, x + w, y + h, d, 128); - ListPartial = Enlist(ListPartial, x + w, y + h + 128, d, 128); - ListPartial = Enlist(ListPartial, x + w, y + h + 256, d, 128); - ListPartial = Enlist(ListPartial, x + w, y + h + 384, d, 128); - NumPartial += 4; - } - } - for (; h <= (height - 256); h += 256) { - for (w = 0; w <= (width - 256); w += 256) { - List256 = Enlist(List256, x + w, y + h, 256, 256); - Num256++; - } - for (; w <= (width - 128); w += 128) { - List128 = Enlist(List128, x + w, y + h, 128, 128); - List128 = Enlist(List128, x + w, y + h + 128, 128, 128); - Num128 += 2; - } - if (w < width) { - int d = width - w; - - ListPartial = Enlist(ListPartial, x + w, y + h, d, 128); - ListPartial = Enlist(ListPartial, x + w, y + h + 128, d, 128); - NumPartial += 2; - } - } - for (; h <= (height - 128); h += 128) { - for (w = 0; w <= (width - 128); w += 128) { - List128 = Enlist(List128, x + w, y + h, 128, 128); - Num128++; - } - if (w < width) { - ListPartial = Enlist(ListPartial, x + w, y + h, width - w, 128); - NumPartial++; - } - } - if (h < height) { - int d = height - h; - - for (w = 0; w <= (width - 128); w += 128) { - ListPartial = Enlist(ListPartial, x + w, y + h, 128, d); - NumPartial++; - } - if (w < width) { - ListPartial = Enlist(ListPartial, x + w, y + h, width - w, d); - NumPartial++; - } - } - pBox++; - } - -/* - by this point we've carved the space into as many 512x512, 256x256 - and 128x128 blocks as we could fit. We will then break larger - blocks into smaller ones if we need to. The rules are as follows: - - 512x512 - - 1) Don't take up more than half the memory. - 2) Don't bother if you can't get at least four. - 3) Don't make more than MAX_512. - 4) Don't have any of there are no 256x256s. - - 256x256 - - 1) Don't take up more than a quarter of the memory enless there - aren't any 512x512s. Then we can take up to half. - 2) Don't bother if you can't get at least four. - 3) Don't make more than MAX_256. - - 128x128 - - 1) Don't make more than MAX_128. - - We don't bother with the partial blocks unless we can use them - for 8x8 pattern fills or we are short on larger blocks. - -*/ - - ntotal = Num128 + (Num256 << 2) + (Num512 << 4); - - Target512 = ntotal >> 5; - if (Target512 < 4) - Target512 = 0; - if (!Target512) - Target256 = ntotal >> 3; - else - Target256 = ntotal >> 4; - if (Target256 < 4) - Target256 = 0; - - if (Num512 && Num256 < 4) { - while (Num512 && Num256 < Target256) { - SubdivideList(&List512, &List256); - Num256 += 4; - Num512--; - } - } - - if (!Num512) { /* no room */ - } - else if ((Num512 < 4) || (!Target512)) { - while (Num512) { - SubdivideList(&List512, &List256); - Num256 += 4; - Num512--; - } - } - else if ((Num512 > MAX_512) || (Num512 > Target512)) { - while (Num512 > MAX_512) { - SubdivideList(&List512, &List256); - Num256 += 4; - Num512--; - } - while (Num512 > Target512) { - if (Num256 < MAX_256) { - SubdivideList(&List512, &List256); - Num256 += 4; - Num512--; - } - else - break; - } - } - - if (!Num256) { /* no room */ - } - else if ((Num256 < 4) || (!Target256)) { - while (Num256) { - SubdivideList(&List256, &List128); - Num128 += 4; - Num256--; - } - } - else if ((Num256 > MAX_256) || (Num256 > Target256)) { - while (Num256 > MAX_256) { - SubdivideList(&List256, &List128); - Num128 += 4; - Num256--; - } - while (Num256 > Target256) { - if (Num128 < MAX_128) { - SubdivideList(&List256, &List128); - Num128 += 4; - Num256--; - } - else - break; - } - } - - if (Num128 && ((Num128 < 4) || (Num128 > MAX_128))) { - CacheLinkPtr next; - int max = (Num128 > MAX_128) ? MAX_128 : 0; - - /* - * Note: next is set in this way to work around a code generation - * bug in gcc 2.7.2.3. - */ - next = List128->next; - while (Num128 > max) { - List128->next = ListPartial; - ListPartial = List128; - if ((List128 = next)) - next = List128->next; - NumPartial++; - Num128--; - } - } - - MaxPartialHeight = MaxPartialWidth = 0; - - /* at this point we have as many 512x512 and 256x256 slots as we - want but may have an excess of 128x128 slots. We still need - to find out if we need 8x8 slots. We take these from the - partials if we have them. Otherwise, we break some 128x128's */ - - if (!(infoRec->PixmapCacheFlags & (CACHE_MONO_8x8 | CACHE_COLOR_8x8))) { - if (NumPartial) { - if (Num128) { /* don't bother with partials */ - FreeList(ListPartial); - NumPartial = 0; - ListPartial = NULL; - } - else { - /* We have no big slots. Weed out the unusable partials */ - ListPartial = ThinOutPartials(ListPartial, &NumPartial, - &MaxPartialWidth, - &MaxPartialHeight); - } - } - } - else { - int MonosPerColor = 1; - int ColorH = infoRec->CacheHeightColor8x8Pattern; - int ColorW = infoRec->CacheWidthColor8x8Pattern; - int MonoH = infoRec->CacheHeightMono8x8Pattern; - int MonoW = infoRec->CacheWidthMono8x8Pattern; - Bool DoColor = (infoRec->PixmapCacheFlags & CACHE_COLOR_8x8); - Bool DoMono = (infoRec->PixmapCacheFlags & CACHE_MONO_8x8); - - if (DoColor) - infoRec->CanDoColor8x8 = FALSE; - if (DoMono) - infoRec->CanDoMono8x8 = FALSE; - - if (DoColor && DoMono) { - /* we assume color patterns take more space than color ones */ - if (MonoH > ColorH) - ColorH = MonoH; - if (MonoW > ColorW) - ColorW = MonoW; - MonosPerColor = (ColorH / MonoH) * (ColorW / MonoW); - } - - if (Num128) { - if (NumPartial) { /* use all for 8x8 slots */ - ConvertAllPartialsTo8x8(&NumMono, &NumColor, - ListPartial, &ListMono, &ListColor, - infoRec); - NumPartial = 0; - ListPartial = NULL; - } - - /* Get some 8x8 slots from the 128 slots */ - while ((Num128 > 4) && - ((NumMono < MAX_MONO) && (NumColor < MAX_COLOR))) { - CacheLinkPtr tmp = NULL; - - tmp = Enlist(tmp, List128->x, List128->y, - List128->w, List128->h); - List128 = Delist(List128); - Num128--; - - ConvertAllPartialsTo8x8(&NumMono, &NumColor, - tmp, &ListMono, &ListColor, infoRec); - } - } - else if (NumPartial) { - /* We have share partials between 8x8 slots and tiles. */ - ListPartial = ConvertSomePartialsTo8x8(&NumMono, &NumColor, - &NumPartial, ListPartial, - &ListMono, &ListColor, - &MaxPartialWidth, - &MaxPartialHeight, infoRec); - } - - if (DoMono && DoColor) { - if (NumColor && ((NumColor > MAX_COLOR) || (NumColor < 4))) { - int max = (NumColor > MAX_COLOR) ? MAX_COLOR : 0; - - while (NumColor > max) { - ConvertColorToMono(&ListColor, ColorW, ColorH, - &ListMono, MonoW, MonoH); - NumColor--; - NumMono += MonosPerColor; - } - } - - /* favor Mono slots over Color ones */ - while ((NumColor > 4) && (NumMono < MAX_MONO)) { - ConvertColorToMono(&ListColor, ColorW, ColorH, - &ListMono, MonoW, MonoH); - NumColor--; - NumMono += MonosPerColor; - } - } - - if (NumMono && ((NumMono > MAX_MONO) || (NumMono < 4))) { - int max = (NumMono > MAX_MONO) ? MAX_MONO : 0; - - while (NumMono > max) { - ListMono = Delist(ListMono); - NumMono--; - } - } - if (NumColor && ((NumColor > MAX_COLOR) || (NumColor < 4))) { - int max = (NumColor > MAX_COLOR) ? MAX_COLOR : 0; - - while (NumColor > max) { - ListColor = Delist(ListColor); - NumColor--; - } - } - } - - pCachePriv = calloc(1, sizeof(XAAPixmapCachePrivate)); - if (!pCachePriv) { - if (Num512) - FreeList(List512); - if (Num256) - FreeList(List256); - if (Num128) - FreeList(List128); - if (NumPartial) - FreeList(ListPartial); - if (NumColor) - FreeList(ListColor); - if (NumMono) - FreeList(ListMono); - return; - } - - infoRec->PixmapCachePrivate = (char *) pCachePriv; - - if (Num512) { - pCachePriv->Info512 = calloc(Num512, sizeof(XAACacheInfoRec)); - if (!pCachePriv->Info512) - Num512 = 0; - if (Num512) - TransferList(List512, pCachePriv->Info512, Num512); - FreeList(List512); - pCachePriv->Num512x512 = Num512; - } - if (Num256) { - pCachePriv->Info256 = calloc(Num256, sizeof(XAACacheInfoRec)); - if (!pCachePriv->Info256) - Num256 = 0; - if (Num256) - TransferList(List256, pCachePriv->Info256, Num256); - FreeList(List256); - pCachePriv->Num256x256 = Num256; - } - if (Num128) { - pCachePriv->Info128 = calloc(Num128, sizeof(XAACacheInfoRec)); - if (!pCachePriv->Info128) - Num128 = 0; - if (Num128) - TransferList(List128, pCachePriv->Info128, Num128); - FreeList(List128); - pCachePriv->Num128x128 = Num128; - } - - if (NumPartial) { - pCachePriv->InfoPartial = calloc(NumPartial, sizeof(XAACacheInfoRec)); - if (!pCachePriv->InfoPartial) - NumPartial = 0; - if (NumPartial) - TransferList(ListPartial, pCachePriv->InfoPartial, NumPartial); - FreeList(ListPartial); - pCachePriv->NumPartial = NumPartial; - } - - if (NumColor) { - pCachePriv->InfoColor = calloc(NumColor, sizeof(XAACacheInfoRec)); - if (!pCachePriv->InfoColor) - NumColor = 0; - if (NumColor) - TransferList(ListColor, pCachePriv->InfoColor, NumColor); - FreeList(ListColor); - pCachePriv->NumColor = NumColor; - } - - if (NumMono) { - pCachePriv->InfoMono = calloc(NumMono, sizeof(XAACacheInfoRec)); - if (!pCachePriv->InfoMono) - NumMono = 0; - if (NumMono) - TransferList(ListMono, pCachePriv->InfoMono, NumMono); - FreeList(ListMono); - pCachePriv->NumMono = NumMono; - } - - if (NumPartial) { - infoRec->MaxCacheableTileWidth = MaxPartialWidth; - infoRec->MaxCacheableTileHeight = MaxPartialHeight; - } - if (Num128) - infoRec->MaxCacheableTileWidth = infoRec->MaxCacheableTileHeight = 128; - if (Num256) - infoRec->MaxCacheableTileWidth = infoRec->MaxCacheableTileHeight = 256; - if (Num512) - infoRec->MaxCacheableTileWidth = infoRec->MaxCacheableTileHeight = 512; - - infoRec->MaxCacheableStippleHeight = infoRec->MaxCacheableTileHeight; - infoRec->MaxCacheableStippleWidth = - infoRec->MaxCacheableTileWidth * pScrn->bitsPerPixel; - if (infoRec->ScreenToScreenColorExpandFillFlags & TRIPLE_BITS_24BPP) - infoRec->MaxCacheableStippleWidth /= 3; - - if (NumMono) { - if (!(infoRec->Mono8x8PatternFillFlags & - (HARDWARE_PATTERN_PROGRAMMED_ORIGIN | - HARDWARE_PATTERN_PROGRAMMED_BITS))) { - int numPerLine = - infoRec->CacheWidthMono8x8Pattern / infoRec->MonoPatternPitch; - - for (i = 0; i < 64; i++) { - pCachePriv->MonoOffsets[i].y = i / numPerLine; - pCachePriv->MonoOffsets[i].x = (i % numPerLine) * - infoRec->MonoPatternPitch; - } - } - infoRec->CanDoMono8x8 = TRUE; - } - if (NumColor) { - if (!(infoRec->Color8x8PatternFillFlags & - HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) { - - for (i = 0; i < 64; i++) { - pCachePriv->ColorOffsets[i].y = i & 0x07; - pCachePriv->ColorOffsets[i].x = i & ~0x07; - } - } - infoRec->CanDoColor8x8 = TRUE; - } - - if (!CACHEINIT(pScrn)) { - xf86ErrorF("\tSetting up tile and stipple cache:\n"); - if (NumPartial) - xf86ErrorF("\t\t%i %ix%i slots\n", - NumPartial, MaxPartialWidth, MaxPartialHeight); - if (Num128) - xf86ErrorF("\t\t%i 128x128 slots\n", Num128); - if (Num256) - xf86ErrorF("\t\t%i 256x256 slots\n", Num256); - if (Num512) - xf86ErrorF("\t\t%i 512x512 slots\n", Num512); - if (NumColor) - xf86ErrorF("\t\t%i 8x8 color pattern slots\n", NumColor); - if (NumMono) - xf86ErrorF("\t\t%i 8x8 color expansion slots\n", NumMono); - } - - if (!(NumPartial | Num128 | Num256 | Num512 | NumColor | NumMono)) { - if (!CACHEINIT(pScrn)) - xf86ErrorF("\t\tNot enough video memory for pixmap cache\n"); - } - else - infoRec->UsingPixmapCache = TRUE; - - CACHEINIT(pScrn) = 1; -} - -#if X_BYTE_ORDER == X_BIG_ENDIAN -static CARD32 StippleMasks[4] = { - 0x80808080, - 0xC0C0C0C0, - 0x00000000, - 0xF0F0F0F0 -}; -#else -static CARD32 StippleMasks[4] = { - 0x01010101, - 0x03030303, - 0x00000000, - 0x0F0F0F0F -}; -#endif - -Bool -XAACheckStippleReducibility(PixmapPtr pPixmap) -{ - XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPixmap); - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_DRAWABLE(&pPixmap->drawable); - CARD32 *IntPtr = (CARD32 *) pPixmap->devPrivate.ptr; - int w = pPixmap->drawable.width; - int h = pPixmap->drawable.height; - int i; - CARD32 bits[8]; - CARD32 mask = SHIFT_R(0xFFFFFFFF, 24); - - pPriv->flags |= REDUCIBILITY_CHECKED | REDUCIBLE_TO_2_COLOR; - pPriv->flags &= ~REDUCIBLE_TO_8x8; - - if ((w > 32) || (h > 32) || (w & (w - 1)) || (h & (h - 1))) - return FALSE; - - i = (h > 8) ? 8 : h; - - switch (w) { - case 32: - while (i--) { - bits[i] = IntPtr[i] & mask; - if ((bits[i] != SHIFT_R((IntPtr[i] & SHIFT_L(mask, 8)), 8)) || - (bits[i] != SHIFT_R((IntPtr[i] & SHIFT_L(mask, 16)), 16)) || - (bits[i] != SHIFT_R((IntPtr[i] & SHIFT_L(mask, 24)), 24))) - return FALSE; - } - break; - case 16: - while (i--) { - bits[i] = IntPtr[i] & mask; - if (bits[i] != ((IntPtr[i] & SHIFT_R(SHIFT_L(mask, 8), 8)))) - return FALSE; - } - break; - default: - while (i--) - bits[i] = IntPtr[i] & mask; - break; - } - - switch (h) { - case 32: - if ((IntPtr[8] != IntPtr[16]) || (IntPtr[9] != IntPtr[17]) || - (IntPtr[10] != IntPtr[18]) || (IntPtr[11] != IntPtr[19]) || - (IntPtr[12] != IntPtr[20]) || (IntPtr[13] != IntPtr[21]) || - (IntPtr[14] != IntPtr[22]) || (IntPtr[15] != IntPtr[23]) || - (IntPtr[16] != IntPtr[24]) || (IntPtr[17] != IntPtr[25]) || - (IntPtr[18] != IntPtr[26]) || (IntPtr[19] != IntPtr[27]) || - (IntPtr[20] != IntPtr[28]) || (IntPtr[21] != IntPtr[29]) || - (IntPtr[22] != IntPtr[30]) || (IntPtr[23] != IntPtr[31])) - return FALSE; - /* fall through */ - case 16: - if ((IntPtr[0] != IntPtr[8]) || (IntPtr[1] != IntPtr[9]) || - (IntPtr[2] != IntPtr[10]) || (IntPtr[3] != IntPtr[11]) || - (IntPtr[4] != IntPtr[12]) || (IntPtr[5] != IntPtr[13]) || - (IntPtr[6] != IntPtr[14]) || (IntPtr[7] != IntPtr[15])) - return FALSE; - case 8: - break; - case 1: - bits[1] = bits[0]; - case 2: - bits[2] = bits[0]; - bits[3] = bits[1]; - case 4: - bits[4] = bits[0]; - bits[5] = bits[1]; - bits[6] = bits[2]; - bits[7] = bits[3]; - break; - } - - pPriv->flags |= REDUCIBLE_TO_8x8; - - pPriv->pattern0 = - bits[0] | SHIFT_L(bits[1], 8) | SHIFT_L(bits[2], 16) | SHIFT_L(bits[3], - 24); - pPriv->pattern1 = - bits[4] | SHIFT_L(bits[5], 8) | SHIFT_L(bits[6], 16) | SHIFT_L(bits[7], - 24); - - if (w < 8) { - pPriv->pattern0 &= StippleMasks[w - 1]; - pPriv->pattern1 &= StippleMasks[w - 1]; - - switch (w) { - case 1: - pPriv->pattern0 |= SHIFT_L(pPriv->pattern0, 1); - pPriv->pattern1 |= SHIFT_L(pPriv->pattern1, 1); - case 2: - pPriv->pattern0 |= SHIFT_L(pPriv->pattern0, 2); - pPriv->pattern1 |= SHIFT_L(pPriv->pattern1, 2); - case 4: - pPriv->pattern0 |= SHIFT_L(pPriv->pattern0, 4); - pPriv->pattern1 |= SHIFT_L(pPriv->pattern1, 4); - } - } - - if (infoRec->Mono8x8PatternFillFlags & BIT_ORDER_IN_BYTE_MSBFIRST) { - pPriv->pattern0 = SWAP_BITS_IN_BYTES(pPriv->pattern0); - pPriv->pattern1 = SWAP_BITS_IN_BYTES(pPriv->pattern1); - } - - return TRUE; -} - -Bool -XAACheckTileReducibility(PixmapPtr pPixmap, Bool checkMono) -{ - XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPixmap); - CARD32 *IntPtr; - int w = pPixmap->drawable.width; - int h = pPixmap->drawable.height; - int pitch = pPixmap->devKind >> 2; - int dwords, i, j; - - pPriv->flags |= REDUCIBILITY_CHECKED; - pPriv->flags &= ~(REDUCIBILITY_CHECKED | REDUCIBLE_TO_2_COLOR); - - if ((w > 32) || (h > 32) || (w & (w - 1)) || (h & (h - 1))) - return FALSE; - - dwords = ((w * pPixmap->drawable.bitsPerPixel) + 31) >> 5; - i = (h > 8) ? 8 : h; - - if (w > 8) { - IntPtr = (CARD32 *) pPixmap->devPrivate.ptr; - switch (pPixmap->drawable.bitsPerPixel) { - case 8: - while (i--) { - for (j = 2; j < dwords; j++) - if (IntPtr[j] != IntPtr[j & 0x01]) - return FALSE; - IntPtr += pitch; - } - break; - case 16: - while (i--) { - for (j = 4; j < dwords; j++) - if (IntPtr[j] != IntPtr[j & 0x03]) - return FALSE; - IntPtr += pitch; - } - break; - case 24: - while (i--) { - for (j = 6; j < dwords; j++) - if (IntPtr[j] != IntPtr[j % 6]) - return FALSE; - IntPtr += pitch; - } - break; - case 32: - while (i--) { - for (j = 8; j < dwords; j++) - if (IntPtr[j] != IntPtr[j & 0x07]) - return FALSE; - IntPtr += pitch; - } - break; - default: - return FALSE; - } - - } - - if (h == 32) { - CARD32 *IntPtr2, *IntPtr3, *IntPtr4; - - i = 8; - IntPtr = (CARD32 *) pPixmap->devPrivate.ptr; - IntPtr2 = IntPtr + (pitch << 3); - IntPtr3 = IntPtr2 + (pitch << 3); - IntPtr4 = IntPtr3 + (pitch << 3); - while (i--) { - for (j = 0; j < dwords; j++) - if ((IntPtr[j] != IntPtr2[j]) || (IntPtr[j] != IntPtr3[j]) || - (IntPtr[j] != IntPtr4[j])) - return FALSE; - IntPtr += pitch; - IntPtr2 += pitch; - IntPtr3 += pitch; - IntPtr4 += pitch; - } - } - else if (h == 16) { - CARD32 *IntPtr2; - - i = 8; - IntPtr = (CARD32 *) pPixmap->devPrivate.ptr; - IntPtr2 = IntPtr + (pitch << 3); - while (i--) { - for (j = 0; j < dwords; j++) - if (IntPtr[j] != IntPtr2[j]) - return FALSE; - IntPtr += pitch; - IntPtr2 += pitch; - } - } - - pPriv->flags |= REDUCIBLE_TO_8x8; - - if (checkMono) { - XAAInfoRecPtr infoRec = - GET_XAAINFORECPTR_FROM_DRAWABLE(&pPixmap->drawable); - unsigned char bits[8]; - int fg, bg = -1, x, y; - - i = (h > 8) ? 8 : h; - j = (w > 8) ? 8 : w; - - if (pPixmap->drawable.bitsPerPixel == 8) { - unsigned char *srcp = pPixmap->devPrivate.ptr; - - fg = srcp[0]; - pitch = pPixmap->devKind; - for (y = 0; y < i; y++) { - bits[y] = 0; - for (x = 0; x < j; x++) { - if (srcp[x] != fg) { - if (bg == -1) - bg = srcp[x]; - else if (bg != srcp[x]) - return TRUE; - } - else - bits[y] |= 1 << x; - } - srcp += pitch; - } - } - else if (pPixmap->drawable.bitsPerPixel == 16) { - unsigned short *srcp = (unsigned short *) pPixmap->devPrivate.ptr; - - fg = srcp[0]; - pitch = pPixmap->devKind >> 1; - for (y = 0; y < i; y++) { - bits[y] = 0; - for (x = 0; x < j; x++) { - if (srcp[x] != fg) { - if (bg == -1) - bg = srcp[x]; - else if (bg != srcp[x]) - return TRUE; - } - else - bits[y] |= 1 << x; - } - srcp += pitch; - } - } - else if (pPixmap->drawable.bitsPerPixel == 24) { - CARD32 val; - unsigned char *srcp = pPixmap->devPrivate.ptr; - - fg = *((CARD32 *) srcp) & 0x00FFFFFF; - pitch = pPixmap->devKind; - j *= 3; - for (y = 0; y < i; y++) { - bits[y] = 0; - for (x = 0; x < j; x += 3) { - val = *((CARD32 *) (srcp + x)) & 0x00FFFFFF; - if (val != fg) { - if (bg == -1) - bg = val; - else if (bg != val) - return TRUE; - } - else - bits[y] |= 1 << (x / 3); - } - srcp += pitch; - } - } - else if (pPixmap->drawable.bitsPerPixel == 32) { - IntPtr = (CARD32 *) pPixmap->devPrivate.ptr; - fg = IntPtr[0]; - for (y = 0; y < i; y++) { - bits[y] = 0; - for (x = 0; x < j; x++) { - if (IntPtr[x] != fg) { - if (bg == -1) - bg = IntPtr[x]; - else if (bg != IntPtr[x]) - return TRUE; - } - else - bits[y] |= 1 << x; - } - IntPtr += pitch; - } - } - else - return TRUE; - - pPriv->fg = fg; - if (bg == -1) - pPriv->bg = fg; - else - pPriv->bg = bg; - - if (h < 8) { - switch (h) { - case 1: - bits[1] = bits[0]; - case 2: - bits[2] = bits[0]; - bits[3] = bits[1]; - case 4: - bits[4] = bits[0]; - bits[5] = bits[1]; - bits[6] = bits[2]; - bits[7] = bits[3]; - break; - } - } - - pPriv->pattern0 = - bits[0] | (bits[1] << 8) | (bits[2] << 16) | (bits[3] << 24); - pPriv->pattern1 = - bits[4] | (bits[5] << 8) | (bits[6] << 16) | (bits[7] << 24); - - if (w < 8) { - switch (w) { - case 1: - pPriv->pattern0 |= (pPriv->pattern0 << 1); - pPriv->pattern1 |= (pPriv->pattern1 << 1); - case 2: - pPriv->pattern0 |= (pPriv->pattern0 << 2); - pPriv->pattern1 |= (pPriv->pattern1 << 2); - case 4: - pPriv->pattern0 |= (pPriv->pattern0 << 4); - pPriv->pattern1 |= (pPriv->pattern1 << 4); - } - } - pPriv->flags |= REDUCIBLE_TO_2_COLOR; - - if (infoRec->Mono8x8PatternFillFlags & BIT_ORDER_IN_BYTE_MSBFIRST) { - pPriv->pattern0 = SWAP_BITS_IN_BYTES(pPriv->pattern0); - pPriv->pattern1 = SWAP_BITS_IN_BYTES(pPriv->pattern1); - } - - } - - return TRUE; -} - -void -XAATileCache(ScrnInfoPtr pScrn, XAACacheInfoPtr pCache, int w, int h) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - - (*infoRec->SetupForScreenToScreenCopy) (pScrn, 1, 1, GXcopy, ~0, -1); - - while ((w << 1) <= pCache->w) { - (*infoRec->SubsequentScreenToScreenCopy) (pScrn, pCache->x, pCache->y, - pCache->x + w, pCache->y, w, - h); - w <<= 1; - } - if (w != pCache->w) { - (*infoRec->SubsequentScreenToScreenCopy) (pScrn, pCache->x, pCache->y, - pCache->x + w, pCache->y, - pCache->w - w, h); - w = pCache->w; - } - - while ((h << 1) <= pCache->h) { - (*infoRec->SubsequentScreenToScreenCopy) (pScrn, pCache->x, pCache->y, - pCache->x, pCache->y + h, w, - h); - h <<= 1; - } - if (h != pCache->h) { - (*infoRec->SubsequentScreenToScreenCopy) (pScrn, pCache->x, pCache->y, - pCache->x, pCache->y + h, w, - pCache->h - h); - } - SET_SYNC_FLAG(infoRec); -} - -XAACacheInfoPtr -XAACacheTile(ScrnInfoPtr pScrn, PixmapPtr pPix) -{ - int w = pPix->drawable.width; - int h = pPix->drawable.height; - int size = max(w, h); - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - XAAPixmapCachePrivatePtr pCachePriv = - (XAAPixmapCachePrivatePtr) infoRec->PixmapCachePrivate; - XAACacheInfoPtr pCache, cacheRoot = NULL; - int i, max = 0; - int *current; - - if (size <= 128) { - if (pCachePriv->Info128) { - cacheRoot = pCachePriv->Info128; - max = pCachePriv->Num128x128; - current = &pCachePriv->Current128; - } - else { - cacheRoot = pCachePriv->InfoPartial; - max = pCachePriv->NumPartial; - current = &pCachePriv->CurrentPartial; - } - } - else if (size <= 256) { - cacheRoot = pCachePriv->Info256; - max = pCachePriv->Num256x256; - current = &pCachePriv->Current256; - } - else if (size <= 512) { - cacheRoot = pCachePriv->Info512; - max = pCachePriv->Num512x512; - current = &pCachePriv->Current512; - } - else { /* something's wrong */ - ErrorF("Something's wrong in XAACacheTile()\n"); - return pCachePriv->Info128; - } - - pCache = cacheRoot; - - /* lets look for it */ - for (i = 0; i < max; i++, pCache++) { - if (pCache->serialNumber == pPix->drawable.serialNumber) { - pCache->trans_color = -1; - return pCache; - } - } - - pCache = &cacheRoot[(*current)++]; - if (*current >= max) - *current = 0; - - pCache->serialNumber = pPix->drawable.serialNumber; - pCache->trans_color = pCache->bg = pCache->fg = -1; - pCache->orig_w = w; - pCache->orig_h = h; - (*infoRec->WritePixmapToCache) (pScrn, pCache->x, pCache->y, w, h, - pPix->devPrivate.ptr, pPix->devKind, - pPix->drawable.bitsPerPixel, - pPix->drawable.depth); - if (!(infoRec->PixmapCacheFlags & DO_NOT_TILE_COLOR_DATA) && - ((w != pCache->w) || (h != pCache->h))) - XAATileCache(pScrn, pCache, w, h); - - return pCache; -} - -XAACacheInfoPtr -XAACacheMonoStipple(ScrnInfoPtr pScrn, PixmapPtr pPix) -{ - int w = pPix->drawable.width; - int h = pPix->drawable.height; - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - XAAPixmapCachePrivatePtr pCachePriv = - (XAAPixmapCachePrivatePtr) infoRec->PixmapCachePrivate; - XAACacheInfoPtr pCache, cacheRoot = NULL; - int i, max = 0, funcNo, pad, dwords, bpp = pScrn->bitsPerPixel; - int *current; - StippleScanlineProcPtr StippleFunc; - unsigned char *data, *srcPtr, *dstPtr; - - if ((h <= 128) && (w <= 128 * bpp)) { - if (pCachePriv->Info128) { - cacheRoot = pCachePriv->Info128; - max = pCachePriv->Num128x128; - current = &pCachePriv->Current128; - } - else { - cacheRoot = pCachePriv->InfoPartial; - max = pCachePriv->NumPartial; - current = &pCachePriv->CurrentPartial; - } - } - else if ((h <= 256) && (w <= 256 * bpp)) { - cacheRoot = pCachePriv->Info256; - max = pCachePriv->Num256x256; - current = &pCachePriv->Current256; - } - else if ((h <= 512) && (w <= 526 * bpp)) { - cacheRoot = pCachePriv->Info512; - max = pCachePriv->Num512x512; - current = &pCachePriv->Current512; - } - else { /* something's wrong */ - ErrorF("Something's wrong in XAACacheMonoStipple()\n"); - return pCachePriv->Info128; - } - - pCache = cacheRoot; - - /* lets look for it */ - for (i = 0; i < max; i++, pCache++) { - if ((pCache->serialNumber == pPix->drawable.serialNumber) && - (pCache->fg == -1) && (pCache->bg == -1)) { - pCache->trans_color = -1; - return pCache; - } - } - - pCache = &cacheRoot[(*current)++]; - if (*current >= max) - *current = 0; - - pCache->serialNumber = pPix->drawable.serialNumber; - pCache->trans_color = pCache->bg = pCache->fg = -1; - pCache->orig_w = w; - pCache->orig_h = h; - - if (w <= 32) { - if (w & (w - 1)) - funcNo = 1; - else - funcNo = 0; - } - else - funcNo = 2; - - pad = BitmapBytePad(pCache->w * bpp); - dwords = bytes_to_int32(pad); - dstPtr = data = (unsigned char *) malloc(pad * pCache->h); - srcPtr = (unsigned char *) pPix->devPrivate.ptr; - - if (infoRec-> - ScreenToScreenColorExpandFillFlags & BIT_ORDER_IN_BYTE_MSBFIRST) - StippleFunc = XAAStippleScanlineFuncMSBFirst[funcNo]; - else - StippleFunc = XAAStippleScanlineFuncLSBFirst[funcNo]; - - /* don't bother generating more than we'll ever use */ - max = ((pScrn->displayWidth + w - 1) + 31) >> 5; - if (dwords > max) - dwords = max; - - for (i = 0; i < h; i++) { - (*StippleFunc) ((CARD32 *) dstPtr, (CARD32 *) srcPtr, 0, w, dwords); - srcPtr += pPix->devKind; - dstPtr += pad; - } - - while ((h << 1) <= pCache->h) { - memcpy(data + (pad * h), data, pad * h); - h <<= 1; - } - - if (h < pCache->h) - memcpy(data + (pad * h), data, pad * (pCache->h - h)); - - (*infoRec->WritePixmapToCache) (pScrn, pCache->x, pCache->y, pCache->w, - pCache->h, data, pad, bpp, pScrn->depth); - - free(data); - - return pCache; -} - -XAACacheInfoPtr -XAACachePlanarMonoStipple(ScrnInfoPtr pScrn, PixmapPtr pPix) -{ - int w = pPix->drawable.width; - int h = pPix->drawable.height; - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - XAAPixmapCachePrivatePtr pCachePriv = - (XAAPixmapCachePrivatePtr) infoRec->PixmapCachePrivate; - XAACacheInfoPtr pCache, cacheRoot = NULL; - int i, max = 0; - int *current; - - if ((h <= 128) && (w <= 128)) { - if (pCachePriv->Info128) { - cacheRoot = pCachePriv->Info128; - max = pCachePriv->Num128x128; - current = &pCachePriv->Current128; - } - else { - cacheRoot = pCachePriv->InfoPartial; - max = pCachePriv->NumPartial; - current = &pCachePriv->CurrentPartial; - } - } - else if ((h <= 256) && (w <= 256)) { - cacheRoot = pCachePriv->Info256; - max = pCachePriv->Num256x256; - current = &pCachePriv->Current256; - } - else if ((h <= 512) && (w <= 526)) { - cacheRoot = pCachePriv->Info512; - max = pCachePriv->Num512x512; - current = &pCachePriv->Current512; - } - else { /* something's wrong */ - ErrorF("Something's wrong in XAACachePlanarMonoStipple()\n"); - return pCachePriv->Info128; - } - - pCache = cacheRoot; - - /* lets look for it */ - for (i = 0; i < max; i++, pCache++) { - if ((pCache->serialNumber == pPix->drawable.serialNumber) && - (pCache->fg == -1) && (pCache->bg == -1)) { - pCache->trans_color = -1; - return pCache; - } - } - - pCache = &cacheRoot[(*current)++]; - if (*current >= max) - *current = 0; - - pCache->serialNumber = pPix->drawable.serialNumber; - pCache->trans_color = pCache->bg = pCache->fg = -1; - pCache->orig_w = w; - pCache->orig_h = h; - - /* Plane 0 holds the stipple. Plane 1 holds the inverted stipple */ - (*infoRec->WriteBitmapToCache) (pScrn, pCache->x, pCache->y, - pPix->drawable.width, pPix->drawable.height, - pPix->devPrivate.ptr, pPix->devKind, 1, 2); - if (!(infoRec->PixmapCacheFlags & DO_NOT_TILE_MONO_DATA) && - ((w != pCache->w) || (h != pCache->h))) - XAATileCache(pScrn, pCache, w, h); - - return pCache; -} - -XAACachePlanarMonoStippleProc -XAAGetCachePlanarMonoStipple(void) -{ - return XAACachePlanarMonoStipple; -} - -XAACacheInfoPtr -XAACacheStipple(ScrnInfoPtr pScrn, PixmapPtr pPix, int fg, int bg) -{ - int w = pPix->drawable.width; - int h = pPix->drawable.height; - int size = max(w, h); - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - XAAPixmapCachePrivatePtr pCachePriv = - (XAAPixmapCachePrivatePtr) infoRec->PixmapCachePrivate; - XAACacheInfoPtr pCache, cacheRoot = NULL; - int i, max = 0; - int *current; - - if (size <= 128) { - if (pCachePriv->Info128) { - cacheRoot = pCachePriv->Info128; - max = pCachePriv->Num128x128; - current = &pCachePriv->Current128; - } - else { - cacheRoot = pCachePriv->InfoPartial; - max = pCachePriv->NumPartial; - current = &pCachePriv->CurrentPartial; - } - } - else if (size <= 256) { - cacheRoot = pCachePriv->Info256; - max = pCachePriv->Num256x256; - current = &pCachePriv->Current256; - } - else if (size <= 512) { - cacheRoot = pCachePriv->Info512; - max = pCachePriv->Num512x512; - current = &pCachePriv->Current512; - } - else { /* something's wrong */ - ErrorF("Something's wrong in XAACacheStipple()\n"); - return pCachePriv->Info128; - } - - pCache = cacheRoot; - /* lets look for it */ - if (bg == -1) - for (i = 0; i < max; i++, pCache++) { - if ((pCache->serialNumber == pPix->drawable.serialNumber) && - (fg == pCache->fg) && (pCache->fg != pCache->bg)) { - pCache->trans_color = pCache->bg; - return pCache; - } - } - else - for (i = 0; i < max; i++, pCache++) { - if ((pCache->serialNumber == pPix->drawable.serialNumber) && - (fg == pCache->fg) && (bg == pCache->bg)) { - pCache->trans_color = -1; - return pCache; - } - } - - pCache = &cacheRoot[(*current)++]; - if (*current >= max) - *current = 0; - - pCache->serialNumber = pPix->drawable.serialNumber; - pCache->fg = fg; - if (bg == -1) - pCache->trans_color = bg = fg ^ 1; - else - pCache->trans_color = -1; - pCache->bg = bg; - - pCache->orig_w = w; - pCache->orig_h = h; - (*infoRec->WriteBitmapToCache) (pScrn, pCache->x, pCache->y, - pPix->drawable.width, pPix->drawable.height, - pPix->devPrivate.ptr, pPix->devKind, fg, - bg); - if (!(infoRec->PixmapCacheFlags & DO_NOT_TILE_COLOR_DATA) && - ((w != pCache->w) || (h != pCache->h))) - XAATileCache(pScrn, pCache, w, h); - - return pCache; -} - -XAACacheInfoPtr -XAACacheMono8x8Pattern(ScrnInfoPtr pScrn, int pat0, int pat1) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - XAAPixmapCachePrivatePtr pCachePriv = - (XAAPixmapCachePrivatePtr) infoRec->PixmapCachePrivate; - XAACacheInfoPtr pCache = pCachePriv->InfoMono; - int i; - - for (i = 0; i < pCachePriv->NumMono; i++, pCache++) { - if (pCache->serialNumber && - (pCache->pat0 == pat0) && (pCache->pat1 == pat1)) - return pCache; - } - - /* OK, let's cache it */ - pCache = &pCachePriv->InfoMono[pCachePriv->CurrentMono++]; - if (pCachePriv->CurrentMono >= pCachePriv->NumMono) - pCachePriv->CurrentMono = 0; - - pCache->serialNumber = 1; /* we don't care since we do lookups by pattern */ - pCache->pat0 = pat0; - pCache->pat1 = pat1; - - (*infoRec->WriteMono8x8PatternToCache) (pScrn, pCache); - - return pCache; -} - -XAACacheInfoPtr -XAACacheColor8x8Pattern(ScrnInfoPtr pScrn, PixmapPtr pPix, int fg, int bg) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - XAAPixmapCachePrivatePtr pCachePriv = - (XAAPixmapCachePrivatePtr) infoRec->PixmapCachePrivate; - XAACacheInfoPtr pCache = pCachePriv->InfoColor; - XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE(pPix); - int i; - - if (!(pixPriv->flags & REDUCIBLE_TO_2_COLOR)) { - for (i = 0; i < pCachePriv->NumColor; i++, pCache++) { - if (pCache->serialNumber == pPix->drawable.serialNumber) { - pCache->trans_color = -1; - return pCache; - } - } - pCache = &pCachePriv->InfoColor[pCachePriv->CurrentColor++]; - if (pCachePriv->CurrentColor >= pCachePriv->NumColor) - pCachePriv->CurrentColor = 0; - - pCache->serialNumber = pPix->drawable.serialNumber; - pCache->trans_color = pCache->fg = pCache->bg = -1; - } - else { - int pat0 = pixPriv->pattern0; - int pat1 = pixPriv->pattern1; - - if (fg == -1) { /* it's a tile */ - fg = pixPriv->fg; - bg = pixPriv->bg; - } - - if (bg == -1) { /* stipple */ - for (i = 0; i < pCachePriv->NumColor; i++, pCache++) { - if (pCache->serialNumber && - (pCache->pat0 == pat0) && (pCache->pat1 == pat1) && - (pCache->fg == fg) && (pCache->bg != fg)) { - pCache->trans_color = pCache->bg; - return pCache; - } - } - } - else { /* opaque stipple */ - for (i = 0; i < pCachePriv->NumColor; i++, pCache++) { - if (pCache->serialNumber && - (pCache->pat0 == pat0) && (pCache->pat1 == pat1) && - (pCache->fg == fg) && (pCache->bg == bg)) { - pCache->trans_color = -1; - return pCache; - } - } - } - pCache = &pCachePriv->InfoColor[pCachePriv->CurrentColor++]; - if (pCachePriv->CurrentColor >= pCachePriv->NumColor) - pCachePriv->CurrentColor = 0; - - if (bg == -1) - pCache->trans_color = bg = fg ^ 1; - else - pCache->trans_color = -1; - - pCache->pat0 = pat0; - pCache->pat1 = pat1; - pCache->fg = fg; - pCache->bg = bg; - pCache->serialNumber = 1; - } - - (*infoRec->WriteColor8x8PatternToCache) (pScrn, pPix, pCache); - - return pCache; -} - -void -XAAWriteBitmapToCache(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, int srcwidth, int fg, int bg) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - - (*infoRec->WriteBitmap) (pScrn, x, y, w, h, src, srcwidth, - 0, fg, bg, GXcopy, ~0); -} - -void -XAAWriteBitmapToCacheLinear(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, int srcwidth, int fg, int bg) -{ - ScreenPtr pScreen = pScrn->pScreen; - PixmapPtr pScreenPix, pDstPix; - ChangeGCVal gcvals[2]; - GCPtr pGC; - - pScreenPix = (*pScreen->GetScreenPixmap) (pScreen); - - pDstPix = GetScratchPixmapHeader(pScreen, pScreenPix->drawable.width, - y + h, pScreenPix->drawable.depth, - pScreenPix->drawable.bitsPerPixel, - pScreenPix->devKind, - pScreenPix->devPrivate.ptr); - - pGC = GetScratchGC(pScreenPix->drawable.depth, pScreen); - gcvals[0].val = fg; - gcvals[1].val = bg; - ChangeGC(NullClient, pGC, GCForeground | GCBackground, gcvals); - ValidateGC((DrawablePtr) pDstPix, pGC); - - /* We've unwrapped already so these ops miss a sync */ - SYNC_CHECK(pScrn); - - (*pGC->ops->PutImage) ((DrawablePtr) pDstPix, pGC, 1, x, y, w, h, 0, - XYBitmap, (pointer) src); - - FreeScratchGC(pGC); - FreeScratchPixmapHeader(pDstPix); -} - -void -XAAWritePixmapToCache(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, int srcwidth, int bpp, int depth) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - - (*infoRec->WritePixmap) (pScrn, x, y, w, h, src, srcwidth, - GXcopy, ~0, -1, bpp, depth); -} - -void -XAAWritePixmapToCacheLinear(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, - int srcwidth, int bpp, int depth) -{ - ScreenPtr pScreen = pScrn->pScreen; - PixmapPtr pScreenPix, pDstPix; - GCPtr pGC; - - pScreenPix = (*pScreen->GetScreenPixmap) (pScreen); - - pDstPix = GetScratchPixmapHeader(pScreen, x + w, y + h, - depth, bpp, pScreenPix->devKind, - pScreenPix->devPrivate.ptr); - - pGC = GetScratchGC(depth, pScreen); - ValidateGC((DrawablePtr) pDstPix, pGC); - - /* We've unwrapped already so these ops miss a sync */ - SYNC_CHECK(pScrn); - - if (bpp == BitsPerPixel(depth)) - (*pGC->ops->PutImage) ((DrawablePtr) pDstPix, pGC, depth, x, y, w, - h, 0, ZPixmap, (pointer) src); - else { - PixmapPtr pSrcPix; - - pSrcPix = GetScratchPixmapHeader(pScreen, w, h, depth, bpp, - srcwidth, (pointer) src); - - (*pGC->ops->CopyArea) ((DrawablePtr) pSrcPix, (DrawablePtr) pDstPix, - pGC, 0, 0, w, h, x, y); - - FreeScratchPixmapHeader(pSrcPix); - } - - FreeScratchGC(pGC); - FreeScratchPixmapHeader(pDstPix); -} - -void -XAAWriteMono8x8PatternToCache(ScrnInfoPtr pScrn, XAACacheInfoPtr pCache) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - XAAPixmapCachePrivatePtr pCachePriv = - (XAAPixmapCachePrivatePtr) infoRec->PixmapCachePrivate; - unsigned char *data; - int pad, Bpp = (pScrn->bitsPerPixel >> 3); - - pCache->offsets = pCachePriv->MonoOffsets; - - pad = BitmapBytePad(pCache->w * pScrn->bitsPerPixel); - - data = (unsigned char *) malloc(pad * pCache->h); - if (!data) - return; - - if (infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_PROGRAMMED_ORIGIN) { - CARD32 *ptr = (CARD32 *) data; - - ptr[0] = pCache->pat0; - ptr[1] = pCache->pat1; - } - else { - CARD32 *ptr; - DDXPointPtr pPoint = pCache->offsets; - int patx, paty, i; - - for (i = 0; i < 64; i++, pPoint++) { - patx = pCache->pat0; - paty = pCache->pat1; - XAARotateMonoPattern(&patx, &paty, i & 0x07, i >> 3, - (infoRec->Mono8x8PatternFillFlags & - BIT_ORDER_IN_BYTE_MSBFIRST)); - ptr = (CARD32 *) (data + (pad * pPoint->y) + (Bpp * pPoint->x)); - ptr[0] = patx; - ptr[1] = paty; - } - } - - (*infoRec->WritePixmapToCache) (pScrn, pCache->x, pCache->y, - pCache->w, pCache->h, data, pad, - pScrn->bitsPerPixel, pScrn->depth); - - free(data); -} - -void -XAAWriteColor8x8PatternToCache(ScrnInfoPtr pScrn, - PixmapPtr pPix, XAACacheInfoPtr pCache) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE(pPix); - XAAPixmapCachePrivatePtr pCachePriv = - (XAAPixmapCachePrivatePtr) infoRec->PixmapCachePrivate; - int pad, i, w, h, nw, nh, Bpp; - unsigned char *data, *srcPtr, *dstPtr; - - pCache->offsets = pCachePriv->ColorOffsets; - - if (pixPriv->flags & REDUCIBLE_TO_2_COLOR) { - CARD32 *ptr; - - pad = BitmapBytePad(pCache->w); - data = (unsigned char *) malloc(pad * pCache->h); - if (!data) - return; - - if (infoRec->Color8x8PatternFillFlags & - HARDWARE_PATTERN_PROGRAMMED_ORIGIN) { - ptr = (CARD32 *) data; - ptr[0] = pCache->pat0; - ptr[1] = pCache->pat1; - } - else { - int patx, paty; - - ptr = (CARD32 *) data; - ptr[0] = ptr[2] = pCache->pat0; - ptr[1] = ptr[3] = pCache->pat1; - for (i = 1; i < 8; i++) { - patx = pCache->pat0; - paty = pCache->pat1; - XAARotateMonoPattern(&patx, &paty, i, 0, - (infoRec->Mono8x8PatternFillFlags & - BIT_ORDER_IN_BYTE_MSBFIRST)); - ptr = (CARD32 *) (data + (pad * i)); - ptr[0] = ptr[2] = patx; - ptr[1] = ptr[3] = paty; - } - } - - (*infoRec->WriteBitmapToCache) (pScrn, pCache->x, pCache->y, - pCache->w, pCache->h, data, pad, - pCache->fg, pCache->bg); - - free(data); - return; - } - - Bpp = pScrn->bitsPerPixel >> 3; - h = min(8, pPix->drawable.height); - w = min(8, pPix->drawable.width); - pad = BitmapBytePad(pCache->w * pScrn->bitsPerPixel); - - data = (unsigned char *) malloc(pad * pCache->h); - if (!data) - return; - - /* Write and expand horizontally. */ - for (i = h, dstPtr = data, srcPtr = pPix->devPrivate.ptr; i--; - srcPtr += pPix->devKind, dstPtr += pScrn->bitsPerPixel) { - nw = w; - memcpy(dstPtr, srcPtr, w * Bpp); - while (nw != 8) { - memcpy(dstPtr + (nw * Bpp), dstPtr, nw * Bpp); - nw <<= 1; - } - } - nh = h; - /* Expand vertically. */ - while (nh != 8) { - memcpy(data + (nh * pScrn->bitsPerPixel), data, - nh * pScrn->bitsPerPixel); - nh <<= 1; - } - - if (!(infoRec->Color8x8PatternFillFlags & - HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) { - int j; - unsigned char *ptr = data + (128 * Bpp); - - memcpy(data + (64 * Bpp), data, 64 * Bpp); - for (i = 1; i < 8; i++, ptr += (128 * Bpp)) { - for (j = 0; j < 8; j++) { - memcpy(ptr + (j * 8) * Bpp, data + (j * 8 + i) * Bpp, - (8 - i) * Bpp); - memcpy(ptr + (j * 8 + 8 - i) * Bpp, data + j * 8 * Bpp, - i * Bpp); - } - memcpy(ptr + (64 * Bpp), ptr, 64 * Bpp); - } - } - - (*infoRec->WritePixmapToCache) (pScrn, pCache->x, pCache->y, - pCache->w, pCache->h, data, pad, - pScrn->bitsPerPixel, pScrn->depth); - - free(data); -} - -int -XAAStippledFillChooser(GCPtr pGC) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - PixmapPtr pPixmap = pGC->stipple; - XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPixmap); - - if (!(pPriv->flags & REDUCIBILITY_CHECKED) && - (infoRec->CanDoMono8x8 || infoRec->CanDoColor8x8)) { - XAACheckStippleReducibility(pPixmap); - } - - if (pPriv->flags & REDUCIBLE_TO_8x8) { - if (infoRec->CanDoMono8x8 && - !(infoRec->FillMono8x8PatternSpansFlags & NO_TRANSPARENCY) && - ((pGC->alu == GXcopy) || !(infoRec->FillMono8x8PatternSpansFlags & - TRANSPARENCY_GXCOPY_ONLY)) && - CHECK_ROP(pGC, infoRec->FillMono8x8PatternSpansFlags) && - CHECK_ROPSRC(pGC, infoRec->FillMono8x8PatternSpansFlags) && - CHECK_FG(pGC, infoRec->FillMono8x8PatternSpansFlags) && - CHECK_PLANEMASK(pGC, infoRec->FillMono8x8PatternSpansFlags)) { - - return DO_MONO_8x8; - } - - if (infoRec->CanDoColor8x8 && - !(infoRec->FillColor8x8PatternSpansFlags & NO_TRANSPARENCY) && - ((pGC->alu == GXcopy) || !(infoRec->FillColor8x8PatternSpansFlags & - TRANSPARENCY_GXCOPY_ONLY)) && - CHECK_ROP(pGC, infoRec->FillColor8x8PatternSpansFlags) && - CHECK_ROPSRC(pGC, infoRec->FillColor8x8PatternSpansFlags) && - CHECK_PLANEMASK(pGC, infoRec->FillColor8x8PatternSpansFlags)) { - - return DO_COLOR_8x8; - } - } - - if (infoRec->UsingPixmapCache && infoRec->FillCacheExpandSpans && - (pPixmap->drawable.height <= infoRec->MaxCacheableStippleHeight) && - (pPixmap->drawable.width <= infoRec->MaxCacheableStippleWidth / - infoRec->CacheColorExpandDensity) && - !(infoRec->FillCacheExpandSpansFlags & NO_TRANSPARENCY) && - ((pGC->alu == GXcopy) || !(infoRec->FillCacheExpandSpansFlags & - TRANSPARENCY_GXCOPY_ONLY)) && - CHECK_ROP(pGC, infoRec->FillCacheExpandSpansFlags) && - CHECK_ROPSRC(pGC, infoRec->FillCacheExpandSpansFlags) && - CHECK_FG(pGC, infoRec->FillCacheExpandSpansFlags) && - CHECK_PLANEMASK(pGC, infoRec->FillCacheExpandSpansFlags)) { - - return DO_CACHE_EXPAND; - } - - if (infoRec->UsingPixmapCache && - !(infoRec->PixmapCacheFlags & DO_NOT_BLIT_STIPPLES) && - infoRec->FillCacheBltSpans && - (pPixmap->drawable.height <= infoRec->MaxCacheableTileHeight) && - (pPixmap->drawable.width <= infoRec->MaxCacheableTileWidth) && - !(infoRec->FillCacheBltSpansFlags & NO_TRANSPARENCY) && - ((pGC->alu == GXcopy) || !(infoRec->FillCacheBltSpansFlags & - TRANSPARENCY_GXCOPY_ONLY)) && - CHECK_ROP(pGC, infoRec->FillCacheBltSpansFlags) && - CHECK_ROPSRC(pGC, infoRec->FillCacheBltSpansFlags) && - CHECK_PLANEMASK(pGC, infoRec->FillCacheBltSpansFlags)) { - - return DO_CACHE_BLT; - } - - if (infoRec->FillColorExpandSpans && - !(infoRec->FillColorExpandSpansFlags & NO_TRANSPARENCY) && - ((pGC->alu == GXcopy) || !(infoRec->FillColorExpandSpansFlags & - TRANSPARENCY_GXCOPY_ONLY)) && - CHECK_ROP(pGC, infoRec->FillColorExpandSpansFlags) && - CHECK_ROPSRC(pGC, infoRec->FillColorExpandSpansFlags) && - CHECK_FG(pGC, infoRec->FillColorExpandSpansFlags) && - CHECK_PLANEMASK(pGC, infoRec->FillColorExpandSpansFlags)) { - - return DO_COLOR_EXPAND; - } - - return 0; -} - -int -XAAOpaqueStippledFillChooser(GCPtr pGC) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - PixmapPtr pPixmap = pGC->stipple; - XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPixmap); - - if (XAA_DEPTH_BUG(pGC)) - return 0; - - if (!(pPriv->flags & REDUCIBILITY_CHECKED) && - (infoRec->CanDoMono8x8 || infoRec->CanDoColor8x8)) { - XAACheckStippleReducibility(pPixmap); - } - - if (pPriv->flags & REDUCIBLE_TO_8x8) { - if (infoRec->CanDoMono8x8 && - !(infoRec->FillMono8x8PatternSpansFlags & TRANSPARENCY_ONLY) && - CHECK_ROP(pGC, infoRec->FillMono8x8PatternSpansFlags) && - CHECK_ROPSRC(pGC, infoRec->FillMono8x8PatternSpansFlags) && - CHECK_COLORS(pGC, infoRec->FillMono8x8PatternSpansFlags) && - CHECK_PLANEMASK(pGC, infoRec->FillMono8x8PatternSpansFlags)) { - - return DO_MONO_8x8; - } - - if (infoRec->CanDoColor8x8 && - CHECK_ROP(pGC, infoRec->FillColor8x8PatternSpansFlags) && - CHECK_ROPSRC(pGC, infoRec->FillColor8x8PatternSpansFlags) && - CHECK_PLANEMASK(pGC, infoRec->FillColor8x8PatternSpansFlags)) { - - return DO_COLOR_8x8; - } - } - - if (infoRec->UsingPixmapCache && infoRec->FillCacheExpandSpans && - (pPixmap->drawable.height <= infoRec->MaxCacheableStippleHeight) && - (pPixmap->drawable.width <= infoRec->MaxCacheableStippleWidth / - infoRec->CacheColorExpandDensity) && - !(infoRec->FillCacheExpandSpansFlags & TRANSPARENCY_ONLY) && - CHECK_ROP(pGC, infoRec->FillCacheExpandSpansFlags) && - CHECK_ROPSRC(pGC, infoRec->FillCacheExpandSpansFlags) && - CHECK_COLORS(pGC, infoRec->FillCacheExpandSpansFlags) && - CHECK_PLANEMASK(pGC, infoRec->FillCacheExpandSpansFlags)) { - - return DO_CACHE_EXPAND; - } - - if (infoRec->UsingPixmapCache && - !(infoRec->PixmapCacheFlags & DO_NOT_BLIT_STIPPLES) && - infoRec->FillCacheBltSpans && - (pPixmap->drawable.height <= infoRec->MaxCacheableTileHeight) && - (pPixmap->drawable.width <= infoRec->MaxCacheableTileWidth) && - CHECK_ROP(pGC, infoRec->FillCacheBltSpansFlags) && - CHECK_ROPSRC(pGC, infoRec->FillCacheBltSpansFlags) && - CHECK_PLANEMASK(pGC, infoRec->FillCacheBltSpansFlags)) { - - return DO_CACHE_BLT; - } - - if (infoRec->FillColorExpandSpans && - !(infoRec->FillColorExpandSpansFlags & TRANSPARENCY_ONLY) && - CHECK_ROP(pGC, infoRec->FillColorExpandSpansFlags) && - CHECK_ROPSRC(pGC, infoRec->FillColorExpandSpansFlags) && - CHECK_COLORS(pGC, infoRec->FillColorExpandSpansFlags) && - CHECK_PLANEMASK(pGC, infoRec->FillColorExpandSpansFlags)) { - - return DO_COLOR_EXPAND; - } - - return 0; -} - -int -XAATiledFillChooser(GCPtr pGC) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - PixmapPtr pPixmap = pGC->tile.pixmap; - XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pPixmap); - - if (IS_OFFSCREEN_PIXMAP(pPixmap) && infoRec->FillCacheBltSpans && - CHECK_ROP(pGC, infoRec->FillCacheBltSpansFlags) && - CHECK_ROPSRC(pGC, infoRec->FillCacheBltSpansFlags) && - CHECK_PLANEMASK(pGC, infoRec->FillCacheBltSpansFlags)) { - - return DO_PIXMAP_COPY; - } - - if (!(pPriv->flags & REDUCIBILITY_CHECKED) && - (infoRec->CanDoMono8x8 || infoRec->CanDoColor8x8)) { - XAACheckTileReducibility(pPixmap, infoRec->CanDoMono8x8); - } - - if (pPriv->flags & REDUCIBLE_TO_8x8) { - if ((pPriv->flags & REDUCIBLE_TO_2_COLOR) && infoRec->CanDoMono8x8 && - !(infoRec->FillMono8x8PatternSpansFlags & TRANSPARENCY_ONLY) && - CHECK_ROP(pGC, infoRec->FillMono8x8PatternSpansFlags) && - CHECK_ROPSRC(pGC, infoRec->FillMono8x8PatternSpansFlags) && - (!(infoRec->FillMono8x8PatternSpansFlags & RGB_EQUAL) || - (CHECK_RGB_EQUAL(pPriv->fg) && CHECK_RGB_EQUAL(pPriv->bg))) && - CHECK_PLANEMASK(pGC, infoRec->FillMono8x8PatternSpansFlags)) { - - return DO_MONO_8x8; - } - - if (infoRec->CanDoColor8x8 && - CHECK_ROP(pGC, infoRec->FillColor8x8PatternSpansFlags) && - CHECK_ROPSRC(pGC, infoRec->FillColor8x8PatternSpansFlags) && - CHECK_PLANEMASK(pGC, infoRec->FillColor8x8PatternSpansFlags)) { - - return DO_COLOR_8x8; - } - } - - if (infoRec->UsingPixmapCache && infoRec->FillCacheBltSpans && - (pPixmap->drawable.height <= infoRec->MaxCacheableTileHeight) && - (pPixmap->drawable.width <= infoRec->MaxCacheableTileWidth) && - CHECK_ROP(pGC, infoRec->FillCacheBltSpansFlags) && - CHECK_ROPSRC(pGC, infoRec->FillCacheBltSpansFlags) && - CHECK_PLANEMASK(pGC, infoRec->FillCacheBltSpansFlags)) { - - return DO_CACHE_BLT; - } - - if (infoRec->FillImageWriteRects && - CHECK_NO_GXCOPY(pGC, infoRec->FillImageWriteRectsFlags) && - CHECK_ROP(pGC, infoRec->FillImageWriteRectsFlags) && - CHECK_ROPSRC(pGC, infoRec->FillImageWriteRectsFlags) && - CHECK_PLANEMASK(pGC, infoRec->FillImageWriteRectsFlags)) { - - return DO_IMAGE_WRITE; - } - - return 0; -} - -static int RotateMasksX[8] = { - 0xFFFFFFFF, 0x7F7F7F7F, 0x3F3F3F3F, 0x1F1F1F1F, - 0x0F0F0F0F, 0x07070707, 0x03030303, 0x01010101 -}; - -static int RotateMasksY[4] = { - 0xFFFFFFFF, 0x00FFFFFF, 0x0000FFFF, 0x000000FF -}; - -void -XAARotateMonoPattern(int *pat0, int *pat1, int xorg, int yorg, Bool msbfirst) -{ - int tmp, mask; - - if (xorg) { - if (msbfirst) - xorg = 8 - xorg; - mask = RotateMasksX[xorg]; - *pat0 = ((*pat0 >> xorg) & mask) | ((*pat0 << (8 - xorg)) & ~mask); - *pat1 = ((*pat1 >> xorg) & mask) | ((*pat1 << (8 - xorg)) & ~mask); - } - if (yorg >= 4) { - tmp = *pat0; - *pat0 = *pat1; - *pat1 = tmp; - yorg -= 4; - } - if (yorg) { - mask = RotateMasksY[yorg]; - yorg <<= 3; - tmp = *pat0; - *pat0 = ((*pat0 >> yorg) & mask) | ((*pat1 << (32 - yorg)) & ~mask); - *pat1 = ((*pat1 >> yorg) & mask) | ((tmp << (32 - yorg)) & ~mask); - } -} - -void -XAAInvalidatePixmapCache(ScreenPtr pScreen) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); - XAAPixmapCachePrivatePtr pCachePriv = - (XAAPixmapCachePrivatePtr) infoRec->PixmapCachePrivate; - int i; - - if (!pCachePriv) - return; - - for (i = 0; i < pCachePriv->Num512x512; i++) - (pCachePriv->Info512)[i].serialNumber = 0; - for (i = 0; i < pCachePriv->Num256x256; i++) - (pCachePriv->Info256)[i].serialNumber = 0; - for (i = 0; i < pCachePriv->Num128x128; i++) - (pCachePriv->Info128)[i].serialNumber = 0; - for (i = 0; i < pCachePriv->NumPartial; i++) - (pCachePriv->InfoPartial)[i].serialNumber = 0; - for (i = 0; i < pCachePriv->NumMono; i++) - (pCachePriv->InfoMono)[i].serialNumber = 0; - for (i = 0; i < pCachePriv->NumColor; i++) - (pCachePriv->InfoColor)[i].serialNumber = 0; -} diff --git a/xserver/hw/xfree86/xaa/xaaPict.c b/xserver/hw/xfree86/xaa/xaaPict.c deleted file mode 100644 index 0721768ed..000000000 --- a/xserver/hw/xfree86/xaa/xaaPict.c +++ /dev/null @@ -1,654 +0,0 @@ -/* - * - * Copyright © 2000 Keith Packard, member of The XFree86 Project, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Keith Packard not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Keith Packard makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include - -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" - -#include -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "windowstr.h" -#include "xf86str.h" -#include "mi.h" -#include "picturestr.h" -#include "glyphstr.h" -#include "picture.h" -#include "mipict.h" -#include "xaa.h" -#include "xaalocal.h" -#include "xaawrap.h" -#include "xaacexp.h" -#include "xf86fbman.h" -#include "servermd.h" - -Bool -XAAGetPixelFromRGBA(CARD32 *pixel, - CARD16 red, - CARD16 green, CARD16 blue, CARD16 alpha, CARD32 format) -{ - int rbits, bbits, gbits, abits; - int rshift, bshift, gshift, ashift; - - *pixel = 0; - - if (!PICT_FORMAT_COLOR(format)) - return FALSE; - - rbits = PICT_FORMAT_R(format); - gbits = PICT_FORMAT_G(format); - bbits = PICT_FORMAT_B(format); - abits = PICT_FORMAT_A(format); - - if (PICT_FORMAT_TYPE(format) == PICT_TYPE_ARGB) { - bshift = 0; - gshift = bbits; - rshift = gshift + gbits; - ashift = rshift + rbits; - } - else if (PICT_FORMAT_TYPE(format) == PICT_TYPE_ABGR) { - rshift = 0; - gshift = rbits; - bshift = gshift + gbits; - ashift = bshift + bbits; - } - else if (PICT_FORMAT_TYPE(format) == PICT_TYPE_BGRA) { - bshift = PICT_FORMAT_BPP(format) - bbits; - gshift = bshift - gbits; - rshift = gshift - rbits; - ashift = 0; - } - else - return FALSE; - - *pixel |= (blue >> (16 - bbits)) << bshift; - *pixel |= (red >> (16 - rbits)) << rshift; - *pixel |= (green >> (16 - gbits)) << gshift; - *pixel |= (alpha >> (16 - abits)) << ashift; - - return TRUE; -} - -Bool -XAAGetRGBAFromPixel(CARD32 pixel, - CARD16 *red, - CARD16 *green, CARD16 *blue, CARD16 *alpha, CARD32 format) -{ - int rbits, bbits, gbits, abits; - int rshift, bshift, gshift, ashift; - - if (!PICT_FORMAT_COLOR(format)) - return FALSE; - - rbits = PICT_FORMAT_R(format); - gbits = PICT_FORMAT_G(format); - bbits = PICT_FORMAT_B(format); - abits = PICT_FORMAT_A(format); - - if (PICT_FORMAT_TYPE(format) == PICT_TYPE_ARGB) { - bshift = 0; - gshift = bbits; - rshift = gshift + gbits; - ashift = rshift + rbits; - } - else if (PICT_FORMAT_TYPE(format) == PICT_TYPE_ABGR) { - rshift = 0; - gshift = rbits; - bshift = gshift + gbits; - ashift = bshift + bbits; - } - else if (PICT_FORMAT_TYPE(format) == PICT_TYPE_BGRA) { - bshift = PICT_FORMAT_BPP(format) - bbits; - gshift = bshift - gbits; - rshift = gshift - rbits; - ashift = 0; - } - else - return FALSE; - - *red = ((pixel >> rshift) & ((1 << rbits) - 1)) << (16 - rbits); - while (rbits < 16) { - *red |= *red >> rbits; - rbits <<= 1; - } - - *green = ((pixel >> gshift) & ((1 << gbits) - 1)) << (16 - gbits); - while (gbits < 16) { - *green |= *green >> gbits; - gbits <<= 1; - } - - *blue = ((pixel >> bshift) & ((1 << bbits) - 1)) << (16 - bbits); - while (bbits < 16) { - *blue |= *blue >> bbits; - bbits <<= 1; - } - - if (abits) { - *alpha = ((pixel >> ashift) & ((1 << abits) - 1)) << (16 - abits); - while (abits < 16) { - *alpha |= *alpha >> abits; - abits <<= 1; - } - } - else - *alpha = 0xffff; - - return TRUE; -} - -/* 8:8:8 + PICT_a8 -> 8:8:8:8 texture */ - -void -XAA_888_plus_PICT_a8_to_8888(CARD32 color, CARD8 *alphaPtr, /* in bytes */ - int alphaPitch, CARD32 *dstPtr, int dstPitch, /* in dwords */ - int width, int height) -{ - int x; - - color &= 0x00ffffff; - - while (height--) { - for (x = 0; x < width; x++) - dstPtr[x] = color | (alphaPtr[x] << 24); - dstPtr += dstPitch; - alphaPtr += alphaPitch; - } -} - -#define DRAWABLE_IS_ON_CARD(pDraw) \ - (pDraw->type == DRAWABLE_WINDOW || \ - (pDraw->type == DRAWABLE_PIXMAP && IS_OFFSCREEN_PIXMAP(pDraw))) - -Bool -XAADoComposite(CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height) -{ - ScreenPtr pScreen = pDst->pDrawable->pScreen; - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); - RegionRec region; - CARD32 *formats, *dstformats; - int flags = 0; - BoxPtr pbox; - int nbox, w, h; - - if (!RegionNumRects(pDst->pCompositeClip)) - return TRUE; - - if (!infoRec->pScrn->vtSema || !DRAWABLE_IS_ON_CARD(pDst->pDrawable)) - return FALSE; - - if (DRAWABLE_IS_ON_CARD(pSrc->pDrawable)) - return FALSE; - - if (pSrc->transform || (pMask && pMask->transform)) - return FALSE; - - if (pDst->alphaMap || pSrc->alphaMap || (pMask && pMask->alphaMap)) - return FALSE; - - if ((pSrc->repeat && pSrc->repeatType != RepeatNormal) || - (pMask && pMask->repeat && pMask->repeatType != RepeatNormal)) { - return FALSE; - } - - xDst += pDst->pDrawable->x; - yDst += pDst->pDrawable->y; - xSrc += pSrc->pDrawable->x; - ySrc += pSrc->pDrawable->y; - - if (pMask) { - if (pMask->componentAlpha) - return FALSE; - - /* for now we only do it if there is a 1x1 (solid) source */ - - if ((pSrc->pDrawable->width == 1) && (pSrc->pDrawable->height == 1)) { - CARD16 red, green, blue, alpha; - CARD32 pixel = - *((CARD32 *) (((PixmapPtr) (pSrc->pDrawable))->devPrivate.ptr)); - - if (!XAAGetRGBAFromPixel - (pixel, &red, &green, &blue, &alpha, pSrc->format)) - return FALSE; - - xMask += pMask->pDrawable->x; - yMask += pMask->pDrawable->y; - - /* pull out color expandable operations here */ - if ((pMask->format == PICT_a1) && (alpha == 0xffff) && - (op == PictOpOver) && infoRec->WriteBitmap && !pMask->repeat && - !(infoRec->WriteBitmapFlags & NO_TRANSPARENCY) && - (!(infoRec->WriteBitmapFlags & RGB_EQUAL) || - ((red == green) && (green == blue)))) { - PixmapPtr pPix = (PixmapPtr) (pMask->pDrawable); - int skipleft; - - if (!miComputeCompositeRegion(®ion, pSrc, pMask, pDst, - xSrc, ySrc, xMask, yMask, xDst, - yDst, width, height)) - return TRUE; - - nbox = RegionNumRects(®ion); - pbox = RegionRects(®ion); - - if (!nbox) - return TRUE; - - XAAGetPixelFromRGBA(&pixel, red, green, blue, 0, pDst->format); - - xMask -= xDst; - yMask -= yDst; - - while (nbox--) { - skipleft = pbox->x1 + xMask; - - (*infoRec->WriteBitmap) (infoRec->pScrn, - pbox->x1, pbox->y1, - pbox->x2 - pbox->x1, - pbox->y2 - pbox->y1, - (unsigned char *) (pPix-> - devPrivate. - ptr) + - (pPix->devKind * - (pbox->y1 + yMask)) + - ((skipleft >> 3) & ~3), - pPix->devKind, skipleft & 31, - pixel, -1, GXcopy, ~0); - pbox++; - } - - /* WriteBitmap sets the Sync flag */ - RegionUninit(®ion); - return TRUE; - } - - formats = infoRec->CPUToScreenAlphaTextureFormats; - dstformats = infoRec->CPUToScreenAlphaTextureDstFormats; - if (!formats || !dstformats) - return FALSE; - - w = pMask->pDrawable->width; - h = pMask->pDrawable->height; - - if (pMask->repeat) { - if ((infoRec->CPUToScreenAlphaTextureFlags & XAA_RENDER_NO_TILE) - || - ((infoRec-> - CPUToScreenAlphaTextureFlags & - XAA_RENDER_POWER_OF_2_TILE_ONLY) && ((h & (h - 1)) || - (w & (w - 1))))) { - return FALSE; - } - flags |= XAA_RENDER_REPEAT; - } - - if ((alpha != 0xffff) && - (infoRec-> - CPUToScreenAlphaTextureFlags & XAA_RENDER_NO_SRC_ALPHA)) - return FALSE; - - while (*formats != pMask->format) { - if (!(*formats)) - return FALSE; - formats++; - } - while (*dstformats != pDst->format) { - if (!(*dstformats)) - return FALSE; - dstformats++; - } - - if (!miComputeCompositeRegion(®ion, pSrc, pMask, pDst, - xSrc, ySrc, xMask, yMask, xDst, yDst, - width, height)) - return TRUE; - - nbox = RegionNumRects(®ion); - pbox = RegionRects(®ion); - - if (!nbox) { - RegionUninit(®ion); - return TRUE; - } - - if (!(infoRec->SetupForCPUToScreenAlphaTexture2) (infoRec->pScrn, - op, red, green, - blue, alpha, - pMask->format, - pDst->format, - ((PixmapPtr) - (pMask-> - pDrawable))-> - devPrivate.ptr, - ((PixmapPtr) - (pMask-> - pDrawable))-> - devKind, w, h, - flags)) { - RegionUninit(®ion); - return FALSE; - } - - xMask -= xDst; - yMask -= yDst; - - while (nbox--) { - (*infoRec->SubsequentCPUToScreenAlphaTexture) (infoRec->pScrn, - pbox->x1, - pbox->y1, - pbox->x1 + xMask, - pbox->y1 + yMask, - pbox->x2 - - pbox->x1, - pbox->y2 - - pbox->y1); - pbox++; - } - - SET_SYNC_FLAG(infoRec); - RegionUninit(®ion); - return TRUE; - } - } - else { - formats = infoRec->CPUToScreenTextureFormats; - dstformats = infoRec->CPUToScreenTextureDstFormats; - if (!formats || !dstformats) - return FALSE; - - w = pSrc->pDrawable->width; - h = pSrc->pDrawable->height; - - if (pSrc->repeat) { - if ((infoRec->CPUToScreenTextureFlags & XAA_RENDER_NO_TILE) || - ((infoRec->CPUToScreenTextureFlags & - XAA_RENDER_POWER_OF_2_TILE_ONLY) && - ((h & (h - 1)) || (w & (w - 1))))) { - return FALSE; - } - flags |= XAA_RENDER_REPEAT; - } - - while (*formats != pSrc->format) { - if (!(*formats)) - return FALSE; - formats++; - } - while (*dstformats != pDst->format) { - if (!(*dstformats)) - return FALSE; - dstformats++; - } - - if (!miComputeCompositeRegion(®ion, pSrc, pMask, pDst, - xSrc, ySrc, xMask, yMask, xDst, yDst, - width, height)) - return TRUE; - - nbox = RegionNumRects(®ion); - pbox = RegionRects(®ion); - - if (!nbox) { - RegionUninit(®ion); - return TRUE; - } - - if (!(infoRec->SetupForCPUToScreenTexture2) (infoRec->pScrn, - op, pSrc->format, - pDst->format, - ((PixmapPtr) - (pSrc->pDrawable))-> - devPrivate.ptr, - ((PixmapPtr) - (pSrc->pDrawable))-> - devKind, w, h, flags)) { - RegionUninit(®ion); - return FALSE; - } - - xSrc -= xDst; - ySrc -= yDst; - - while (nbox--) { - (*infoRec->SubsequentCPUToScreenTexture) (infoRec->pScrn, - pbox->x1, pbox->y1, - pbox->x1 + xSrc, - pbox->y1 + ySrc, - pbox->x2 - pbox->x1, - pbox->y2 - pbox->y1); - pbox++; - } - - SET_SYNC_FLAG(infoRec); - RegionUninit(®ion); - return TRUE; - } - - return FALSE; -} - -static void -XAACompositeSrcCopy(PicturePtr pSrc, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xDst, INT16 yDst, CARD16 width, CARD16 height) -{ - ScreenPtr pScreen = pDst->pDrawable->pScreen; - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); - int i, nbox; - int xoff, yoff; - BoxPtr pbox; - DDXPointPtr pptSrc; - RegionRec region; - - xDst += pDst->pDrawable->x; - yDst += pDst->pDrawable->y; - xSrc += pSrc->pDrawable->x; - ySrc += pSrc->pDrawable->y; - - if (!miComputeCompositeRegion(®ion, pSrc, NULL, pDst, - xSrc, ySrc, 0, 0, xDst, yDst, width, height)) - return; - - nbox = RegionNumRects(®ion); - pbox = RegionRects(®ion); - - if (!nbox) { - RegionUninit(®ion); - return; - } - pptSrc = malloc(sizeof(DDXPointRec) * nbox); - if (!pptSrc) { - RegionUninit(®ion); - 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, ®ion, - pptSrc); - - free(pptSrc); - RegionUninit(®ion); - return; -} - -void -XAAComposite(CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height) -{ - ScreenPtr pScreen = pDst->pDrawable->pScreen; - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); - - XAA_RENDER_PROLOGUE(pScreen, Composite); - - if (!pMask && infoRec->pScrn->vtSema && - infoRec->ScreenToScreenBitBlt && - pSrc->pDrawable && - DRAWABLE_IS_ON_CARD(pSrc->pDrawable) && - DRAWABLE_IS_ON_CARD(pDst->pDrawable) && - !pSrc->transform && - (!pSrc->repeat || (xSrc >= 0 && ySrc >= 0 && - xSrc + width <= pSrc->pDrawable->width && - ySrc + height <= pSrc->pDrawable->height)) && - ((op == PictOpSrc && - ((pSrc->format == pDst->format) || - (pSrc->format == PICT_a8r8g8b8 && pDst->format == PICT_x8r8g8b8) || - (pSrc->format == PICT_a8b8g8r8 && pDst->format == PICT_x8b8g8r8))) || - (op == PictOpOver && !pSrc->alphaMap && !pDst->alphaMap && - pSrc->format == pDst->format && - (pSrc->format == PICT_x8r8g8b8 || pSrc->format == PICT_x8b8g8r8)))) { - XAACompositeSrcCopy(pSrc, pDst, xSrc, ySrc, xDst, yDst, width, height); - } - else if (!pSrc->pDrawable || (pMask && !pMask->pDrawable) || - !infoRec->Composite || - !(*infoRec->Composite) (op, pSrc, pMask, pDst, - xSrc, ySrc, xMask, yMask, xDst, yDst, - width, height)) { - if (infoRec->pScrn->vtSema && - ((pSrc->pDrawable && - (pSrc->pDrawable->type == DRAWABLE_WINDOW || - IS_OFFSCREEN_PIXMAP(pSrc->pDrawable))) || - pDst->pDrawable->type == DRAWABLE_WINDOW || - IS_OFFSCREEN_PIXMAP(pDst->pDrawable))) { - SYNC_CHECK(pDst->pDrawable); - } - (*GetPictureScreen(pScreen)->Composite) (op, - pSrc, - pMask, - pDst, - xSrc, - ySrc, - xMask, - yMask, - xDst, yDst, width, height); - } - - if (pDst->pDrawable->type == DRAWABLE_PIXMAP) - (XAA_GET_PIXMAP_PRIVATE((PixmapPtr) (pDst->pDrawable)))->flags |= DIRTY; - - XAA_RENDER_EPILOGUE(pScreen, Composite, XAAComposite); -} - -Bool -XAADoGlyphs(CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr * glyphs) -{ - ScreenPtr pScreen = pDst->pDrawable->pScreen; - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); - - if (!RegionNumRects(pDst->pCompositeClip)) - return TRUE; - - if (!infoRec->pScrn->vtSema || - ((pDst->pDrawable->type != DRAWABLE_WINDOW) && - !IS_OFFSCREEN_PIXMAP(pDst->pDrawable))) - return FALSE; - - if ((pSrc->pDrawable->type != DRAWABLE_PIXMAP) || - IS_OFFSCREEN_PIXMAP(pSrc->pDrawable)) - return FALSE; - - /* - * If it looks like we have a chance of being able to draw these - * glyphs with an accelerated Composite, do that now to avoid - * unneeded and costly syncs. - */ - if (maskFormat) { - if (!infoRec->CPUToScreenAlphaTextureFormats) - return FALSE; - } - else { - if (!infoRec->CPUToScreenTextureFormats) - return FALSE; - } - - miGlyphs(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs); - - return TRUE; -} - -void -XAAGlyphs(CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr * glyphs) -{ - ScreenPtr pScreen = pDst->pDrawable->pScreen; - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); - - XAA_RENDER_PROLOGUE(pScreen, Glyphs); - - if (!pSrc->pDrawable || !infoRec->Glyphs || - !(*infoRec->Glyphs) (op, pSrc, pDst, maskFormat, - xSrc, ySrc, nlist, list, glyphs)) { - if (infoRec->pScrn->vtSema && - ((pSrc->pDrawable && - (pSrc->pDrawable->type == DRAWABLE_WINDOW || - IS_OFFSCREEN_PIXMAP(pSrc->pDrawable))) || - pDst->pDrawable->type == DRAWABLE_WINDOW || - IS_OFFSCREEN_PIXMAP(pDst->pDrawable))) { - SYNC_CHECK(pDst->pDrawable); - } - (*GetPictureScreen(pScreen)->Glyphs) (op, pSrc, pDst, maskFormat, - xSrc, ySrc, nlist, list, glyphs); - } - - if (pDst->pDrawable->type == DRAWABLE_PIXMAP) - (XAA_GET_PIXMAP_PRIVATE((PixmapPtr) (pDst->pDrawable)))->flags |= DIRTY; - - XAA_RENDER_EPILOGUE(pScreen, Glyphs, XAAGlyphs); -} diff --git a/xserver/hw/xfree86/xaa/xaaROP.c b/xserver/hw/xfree86/xaa/xaaROP.c deleted file mode 100644 index 3b6ec9385..000000000 --- a/xserver/hw/xfree86/xaa/xaaROP.c +++ /dev/null @@ -1,182 +0,0 @@ -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" - -#include "scrnintstr.h" -#include "xf86str.h" -#include "xaarop.h" -#include "xaa.h" -#include "xaalocal.h" - -int XAACopyROP[16] = { - ROP_0, /* GXclear */ - ROP_DSa, /* GXand */ - ROP_SDna, /* GXandReverse */ - ROP_S, /* GXcopy */ - ROP_DSna, /* GXandInverted */ - ROP_D, /* GXnoop */ - ROP_DSx, /* GXxor */ - ROP_DSo, /* GXor */ - ROP_DSon, /* GXnor */ - ROP_DSxn, /* GXequiv */ - ROP_Dn, /* GXinvert */ - ROP_SDno, /* GXorReverse */ - ROP_Sn, /* GXcopyInverted */ - ROP_DSno, /* GXorInverted */ - ROP_DSan, /* GXnand */ - ROP_1 /* GXset */ -}; - -int XAACopyROP_PM[16] = { - ROP_0, /* not used */ - ROP_DSPnoa, - ROP_DPSnaon, - ROP_DPSDxax, - ROP_DPSana, - ROP_D, /* not used */ - ROP_DPSax, - ROP_DPSao, - ROP_DPSaon, - ROP_DPSaxn, - ROP_Dn, /* not used */ - ROP_DPSanan, - ROP_PSDPxox, /* is that correct ? */ - ROP_DPSnao, - ROP_DSPnoan, - ROP_1 /* not used */ -}; - -int XAAPatternROP[16] = { - ROP_0, - ROP_DPa, - ROP_PDna, - ROP_P, - ROP_DPna, - ROP_D, - ROP_DPx, - ROP_DPo, - ROP_DPon, - ROP_PDxn, - ROP_Dn, - ROP_PDno, - ROP_Pn, - ROP_DPno, - ROP_DPan, - ROP_1 -}; - -int XAAPatternROP_PM[16] = { - ROP_DPna, - ROP_DPSnoa, - ROP_DSPnaon, - ROP_DSPDxax, - ROP_DPSana, - ROP_D, - ROP_DPSax, - ROP_DPSao, - ROP_DPSaon, - ROP_DPSaxn, - ROP_DPx, - ROP_DPSanan, - ROP_SPDSxox, /* is that correct ? */ - ROP_DSPnao, - ROP_DPSnoan, - ROP_DPo -}; - -int -XAAGetCopyROP(int i) -{ - return XAACopyROP[i]; -} - -int -XAAGetCopyROP_PM(int i) -{ - return XAACopyROP_PM[i]; -} - -int -XAAGetPatternROP(int i) -{ - return XAAPatternROP[i]; -} - -int -XAAGetPatternROP_PM(int i) -{ - return XAAPatternROP_PM[i]; -} - -int -XAAHelpPatternROP(ScrnInfoPtr pScrn, int *fg, int *bg, int pm, int *rop) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - int ret = 0; - - pm &= infoRec->FullPlanemasks[pScrn->depth - 1]; - - if (pm == infoRec->FullPlanemasks[pScrn->depth - 1]) { - if (!NO_SRC_ROP(*rop)) - ret |= ROP_PAT; - *rop = XAAPatternROP[*rop]; - } - else { - switch (*rop) { - case GXnoop: - break; - case GXset: - case GXclear: - case GXinvert: - ret |= ROP_PAT; - *fg = pm; - if (*bg != -1) - *bg = pm; - break; - default: - ret |= ROP_PAT | ROP_SRC; - break; - } - *rop = XAAPatternROP_PM[*rop]; - } - - return ret; -} - -int -XAAHelpSolidROP(ScrnInfoPtr pScrn, int *fg, int pm, int *rop) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - int ret = 0; - - pm &= infoRec->FullPlanemasks[pScrn->depth - 1]; - - if (pm == infoRec->FullPlanemasks[pScrn->depth - 1]) { - if (!NO_SRC_ROP(*rop)) - ret |= ROP_PAT; - *rop = XAAPatternROP[*rop]; - } - else { - switch (*rop) { - case GXnoop: - break; - case GXset: - case GXclear: - case GXinvert: - ret |= ROP_PAT; - *fg = pm; - break; - default: - ret |= ROP_PAT | ROP_SRC; - break; - } - *rop = XAAPatternROP_PM[*rop]; - } - - return ret; -} diff --git a/xserver/hw/xfree86/xaa/xaaRect.c b/xserver/hw/xfree86/xaa/xaaRect.c deleted file mode 100644 index 002090085..000000000 --- a/xserver/hw/xfree86/xaa/xaaRect.c +++ /dev/null @@ -1,121 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" - -#include -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "xf86str.h" -#include "xaa.h" -#include "xaalocal.h" - -/* - Much of this file based on code by - Harm Hanemaayer (H.Hanemaayer@inter.nl.net). -*/ - -void -XAAPolyRectangleThinSolid(DrawablePtr pDrawable, - GCPtr pGC, int nRectsInit, xRectangle *pRectsInit) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - int nClipRects; /* number of clip rectangles */ - BoxPtr pClipRects; /* points to the list of clip rects */ - int xOrigin; /* Drawables x origin */ - int yOrigin; /* Drawables x origin */ - xRectangle *pRect; /* list of rects */ - int nRects; /* running count of number of rects */ - int origX1, origY1; /* original rectangle's U/L corner */ - int origX2, origY2; /* original rectangle's L/R corner */ - int clippedX1; /* clipped rectangle's left x */ - int clippedY1; /* clipped rectangle's top y */ - int clippedX2; /* clipped rectangle's right x */ - int clippedY2; /* clipped rectangle's bottom y */ - int clipXMin; /* upper left corner of clip rect */ - int clipYMin; /* upper left corner of clip rect */ - int clipXMax; /* lower right corner of clip rect */ - int clipYMax; /* lower right corner of clip rect */ - int width, height; /* width and height of rect */ - - nClipRects = RegionNumRects(pGC->pCompositeClip); - pClipRects = RegionRects(pGC->pCompositeClip); - - if (!nClipRects) - return; - - xOrigin = pDrawable->x; - yOrigin = pDrawable->y; - - (*infoRec->SetupForSolidLine) (infoRec->pScrn, - pGC->fgPixel, pGC->alu, pGC->planemask); - - for (; nClipRects > 0; nClipRects--, pClipRects++) { - clipYMin = pClipRects->y1; - clipYMax = pClipRects->y2 - 1; - clipXMin = pClipRects->x1; - clipXMax = pClipRects->x2 - 1; - - for (pRect = pRectsInit, nRects = nRectsInit; - nRects > 0; nRects--, pRect++) { - /* translate rectangle data over to the drawable */ - origX1 = pRect->x + xOrigin; - origY1 = pRect->y + yOrigin; - origX2 = origX1 + pRect->width; - origY2 = origY1 + pRect->height; - - /* reject entire rectangle if completely outside clip rect */ - if ((origX1 > clipXMax) || (origX2 < clipXMin) || - (origY1 > clipYMax) || (origY2 < clipYMin)) - continue; - - /* clip the rectangle */ - clippedX1 = max(origX1, clipXMin); - clippedX2 = min(origX2, clipXMax); - clippedY1 = max(origY1, clipYMin); - clippedY2 = min(origY2, clipYMax); - - width = clippedX2 - clippedX1 + 1; - - if (origY1 >= clipYMin) { - (*infoRec->SubsequentSolidHorVertLine) (infoRec->pScrn, - clippedX1, clippedY1, - width, DEGREES_0); - - /* don't overwrite corner */ - clippedY1++; - } - - if ((origY2 <= clipYMax) && (origY1 != origY2)) { - (*infoRec->SubsequentSolidHorVertLine) (infoRec->pScrn, - clippedX1, clippedY2, - width, DEGREES_0); - - /* don't overwrite corner */ - clippedY2--; - } - - if (clippedY2 < clippedY1) - continue; - - height = clippedY2 - clippedY1 + 1; - - /* draw vertical edges using lines if not clipped out */ - if (origX1 >= clipXMin) - (*infoRec->SubsequentSolidHorVertLine) (infoRec->pScrn, - clippedX1, clippedY1, - height, DEGREES_270); - - if ((origX2 <= clipXMax) && (origX2 != origX1)) - (*infoRec->SubsequentSolidHorVertLine) (infoRec->pScrn, - clippedX2, clippedY1, - height, DEGREES_270); - } - } - - SET_SYNC_FLAG(infoRec); -} diff --git a/xserver/hw/xfree86/xaa/xaaSpans.c b/xserver/hw/xfree86/xaa/xaaSpans.c deleted file mode 100644 index f03452a46..000000000 --- a/xserver/hw/xfree86/xaa/xaaSpans.c +++ /dev/null @@ -1,876 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" - -#include -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "xf86str.h" -#include "mi.h" -#include "mispans.h" -#include "xaa.h" -#include "xaalocal.h" - -static void XAARenderSolidSpans(GCPtr, int, DDXPointPtr, int *, int, int, int); -static void XAARenderColor8x8Spans(GCPtr, int, DDXPointPtr, int *, int, int, - int); -static void XAARenderMono8x8Spans(GCPtr, int, DDXPointPtr, int *, int, int, - int); -static void XAARenderCacheBltSpans(GCPtr, int, DDXPointPtr, int *, int, int, - int); -static void XAARenderColorExpandSpans(GCPtr, int, DDXPointPtr, int *, int, int, - int); -static void XAARenderCacheExpandSpans(GCPtr, int, DDXPointPtr, int *, int, int, - int); -static void XAARenderPixmapCopySpans(GCPtr, int, DDXPointPtr, int *, int, int, - int); - -void -XAAFillSpans(DrawablePtr pDraw, GC * pGC, int nInit, /* number of spans to fill */ - DDXPointPtr pptInit, /* pointer to list of start points */ - int *pwidthInit, /* pointer to list of n widths */ - int fSorted) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - int type = 0; - ClipAndRenderSpansFunc function; - Bool fastClip = FALSE; - - if ((nInit <= 0) || !pGC->planemask) - return; - - if (!RegionNumRects(pGC->pCompositeClip)) - return; - - switch (pGC->fillStyle) { - case FillSolid: - type = DO_SOLID; - break; - case FillStippled: - type = (*infoRec->StippledFillChooser) (pGC); - break; - case FillOpaqueStippled: - if ((pGC->fgPixel == pGC->bgPixel) && infoRec->FillSpansSolid && - CHECK_PLANEMASK(pGC, infoRec->FillSpansSolidFlags) && - CHECK_ROP(pGC, infoRec->FillSpansSolidFlags) && - CHECK_ROPSRC(pGC, infoRec->FillSpansSolidFlags) && - CHECK_FG(pGC, infoRec->FillSpansSolidFlags)) - type = DO_SOLID; - else - type = (*infoRec->OpaqueStippledFillChooser) (pGC); - break; - case FillTiled: - type = (*infoRec->TiledFillChooser) (pGC); - break; - } - - switch (type) { - case DO_SOLID: - function = XAARenderSolidSpans; - if (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL) - fastClip = TRUE; - break; - case DO_COLOR_8x8: - function = XAARenderColor8x8Spans; - if (infoRec->ClippingFlags & HARDWARE_CLIP_COLOR_8x8_FILL) - fastClip = TRUE; - break; - case DO_MONO_8x8: - function = XAARenderMono8x8Spans; - if (infoRec->ClippingFlags & HARDWARE_CLIP_MONO_8x8_FILL) - fastClip = TRUE; - break; - case DO_CACHE_BLT: - function = XAARenderCacheBltSpans; - if (infoRec->ClippingFlags & HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY) - fastClip = TRUE; - break; - case DO_COLOR_EXPAND: - function = XAARenderColorExpandSpans; - break; - case DO_CACHE_EXPAND: - function = XAARenderCacheExpandSpans; - if (infoRec->ClippingFlags & - HARDWARE_CLIP_SCREEN_TO_SCREEN_COLOR_EXPAND) - fastClip = TRUE; - break; - case DO_PIXMAP_COPY: - function = XAARenderPixmapCopySpans; - if (infoRec->ClippingFlags & HARDWARE_CLIP_SCREEN_TO_SCREEN_COPY) - fastClip = TRUE; - break; - case DO_IMAGE_WRITE: - default: - (*XAAFallbackOps.FillSpans) (pDraw, pGC, nInit, pptInit, - pwidthInit, fSorted); - return; - } - - if ((nInit < 10) || (RegionNumRects(pGC->pCompositeClip) != 1)) - fastClip = FALSE; - - if (fastClip) { - infoRec->ClipBox = &pGC->pCompositeClip->extents; - (*function) (pGC, nInit, pptInit, pwidthInit, fSorted, - pDraw->x, pDraw->y); - infoRec->ClipBox = NULL; - } - else - XAAClipAndRenderSpans(pGC, pptInit, pwidthInit, nInit, fSorted, - function, pDraw->x, pDraw->y); -} - - /*********************\ - | Solid Spans | - \*********************/ - -static void -XAARenderSolidSpans(GCPtr pGC, - int n, - DDXPointPtr ppt, - int *pwidth, int fSorted, int xorg, int yorg) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - - (*infoRec->FillSolidSpans) (infoRec->pScrn, pGC->fgPixel, - pGC->alu, pGC->planemask, n, ppt, pwidth, - fSorted); -} - - /************************\ - | Mono 8x8 Spans | - \************************/ - -static void -XAARenderMono8x8Spans(GCPtr pGC, - int n, - DDXPointPtr ppt, - int *pwidth, int fSorted, int xorg, int yorg) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - XAAPixmapPtr pPriv; - int fg, bg; - - switch (pGC->fillStyle) { - case FillStippled: - pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple); - fg = pGC->fgPixel; - bg = -1; - break; - case FillOpaqueStippled: - pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->stipple); - fg = pGC->fgPixel; - bg = pGC->bgPixel; - break; - case FillTiled: - pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap); - fg = pPriv->fg; - bg = pPriv->bg; - break; - default: /* Muffle compiler */ - pPriv = NULL; /* Kaboom */ - fg = -1; - bg = -1; - break; - } - - (*infoRec->FillMono8x8PatternSpans) (infoRec->pScrn, - fg, bg, pGC->alu, pGC->planemask, - n, ppt, pwidth, fSorted, - pPriv->pattern0, pPriv->pattern1, - (xorg + pGC->patOrg.x), - (yorg + pGC->patOrg.y)); -} - - /*************************\ - | Color 8x8 Spans | - \*************************/ - -static void -XAARenderColor8x8Spans(GCPtr pGC, - int n, - DDXPointPtr ppt, - int *pwidth, int fSorted, int xorg, int yorg) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - XAACacheInfoPtr pCache; - PixmapPtr pPix; - int fg, bg; - - switch (pGC->fillStyle) { - case FillStippled: - pPix = pGC->stipple; - fg = pGC->fgPixel; - bg = -1; - break; - case FillOpaqueStippled: - pPix = pGC->stipple; - fg = pGC->fgPixel; - bg = pGC->bgPixel; - break; - case FillTiled: - pPix = pGC->tile.pixmap; - fg = -1; - bg = -1; - break; - default: /* Muffle compiler */ - pPix = NULL; - fg = -1; - bg = -1; - break; - } - - pCache = (*infoRec->CacheColor8x8Pattern) (infoRec->pScrn, pPix, fg, bg); - - (*infoRec->FillColor8x8PatternSpans) (infoRec->pScrn, - pGC->alu, pGC->planemask, n, ppt, - pwidth, fSorted, pCache, - (yorg + pGC->patOrg.x), - (xorg + pGC->patOrg.y)); -} - - /****************************\ - | Color Expand Spans | - \****************************/ - -static void -XAARenderColorExpandSpans(GCPtr pGC, - int n, - DDXPointPtr ppt, - int *pwidth, int fSorted, int xorg, int yorg) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - int fg, bg; - - switch (pGC->fillStyle) { - case FillStippled: - fg = pGC->fgPixel; - bg = -1; - break; - case FillOpaqueStippled: - fg = pGC->fgPixel; - bg = pGC->bgPixel; - break; - default: /* Muffle compiler */ - fg = -1; - bg = -1; - break; - } - - (*infoRec->FillColorExpandSpans) (infoRec->pScrn, fg, bg, - pGC->alu, pGC->planemask, n, ppt, pwidth, - fSorted, (xorg + pGC->patOrg.x), - (yorg + pGC->patOrg.y), pGC->stipple); - -} - - /*************************\ - | Cache Blt Spans | - \*************************/ - -static void -XAARenderCacheBltSpans(GCPtr pGC, - int n, - DDXPointPtr ppt, - int *pwidth, int fSorted, int xorg, int yorg) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - XAACacheInfoPtr pCache; - - switch (pGC->fillStyle) { - case FillStippled: - pCache = (*infoRec->CacheStipple) (infoRec->pScrn, pGC->stipple, - pGC->fgPixel, -1); - break; - case FillOpaqueStippled: - pCache = (*infoRec->CacheStipple) (infoRec->pScrn, pGC->stipple, - pGC->fgPixel, pGC->bgPixel); - break; - case FillTiled: - pCache = (*infoRec->CacheTile) (infoRec->pScrn, pGC->tile.pixmap); - break; - default: /* Muffle compiler */ - pCache = NULL; - break; - } - - (*infoRec->FillCacheBltSpans) (infoRec->pScrn, - pGC->alu, pGC->planemask, n, ppt, pwidth, - fSorted, pCache, (xorg + pGC->patOrg.x), - (yorg + pGC->patOrg.y)); - -} - - /****************************\ - | Cache Expand Spans | - \****************************/ - -static void -XAARenderCacheExpandSpans(GCPtr pGC, - int n, - DDXPointPtr ppt, - int *pwidth, int fSorted, int xorg, int yorg) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - int fg, bg; - - switch (pGC->fillStyle) { - case FillStippled: - fg = pGC->fgPixel; - bg = -1; - break; - case FillOpaqueStippled: - fg = pGC->fgPixel; - bg = pGC->bgPixel; - break; - default: /* Muffle compiler */ - fg = -1; - bg = -1; - break; - } - - (*infoRec->FillCacheExpandSpans) (infoRec->pScrn, fg, bg, - pGC->alu, pGC->planemask, n, ppt, pwidth, - fSorted, (xorg + pGC->patOrg.x), - (yorg + pGC->patOrg.y), pGC->stipple); -} - - /***************************\ - | Pixmap Copy Spans | - \***************************/ - -static void -XAARenderPixmapCopySpans(GCPtr pGC, - int n, - DDXPointPtr ppt, - int *pwidth, int fSorted, int xorg, int yorg) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - XAACacheInfoPtr pCache = &(infoRec->ScratchCacheInfoRec); - XAAPixmapPtr pPriv = XAA_GET_PIXMAP_PRIVATE(pGC->tile.pixmap); - - pCache->x = pPriv->offscreenArea->box.x1; - pCache->y = pPriv->offscreenArea->box.y1; - pCache->w = pCache->orig_w = pPriv->offscreenArea->box.x2 - pCache->x; - pCache->h = pCache->orig_h = pPriv->offscreenArea->box.y2 - pCache->y; - pCache->trans_color = -1; - - (*infoRec->FillCacheBltSpans) (infoRec->pScrn, - pGC->alu, pGC->planemask, n, ppt, pwidth, - fSorted, pCache, (xorg + pGC->patOrg.x), - (yorg + pGC->patOrg.y)); -} - - /****************\ - | Solid | - \****************/ - -void -XAAFillSolidSpans(ScrnInfoPtr pScrn, - int fg, int rop, - unsigned int planemask, - int n, DDXPointPtr ppt, int *pwidth, int fSorted) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - - (*infoRec->SetupForSolidFill) (pScrn, fg, rop, planemask); - - if (infoRec->ClipBox) - (*infoRec->SetClippingRectangle) (infoRec->pScrn, - infoRec->ClipBox->x1, - infoRec->ClipBox->y1, - infoRec->ClipBox->x2 - 1, - infoRec->ClipBox->y2 - 1); - - while (n--) { - if (*pwidth > 0) - (*infoRec->SubsequentSolidFillRect) (pScrn, ppt->x, ppt->y, - *pwidth, 1); - ppt++; - pwidth++; - } - - if (infoRec->ClipBox) - (*infoRec->DisableClipping) (infoRec->pScrn); - - SET_SYNC_FLAG(infoRec); -} - - /***************\ - | Mono 8x8 | - \***************/ - -void -XAAFillMono8x8PatternSpansScreenOrigin(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int n, - DDXPointPtr ppt, - int *pwidth, int fSorted, - int pattern0, int pattern1, - int xorigin, int yorigin) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - int patx = pattern0, paty = pattern1; - int xorg = (-xorigin) & 0x07; - int yorg = (-yorigin) & 0x07; - - if (infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_PROGRAMMED_BITS) { - if (!(infoRec->Mono8x8PatternFillFlags & - HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) { - XAARotateMonoPattern(&patx, &paty, xorg, yorg, - (infoRec->Mono8x8PatternFillFlags & - BIT_ORDER_IN_BYTE_MSBFIRST)); - xorg = patx; - yorg = paty; - } - } - else { - XAACacheInfoPtr pCache = - (*infoRec->CacheMono8x8Pattern) (pScrn, pattern0, pattern1); - patx = pCache->x; - paty = pCache->y; - if (!(infoRec->Mono8x8PatternFillFlags & - HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) { - int slot = (yorg << 3) + xorg; - - patx += pCache->offsets[slot].x; - paty += pCache->offsets[slot].y; - xorg = patx; - yorg = paty; - } - } - - (*infoRec->SetupForMono8x8PatternFill) (pScrn, patx, paty, - fg, bg, rop, planemask); - - if (infoRec->ClipBox) - (*infoRec->SetClippingRectangle) (infoRec->pScrn, - infoRec->ClipBox->x1, - infoRec->ClipBox->y1, - infoRec->ClipBox->x2 - 1, - infoRec->ClipBox->y2 - 1); - - while (n--) { - (*infoRec->SubsequentMono8x8PatternFillRect) (pScrn, - xorg, yorg, ppt->x, - ppt->y, *pwidth, 1); - ppt++; - pwidth++; - } - - if (infoRec->ClipBox) - (*infoRec->DisableClipping) (infoRec->pScrn); - - SET_SYNC_FLAG(infoRec); -} - -void -XAAFillMono8x8PatternSpans(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int n, - DDXPointPtr ppt, - int *pwidth, int fSorted, - int pattern0, int pattern1, int xorigin, int yorigin) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - int patx = pattern0, paty = pattern1; - int xorg, yorg, slot; - XAACacheInfoPtr pCache = NULL; - - if (!(infoRec->Mono8x8PatternFillFlags & HARDWARE_PATTERN_PROGRAMMED_BITS)) { - pCache = (*infoRec->CacheMono8x8Pattern) (pScrn, pattern0, pattern1); - patx = pCache->x; - paty = pCache->y; - } - - (*infoRec->SetupForMono8x8PatternFill) (pScrn, patx, paty, - fg, bg, rop, planemask); - - if (infoRec->ClipBox) - (*infoRec->SetClippingRectangle) (infoRec->pScrn, - infoRec->ClipBox->x1, - infoRec->ClipBox->y1, - infoRec->ClipBox->x2 - 1, - infoRec->ClipBox->y2 - 1); - - while (n--) { - xorg = (ppt->x - xorigin) & 0x07; - yorg = (ppt->y - yorigin) & 0x07; - - if (!(infoRec->Mono8x8PatternFillFlags & - HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) { - if (infoRec->Mono8x8PatternFillFlags & - HARDWARE_PATTERN_PROGRAMMED_BITS) { - patx = pattern0; - paty = pattern1; - XAARotateMonoPattern(&patx, &paty, xorg, yorg, - (infoRec->Mono8x8PatternFillFlags & - BIT_ORDER_IN_BYTE_MSBFIRST)); - xorg = patx; - yorg = paty; - } - else { - slot = (yorg << 3) + xorg; - xorg = patx + pCache->offsets[slot].x; - yorg = paty + pCache->offsets[slot].y; - } - } - - (*infoRec->SubsequentMono8x8PatternFillRect) (pScrn, - xorg, yorg, ppt->x, - ppt->y, *pwidth, 1); - ppt++; - pwidth++; - } - - if (infoRec->ClipBox) - (*infoRec->DisableClipping) (infoRec->pScrn); - - SET_SYNC_FLAG(infoRec); -} - - /****************\ - | Color 8x8 | - \****************/ - -void -XAAFillColor8x8PatternSpansScreenOrigin(ScrnInfoPtr pScrn, - int rop, - unsigned int planemask, - int n, - DDXPointPtr ppt, - int *pwidth, int fSorted, - XAACacheInfoPtr pCache, - int xorigin, int yorigin) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - int patx = pCache->x, paty = pCache->y; - int xorg = (-xorigin) & 0x07; - int yorg = (-yorigin) & 0x07; - - if (!(infoRec->Color8x8PatternFillFlags & - HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) { - int slot = (yorg << 3) + xorg; - - paty += pCache->offsets[slot].y; - patx += pCache->offsets[slot].x; - xorg = patx; - yorg = paty; - } - - (*infoRec->SetupForColor8x8PatternFill) (pScrn, patx, paty, - rop, planemask, - pCache->trans_color); - - if (infoRec->ClipBox) - (*infoRec->SetClippingRectangle) (infoRec->pScrn, - infoRec->ClipBox->x1, - infoRec->ClipBox->y1, - infoRec->ClipBox->x2 - 1, - infoRec->ClipBox->y2 - 1); - - while (n--) { - (*infoRec->SubsequentColor8x8PatternFillRect) (pScrn, - xorg, yorg, ppt->x, - ppt->y, *pwidth, 1); - ppt++; - pwidth++; - } - - if (infoRec->ClipBox) - (*infoRec->DisableClipping) (infoRec->pScrn); - - SET_SYNC_FLAG(infoRec); -} - -void -XAAFillColor8x8PatternSpans(ScrnInfoPtr pScrn, - int rop, - unsigned int planemask, - int n, - DDXPointPtr ppt, - int *pwidth, int fSorted, - XAACacheInfoPtr pCache, int xorigin, int yorigin) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - int xorg, yorg, slot; - - (*infoRec->SetupForColor8x8PatternFill) (pScrn, pCache->x, pCache->y, - rop, planemask, - pCache->trans_color); - - if (infoRec->ClipBox) - (*infoRec->SetClippingRectangle) (infoRec->pScrn, - infoRec->ClipBox->x1, - infoRec->ClipBox->y1, - infoRec->ClipBox->x2 - 1, - infoRec->ClipBox->y2 - 1); - - while (n--) { - xorg = (ppt->x - xorigin) & 0x07; - yorg = (ppt->y - yorigin) & 0x07; - - if (!(infoRec->Color8x8PatternFillFlags & - HARDWARE_PATTERN_PROGRAMMED_ORIGIN)) { - slot = (yorg << 3) + xorg; - yorg = pCache->y + pCache->offsets[slot].y; - xorg = pCache->x + pCache->offsets[slot].x; - } - - (*infoRec->SubsequentColor8x8PatternFillRect) (pScrn, - xorg, yorg, ppt->x, - ppt->y, *pwidth, 1); - ppt++; - pwidth++; - } - - if (infoRec->ClipBox) - (*infoRec->DisableClipping) (infoRec->pScrn); - - SET_SYNC_FLAG(infoRec); -} - - /*****************\ - | Cache Blit | - \*****************/ - -void -XAAFillCacheBltSpans(ScrnInfoPtr pScrn, - int rop, - unsigned int planemask, - int n, - DDXPointPtr ppt, - int *pwidth, - int fSorted, XAACacheInfoPtr pCache, int xorg, int yorg) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - int x, w, phaseX, phaseY, blit_w; - - (*infoRec->SetupForScreenToScreenCopy) (pScrn, 1, 1, rop, planemask, - pCache->trans_color); - - if (infoRec->ClipBox) - (*infoRec->SetClippingRectangle) (infoRec->pScrn, - infoRec->ClipBox->x1, - infoRec->ClipBox->y1, - infoRec->ClipBox->x2 - 1, - infoRec->ClipBox->y2 - 1); - - while (n--) { - x = ppt->x; - w = *pwidth; - phaseX = (x - xorg) % pCache->orig_w; - if (phaseX < 0) - phaseX += pCache->orig_w; - phaseY = (ppt->y - yorg) % pCache->orig_h; - if (phaseY < 0) - phaseY += pCache->orig_h; - - while (1) { - blit_w = pCache->w - phaseX; - if (blit_w > w) - blit_w = w; - - (*infoRec->SubsequentScreenToScreenCopy) (pScrn, - pCache->x + phaseX, - pCache->y + phaseY, x, - ppt->y, blit_w, 1); - - w -= blit_w; - if (!w) - break; - x += blit_w; - phaseX = (phaseX + blit_w) % pCache->orig_w; - } - ppt++; - pwidth++; - } - - if (infoRec->ClipBox) - (*infoRec->DisableClipping) (infoRec->pScrn); - - SET_SYNC_FLAG(infoRec); -} - - /****************\ - | Cache Expand | - \****************/ - -void -XAAFillCacheExpandSpans(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int n, - DDXPointPtr ppt, - int *pwidth, - int fSorted, int xorg, int yorg, PixmapPtr pPix) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - int x, w, phaseX, phaseY, blit_w, cacheWidth; - XAACacheInfoPtr pCache; - - pCache = (*infoRec->CacheMonoStipple) (pScrn, pPix); - - cacheWidth = (pCache->w * pScrn->bitsPerPixel) / - infoRec->CacheColorExpandDensity; - - (*infoRec->SetupForScreenToScreenColorExpandFill) (pScrn, fg, bg, rop, - planemask); - - if (infoRec->ClipBox) - (*infoRec->SetClippingRectangle) (infoRec->pScrn, - infoRec->ClipBox->x1, - infoRec->ClipBox->y1, - infoRec->ClipBox->x2 - 1, - infoRec->ClipBox->y2 - 1); - - while (n--) { - x = ppt->x; - w = *pwidth; - phaseX = (x - xorg) % pCache->orig_w; - if (phaseX < 0) - phaseX += pCache->orig_w; - phaseY = (ppt->y - yorg) % pCache->orig_h; - if (phaseY < 0) - phaseY += pCache->orig_h; - - while (1) { - blit_w = cacheWidth - phaseX; - if (blit_w > w) - blit_w = w; - - (*infoRec->SubsequentScreenToScreenColorExpandFill) (pScrn, x, - ppt->y, blit_w, - 1, pCache->x, - pCache->y + - phaseY, - phaseX); - - w -= blit_w; - if (!w) - break; - x += blit_w; - phaseX = (phaseX + blit_w) % pCache->orig_w; - } - ppt++; - pwidth++; - } - - if (infoRec->ClipBox) - (*infoRec->DisableClipping) (infoRec->pScrn); - - SET_SYNC_FLAG(infoRec); -} - -void -XAAClipAndRenderSpans(GCPtr pGC, - DDXPointPtr ppt, - int *pwidth, - int nspans, - int fSorted, - ClipAndRenderSpansFunc func, int xorg, int yorg) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - DDXPointPtr pptNew, pptBase; - int *pwidthBase, *pwidthNew; - int Right, numRects, MaxBoxes; - - MaxBoxes = infoRec->PreAllocSize / (sizeof(DDXPointRec) + sizeof(int)); - pptBase = (DDXPointRec *) infoRec->PreAllocMem; - pwidthBase = (int *) (&pptBase[MaxBoxes]); - - pptNew = pptBase; - pwidthNew = pwidthBase; - - numRects = RegionNumRects(pGC->pCompositeClip); - - if (numRects == 1) { - BoxPtr pextent = RegionRects(pGC->pCompositeClip); - - while (nspans--) { - if ((pextent->y1 <= ppt->y) && (ppt->y < pextent->y2)) { - pptNew->x = max(pextent->x1, ppt->x); - Right = ppt->x + *pwidth; - *pwidthNew = min(pextent->x2, Right) - pptNew->x; - - if (*pwidthNew > 0) { - pptNew->y = ppt->y; - pptNew++; - pwidthNew++; - - if (pptNew >= (pptBase + MaxBoxes)) { - (*func) (pGC, MaxBoxes, pptBase, pwidthBase, fSorted, - xorg, yorg); - pptNew = pptBase; - pwidthNew = pwidthBase; - } - } - } - ppt++; - pwidth++; - } - } - else if (numRects) { - BoxPtr pbox; - int nbox; - - while (nspans--) { - nbox = numRects; - pbox = RegionRects(pGC->pCompositeClip); - - /* find the first band */ - while (nbox && (pbox->y2 <= ppt->y)) { - pbox++; - nbox--; - } - - if (nbox && (pbox->y1 <= ppt->y)) { - int orig_y = pbox->y1; - - Right = ppt->x + *pwidth; - while (nbox && (orig_y == pbox->y1)) { - if (pbox->x2 <= ppt->x) { - nbox--; - pbox++; - continue; - } - - if (pbox->x1 >= Right) { - nbox = 0; - break; - } - - pptNew->x = max(pbox->x1, ppt->x); - *pwidthNew = min(pbox->x2, Right) - pptNew->x; - if (*pwidthNew > 0) { - pptNew->y = ppt->y; - pptNew++; - pwidthNew++; - - if (pptNew >= (pptBase + MaxBoxes)) { - (*func) (pGC, MaxBoxes, pptBase, pwidthBase, - fSorted, xorg, yorg); - pptNew = pptBase; - pwidthNew = pwidthBase; - } - } - pbox++; - nbox--; - } - } - ppt++; - pwidth++; - } - } - - if (pptNew != pptBase) - (*func) (pGC, pptNew - pptBase, pptBase, pwidthBase, fSorted, - xorg, yorg); -} diff --git a/xserver/hw/xfree86/xaa/xaaStateChange.c b/xserver/hw/xfree86/xaa/xaaStateChange.c deleted file mode 100644 index 0218cb57c..000000000 --- a/xserver/hw/xfree86/xaa/xaaStateChange.c +++ /dev/null @@ -1,1665 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" - -#include -#include "scrnintstr.h" -#include "pixmapstr.h" -#include "windowstr.h" -#include "xf86str.h" -#include "mi.h" -#include "miline.h" -#include "xaa.h" -#include "xaalocal.h" -#include "xaawrap.h" -#include "servermd.h" - -#define XAA_STATE_WRAP(func) do {\ -if(infoRec->func) { \ - pStatePriv->func = infoRec->func;\ - infoRec->func = XAAStateWrap##func;\ -}} while(0) - -/* Wrap all XAA functions and allocate our private structure. - */ - -typedef struct _XAAStateWrapRec { - ScrnInfoPtr pScrn; - void (*RestoreAccelState) (ScrnInfoPtr pScrn); - void (*Sync) (ScrnInfoPtr pScrn); - void (*SetupForScreenToScreenCopy) (ScrnInfoPtr pScrn, int xdir, int ydir, - int rop, unsigned int planemask, - int trans_color); - void (*SetupForSolidFill) (ScrnInfoPtr pScrn, int color, int rop, - unsigned int planemask); - void (*SetupForSolidLine) (ScrnInfoPtr pScrn, int color, int rop, - unsigned int planemask); - void (*SetupForDashedLine) (ScrnInfoPtr pScrn, int fg, int bg, int rop, - unsigned int planemask, int length, - unsigned char *pattern); - void (*SetClippingRectangle) (ScrnInfoPtr pScrn, int left, int top, - int right, int bottom); - void (*DisableClipping) (ScrnInfoPtr pScrn); - void (*SetupForMono8x8PatternFill) (ScrnInfoPtr pScrn, int patx, int paty, - int fg, int bg, int rop, - unsigned int planemask); - void (*SetupForColor8x8PatternFill) (ScrnInfoPtr pScrn, int patx, int paty, - int rop, unsigned int planemask, - int transparency_color); - void (*SetupForCPUToScreenColorExpandFill) (ScrnInfoPtr pScrn, int fg, - int bg, int rop, - unsigned int planemask); - void (*SetupForScanlineCPUToScreenColorExpandFill) (ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask); - void (*SetupForScreenToScreenColorExpandFill) (ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask); - void (*SetupForImageWrite) (ScrnInfoPtr pScrn, int rop, - unsigned int planemask, int transparency_color, - int bpp, int depth); - void (*SetupForScanlineImageWrite) (ScrnInfoPtr pScrn, int rop, - unsigned int planemask, - int transparency_color, - int bpp, int depth); - void (*SetupForImageRead) (ScrnInfoPtr pScrn, int bpp, int depth); - void (*ScreenToScreenBitBlt) (ScrnInfoPtr pScrn, int nbox, - DDXPointPtr pptSrc, BoxPtr pbox, int xdir, - int ydir, int alu, unsigned int planmask); - void (*WriteBitmap) (ScrnInfoPtr pScrn, int x, int y, int w, int h, - unsigned char *src, int srcwidth, int skipleft, - int fg, int bg, int rop, unsigned int planemask); - void (*FillSolidRects) (ScrnInfoPtr pScrn, int fg, int rop, - unsigned int planemask, int nBox, BoxPtr pBox); - void (*FillMono8x8PatternRects) (ScrnInfoPtr pScrn, int fg, int bg, int rop, - unsigned int planemask, int nBox, - BoxPtr pBox, int pat0, int pat1, - int xorg, int yorg); - void (*FillColor8x8PatternRects) (ScrnInfoPtr pScrn, int rop, - unsigned int planemask, int nBox, - BoxPtr pBox, int xorg, int yorg, - XAACacheInfoPtr pCache); - void (*FillCacheBltRects) (ScrnInfoPtr pScrn, int rop, - unsigned int planemask, int nBox, BoxPtr pBox, - int xorg, int yorg, XAACacheInfoPtr pCache); - void (*FillColorExpandRects) (ScrnInfoPtr pScrn, int fg, int bg, int rop, - unsigned int planemask, int nBox, - BoxPtr pBox, int xorg, int yorg, - PixmapPtr pPix); - void (*FillCacheExpandRects) (ScrnInfoPtr pScrn, int fg, int bg, int rop, - unsigned int planemask, int nBox, BoxPtr pBox, - int xorg, int yorg, PixmapPtr pPix); - void (*FillImageWriteRects) (ScrnInfoPtr pScrn, int rop, - unsigned int planemask, int nBox, BoxPtr pBox, - int xorg, int yorg, PixmapPtr pPix); - void (*FillSolidSpans) (ScrnInfoPtr pScrn, int fg, int rop, - unsigned int planemask, int n, DDXPointPtr points, - int *widths, int fSorted); - void (*FillMono8x8PatternSpans) (ScrnInfoPtr pScrn, int fg, int bg, int rop, - unsigned int planemask, int n, - DDXPointPtr points, int *widths, - int fSorted, int pat0, int pat1, - int xorg, int yorg); - void (*FillColor8x8PatternSpans) (ScrnInfoPtr pScrn, int rop, - unsigned int planemask, int n, - DDXPointPtr points, int *widths, - int fSorted, XAACacheInfoPtr pCache, - int xorg, int yorg); - void (*FillCacheBltSpans) (ScrnInfoPtr pScrn, int rop, - unsigned int planemask, int n, - DDXPointPtr points, int *widths, int fSorted, - XAACacheInfoPtr pCache, int xorg, int yorg); - void (*FillColorExpandSpans) (ScrnInfoPtr pScrn, int fg, int bg, int rop, - unsigned int planemask, int n, - DDXPointPtr points, int *widths, int fSorted, - int xorg, int yorg, PixmapPtr pPix); - void (*FillCacheExpandSpans) (ScrnInfoPtr pScrn, int fg, int bg, int rop, - unsigned int planemask, int n, - DDXPointPtr ppt, int *pwidth, int fSorted, - int xorg, int yorg, PixmapPtr pPix); - void (*TEGlyphRenderer) (ScrnInfoPtr pScrn, int x, int y, int w, int h, - int skipleft, int startline, unsigned int **glyphs, - int glyphWidth, int fg, int bg, int rop, - unsigned planemask); - void (*NonTEGlyphRenderer) (ScrnInfoPtr pScrn, int x, int y, int n, - NonTEGlyphPtr glyphs, BoxPtr pbox, int fg, - int rop, unsigned int planemask); - void (*WritePixmap) (ScrnInfoPtr pScrn, int x, int y, int w, int h, - unsigned char *src, int srcwidth, int rop, - unsigned int planemask, int transparency_color, - int bpp, int depth); - void (*ReadPixmap) (ScrnInfoPtr pScrn, int x, int y, int w, int h, - unsigned char *dst, int dstwidth, int bpp, int depth); - RegionPtr (*CopyArea) (DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, - GC * pGC, int srcx, int srcy, int width, int height, - int dstx, int dsty); - RegionPtr (*CopyPlane) (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, - int srcx, int srcy, int width, int height, int dstx, - int dsty, unsigned long bitPlane); - void (*PushPixelsSolid) (GCPtr pGC, PixmapPtr pBitMap, - DrawablePtr pDrawable, int dx, int dy, int xOrg, - int yOrg); - void (*PolyFillRectSolid) (DrawablePtr pDraw, GCPtr pGC, int nrectFill, - xRectangle *prectInit); - void (*PolyFillRectStippled) (DrawablePtr pDraw, GCPtr pGC, int nrectFill, - xRectangle *prectInit); - void (*PolyFillRectOpaqueStippled) (DrawablePtr pDraw, GCPtr pGC, - int nrectFill, xRectangle *prectInit); - void (*PolyFillRectTiled) (DrawablePtr pDraw, GCPtr pGC, int nrectFill, - xRectangle *prectInit); - void (*FillSpansSolid) (DrawablePtr pDraw, GCPtr pGC, int nInit, - DDXPointPtr ppt, int *pwidth, int fSorted); - void (*FillSpansStippled) (DrawablePtr pDraw, GCPtr pGC, int nInit, - DDXPointPtr ppt, int *pwidth, int fSorted); - void (*FillSpansOpaqueStippled) (DrawablePtr pDraw, GCPtr pGC, int nInit, - DDXPointPtr ppt, int *pwidth, int fSorted); - void (*FillSpansTiled) (DrawablePtr pDraw, GCPtr pGC, int nInit, - DDXPointPtr ppt, int *pwidth, int fSorted); - int (*PolyText8TE) (DrawablePtr pDraw, GCPtr pGC, int x, int y, int count, - char *chars); - int (*PolyText16TE) (DrawablePtr pDraw, GCPtr pGC, int x, int y, int count, - unsigned short *chars); - void (*ImageText8TE) (DrawablePtr pDraw, GCPtr pGC, int x, int y, int count, - char *chars); - void (*ImageText16TE) (DrawablePtr pDraw, GCPtr pGC, int x, int y, - int count, unsigned short *chars); - void (*ImageGlyphBltTE) (DrawablePtr pDrawable, GCPtr pGC, int xInit, - int yInit, unsigned int nglyph, CharInfoPtr * ppci, - pointer pglyphBase); - void (*PolyGlyphBltTE) (DrawablePtr pDrawable, GCPtr pGC, int xInit, - int yInit, unsigned int nglyph, CharInfoPtr * ppci, - pointer pglyphBase); - int (*PolyText8NonTE) (DrawablePtr pDraw, GCPtr pGC, int x, int y, - int count, char *chars); - int (*PolyText16NonTE) (DrawablePtr pDraw, GCPtr pGC, int x, int y, - int count, unsigned short *chars); - void (*ImageText8NonTE) (DrawablePtr pDraw, GCPtr pGC, int x, int y, - int count, char *chars); - void (*ImageText16NonTE) (DrawablePtr pDraw, GCPtr pGC, int x, int y, - int count, unsigned short *chars); - void (*ImageGlyphBltNonTE) (DrawablePtr pDrawable, GCPtr pGC, int xInit, - int yInit, unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase); - void (*PolyGlyphBltNonTE) (DrawablePtr pDrawable, GCPtr pGC, int xInit, - int yInit, unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase); - void (*PolyRectangleThinSolid) (DrawablePtr pDrawable, GCPtr pGC, - int nRectsInit, xRectangle *pRectsInit); - void (*PolylinesWideSolid) (DrawablePtr pDrawable, GCPtr pGC, int mode, - int npt, DDXPointPtr pPts); - void (*PolylinesThinSolid) (DrawablePtr pDrawable, GCPtr pGC, int mode, - int npt, DDXPointPtr pPts); - void (*PolySegmentThinSolid) (DrawablePtr pDrawable, GCPtr pGC, int nseg, - xSegment * pSeg); - void (*PolylinesThinDashed) (DrawablePtr pDrawable, GCPtr pGC, int mode, - int npt, DDXPointPtr pPts); - void (*PolySegmentThinDashed) (DrawablePtr pDrawable, GCPtr pGC, int nseg, - xSegment * pSeg); - void (*FillPolygonSolid) (DrawablePtr pDrawable, GCPtr pGC, int shape, - int mode, int count, DDXPointPtr ptsIn); - void (*FillPolygonStippled) (DrawablePtr pDrawable, GCPtr pGC, int shape, - int mode, int count, DDXPointPtr ptsIn); - void (*FillPolygonOpaqueStippled) (DrawablePtr pDrawable, GCPtr pGC, - int shape, int mode, int count, - DDXPointPtr ptsIn); - void (*FillPolygonTiled) (DrawablePtr pDrawable, GCPtr pGC, int shape, - int mode, int count, DDXPointPtr ptsIn); - void (*PolyFillArcSolid) (DrawablePtr pDraw, GCPtr pGC, int narcs, - xArc * parcs); - void (*PutImage) (DrawablePtr pDraw, GCPtr pGC, int depth, int x, int y, - int w, int h, int leftPad, int format, char *pImage); - ValidateGCProcPtr ValidateFillSpans; - ValidateGCProcPtr ValidateSetSpans; - ValidateGCProcPtr ValidatePutImage; - ValidateGCProcPtr ValidateCopyArea; - ValidateGCProcPtr ValidateCopyPlane; - ValidateGCProcPtr ValidatePolyPoint; - ValidateGCProcPtr ValidatePolylines; - ValidateGCProcPtr ValidatePolySegment; - ValidateGCProcPtr ValidatePolyRectangle; - ValidateGCProcPtr ValidatePolyArc; - ValidateGCProcPtr ValidateFillPolygon; - ValidateGCProcPtr ValidatePolyFillRect; - ValidateGCProcPtr ValidatePolyFillArc; - ValidateGCProcPtr ValidatePolyText8; - ValidateGCProcPtr ValidatePolyText16; - ValidateGCProcPtr ValidateImageText8; - ValidateGCProcPtr ValidateImageText16; - ValidateGCProcPtr ValidatePolyGlyphBlt; - ValidateGCProcPtr ValidateImageGlyphBlt; - ValidateGCProcPtr ValidatePushPixels; - void (*ComputeDash) (GCPtr pGC); - void (*InitPixmapCache) (ScreenPtr pScreen, RegionPtr areas, pointer data); - void (*ClosePixmapCache) (ScreenPtr pScreen); - int (*StippledFillChooser) (GCPtr pGC); - int (*OpaqueStippledFillChooser) (GCPtr pGC); - int (*TiledFillChooser) (GCPtr pGC); - XAACacheInfoPtr(*CacheTile) (ScrnInfoPtr Scrn, PixmapPtr pPix); - XAACacheInfoPtr(*CacheStipple) (ScrnInfoPtr Scrn, PixmapPtr pPix, int fg, - int bg); - XAACacheInfoPtr(*CacheMonoStipple) (ScrnInfoPtr Scrn, PixmapPtr pPix); - XAACacheInfoPtr(*CacheMono8x8Pattern) (ScrnInfoPtr Scrn, int pat0, - int pat1); - XAACacheInfoPtr(*CacheColor8x8Pattern) (ScrnInfoPtr Scrn, PixmapPtr pPix, - int fg, int bg); - void (*WriteBitmapToCache) (ScrnInfoPtr pScrn, int x, int y, int w, int h, - unsigned char *src, int srcwidth, int fg, - int bg); - void (*WritePixmapToCache) (ScrnInfoPtr pScrn, int x, int y, int w, int h, - unsigned char *src, int srcwidth, int bpp, - int depth); - void (*WriteMono8x8PatternToCache) (ScrnInfoPtr pScrn, - XAACacheInfoPtr pCache); - void (*WriteColor8x8PatternToCache) (ScrnInfoPtr pScrn, PixmapPtr pPix, - XAACacheInfoPtr pCache); - GetImageProcPtr GetImage; - GetSpansProcPtr GetSpans; - CopyWindowProcPtr CopyWindow; - Bool (*SetupForCPUToScreenAlphaTexture2) (ScrnInfoPtr pScrn, int op, - CARD16 red, CARD16 green, - CARD16 blue, CARD16 alpha, - CARD32 maskFormat, - CARD32 dstFormat, CARD8 *alphaPtr, - int alphaPitch, int width, - int height, int flags); - Bool (*SetupForCPUToScreenTexture2) (ScrnInfoPtr pScrn, int op, - CARD32 srcFormat, CARD32 dstFormat, - CARD8 *texPtr, int texPitch, int width, - int height, int flags); -} XAAStateWrapRec, *XAAStateWrapPtr; - -static DevPrivateKeyRec XAAStateKeyRec; - -#define XAAStateKey (&XAAStateKeyRec) - -/* Wrap functions start here */ -#define GET_STATEPRIV_GC(pGC) XAAStateWrapPtr pStatePriv =\ -(XAAStateWrapPtr)dixLookupPrivate(&(pGC)->pScreen->devPrivates, XAAStateKey) - -#define GET_STATEPRIV_SCREEN(pScreen) XAAStateWrapPtr pStatePriv =\ -(XAAStateWrapPtr)dixLookupPrivate(&(pScreen)->devPrivates, XAAStateKey) - -#define GET_STATEPRIV_PSCRN(pScrn) XAAStateWrapPtr pStatePriv =\ -(XAAStateWrapPtr)dixLookupPrivate(&(pScrn)->pScreen->devPrivates, XAAStateKey) - -#define STATE_CHECK_SP(pStatePriv) {\ - ScrnInfoPtr pScrn = pStatePriv->pScrn;\ - int i = 0;\ - int need_change = 0;\ - while(i < pScrn->numEntities) {\ - if(xf86IsEntityShared(pScrn->entityList[i]) &&\ - xf86GetLastScrnFlag(pScrn->entityList[i]) != pScrn->scrnIndex) {\ - need_change = 1;\ - xf86SetLastScrnFlag(pScrn->entityList[i],\ - pScrn->scrnIndex);\ - }\ - i++;\ - }\ - if(need_change == 1) (*pStatePriv->RestoreAccelState)(pScrn);\ -} - -#define STATE_CHECK_PSCRN(pScrn) {\ - int i = 0;\ - int need_change = 0;\ - while(i < pScrn->numEntities) {\ - if(xf86IsEntityShared(pScrn->entityList[i]) &&\ - xf86GetLastScrnFlag(pScrn->entityList[i]) != pScrn->scrnIndex) {\ - need_change = 1;\ - xf86SetLastScrnFlag(pScrn->entityList[i],\ - pScrn->scrnIndex);\ - }\ - i++;\ - }\ - if(need_change == 1) (*pStatePriv->RestoreAccelState)(pScrn);\ -} - -static void -XAAStateWrapSync(ScrnInfoPtr pScrn) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->Sync) (pScrn); -} - -static void -XAAStateWrapSetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir, - int rop, unsigned int planemask, - int trans_color) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->SetupForScreenToScreenCopy) (pScrn, xdir, ydir, rop, - planemask, trans_color); -} - -static void -XAAStateWrapSetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop, - unsigned int planemask) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->SetupForSolidFill) (pScrn, color, rop, planemask); -} - -static void -XAAStateWrapSetupForSolidLine(ScrnInfoPtr pScrn, int color, int rop, - unsigned int planemask) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->SetupForSolidLine) (pScrn, color, rop, planemask); -} - -static void -XAAStateWrapSetupForDashedLine(ScrnInfoPtr pScrn, int fg, int bg, int rop, - unsigned int planemask, int length, - unsigned char *pattern) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->SetupForDashedLine) (pScrn, fg, bg, rop, planemask, length, - pattern); -} - -static void -XAAStateWrapSetClippingRectangle(ScrnInfoPtr pScrn, int left, int top, - int right, int bottom) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->SetClippingRectangle) (pScrn, left, top, right, bottom); -} - -static void -XAAStateWrapDisableClipping(ScrnInfoPtr pScrn) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->DisableClipping) (pScrn); -} - -static void -XAAStateWrapSetupForMono8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty, - int fg, int bg, int rop, - unsigned int planemask) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->SetupForMono8x8PatternFill) (pScrn, patx, paty, fg, bg, rop, - planemask); -} - -static void -XAAStateWrapSetupForColor8x8PatternFill(ScrnInfoPtr pScrn, int patx, int paty, - int rop, unsigned int planemask, - int transparency_color) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->SetupForColor8x8PatternFill) (pScrn, patx, paty, rop, - planemask, transparency_color); -} - -static void -XAAStateWrapSetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, int fg, - int bg, int rop, - unsigned int planemask) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->SetupForCPUToScreenColorExpandFill) (pScrn, fg, bg, rop, - planemask); -} - -static void -XAAStateWrapSetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, - int fg, int bg, - int rop, - unsigned int planemask) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->SetupForScanlineCPUToScreenColorExpandFill) (pScrn, fg, bg, - rop, planemask); -} - -static void -XAAStateWrapSetupForScreenToScreenColorExpandFill(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->SetupForScreenToScreenColorExpandFill) (pScrn, fg, bg, rop, - planemask); -} - -static void -XAAStateWrapSetupForImageWrite(ScrnInfoPtr pScrn, int rop, - unsigned int planemask, int transparency_color, - int bpp, int depth) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->SetupForImageWrite) (pScrn, rop, planemask, - transparency_color, bpp, depth); -} - -static void -XAAStateWrapSetupForScanlineImageWrite(ScrnInfoPtr pScrn, int rop, - unsigned int planemask, - int transparency_color, - int bpp, int depth) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->SetupForScanlineImageWrite) (pScrn, rop, planemask, - transparency_color, bpp, depth); -} - -static void -XAAStateWrapSetupForImageRead(ScrnInfoPtr pScrn, int bpp, int depth) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->SetupForImageRead) (pScrn, bpp, depth); -} - -static void -XAAStateWrapScreenToScreenBitBlt(ScrnInfoPtr pScrn, int nbox, - DDXPointPtr pptSrc, BoxPtr pbox, int xdir, - int ydir, int alu, unsigned int planmask) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->ScreenToScreenBitBlt) (pScrn, nbox, - pptSrc, pbox, xdir, - ydir, alu, planmask); -} - -static void -XAAStateWrapWriteBitmap(ScrnInfoPtr pScrn, int x, int y, int w, int h, - unsigned char *src, int srcwidth, int skipleft, - int fg, int bg, int rop, unsigned int planemask) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->WriteBitmap) (pScrn, x, y, w, h, - src, srcwidth, skipleft, - fg, bg, rop, planemask); -} - -static void -XAAStateWrapFillSolidRects(ScrnInfoPtr pScrn, int fg, int rop, - unsigned int planemask, int nBox, BoxPtr pBox) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->FillSolidRects) (pScrn, fg, rop, planemask, nBox, pBox); -} - -static void -XAAStateWrapFillMono8x8PatternRects(ScrnInfoPtr pScrn, int fg, int bg, - int rop, unsigned int planemask, int nBox, - BoxPtr pBox, int pat0, int pat1, - int xorg, int yorg) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->FillMono8x8PatternRects) (pScrn, fg, bg, - rop, planemask, nBox, - pBox, pat0, pat1, xorg, yorg); -} - -static void -XAAStateWrapFillColor8x8PatternRects(ScrnInfoPtr pScrn, int rop, - unsigned int planemask, int nBox, - BoxPtr pBox, int xorg, int yorg, - XAACacheInfoPtr pCache) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->FillColor8x8PatternRects) (pScrn, rop, - planemask, nBox, - pBox, xorg, yorg, pCache); -} - -static void -XAAStateWrapFillCacheBltRects(ScrnInfoPtr pScrn, int rop, - unsigned int planemask, int nBox, BoxPtr pBox, - int xorg, int yorg, XAACacheInfoPtr pCache) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->FillCacheBltRects) (pScrn, rop, - planemask, nBox, pBox, - xorg, yorg, pCache); -} - -static void -XAAStateWrapFillColorExpandRects(ScrnInfoPtr pScrn, int fg, int bg, int rop, - unsigned int planemask, int nBox, - BoxPtr pBox, int xorg, int yorg, - PixmapPtr pPix) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->FillColorExpandRects) (pScrn, fg, bg, rop, - planemask, nBox, - pBox, xorg, yorg, pPix); -} - -static void -XAAStateWrapFillCacheExpandRects(ScrnInfoPtr pScrn, int fg, int bg, int rop, - unsigned int planemask, int nBox, - BoxPtr pBox, int xorg, int yorg, - PixmapPtr pPix) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->FillCacheExpandRects) (pScrn, fg, bg, rop, - planemask, nBox, - pBox, xorg, yorg, pPix); -} - -static void -XAAStateWrapFillImageWriteRects(ScrnInfoPtr pScrn, int rop, - unsigned int planemask, int nBox, BoxPtr pBox, - int xorg, int yorg, PixmapPtr pPix) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->FillImageWriteRects) (pScrn, rop, - planemask, nBox, pBox, - xorg, yorg, pPix); -} - -static void -XAAStateWrapFillSolidSpans(ScrnInfoPtr pScrn, int fg, int rop, - unsigned int planemask, int n, DDXPointPtr points, - int *widths, int fSorted) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->FillSolidSpans) (pScrn, fg, rop, - planemask, n, points, widths, fSorted); -} - -static void -XAAStateWrapFillMono8x8PatternSpans(ScrnInfoPtr pScrn, int fg, int bg, - int rop, unsigned int planemask, int n, - DDXPointPtr points, int *widths, - int fSorted, int pat0, int pat1, - int xorg, int yorg) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->FillMono8x8PatternSpans) (pScrn, fg, bg, - rop, planemask, n, - points, widths, - fSorted, pat0, pat1, xorg, yorg); -} - -static void -XAAStateWrapFillColor8x8PatternSpans(ScrnInfoPtr pScrn, int rop, - unsigned int planemask, int n, - DDXPointPtr points, int *widths, - int fSorted, XAACacheInfoPtr pCache, - int xorg, int yorg) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->FillColor8x8PatternSpans) (pScrn, rop, - planemask, n, - points, widths, - fSorted, pCache, xorg, yorg); -} - -static void -XAAStateWrapFillCacheBltSpans(ScrnInfoPtr pScrn, int rop, - unsigned int planemask, int n, - DDXPointPtr points, int *widths, - int fSorted, XAACacheInfoPtr pCache, - int xorg, int yorg) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->FillCacheBltSpans) (pScrn, rop, - planemask, n, - points, widths, - fSorted, pCache, xorg, yorg); -} - -static void -XAAStateWrapFillColorExpandSpans(ScrnInfoPtr pScrn, int fg, int bg, int rop, - unsigned int planemask, int n, - DDXPointPtr points, int *widths, int fSorted, - int xorg, int yorg, PixmapPtr pPix) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->FillColorExpandSpans) (pScrn, fg, bg, rop, - planemask, n, - points, widths, fSorted, - xorg, yorg, pPix); -} - -static void -XAAStateWrapFillCacheExpandSpans(ScrnInfoPtr pScrn, int fg, int bg, int rop, - unsigned int planemask, int n, - DDXPointPtr ppt, int *pwidth, int fSorted, - int xorg, int yorg, PixmapPtr pPix) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->FillCacheExpandSpans) (pScrn, fg, bg, rop, - planemask, n, - ppt, pwidth, fSorted, - xorg, yorg, pPix); -} - -static void -XAAStateWrapTEGlyphRenderer(ScrnInfoPtr pScrn, int x, int y, int w, int h, - int skipleft, int startline, - unsigned int **glyphs, - int glyphWidth, int fg, int bg, int rop, - unsigned planemask) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->TEGlyphRenderer) (pScrn, x, y, w, h, - skipleft, startline, - glyphs, glyphWidth, fg, bg, rop, planemask); -} - -static void -XAAStateWrapNonTEGlyphRenderer(ScrnInfoPtr pScrn, int x, int y, int n, - NonTEGlyphPtr glyphs, BoxPtr pbox, - int fg, int rop, unsigned int planemask) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->NonTEGlyphRenderer) (pScrn, x, y, n, - glyphs, pbox, fg, rop, planemask); -} - -static void -XAAStateWrapWritePixmap(ScrnInfoPtr pScrn, int x, int y, int w, int h, - unsigned char *src, int srcwidth, int rop, - unsigned int planemask, int transparency_color, - int bpp, int depth) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->WritePixmap) (pScrn, x, y, w, h, - src, srcwidth, rop, - planemask, transparency_color, bpp, depth); -} - -static void -XAAStateWrapReadPixmap(ScrnInfoPtr pScrn, int x, int y, int w, int h, - unsigned char *dst, int dstwidth, int bpp, int depth) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->ReadPixmap) (pScrn, x, y, w, h, dst, dstwidth, bpp, depth); -} - -static RegionPtr -XAAStateWrapCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, - GC * pGC, int srcx, int srcy, int width, int height, - int dstx, int dsty) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - return (*pStatePriv->CopyArea) (pSrcDrawable, pDstDrawable, - pGC, srcx, srcy, width, height, dstx, dsty); -} - -static RegionPtr -XAAStateWrapCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, - int srcx, int srcy, int width, int height, - int dstx, int dsty, unsigned long bitPlane) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - return (*pStatePriv->CopyPlane) (pSrc, pDst, pGC, - srcx, srcy, width, height, - dstx, dsty, bitPlane); -} - -static void -XAAStateWrapPushPixelsSolid(GCPtr pGC, PixmapPtr pBitMap, - DrawablePtr pDrawable, int dx, int dy, int xOrg, - int yOrg) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->PushPixelsSolid) (pGC, pBitMap, - pDrawable, dx, dy, xOrg, yOrg); -} - -static void -XAAStateWrapPolyFillRectSolid(DrawablePtr pDraw, GCPtr pGC, int nrectFill, - xRectangle *prectInit) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->PolyFillRectSolid) (pDraw, pGC, nrectFill, prectInit); -} - -static void -XAAStateWrapPolyFillRectStippled(DrawablePtr pDraw, GCPtr pGC, int nrectFill, - xRectangle *prectInit) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->PolyFillRectStippled) (pDraw, pGC, nrectFill, prectInit); -} - -static void -XAAStateWrapPolyFillRectOpaqueStippled(DrawablePtr pDraw, GCPtr pGC, - int nrectFill, xRectangle *prectInit) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->PolyFillRectOpaqueStippled) (pDraw, pGC, - nrectFill, prectInit); -} - -static void -XAAStateWrapPolyFillRectTiled(DrawablePtr pDraw, GCPtr pGC, int nrectFill, - xRectangle *prectInit) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->PolyFillRectTiled) (pDraw, pGC, nrectFill, prectInit); -} - -static void -XAAStateWrapFillSpansSolid(DrawablePtr pDraw, GCPtr pGC, int nInit, - DDXPointPtr ppt, int *pwidth, int fSorted) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->FillSpansSolid) (pDraw, pGC, nInit, ppt, pwidth, fSorted); -} - -static void -XAAStateWrapFillSpansStippled(DrawablePtr pDraw, GCPtr pGC, int nInit, - DDXPointPtr ppt, int *pwidth, int fSorted) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->FillSpansStippled) (pDraw, pGC, nInit, ppt, pwidth, fSorted); -} - -static void -XAAStateWrapFillSpansOpaqueStippled(DrawablePtr pDraw, GCPtr pGC, int nInit, - DDXPointPtr ppt, int *pwidth, int fSorted) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->FillSpansOpaqueStippled) (pDraw, pGC, nInit, - ppt, pwidth, fSorted); -} - -static void -XAAStateWrapFillSpansTiled(DrawablePtr pDraw, GCPtr pGC, int nInit, - DDXPointPtr ppt, int *pwidth, int fSorted) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->FillSpansTiled) (pDraw, pGC, nInit, ppt, pwidth, fSorted); -} - -static int -XAAStateWrapPolyText8TE(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count, - char *chars) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - return (*pStatePriv->PolyText8TE) (pDraw, pGC, x, y, count, chars); -} - -static int -XAAStateWrapPolyText16TE(DrawablePtr pDraw, GCPtr pGC, int x, int y, int count, - unsigned short *chars) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - return (*pStatePriv->PolyText16TE) (pDraw, pGC, x, y, count, chars); -} - -static void -XAAStateWrapImageText8TE(DrawablePtr pDraw, GCPtr pGC, int x, int y, - int count, char *chars) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->ImageText8TE) (pDraw, pGC, x, y, count, chars); -} - -static void -XAAStateWrapImageText16TE(DrawablePtr pDraw, GCPtr pGC, int x, int y, - int count, unsigned short *chars) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->ImageText16TE) (pDraw, pGC, x, y, count, chars); -} - -static void -XAAStateWrapImageGlyphBltTE(DrawablePtr pDrawable, GCPtr pGC, int xInit, - int yInit, unsigned int nglyph, CharInfoPtr * ppci, - pointer pglyphBase) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->ImageGlyphBltTE) (pDrawable, pGC, xInit, - yInit, nglyph, ppci, pglyphBase); -} - -static void -XAAStateWrapPolyGlyphBltTE(DrawablePtr pDrawable, GCPtr pGC, int xInit, - int yInit, unsigned int nglyph, CharInfoPtr * ppci, - pointer pglyphBase) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->PolyGlyphBltTE) (pDrawable, pGC, xInit, - yInit, nglyph, ppci, pglyphBase); -} - -static int -XAAStateWrapPolyText8NonTE(DrawablePtr pDraw, GCPtr pGC, int x, int y, - int count, char *chars) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - return (*pStatePriv->PolyText8NonTE) (pDraw, pGC, x, y, count, chars); -} - -static int -XAAStateWrapPolyText16NonTE(DrawablePtr pDraw, GCPtr pGC, int x, int y, - int count, unsigned short *chars) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - return (*pStatePriv->PolyText16NonTE) (pDraw, pGC, x, y, count, chars); -} - -static void -XAAStateWrapImageText8NonTE(DrawablePtr pDraw, GCPtr pGC, int x, int y, - int count, char *chars) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->ImageText8NonTE) (pDraw, pGC, x, y, count, chars); -} - -static void -XAAStateWrapImageText16NonTE(DrawablePtr pDraw, GCPtr pGC, int x, int y, - int count, unsigned short *chars) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->ImageText16NonTE) (pDraw, pGC, x, y, count, chars); -} - -static void -XAAStateWrapImageGlyphBltNonTE(DrawablePtr pDrawable, GCPtr pGC, int xInit, - int yInit, unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->ImageGlyphBltNonTE) (pDrawable, pGC, xInit, - yInit, nglyph, ppci, pglyphBase); -} - -static void -XAAStateWrapPolyGlyphBltNonTE(DrawablePtr pDrawable, GCPtr pGC, int xInit, - int yInit, unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->PolyGlyphBltNonTE) (pDrawable, pGC, xInit, - yInit, nglyph, ppci, pglyphBase); -} - -static void -XAAStateWrapPolyRectangleThinSolid(DrawablePtr pDrawable, GCPtr pGC, - int nRectsInit, xRectangle *pRectsInit) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->PolyRectangleThinSolid) (pDrawable, pGC, - nRectsInit, pRectsInit); -} - -static void -XAAStateWrapPolylinesWideSolid(DrawablePtr pDrawable, GCPtr pGC, int mode, - int npt, DDXPointPtr pPts) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->PolylinesWideSolid) (pDrawable, pGC, mode, npt, pPts); -} - -static void -XAAStateWrapPolylinesThinSolid(DrawablePtr pDrawable, GCPtr pGC, int mode, - int npt, DDXPointPtr pPts) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->PolylinesThinSolid) (pDrawable, pGC, mode, npt, pPts); -} - -static void -XAAStateWrapPolySegmentThinSolid(DrawablePtr pDrawable, GCPtr pGC, int nseg, - xSegment * pSeg) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->PolySegmentThinSolid) (pDrawable, pGC, nseg, pSeg); -} - -static void -XAAStateWrapPolylinesThinDashed(DrawablePtr pDrawable, GCPtr pGC, int mode, - int npt, DDXPointPtr pPts) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->PolylinesThinDashed) (pDrawable, pGC, mode, npt, pPts); -} - -static void -XAAStateWrapPolySegmentThinDashed(DrawablePtr pDrawable, GCPtr pGC, int nseg, - xSegment * pSeg) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->PolySegmentThinDashed) (pDrawable, pGC, nseg, pSeg); -} - -static void -XAAStateWrapFillPolygonSolid(DrawablePtr pDrawable, GCPtr pGC, int shape, - int mode, int count, DDXPointPtr ptsIn) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->FillPolygonSolid) (pDrawable, pGC, shape, mode, count, ptsIn); -} - -static void -XAAStateWrapFillPolygonStippled(DrawablePtr pDrawable, GCPtr pGC, int shape, - int mode, int count, DDXPointPtr ptsIn) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->FillPolygonStippled) (pDrawable, pGC, shape, - mode, count, ptsIn); -} - -static void -XAAStateWrapFillPolygonOpaqueStippled(DrawablePtr pDrawable, GCPtr pGC, - int shape, int mode, int count, - DDXPointPtr ptsIn) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->FillPolygonOpaqueStippled) (pDrawable, pGC, - shape, mode, count, ptsIn); -} - -static void -XAAStateWrapFillPolygonTiled(DrawablePtr pDrawable, GCPtr pGC, int shape, - int mode, int count, DDXPointPtr ptsIn) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->FillPolygonTiled) (pDrawable, pGC, shape, mode, count, ptsIn); -} - -static void -XAAStateWrapPolyFillArcSolid(DrawablePtr pDraw, GCPtr pGC, int narcs, - xArc * parcs) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->PolyFillArcSolid) (pDraw, pGC, narcs, parcs); -} - -static void -XAAStateWrapPutImage(DrawablePtr pDraw, GCPtr pGC, int depth, int x, int y, - int w, int h, int leftPad, int format, char *pImage) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->PutImage) (pDraw, pGC, depth, x, y, - w, h, leftPad, format, pImage); -} - -static void -XAAStateWrapValidateFillSpans(GCPtr pGC, unsigned long changes, - DrawablePtr pDraw) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->ValidateFillSpans) (pGC, changes, pDraw); -} - -static void -XAAStateWrapValidateSetSpans(GCPtr pGC, unsigned long changes, - DrawablePtr pDraw) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->ValidateSetSpans) (pGC, changes, pDraw); -} - -static void -XAAStateWrapValidatePutImage(GCPtr pGC, unsigned long changes, - DrawablePtr pDraw) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->ValidatePutImage) (pGC, changes, pDraw); -} - -static void -XAAStateWrapValidateCopyArea(GCPtr pGC, unsigned long changes, - DrawablePtr pDraw) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->ValidateCopyArea) (pGC, changes, pDraw); -} - -static void -XAAStateWrapValidateCopyPlane(GCPtr pGC, unsigned long changes, - DrawablePtr pDraw) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->ValidateCopyPlane) (pGC, changes, pDraw); -} - -static void -XAAStateWrapValidatePolyPoint(GCPtr pGC, unsigned long changes, - DrawablePtr pDraw) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->ValidatePolyPoint) (pGC, changes, pDraw); -} - -static void -XAAStateWrapValidatePolylines(GCPtr pGC, unsigned long changes, - DrawablePtr pDraw) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->ValidatePolylines) (pGC, changes, pDraw); -} - -static void -XAAStateWrapValidatePolySegment(GCPtr pGC, unsigned long changes, - DrawablePtr pDraw) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->ValidatePolySegment) (pGC, changes, pDraw); -} - -static void -XAAStateWrapValidatePolyRectangle(GCPtr pGC, unsigned long changes, - DrawablePtr pDraw) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->ValidatePolyRectangle) (pGC, changes, pDraw); -} - -static void -XAAStateWrapValidatePolyArc(GCPtr pGC, unsigned long changes, DrawablePtr pDraw) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->ValidatePolyArc) (pGC, changes, pDraw); -} - -static void -XAAStateWrapValidateFillPolygon(GCPtr pGC, unsigned long changes, - DrawablePtr pDraw) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->ValidateFillPolygon) (pGC, changes, pDraw); -} - -static void -XAAStateWrapValidatePolyFillRect(GCPtr pGC, unsigned long changes, - DrawablePtr pDraw) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->ValidatePolyFillRect) (pGC, changes, pDraw); -} - -static void -XAAStateWrapValidatePolyFillArc(GCPtr pGC, unsigned long changes, - DrawablePtr pDraw) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->ValidatePolyFillArc) (pGC, changes, pDraw); -} - -static void -XAAStateWrapValidatePolyText8(GCPtr pGC, unsigned long changes, - DrawablePtr pDraw) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->ValidatePolyText8) (pGC, changes, pDraw); -} - -static void -XAAStateWrapValidatePolyText16(GCPtr pGC, unsigned long changes, - DrawablePtr pDraw) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->ValidatePolyText16) (pGC, changes, pDraw); -} - -static void -XAAStateWrapValidateImageText8(GCPtr pGC, unsigned long changes, - DrawablePtr pDraw) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->ValidateImageText8) (pGC, changes, pDraw); -} - -static void -XAAStateWrapValidateImageText16(GCPtr pGC, unsigned long changes, - DrawablePtr pDraw) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->ValidateImageText16) (pGC, changes, pDraw); -} - -static void -XAAStateWrapValidatePolyGlyphBlt(GCPtr pGC, unsigned long changes, - DrawablePtr pDraw) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->ValidatePolyGlyphBlt) (pGC, changes, pDraw); -} - -static void -XAAStateWrapValidateImageGlyphBlt(GCPtr pGC, unsigned long changes, - DrawablePtr pDraw) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - (*pStatePriv->ValidateImageGlyphBlt) (pGC, changes, pDraw); -} - -static void -XAAStateWrapValidatePushPixels(GCPtr pGC, unsigned long changes, - DrawablePtr pDraw) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->ValidatePushPixels) (pGC, changes, pDraw); -} - -static void -XAAStateWrapComputeDash(GCPtr pGC) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->ComputeDash) (pGC); -} - -static void -XAAStateWrapInitPixmapCache(ScreenPtr pScreen, RegionPtr areas, pointer data) -{ - GET_STATEPRIV_SCREEN(pScreen); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->InitPixmapCache) (pScreen, areas, data); -} - -static void -XAAStateWrapClosePixmapCache(ScreenPtr pScreen) -{ - GET_STATEPRIV_SCREEN(pScreen); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->ClosePixmapCache) (pScreen); -} - -static int -XAAStateWrapStippledFillChooser(GCPtr pGC) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - return (*pStatePriv->StippledFillChooser) (pGC); -} - -static int -XAAStateWrapOpaqueStippledFillChooser(GCPtr pGC) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - return (*pStatePriv->OpaqueStippledFillChooser) (pGC); -} - -static int -XAAStateWrapTiledFillChooser(GCPtr pGC) -{ - GET_STATEPRIV_GC(pGC); - STATE_CHECK_SP(pStatePriv); - - return (*pStatePriv->TiledFillChooser) (pGC); -} - -static XAACacheInfoPtr -XAAStateWrapCacheTile(ScrnInfoPtr pScrn, PixmapPtr pPix) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - return (*pStatePriv->CacheTile) (pScrn, pPix); -} - -static XAACacheInfoPtr -XAAStateWrapCacheStipple(ScrnInfoPtr pScrn, PixmapPtr pPix, int fg, int bg) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - return (*pStatePriv->CacheStipple) (pScrn, pPix, fg, bg); -} - -static XAACacheInfoPtr -XAAStateWrapCacheMonoStipple(ScrnInfoPtr pScrn, PixmapPtr pPix) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - return (*pStatePriv->CacheMonoStipple) (pScrn, pPix); -} - -static XAACacheInfoPtr -XAAStateWrapCacheMono8x8Pattern(ScrnInfoPtr pScrn, int pat0, int pat1) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - return (*pStatePriv->CacheMono8x8Pattern) (pScrn, pat0, pat1); -} - -static XAACacheInfoPtr -XAAStateWrapCacheColor8x8Pattern(ScrnInfoPtr pScrn, PixmapPtr pPix, - int fg, int bg) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - return (*pStatePriv->CacheColor8x8Pattern) (pScrn, pPix, fg, bg); -} - -static void -XAAStateWrapWriteBitmapToCache(ScrnInfoPtr pScrn, int x, int y, int w, int h, - unsigned char *src, int srcwidth, int fg, int bg) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->WriteBitmapToCache) (pScrn, x, y, w, h, - src, srcwidth, fg, bg); -} - -static void -XAAStateWrapWritePixmapToCache(ScrnInfoPtr pScrn, int x, int y, int w, int h, - unsigned char *src, int srcwidth, int bpp, - int depth) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->WritePixmapToCache) (pScrn, x, y, w, h, - src, srcwidth, bpp, depth); -} - -static void -XAAStateWrapWriteMono8x8PatternToCache(ScrnInfoPtr pScrn, - XAACacheInfoPtr pCache) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->WriteMono8x8PatternToCache) (pScrn, pCache); -} - -static void -XAAStateWrapWriteColor8x8PatternToCache(ScrnInfoPtr pScrn, PixmapPtr pPix, - XAACacheInfoPtr pCache) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - (*pStatePriv->WriteColor8x8PatternToCache) (pScrn, pPix, pCache); -} - -static void -XAAStateWrapGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h, - unsigned int format, unsigned long planeMask, - char *pdstLine) -{ - GET_STATEPRIV_SCREEN(pDrawable->pScreen); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->GetImage) (pDrawable, sx, sy, w, h, - format, planeMask, pdstLine); -} - -static void -XAAStateWrapGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, - int *pwidth, int nspans, char *pdstStart) -{ - GET_STATEPRIV_SCREEN(pDrawable->pScreen); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->GetSpans) (pDrawable, wMax, ppt, pwidth, nspans, pdstStart); -} - -static void -XAAStateWrapCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, - RegionPtr prgnSrc) -{ - GET_STATEPRIV_SCREEN(pWindow->drawable.pScreen); - STATE_CHECK_SP(pStatePriv); - - (*pStatePriv->CopyWindow) (pWindow, ptOldOrg, prgnSrc); -} - -static Bool -XAAStateWrapSetupForCPUToScreenAlphaTexture2(ScrnInfoPtr pScrn, - int op, CARD16 red, - CARD16 green, - CARD16 blue, - CARD16 alpha, - CARD32 srcFormat, - CARD32 dstFormat, - CARD8 *alphaPtr, - int alphaPitch, - int width, int height, int flags) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - return (*pStatePriv->SetupForCPUToScreenAlphaTexture2) (pScrn, op, red, - green, blue, alpha, - srcFormat, - dstFormat, alphaPtr, - alphaPitch, width, - height, flags); -} - -static Bool -XAAStateWrapSetupForCPUToScreenTexture2(ScrnInfoPtr pScrn, int op, - CARD32 srcFormat, - CARD32 dstFormat, - CARD8 *texPtr, int texPitch, - int width, int height, int flags) -{ - GET_STATEPRIV_PSCRN(pScrn); - STATE_CHECK_PSCRN(pScrn); - - return (*pStatePriv->SetupForCPUToScreenTexture2) (pScrn, op, srcFormat, - dstFormat, texPtr, - texPitch, width, height, - flags); -} - -/* Setup Function */ -Bool -XAAInitStateWrap(ScreenPtr pScreen, XAAInfoRecPtr infoRec) -{ - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; - XAAStateWrapPtr pStatePriv; - int i = 0; - - if (!dixRegisterPrivateKey(&XAAStateKeyRec, PRIVATE_SCREEN, 0)) - return FALSE; - if (!(pStatePriv = malloc(sizeof(XAAStateWrapRec)))) - return FALSE; - dixSetPrivate(&pScreen->devPrivates, XAAStateKey, pStatePriv); - pStatePriv->RestoreAccelState = infoRec->RestoreAccelState; - pStatePriv->pScrn = pScrn; - - /* Initialize the last screen to -1 so whenever an accel function - * is called the proper state is setup - */ - while (i < pScrn->numEntities) { - xf86SetLastScrnFlag(pScrn->entityList[i], -1); - i++; - } -/* Do the wrapping */ - XAA_STATE_WRAP(Sync); - XAA_STATE_WRAP(SetupForScreenToScreenCopy); - XAA_STATE_WRAP(SetupForSolidFill); - XAA_STATE_WRAP(SetupForSolidLine); - XAA_STATE_WRAP(SetupForDashedLine); - XAA_STATE_WRAP(SetClippingRectangle); - XAA_STATE_WRAP(DisableClipping); - XAA_STATE_WRAP(SetupForMono8x8PatternFill); - XAA_STATE_WRAP(SetupForColor8x8PatternFill); - XAA_STATE_WRAP(SetupForCPUToScreenColorExpandFill); - XAA_STATE_WRAP(SetupForScanlineCPUToScreenColorExpandFill); - XAA_STATE_WRAP(SetupForScreenToScreenColorExpandFill); - XAA_STATE_WRAP(SetupForImageWrite); - XAA_STATE_WRAP(SetupForScanlineImageWrite); - XAA_STATE_WRAP(SetupForImageRead); - XAA_STATE_WRAP(ScreenToScreenBitBlt); - XAA_STATE_WRAP(WriteBitmap); - XAA_STATE_WRAP(FillSolidRects); - XAA_STATE_WRAP(FillMono8x8PatternRects); - XAA_STATE_WRAP(FillColor8x8PatternRects); - XAA_STATE_WRAP(FillCacheBltRects); - XAA_STATE_WRAP(FillColorExpandRects); - XAA_STATE_WRAP(FillCacheExpandRects); - XAA_STATE_WRAP(FillImageWriteRects); - XAA_STATE_WRAP(FillSolidSpans); - XAA_STATE_WRAP(FillMono8x8PatternSpans); - XAA_STATE_WRAP(FillColor8x8PatternSpans); - XAA_STATE_WRAP(FillCacheBltSpans); - XAA_STATE_WRAP(FillColorExpandSpans); - XAA_STATE_WRAP(FillCacheExpandSpans); - XAA_STATE_WRAP(TEGlyphRenderer); - XAA_STATE_WRAP(NonTEGlyphRenderer); - XAA_STATE_WRAP(WritePixmap); - XAA_STATE_WRAP(ReadPixmap); - XAA_STATE_WRAP(CopyArea); - XAA_STATE_WRAP(CopyPlane); - XAA_STATE_WRAP(PushPixelsSolid); - XAA_STATE_WRAP(PolyFillRectSolid); - XAA_STATE_WRAP(PolyFillRectStippled); - XAA_STATE_WRAP(PolyFillRectOpaqueStippled); - XAA_STATE_WRAP(PolyFillRectTiled); - XAA_STATE_WRAP(FillSpansSolid); - XAA_STATE_WRAP(FillSpansStippled); - XAA_STATE_WRAP(FillSpansOpaqueStippled); - XAA_STATE_WRAP(FillSpansTiled); - XAA_STATE_WRAP(PolyText8TE); - XAA_STATE_WRAP(PolyText16TE); - XAA_STATE_WRAP(ImageText8TE); - XAA_STATE_WRAP(ImageText16TE); - XAA_STATE_WRAP(ImageGlyphBltTE); - XAA_STATE_WRAP(PolyGlyphBltTE); - XAA_STATE_WRAP(PolyText8NonTE); - XAA_STATE_WRAP(PolyText16NonTE); - XAA_STATE_WRAP(ImageText8NonTE); - XAA_STATE_WRAP(ImageText16NonTE); - XAA_STATE_WRAP(ImageGlyphBltNonTE); - XAA_STATE_WRAP(PolyGlyphBltNonTE); - XAA_STATE_WRAP(PolyRectangleThinSolid); - XAA_STATE_WRAP(PolylinesWideSolid); - XAA_STATE_WRAP(PolylinesThinSolid); - XAA_STATE_WRAP(PolySegmentThinSolid); - XAA_STATE_WRAP(PolylinesThinDashed); - XAA_STATE_WRAP(PolySegmentThinDashed); - XAA_STATE_WRAP(FillPolygonSolid); - XAA_STATE_WRAP(FillPolygonStippled); - XAA_STATE_WRAP(FillPolygonOpaqueStippled); - XAA_STATE_WRAP(FillPolygonTiled); - XAA_STATE_WRAP(PolyFillArcSolid); - XAA_STATE_WRAP(PutImage); - XAA_STATE_WRAP(ValidateFillSpans); - XAA_STATE_WRAP(ValidateSetSpans); - XAA_STATE_WRAP(ValidatePutImage); - XAA_STATE_WRAP(ValidateCopyArea); - XAA_STATE_WRAP(ValidateCopyPlane); - XAA_STATE_WRAP(ValidatePolyPoint); - XAA_STATE_WRAP(ValidatePolylines); - XAA_STATE_WRAP(ValidatePolySegment); - XAA_STATE_WRAP(ValidatePolyRectangle); - XAA_STATE_WRAP(ValidatePolyArc); - XAA_STATE_WRAP(ValidateFillPolygon); - XAA_STATE_WRAP(ValidatePolyFillRect); - XAA_STATE_WRAP(ValidatePolyFillArc); - XAA_STATE_WRAP(ValidatePolyText8); - XAA_STATE_WRAP(ValidatePolyText16); - XAA_STATE_WRAP(ValidateImageText8); - XAA_STATE_WRAP(ValidateImageText16); - XAA_STATE_WRAP(ValidatePolyGlyphBlt); - XAA_STATE_WRAP(ValidateImageGlyphBlt); - XAA_STATE_WRAP(ValidatePushPixels); - XAA_STATE_WRAP(ComputeDash); - XAA_STATE_WRAP(InitPixmapCache); - XAA_STATE_WRAP(ClosePixmapCache); - XAA_STATE_WRAP(StippledFillChooser); - XAA_STATE_WRAP(OpaqueStippledFillChooser); - XAA_STATE_WRAP(TiledFillChooser); - XAA_STATE_WRAP(CacheTile); - XAA_STATE_WRAP(CacheStipple); - XAA_STATE_WRAP(CacheMonoStipple); - XAA_STATE_WRAP(CacheMono8x8Pattern); - XAA_STATE_WRAP(CacheColor8x8Pattern); - XAA_STATE_WRAP(WriteBitmapToCache); - XAA_STATE_WRAP(WritePixmapToCache); - XAA_STATE_WRAP(WriteMono8x8PatternToCache); - XAA_STATE_WRAP(WriteColor8x8PatternToCache); - XAA_STATE_WRAP(GetImage); - XAA_STATE_WRAP(GetSpans); - XAA_STATE_WRAP(CopyWindow); - XAA_STATE_WRAP(SetupForCPUToScreenAlphaTexture2); - XAA_STATE_WRAP(SetupForCPUToScreenTexture2); - return TRUE; -} diff --git a/xserver/hw/xfree86/xaa/xaaStipple.c b/xserver/hw/xfree86/xaa/xaaStipple.c deleted file mode 100644 index fc74e3988..000000000 --- a/xserver/hw/xfree86/xaa/xaaStipple.c +++ /dev/null @@ -1,915 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xaa.h" -#include "xaalocal.h" -#include "xaacexp.h" -#include "xf86.h" - -static CARD32 *StipplePowerOfTwo(CARD32 *, CARD32 *, int, int, int); -static CARD32 *StipplePowerOfTwo_Inverted(CARD32 *, CARD32 *, int, int, int); -static CARD32 *StippleUpTo32(CARD32 *, CARD32 *, int, int, int); -static CARD32 *StippleUpTo32_Inverted(CARD32 *, CARD32 *, int, int, int); -static CARD32 *StippleOver32(CARD32 *, CARD32 *, int, int, int); -static CARD32 *StippleOver32_Inverted(CARD32 *, CARD32 *, int, int, int); - -#ifdef TRIPLE_BITS -#define stipple_scanline_func EXPNAME(XAAStippleScanlineFunc3) -#define stipple_get_scanline_func EXPNAME(XAAGetStippleScanlineFunc3) -#else -#define stipple_scanline_func EXPNAME(XAAStippleScanlineFunc) -#define stipple_get_scanline_func EXPNAME(XAAGetStippleScanlineFunc) -#endif - -StippleScanlineProcPtr stipple_scanline_func[6] = { - StipplePowerOfTwo, - StippleUpTo32, - StippleOver32, - StipplePowerOfTwo_Inverted, - StippleUpTo32_Inverted, - StippleOver32_Inverted -}; - -StippleScanlineProcPtr * -stipple_get_scanline_func(void) -{ - return stipple_scanline_func; -} - -#ifdef FIXEDBASE -#define DEST(i) *dest -#define RETURN(i) return(dest) -#else -#define DEST(i) dest[i] -#define RETURN(i) return(dest + i) -#endif - -/* TRIPLE_BITS pattern expansion */ -#ifdef TRIPLE_BITS -#define EXPAND_PAT \ - CARD32 pat1 = byte_expand3[pat & 0xFF], \ - pat2 = byte_expand3[(pat & 0xFF00) >> 8], \ - pat3 = byte_expand3[(pat & 0xFF0000) >> 16], \ - pat4 = byte_expand3[(pat & 0xFF000000) >> 24], \ - patA = pat1 | (pat2 << 24), \ - patB = (pat2 >> 8) | (pat3 << 16), \ - patC = (pat3 >> 16) | (pat4 << 8) -#ifdef FIXED_BASE -#define WRITE_PAT1 { \ - *dest = patA; } -#define WRITE_PAT2 { \ - *dest = patA; \ - *dest = patB; } -#define WRITE_PAT3 { \ - *dest = patA; \ - *dest = patB; \ - *dest = patC; } -#else -#define WRITE_PAT1 { \ - *(dest++) = patA; } -#define WRITE_PAT2 { \ - *(dest) = patA; \ - *(dest + 1) = patB; \ - dest += 2; } -#define WRITE_PAT3 { \ - *(dest) = patA; \ - *(dest + 1) = patB; \ - *(dest + 2) = patC; \ - dest += 3; } -#endif -#endif - -#if !defined(FIXEDBASE) && !defined(MSBFIRST) && !defined(TRIPLE_BITS) - -unsigned int XAAShiftMasks[32] = { - /* gcc is rather pedantic about SHIFT_R(0xFFFFFFFF,32) */ - 0x00000000, SHIFT_R(0xFFFFFFFF, 31), - SHIFT_R(0xFFFFFFFF, 30), SHIFT_R(0xFFFFFFFF, 29), - SHIFT_R(0xFFFFFFFF, 28), SHIFT_R(0xFFFFFFFF, 27), - SHIFT_R(0xFFFFFFFF, 26), SHIFT_R(0xFFFFFFFF, 25), - SHIFT_R(0xFFFFFFFF, 24), SHIFT_R(0xFFFFFFFF, 23), - SHIFT_R(0xFFFFFFFF, 22), SHIFT_R(0xFFFFFFFF, 21), - SHIFT_R(0xFFFFFFFF, 20), SHIFT_R(0xFFFFFFFF, 19), - SHIFT_R(0xFFFFFFFF, 18), SHIFT_R(0xFFFFFFFF, 17), - SHIFT_R(0xFFFFFFFF, 16), SHIFT_R(0xFFFFFFFF, 15), - SHIFT_R(0xFFFFFFFF, 14), SHIFT_R(0xFFFFFFFF, 13), - SHIFT_R(0xFFFFFFFF, 12), SHIFT_R(0xFFFFFFFF, 11), - SHIFT_R(0xFFFFFFFF, 10), SHIFT_R(0xFFFFFFFF, 9), - SHIFT_R(0xFFFFFFFF, 8), SHIFT_R(0xFFFFFFFF, 7), - SHIFT_R(0xFFFFFFFF, 6), SHIFT_R(0xFFFFFFFF, 5), - SHIFT_R(0xFFFFFFFF, 4), SHIFT_R(0xFFFFFFFF, 3), - SHIFT_R(0xFFFFFFFF, 2), SHIFT_R(0xFFFFFFFF, 1) -}; - -#endif - -void -#ifdef TRIPLE_BITS - EXPNAME(XAAFillColorExpandRects3) ( -#else - EXPNAME(XAAFillColorExpandRects) ( -#endif - ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, - int xorg, int yorg, PixmapPtr pPix) { - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - CARD32 *base; - Bool TwoPass = FALSE, FirstPass = TRUE; - StippleScanlineProcPtr StippleFunc, FirstFunc, SecondFunc; - int stipplewidth = pPix->drawable.width; - int stippleheight = pPix->drawable.height; - int srcwidth = pPix->devKind; - int dwords, srcy, srcx, funcNo = 2, h; - unsigned char *src = (unsigned char *) pPix->devPrivate.ptr; - unsigned char *srcp; - int flag; - - if (stipplewidth <= 32) { - if (stipplewidth & (stipplewidth - 1)) - funcNo = 1; - else - funcNo = 0; - } - StippleFunc = stipple_scanline_func[funcNo]; - SecondFunc = stipple_scanline_func[funcNo]; - FirstFunc = stipple_scanline_func[funcNo + 3]; - -#ifdef TRIPLE_BITS - if ((bg == -1) || - (!(infoRec->CPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY) && - (!(infoRec->CPUToScreenColorExpandFillFlags & RGB_EQUAL) || - (CHECK_RGB_EQUAL(bg))))) { -#else - if ((bg == -1) || - !(infoRec->CPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)) { -#endif - /* one pass */ - } - else if ((rop == GXcopy) && infoRec->FillSolidRects) { - /* one pass but we fill background rects first */ - (*infoRec->FillSolidRects) (pScrn, bg, rop, planemask, nBox, pBox); - bg = -1; - } - else { - /* gotta do two passes */ - TwoPass = TRUE; - } - - if (!TwoPass) - (*infoRec->SetupForCPUToScreenColorExpandFill) (pScrn, fg, bg, rop, - planemask); - - while (nBox--) { -#ifdef TRIPLE_BITS - dwords = (3 * (pBox->x2 - pBox->x1) + 31) >> 5; -#else - dwords = (pBox->x2 - pBox->x1 + 31) >> 5; -#endif - - SECOND_PASS: - if (TwoPass) { - (*infoRec->SetupForCPUToScreenColorExpandFill) (pScrn, - (FirstPass) ? bg : - fg, -1, rop, - planemask); - StippleFunc = (FirstPass) ? FirstFunc : SecondFunc; - } - - h = pBox->y2 - pBox->y1; - flag = (infoRec->CPUToScreenColorExpandFillFlags - & CPU_TRANSFER_PAD_QWORD) && ((dwords * h) & 0x01); - - (*infoRec->SubsequentCPUToScreenColorExpandFill) (pScrn, pBox->x1, - pBox->y1, - pBox->x2 - pBox->x1, - h, 0); - - base = (CARD32 *) infoRec->ColorExpandBase; - - srcy = (pBox->y1 - yorg) % stippleheight; - if (srcy < 0) - srcy += stippleheight; - srcx = (pBox->x1 - xorg) % stipplewidth; - if (srcx < 0) - srcx += stipplewidth; - - srcp = (srcwidth * srcy) + src; - -#ifndef FIXEDBASE - if ((dwords * h) <= infoRec->ColorExpandRange) { - while (h--) { - base = - (*StippleFunc) (base, (CARD32 *) srcp, srcx, stipplewidth, - dwords); - srcy++; - srcp += srcwidth; - if (srcy >= stippleheight) { - srcy = 0; - srcp = src; - } - } - } - else -#endif - while (h--) { - (*StippleFunc) (base, (CARD32 *) srcp, srcx, stipplewidth, - dwords); - srcy++; - srcp += srcwidth; - if (srcy >= stippleheight) { - srcy = 0; - srcp = src; - } - } - - if (flag) { - base = (CARD32 *) infoRec->ColorExpandBase; - base[0] = 0x00000000; - } - - if (TwoPass) { - if (FirstPass) { - FirstPass = FALSE; - goto SECOND_PASS; - } - else - FirstPass = TRUE; - } - - pBox++; - } - - if (infoRec->CPUToScreenColorExpandFillFlags & SYNC_AFTER_COLOR_EXPAND) - (*infoRec->Sync) (pScrn); - else - SET_SYNC_FLAG(infoRec); -} - -void -#ifdef TRIPLE_BITS - EXPNAME(XAAFillColorExpandSpans3) ( -#else - EXPNAME(XAAFillColorExpandSpans) ( -#endif - ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int n, - DDXPointPtr ppt, - int *pwidth, - int fSorted, - int xorg, int yorg, PixmapPtr pPix) { - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - CARD32 *base; - Bool TwoPass = FALSE, FirstPass = TRUE; - StippleScanlineProcPtr StippleFunc, FirstFunc, SecondFunc; - int stipplewidth = pPix->drawable.width; - int stippleheight = pPix->drawable.height; - int dwords, srcy, srcx, funcNo = 2; - unsigned char *srcp; - - if (stipplewidth <= 32) { - if (stipplewidth & (stipplewidth - 1)) - funcNo = 1; - else - funcNo = 0; - } - StippleFunc = stipple_scanline_func[funcNo]; - SecondFunc = stipple_scanline_func[funcNo]; - FirstFunc = stipple_scanline_func[funcNo + 3]; - -#ifdef TRIPLE_BITS - if ((bg == -1) || - (!(infoRec->CPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY) && - (!(infoRec->CPUToScreenColorExpandFillFlags & RGB_EQUAL) || - (CHECK_RGB_EQUAL(bg))))) { -#else - if ((bg == -1) || - !(infoRec->CPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)) { -#endif - /* one pass */ - } - else if ((rop == GXcopy) && infoRec->FillSolidSpans) { - /* one pass but we fill background rects first */ - (*infoRec->FillSolidSpans) (pScrn, bg, rop, planemask, n, ppt, pwidth, - fSorted); - bg = -1; - } - else { - /* gotta do two passes */ - TwoPass = TRUE; - } - - if (!TwoPass) - (*infoRec->SetupForCPUToScreenColorExpandFill) (pScrn, fg, bg, rop, - planemask); - - while (n--) { -#ifdef TRIPLE_BITS - dwords = (3 * *pwidth + 31) >> 5; -#else - dwords = (*pwidth + 31) >> 5; -#endif - - srcy = (ppt->y - yorg) % stippleheight; - if (srcy < 0) - srcy += stippleheight; - srcx = (ppt->x - xorg) % stipplewidth; - if (srcx < 0) - srcx += stipplewidth; - - srcp = (pPix->devKind * srcy) + (unsigned char *) pPix->devPrivate.ptr; - - SECOND_PASS: - if (TwoPass) { - (*infoRec->SetupForCPUToScreenColorExpandFill) (pScrn, - (FirstPass) ? bg : - fg, -1, rop, - planemask); - StippleFunc = (FirstPass) ? FirstFunc : SecondFunc; - } - - (*infoRec->SubsequentCPUToScreenColorExpandFill) (pScrn, ppt->x, ppt->y, - *pwidth, 1, 0); - - base = (CARD32 *) infoRec->ColorExpandBase; - - (*StippleFunc) (base, (CARD32 *) srcp, srcx, stipplewidth, dwords); - - if ((infoRec->CPUToScreenColorExpandFillFlags & CPU_TRANSFER_PAD_QWORD) - && (dwords & 0x01)) { - base = (CARD32 *) infoRec->ColorExpandBase; - base[0] = 0x00000000; - } - - if (TwoPass) { - if (FirstPass) { - FirstPass = FALSE; - goto SECOND_PASS; - } - else - FirstPass = TRUE; - } - - ppt++; - pwidth++; - } - - if (infoRec->CPUToScreenColorExpandFillFlags & SYNC_AFTER_COLOR_EXPAND) - (*infoRec->Sync) (pScrn); - else - SET_SYNC_FLAG(infoRec); -} - -#ifndef FIXEDBASE - -void -#ifdef TRIPLE_BITS - EXPNAME(XAAFillScanlineColorExpandRects3) ( -#else - EXPNAME(XAAFillScanlineColorExpandRects) ( -#endif - ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, - int xorg, int yorg, - PixmapPtr pPix) { - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - CARD32 *base; - Bool TwoPass = FALSE, FirstPass = TRUE; - StippleScanlineProcPtr StippleFunc, FirstFunc, SecondFunc; - int stipplewidth = pPix->drawable.width; - int stippleheight = pPix->drawable.height; - int srcwidth = pPix->devKind; - int dwords, srcy, srcx, funcNo = 2, bufferNo, h; - unsigned char *src = pPix->devPrivate.ptr; - unsigned char *srcp; - - if (stipplewidth <= 32) { - if (stipplewidth & (stipplewidth - 1)) - funcNo = 1; - else - funcNo = 0; - } - StippleFunc = stipple_scanline_func[funcNo]; - SecondFunc = stipple_scanline_func[funcNo]; - FirstFunc = stipple_scanline_func[funcNo + 3]; - -#ifdef TRIPLE_BITS - if ((bg == -1) || - (!(infoRec->ScanlineCPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY) - && (!(infoRec->ScanlineCPUToScreenColorExpandFillFlags & RGB_EQUAL) || - (CHECK_RGB_EQUAL(bg))))) { -#else - if ((bg == -1) || - !(infoRec-> - ScanlineCPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)) { -#endif - /* one pass */ - } - else if ((rop == GXcopy) && infoRec->FillSolidRects) { - /* one pass but we fill background rects first */ - (*infoRec->FillSolidRects) (pScrn, bg, rop, planemask, nBox, pBox); - bg = -1; - } - else { - /* gotta do two passes */ - TwoPass = TRUE; - } - - if (!TwoPass) - (*infoRec->SetupForScanlineCPUToScreenColorExpandFill) (pScrn, fg, bg, - rop, planemask); - - while (nBox--) { -#ifdef TRIPLE_BITS - dwords = (3 * (pBox->x2 - pBox->x1) + 31) >> 5; -#else - dwords = (pBox->x2 - pBox->x1 + 31) >> 5; -#endif - - SECOND_PASS: - if (TwoPass) { - (*infoRec->SetupForScanlineCPUToScreenColorExpandFill) (pScrn, - (FirstPass) - ? bg : fg, - -1, rop, - planemask); - StippleFunc = (FirstPass) ? FirstFunc : SecondFunc; - } - - h = pBox->y2 - pBox->y1; - - (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill) (pScrn, - pBox->x1, - pBox->y1, - pBox->x2 - - pBox->x1, h, - 0); - - bufferNo = 0; - - srcy = (pBox->y1 - yorg) % stippleheight; - if (srcy < 0) - srcy += stippleheight; - srcx = (pBox->x1 - xorg) % stipplewidth; - if (srcx < 0) - srcx += stipplewidth; - - srcp = (srcwidth * srcy) + src; - - while (h--) { - base = (CARD32 *) infoRec->ScanlineColorExpandBuffers[bufferNo]; - (*StippleFunc) (base, (CARD32 *) srcp, srcx, stipplewidth, dwords); - (*infoRec->SubsequentColorExpandScanline) (pScrn, bufferNo++); - if (bufferNo >= infoRec->NumScanlineColorExpandBuffers) - bufferNo = 0; - srcy++; - srcp += srcwidth; - if (srcy >= stippleheight) { - srcy = 0; - srcp = src; - } - } - - if (TwoPass) { - if (FirstPass) { - FirstPass = FALSE; - goto SECOND_PASS; - } - else - FirstPass = TRUE; - } - - pBox++; - } - - SET_SYNC_FLAG(infoRec); -} - -void -#ifdef TRIPLE_BITS - EXPNAME(XAAFillScanlineColorExpandSpans3) ( -#else - EXPNAME(XAAFillScanlineColorExpandSpans) ( -#endif - ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int n, - DDXPointPtr ppt, - int *pwidth, - int fSorted, - int xorg, int yorg, - PixmapPtr pPix) { - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - CARD32 *base; - Bool TwoPass = FALSE, FirstPass = TRUE; - StippleScanlineProcPtr StippleFunc, FirstFunc, SecondFunc; - int stipplewidth = pPix->drawable.width; - int stippleheight = pPix->drawable.height; - int dwords, srcy, srcx, funcNo = 2; - unsigned char *srcp; - - if (stipplewidth <= 32) { - if (stipplewidth & (stipplewidth - 1)) - funcNo = 1; - else - funcNo = 0; - } - StippleFunc = stipple_scanline_func[funcNo]; - SecondFunc = stipple_scanline_func[funcNo]; - FirstFunc = stipple_scanline_func[funcNo + 3]; - -#ifdef TRIPLE_BITS - if ((bg == -1) || - (!(infoRec->ScanlineCPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY) - && (!(infoRec->ScanlineCPUToScreenColorExpandFillFlags & RGB_EQUAL) || - (CHECK_RGB_EQUAL(bg))))) { -#else - if ((bg == -1) || - !(infoRec-> - ScanlineCPUToScreenColorExpandFillFlags & TRANSPARENCY_ONLY)) { -#endif - /* one pass */ - } - else if ((rop == GXcopy) && infoRec->FillSolidSpans) { - /* one pass but we fill background rects first */ - (*infoRec->FillSolidSpans) (pScrn, bg, rop, planemask, n, ppt, pwidth, - fSorted); - bg = -1; - } - else { - /* gotta do two passes */ - TwoPass = TRUE; - } - - if (!TwoPass) - (*infoRec->SetupForScanlineCPUToScreenColorExpandFill) (pScrn, fg, bg, - rop, planemask); - - while (n--) { -#ifdef TRIPLE_BITS - dwords = (3 * *pwidth + 31) >> 5; -#else - dwords = (*pwidth + 31) >> 5; -#endif - - srcy = (ppt->y - yorg) % stippleheight; - if (srcy < 0) - srcy += stippleheight; - srcx = (ppt->x - xorg) % stipplewidth; - if (srcx < 0) - srcx += stipplewidth; - - srcp = (pPix->devKind * srcy) + (unsigned char *) pPix->devPrivate.ptr; - - SECOND_PASS: - if (TwoPass) { - (*infoRec->SetupForScanlineCPUToScreenColorExpandFill) (pScrn, - (FirstPass) - ? bg : fg, - -1, rop, - planemask); - StippleFunc = (FirstPass) ? FirstFunc : SecondFunc; - } - - (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill) (pScrn, ppt->x, - ppt->y, - *pwidth, 1, - 0); - - base = (CARD32 *) infoRec->ScanlineColorExpandBuffers[0]; - - (*StippleFunc) (base, (CARD32 *) srcp, srcx, stipplewidth, dwords); - (*infoRec->SubsequentColorExpandScanline) (pScrn, 0); - - if (TwoPass) { - if (FirstPass) { - FirstPass = FALSE; - goto SECOND_PASS; - } - else - FirstPass = TRUE; - } - - ppt++; - pwidth++; - } - - SET_SYNC_FLAG(infoRec); -} - -#endif - -static CARD32 * -StipplePowerOfTwo(CARD32 *dest, CARD32 *src, int shift, int width, int dwords) -{ - CARD32 pat = *src; - - if (width < 32) { - pat &= XAAShiftMasks[width]; - while (width < 32) { - pat |= SHIFT_L(pat, width); - width <<= 1; - } - } - - if (shift) - pat = SHIFT_R(pat, shift) | SHIFT_L(pat, 32 - shift); - -#ifdef MSBFIRST - pat = SWAP_BITS_IN_BYTES(pat); -#endif - -#ifdef TRIPLE_BITS - { - EXPAND_PAT; - - while (dwords >= 3) { - WRITE_PAT3; - dwords -= 3; - } - if (dwords == 2) { - WRITE_PAT2; - } - else if (dwords == 1) { - WRITE_PAT1; - } - - return dest; - } -#else /* TRIPLE_BITS */ - while (dwords >= 4) { - DEST(0) = pat; - DEST(1) = pat; - DEST(2) = pat; - DEST(3) = pat; - dwords -= 4; -#ifndef FIXEDBASE - dest += 4; -#endif - } - - if (!dwords) - return dest; - DEST(0) = pat; - if (dwords == 1) - RETURN(1); - DEST(1) = pat; - if (dwords == 2) - RETURN(2); - DEST(2) = pat; - RETURN(3); -#endif /* TRIPLE_BITS */ -} - -static CARD32 * -StipplePowerOfTwo_Inverted(CARD32 *dest, CARD32 *src, - int shift, int width, int dwords) -{ - CARD32 pat = *src; - - if (width < 32) { - pat &= XAAShiftMasks[width]; - while (width < 32) { - pat |= SHIFT_L(pat, width); - width <<= 1; - } - } - - if (shift) - pat = SHIFT_R(pat, shift) | SHIFT_L(pat, 32 - shift); - -#ifdef MSBFIRST - pat = SWAP_BITS_IN_BYTES(pat); -#endif - - pat = ~pat; - -#ifdef TRIPLE_BITS - { - EXPAND_PAT; - - while (dwords >= 3) { - WRITE_PAT3; - dwords -= 3; - } - if (dwords == 2) { - WRITE_PAT2; - } - else if (dwords == 1) { - WRITE_PAT1; - } - - return dest; - } -#else /* TRIPLE_BITS */ - while (dwords >= 4) { - DEST(0) = pat; - DEST(1) = pat; - DEST(2) = pat; - DEST(3) = pat; - dwords -= 4; -#ifndef FIXEDBASE - dest += 4; -#endif - } - - if (!dwords) - return dest; - DEST(0) = pat; - if (dwords == 1) - RETURN(1); - DEST(1) = pat; - if (dwords == 2) - RETURN(2); - DEST(2) = pat; - RETURN(3); -#endif /* TRIPLE_BITS */ -} - -static CARD32 * -StippleUpTo32(CARD32 *base, CARD32 *src, int shift, int width, int dwords) -{ - CARD32 pat = *src & XAAShiftMasks[width]; - - while (width <= 15) { - pat |= SHIFT_L(pat, width); - width <<= 1; - } - pat |= SHIFT_L(pat, width); - - while (dwords--) { - CARD32 bits = SHIFT_R(pat, shift) | SHIFT_L(pat, width - shift); - -#ifdef TRIPLE_BITS - if (dwords >= 2) { - WRITE_BITS3(bits); - dwords -= 2; - } - else if (dwords > 0) { - WRITE_BITS2(bits); - dwords--; - } - else { - WRITE_BITS1(bits); - } -#else - WRITE_BITS(bits); -#endif - - shift += 32; - shift %= width; - } - return base; -} - -static CARD32 * -StippleUpTo32_Inverted(CARD32 *base, CARD32 *src, - int shift, int width, int dwords) -{ - CARD32 pat = *src & XAAShiftMasks[width]; - - while (width <= 15) { - pat |= SHIFT_L(pat, width); - width <<= 1; - } - pat |= SHIFT_L(pat, width); - - while (dwords--) { - CARD32 bits = ~(SHIFT_R(pat, shift) | SHIFT_L(pat, width - shift)); - -#ifdef TRIPLE_BITS - if (dwords >= 2) { - WRITE_BITS3(bits); - dwords -= 2; - } - else if (dwords > 0) { - WRITE_BITS2(bits); - dwords--; - } - else { - WRITE_BITS1(bits); - } -#else - WRITE_BITS(bits); -#endif - - shift += 32; - shift %= width; - } - return base; -} - -static CARD32 * -StippleOver32(CARD32 *base, CARD32 *src, int offset, int width, int dwords) -{ - CARD32 *srcp; - CARD32 bits; - int bitsleft, shift, usable; - - while (dwords--) { - bitsleft = width - offset; - srcp = src + (offset >> 5); - shift = offset & 31; - usable = 32 - shift; - - if (bitsleft < 32) { - if (bitsleft <= usable) { - bits = SHIFT_L(*src, bitsleft) | - (SHIFT_R(*srcp, shift) & XAAShiftMasks[bitsleft]); - } - else { - bits = SHIFT_L(*src, bitsleft) | - (SHIFT_L(srcp[1], usable) & XAAShiftMasks[bitsleft]) | - (SHIFT_R(*srcp, shift) & XAAShiftMasks[usable]); - } - } - else if (shift) - bits = SHIFT_R(*srcp, shift) | SHIFT_L(srcp[1], usable); - else - bits = *srcp; - -#ifdef TRIPLE_BITS - if (dwords >= 2) { - WRITE_BITS3(bits); - dwords -= 2; - } - else if (dwords > 0) { - WRITE_BITS2(bits); - dwords--; - } - else { - WRITE_BITS1(bits); - } -#else - WRITE_BITS(bits); -#endif - - offset += 32; - offset %= width; - } - return base; -} - -static CARD32 * -StippleOver32_Inverted(CARD32 *base, CARD32 *src, - int offset, int width, int dwords) -{ - CARD32 *srcp; - CARD32 bits; - int bitsleft, shift, usable; - - while (dwords--) { - bitsleft = width - offset; - srcp = src + (offset >> 5); - shift = offset & 31; - usable = 32 - shift; - - if (bitsleft < 32) { - if (bitsleft <= usable) { - bits = SHIFT_L(*src, bitsleft) | - (SHIFT_R(*srcp, shift) & XAAShiftMasks[bitsleft]); - } - else { - bits = SHIFT_L(*src, bitsleft) | - (SHIFT_L(srcp[1], usable) & XAAShiftMasks[bitsleft]) | - (SHIFT_R(*srcp, shift) & XAAShiftMasks[usable]); - } - } - else if (shift) - bits = SHIFT_R(*srcp, shift) | SHIFT_L(srcp[1], usable); - else - bits = *srcp; - - bits = ~bits; - -#ifdef TRIPLE_BITS - if (dwords >= 2) { - WRITE_BITS3(bits); - dwords -= 2; - } - else if (dwords > 0) { - WRITE_BITS2(bits); - dwords--; - } - else { - WRITE_BITS1(bits); - } -#else - WRITE_BITS(bits); -#endif - - offset += 32; - offset %= width; - } - return base; -} diff --git a/xserver/hw/xfree86/xaa/xaaTEGlyph.c b/xserver/hw/xfree86/xaa/xaaTEGlyph.c deleted file mode 100644 index 2926c1df2..000000000 --- a/xserver/hw/xfree86/xaa/xaaTEGlyph.c +++ /dev/null @@ -1,1083 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xaa.h" -#include "xaalocal.h" -#include "xaacexp.h" -#include "xf86.h" - -/* scanline function for TRIPLE_BITS_24BPP */ -static CARD32 *DrawTextScanline3(CARD32 *base, CARD32 *mem, int width); - -/* Loop unrolled functions for common font widths */ -static CARD32 *DrawTETextScanlineGeneric(CARD32 *base, unsigned int **glyphp, - int line, int width, int glyphwidth); -static CARD32 *DrawTETextScanlineWidth7(CARD32 *base, unsigned int **glyphp, - int line, int width, int glyphwidth); -static CARD32 *DrawTETextScanlineWidth10(CARD32 *base, unsigned int **glyphp, - int line, int width, int glyphwidth); -static CARD32 *DrawTETextScanlineWidth12(CARD32 *base, unsigned int **glyphp, - int line, int width, int glyphwidth); -static CARD32 *DrawTETextScanlineWidth14(CARD32 *base, unsigned int **glyphp, - int line, int width, int glyphwidth); -static CARD32 *DrawTETextScanlineWidth16(CARD32 *base, unsigned int **glyphp, - int line, int width, int glyphwidth); -static CARD32 *DrawTETextScanlineWidth18(CARD32 *base, unsigned int **glyphp, - int line, int width, int glyphwidth); -static CARD32 *DrawTETextScanlineWidth24(CARD32 *base, unsigned int **glyphp, - int line, int width, int glyphwidth); - -#ifdef USEASSEMBLER -#ifdef FIXEDBASE -#ifdef MSBFIRST -CARD32 *DrawTETextScanlineWidth6PMSBFirstFixedBase(CARD32 *base, - unsigned int **glyphp, - int line, int width, - int glyphwidth); -CARD32 *DrawTETextScanlineWidth8PMSBFirstFixedBase(CARD32 *base, - unsigned int **glyphp, - int line, int width, - int glyphwidth); -CARD32 *DrawTETextScanlineWidth9PMSBFirstFixedBase(CARD32 *base, - unsigned int **glyphp, - int line, int width, - int glyphwidth); -#else -CARD32 *DrawTETextScanlineWidth6PLSBFirstFixedBase(CARD32 *base, - unsigned int **glyphp, - int line, int width, - int glyphwidth); -CARD32 *DrawTETextScanlineWidth8PLSBFirstFixedBase(CARD32 *base, - unsigned int **glyphp, - int line, int width, - int glyphwidth); -CARD32 *DrawTETextScanlineWidth9PLSBFirstFixedBase(CARD32 *base, - unsigned int **glyphp, - int line, int width, - int glyphwidth); -#endif -#else -#ifdef MSBFIRST -CARD32 *DrawTETextScanlineWidth6PMSBFirst(CARD32 *base, unsigned int **glyphp, - int line, int width, int glyphwidth); -CARD32 *DrawTETextScanlineWidth8PMSBFirst(CARD32 *base, unsigned int **glyphp, - int line, int width, int glyphwidth); -CARD32 *DrawTETextScanlineWidth9PMSBFirst(CARD32 *base, unsigned int **glyphp, - int line, int width, int glyphwidth); -#else -CARD32 *DrawTETextScanlineWidth6PLSBFirst(CARD32 *base, unsigned int **glyphp, - int line, int width, int glyphwidth); -CARD32 *DrawTETextScanlineWidth8PLSBFirst(CARD32 *base, unsigned int **glyphp, - int line, int width, int glyphwidth); -CARD32 *DrawTETextScanlineWidth9PLSBFirst(CARD32 *base, unsigned int **glyphp, - int line, int width, int glyphwidth); -#endif -#endif -#else -static CARD32 *DrawTETextScanlineWidth6(CARD32 *base, unsigned int **glyphp, - int line, int width, int glyphwidth); -static CARD32 *DrawTETextScanlineWidth8(CARD32 *base, unsigned int **glyphp, - int line, int width, int glyphwidth); -static CARD32 *DrawTETextScanlineWidth9(CARD32 *base, unsigned int **glyphp, - int line, int width, int glyphwidth); -#endif - -#define glyph_scanline_func EXPNAME(XAAGlyphScanlineFunc) -#define glyph_get_scanline_func EXPNAME(XAAGetGlyphScanlineFunc) - -GlyphScanlineFuncPtr glyph_scanline_func[32] = { - DrawTETextScanlineGeneric, DrawTETextScanlineGeneric, - DrawTETextScanlineGeneric, DrawTETextScanlineGeneric, - DrawTETextScanlineGeneric, -#ifdef USEASSEMBLER -#ifdef FIXEDBASE -#ifdef MSBFIRST - DrawTETextScanlineWidth6PMSBFirstFixedBase, - DrawTETextScanlineWidth7, - DrawTETextScanlineWidth8PMSBFirstFixedBase, - DrawTETextScanlineWidth9PMSBFirstFixedBase, -#else - DrawTETextScanlineWidth6PLSBFirstFixedBase, - DrawTETextScanlineWidth7, - DrawTETextScanlineWidth8PLSBFirstFixedBase, - DrawTETextScanlineWidth9PLSBFirstFixedBase, -#endif -#else -#ifdef MSBFIRST - DrawTETextScanlineWidth6PMSBFirst, - DrawTETextScanlineWidth7, - DrawTETextScanlineWidth8PMSBFirst, - DrawTETextScanlineWidth9PMSBFirst, -#else - DrawTETextScanlineWidth6PLSBFirst, - DrawTETextScanlineWidth7, - DrawTETextScanlineWidth8PLSBFirst, - DrawTETextScanlineWidth9PLSBFirst, -#endif -#endif -#else - DrawTETextScanlineWidth6, DrawTETextScanlineWidth7, - DrawTETextScanlineWidth8, DrawTETextScanlineWidth9, -#endif - DrawTETextScanlineWidth10, - DrawTETextScanlineGeneric, DrawTETextScanlineWidth12, - DrawTETextScanlineGeneric, DrawTETextScanlineWidth14, - DrawTETextScanlineGeneric, DrawTETextScanlineWidth16, - DrawTETextScanlineGeneric, DrawTETextScanlineWidth18, - DrawTETextScanlineGeneric, DrawTETextScanlineGeneric, - DrawTETextScanlineGeneric, DrawTETextScanlineGeneric, - DrawTETextScanlineGeneric, DrawTETextScanlineWidth24, - DrawTETextScanlineGeneric, DrawTETextScanlineGeneric, - DrawTETextScanlineGeneric, DrawTETextScanlineGeneric, - DrawTETextScanlineGeneric, DrawTETextScanlineGeneric, - DrawTETextScanlineGeneric, DrawTETextScanlineGeneric -}; - -GlyphScanlineFuncPtr * -glyph_get_scanline_func(void) -{ - return glyph_scanline_func; -} - -/******************************************************************** - - Here we have TEGlyphRenders for a bunch of different color - expansion types. The driver may provide its own renderer, but - this is the default one which renders using lower-level primitives - exported by the chipset driver. - -********************************************************************/ - -/* This gets built for MSBFIRST or LSBFIRST with FIXEDBASE or not. - A total of 4 versions */ - -void - -EXPNAME(XAATEGlyphRenderer) (ScrnInfoPtr pScrn, - int x, int y, int w, int h, int skipleft, - int startline, unsigned int **glyphs, - int glyphWidth, int fg, int bg, int rop, - unsigned planemask) { - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - CARD32 *base; - GlyphScanlineFuncPtr GlyphFunc = glyph_scanline_func[glyphWidth - 1]; - int dwords = 0; - - if ((bg != -1) && (infoRec->TEGlyphRendererFlags & TRANSPARENCY_ONLY)) { - (*infoRec->SetupForSolidFill) (pScrn, bg, rop, planemask); - (*infoRec->SubsequentSolidFillRect) (pScrn, x, y, w, h); - bg = -1; - } - - (*infoRec->SetupForCPUToScreenColorExpandFill) (pScrn, fg, bg, rop, - planemask); - - if (skipleft && - (!(infoRec->TEGlyphRendererFlags & LEFT_EDGE_CLIPPING) || - (!(infoRec->TEGlyphRendererFlags & LEFT_EDGE_CLIPPING_NEGATIVE_X) && - (skipleft > x)))) { - /* draw the first character only */ - - int count = h, line = startline; - int width = glyphWidth - skipleft; - - if (width > w) - width = w; - - (*infoRec->SubsequentCPUToScreenColorExpandFill) (pScrn, x, y, width, h, - 0); - - base = (CARD32 *) infoRec->ColorExpandBase; - - while (count--) { - register CARD32 tmp = SHIFT_R(glyphs[0][line++], skipleft); - - WRITE_BITS(tmp); - } - - w -= width; - if ((infoRec->TEGlyphRendererFlags & CPU_TRANSFER_PAD_QWORD) && - ((((width + 31) >> 5) * h) & 1)) { - base = (CARD32 *) infoRec->ColorExpandBase; - base[0] = 0x00000000; - } - if (!w) - goto THE_END; - glyphs++; - x += width; - skipleft = 0; /* nicely aligned again */ - } - - w += skipleft; - x -= skipleft; - dwords = ((w + 31) >> 5) * h; - - (*infoRec->SubsequentCPUToScreenColorExpandFill) (pScrn, x, y, w, h, - skipleft); - - base = (CARD32 *) infoRec->ColorExpandBase; - -#ifndef FIXEDBASE - if ((((w + 31) >> 5) * h) <= infoRec->ColorExpandRange) - while (h--) { - base = (*GlyphFunc) (base, glyphs, startline++, w, glyphWidth); - } - else -#endif - while (h--) { - (*GlyphFunc) (base, glyphs, startline++, w, glyphWidth); - } - - if ((infoRec->TEGlyphRendererFlags & CPU_TRANSFER_PAD_QWORD) && - (dwords & 1)) { - base = (CARD32 *) infoRec->ColorExpandBase; - base[0] = 0x00000000; - } - - THE_END: - - if (infoRec->TEGlyphRendererFlags & SYNC_AFTER_COLOR_EXPAND) - (*infoRec->Sync) (pScrn); - else - SET_SYNC_FLAG(infoRec); -} - -/******************************************************************** - - This is the GlyphRenderer for TRIPLE_BITS_24BPP. It renders to a buffer - with the non FIXEDBASE LSB_FIRST code before tripling, and possibly - reversing the bits and sending them to the screen - -********************************************************************/ - -void - -EXPNAME(XAATEGlyphRenderer3) (ScrnInfoPtr pScrn, - int x, int y, int w, int h, int skipleft, - int startline, unsigned int **glyphs, - int glyphWidth, int fg, int bg, int rop, - unsigned planemask) { - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - CARD32 *base, *mem; - GlyphScanlineFuncPtr GlyphFunc = - XAAGlyphScanlineFuncLSBFirst[glyphWidth - 1]; - int dwords = 0; - - if ((bg != -1) && - ((infoRec->TEGlyphRendererFlags & TRANSPARENCY_ONLY) || - ((infoRec->TEGlyphRendererFlags & RGB_EQUAL) && - (!CHECK_RGB_EQUAL(bg))))) { - (*infoRec->SetupForSolidFill) (pScrn, bg, rop, planemask); - (*infoRec->SubsequentSolidFillRect) (pScrn, x, y, w, h); - bg = -1; - } - - (*infoRec->SetupForCPUToScreenColorExpandFill) (pScrn, fg, bg, rop, - planemask); - - if (skipleft) { - /* draw the first character only */ - - int count = h, line = startline; - int width = glyphWidth - skipleft; - CARD32 bits; - - if (width > w) - width = w; - (*infoRec->SubsequentCPUToScreenColorExpandFill) (pScrn, x, y, width, h, - 0); - - base = (CARD32 *) infoRec->ColorExpandBase; - - while (count--) { - bits = SHIFT_R(glyphs[0][line++], skipleft); - if (width >= 22) { - WRITE_BITS3(bits); - } - else if (width >= 11) { - WRITE_BITS2(bits); - } - else { - WRITE_BITS1(bits); - } - } - - w -= width; - if ((infoRec->TEGlyphRendererFlags & CPU_TRANSFER_PAD_QWORD) && - ((((3 * width + 31) >> 5) * h) & 1)) { - base = (CARD32 *) infoRec->ColorExpandBase; - base[0] = 0x00000000; - } - if (!w) - goto THE_END; - glyphs++; - x += width; - skipleft = 0; /* nicely aligned again */ - } - - dwords = ((3 * w + 31) >> 5) * h; - mem = (CARD32 *) malloc(((w + 31) >> 3) * sizeof(char)); - if (!mem) - return; - - (*infoRec->SubsequentCPUToScreenColorExpandFill) (pScrn, x, y, w, h, 0); - - base = (CARD32 *) infoRec->ColorExpandBase; - -#ifndef FIXEDBASE - if ((((3 * w + 31) >> 5) * h) <= infoRec->ColorExpandRange) - while (h--) { - (*GlyphFunc) (mem, glyphs, startline++, w, glyphWidth); - base = DrawTextScanline3(base, mem, w); - } - else -#endif - while (h--) { - (*GlyphFunc) (mem, glyphs, startline++, w, glyphWidth); - DrawTextScanline3(base, mem, w); - } - - free(mem); - - if ((infoRec->TEGlyphRendererFlags & CPU_TRANSFER_PAD_QWORD) && - (dwords & 1)) { - base = (CARD32 *) infoRec->ColorExpandBase; - base[0] = 0x00000000; - } - - THE_END: - - if (infoRec->TEGlyphRendererFlags & SYNC_AFTER_COLOR_EXPAND) - (*infoRec->Sync) (pScrn); - else - SET_SYNC_FLAG(infoRec); -} - -#ifndef FIXEDBASE -/* Scanline version of above gets built for LSBFIRST and MSBFIRST */ - -void - -EXPNAME(XAATEGlyphRendererScanline) (ScrnInfoPtr pScrn, - int x, int y, int w, int h, int skipleft, - int startline, unsigned int **glyphs, - int glyphWidth, int fg, int bg, int rop, - unsigned planemask) { - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - int bufferNo; - CARD32 *base; - GlyphScanlineFuncPtr GlyphFunc = glyph_scanline_func[glyphWidth - 1]; - - if ((bg != -1) && (infoRec->TEGlyphRendererFlags & TRANSPARENCY_ONLY)) { - (*infoRec->SetupForSolidFill) (pScrn, bg, rop, planemask); - (*infoRec->SubsequentSolidFillRect) (pScrn, x, y, w, h); - bg = -1; - } - - (*infoRec->SetupForScanlineCPUToScreenColorExpandFill) (pScrn, fg, bg, rop, - planemask); - - if (skipleft && - (!(infoRec->TEGlyphRendererFlags & LEFT_EDGE_CLIPPING) || - (!(infoRec->TEGlyphRendererFlags & LEFT_EDGE_CLIPPING_NEGATIVE_X) && - (skipleft > x)))) { - /* draw the first character only */ - - int count = h, line = startline; - int width = glyphWidth - skipleft; - - if (width > w) - width = w; - - (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill) (pScrn, x, y, - width, h, 0); - - bufferNo = 0; - - while (count--) { - register CARD32 tmp = SHIFT_R(glyphs[0][line++], skipleft); - - base = (CARD32 *) infoRec->ScanlineColorExpandBuffers[bufferNo]; - WRITE_BITS(tmp); - (*infoRec->SubsequentColorExpandScanline) (pScrn, bufferNo++); - if (bufferNo >= infoRec->NumScanlineColorExpandBuffers) - bufferNo = 0; - } - - w -= width; - if (!w) - goto THE_END; - glyphs++; - x += width; - skipleft = 0; /* nicely aligned again */ - } - - w += skipleft; - x -= skipleft; - - (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill) (pScrn, x, y, w, h, - skipleft); - - bufferNo = 0; - - while (h--) { - base = (CARD32 *) infoRec->ScanlineColorExpandBuffers[bufferNo]; - (*GlyphFunc) (base, glyphs, startline++, w, glyphWidth); - (*infoRec->SubsequentColorExpandScanline) (pScrn, bufferNo++); - if (bufferNo >= infoRec->NumScanlineColorExpandBuffers) - bufferNo = 0; - } - - THE_END: - - SET_SYNC_FLAG(infoRec); -} - -void - -EXPNAME(XAATEGlyphRendererScanline3) (ScrnInfoPtr pScrn, - int x, int y, int w, int h, int skipleft, - int startline, unsigned int **glyphs, - int glyphWidth, int fg, int bg, int rop, - unsigned planemask) { - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - int bufferNo; - CARD32 *base, *mem; - GlyphScanlineFuncPtr GlyphFunc = - XAAGlyphScanlineFuncLSBFirst[glyphWidth - 1]; - - if ((bg != -1) && - ((infoRec->TEGlyphRendererFlags & TRANSPARENCY_ONLY) || - ((infoRec->TEGlyphRendererFlags & RGB_EQUAL) && - (!CHECK_RGB_EQUAL(bg))))) { - (*infoRec->SetupForSolidFill) (pScrn, bg, rop, planemask); - (*infoRec->SubsequentSolidFillRect) (pScrn, x, y, w, h); - bg = -1; - } - - (*infoRec->SetupForScanlineCPUToScreenColorExpandFill) (pScrn, fg, bg, rop, - planemask); - - if (skipleft) { - /* draw the first character only */ - - int count = h, line = startline; - int width = glyphWidth - skipleft; - CARD32 bits; - - if (width > w) - width = w; - - (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill) (pScrn, x, y, - width, h, 0); - - bufferNo = 0; - - while (count--) { - base = (CARD32 *) infoRec->ScanlineColorExpandBuffers[bufferNo]; - bits = SHIFT_R(glyphs[0][line++], skipleft); - if (width >= 22) { - WRITE_BITS3(bits); - } - else if (width >= 11) { - WRITE_BITS2(bits); - } - else { - WRITE_BITS1(bits); - } - (*infoRec->SubsequentColorExpandScanline) (pScrn, bufferNo++); - if (bufferNo >= infoRec->NumScanlineColorExpandBuffers) - bufferNo = 0; - } - - w -= width; - if (!w) - goto THE_END; - glyphs++; - x += width; - skipleft = 0; /* nicely aligned again */ - } - - w += skipleft; - x -= skipleft; - mem = (CARD32 *) malloc(((w + 31) >> 3) * sizeof(char)); - if (!mem) - return; - - (*infoRec->SubsequentScanlineCPUToScreenColorExpandFill) (pScrn, x, y, w, h, - skipleft); - - bufferNo = 0; - - while (h--) { - base = (CARD32 *) infoRec->ScanlineColorExpandBuffers[bufferNo]; - (*GlyphFunc) (mem, glyphs, startline++, w, glyphWidth); - DrawTextScanline3(base, mem, w); - (*infoRec->SubsequentColorExpandScanline) (pScrn, bufferNo++); - if (bufferNo >= infoRec->NumScanlineColorExpandBuffers) - bufferNo = 0; - } - - free(mem); - - THE_END: - - SET_SYNC_FLAG(infoRec); -} - -#endif - -/******************************************************************** - - TRIPLE_BITS_24BPP scanline rendering code. - -********************************************************************/ - -static CARD32 * -DrawTextScanline3(CARD32 *base, CARD32 *mem, int width) -{ - - while (width > 32) { - WRITE_BITS3(*mem); - mem++; - width -= 32; - } - if (width) { - if (width >= 22) { - WRITE_BITS3(*mem); - } - else if (width >= 11) { - WRITE_BITS2(*mem); - } - else { - WRITE_BITS1(*mem); - } - } - - return base; -} - -/******************************************************************** - - Generic TE scanline rendering code. - -********************************************************************/ - -static CARD32 * -DrawTETextScanlineGeneric(CARD32 *base, - unsigned int **glyphp, - int line, int width, int glyphwidth) -{ - CARD32 bits = (*glyphp)[line]; - int shift = glyphwidth; - - while (width > 32) { - while (shift < 32) { - glyphp++; - bits |= SHIFT_L((*glyphp)[line], shift); - shift += glyphwidth; - } - WRITE_BITS(bits); - shift &= 31; - if (shift) - bits = SHIFT_R((*glyphp)[line], (glyphwidth - shift)); - else - bits = 0; - width -= 32; - } - - if (width) { - width -= shift; - while (width > 0) { - glyphp++; - bits |= SHIFT_L((*glyphp)[line], shift); - shift += glyphwidth; - width -= glyphwidth; - } - WRITE_BITS(bits); - } - - return base; -} - -/******************************************************************** - - Loop unrolled TE font scanline rendering code - -********************************************************************/ - -#ifndef USEASSEMBLER -static CARD32 * -DrawTETextScanlineWidth6(CARD32 *base, - unsigned int **glyphp, - int line, int width, int glyphwidth) -{ - while (1) { - unsigned int bits; - - bits = glyphp[0][line]; - bits |= SHIFT_L(glyphp[1][line], 6); - bits |= SHIFT_L(glyphp[2][line], 12); - bits |= SHIFT_L(glyphp[3][line], 18); - bits |= SHIFT_L(glyphp[4][line], 24); - bits |= SHIFT_L(glyphp[5][line], 30); - WRITE_IN_BITORDER(base, 0, bits); - CHECKRETURN(1); - bits = SHIFT_R(glyphp[5][line], 2); - bits |= SHIFT_L(glyphp[6][line], 4); - bits |= SHIFT_L(glyphp[7][line], 10); - bits |= SHIFT_L(glyphp[8][line], 16); - bits |= SHIFT_L(glyphp[9][line], 22); - bits |= SHIFT_L(glyphp[10][line], 28); - WRITE_IN_BITORDER(base, 1, bits); - CHECKRETURN(2); - bits = SHIFT_R(glyphp[10][line], 4); - bits |= SHIFT_L(glyphp[11][line], 2); - bits |= SHIFT_L(glyphp[12][line], 8); - bits |= SHIFT_L(glyphp[13][line], 14); - bits |= SHIFT_L(glyphp[14][line], 20); - bits |= SHIFT_L(glyphp[15][line], 26); - WRITE_IN_BITORDER(base, 2, bits); - CHECKRETURN(3); -#ifndef FIXEDBASE - base += 3; -#endif - width -= 96; - glyphp += 16; - } - return base; -} -#endif - -static CARD32 * -DrawTETextScanlineWidth7(CARD32 *base, - unsigned int **glyphp, - int line, int width, int glyphwidth) -{ - while (1) { - unsigned int bits; - - bits = glyphp[0][line]; - bits |= SHIFT_L(glyphp[1][line], 7); - bits |= SHIFT_L(glyphp[2][line], 14); - bits |= SHIFT_L(glyphp[3][line], 21); - bits |= SHIFT_L(glyphp[4][line], 28); - WRITE_IN_BITORDER(base, 0, bits); - CHECKRETURN(1); - bits = SHIFT_R(glyphp[4][line], 4); - bits |= SHIFT_L(glyphp[5][line], 3); - bits |= SHIFT_L(glyphp[6][line], 10); - bits |= SHIFT_L(glyphp[7][line], 17); - bits |= SHIFT_L(glyphp[8][line], 24); - bits |= SHIFT_L(glyphp[9][line], 31); - WRITE_IN_BITORDER(base, 1, bits); - CHECKRETURN(2); - bits = SHIFT_R(glyphp[9][line], 1); - bits |= SHIFT_L(glyphp[10][line], 6); - bits |= SHIFT_L(glyphp[11][line], 13); - bits |= SHIFT_L(glyphp[12][line], 20); - bits |= SHIFT_L(glyphp[13][line], 27); - WRITE_IN_BITORDER(base, 2, bits); - CHECKRETURN(3); - bits = SHIFT_R(glyphp[13][line], 5); - bits |= SHIFT_L(glyphp[14][line], 2); - bits |= SHIFT_L(glyphp[15][line], 9); - bits |= SHIFT_L(glyphp[16][line], 16); - bits |= SHIFT_L(glyphp[17][line], 23); - bits |= SHIFT_L(glyphp[18][line], 30); - WRITE_IN_BITORDER(base, 3, bits); - CHECKRETURN(4); - bits = SHIFT_R(glyphp[18][line], 2); - bits |= SHIFT_L(glyphp[19][line], 5); - bits |= SHIFT_L(glyphp[20][line], 12); - bits |= SHIFT_L(glyphp[21][line], 19); - bits |= SHIFT_L(glyphp[22][line], 26); - WRITE_IN_BITORDER(base, 4, bits); - CHECKRETURN(5); - bits = SHIFT_R(glyphp[22][line], 6); - bits |= SHIFT_L(glyphp[23][line], 1); - bits |= SHIFT_L(glyphp[24][line], 8); - bits |= SHIFT_L(glyphp[25][line], 15); - bits |= SHIFT_L(glyphp[26][line], 22); - bits |= SHIFT_L(glyphp[27][line], 29); - WRITE_IN_BITORDER(base, 5, bits); - CHECKRETURN(6); - bits = SHIFT_R(glyphp[27][line], 3); - bits |= SHIFT_L(glyphp[28][line], 4); - bits |= SHIFT_L(glyphp[29][line], 11); - bits |= SHIFT_L(glyphp[30][line], 18); - bits |= SHIFT_L(glyphp[31][line], 25); - WRITE_IN_BITORDER(base, 6, bits); - CHECKRETURN(7); -#ifndef FIXEDBASE - base += 7; -#endif - width -= 224; - glyphp += 32; - } - return base; -} - -#ifndef USEASSEMBLER -static CARD32 * -DrawTETextScanlineWidth8(CARD32 *base, - unsigned int **glyphp, - int line, int width, int glyphwidth) -{ - while (1) { - unsigned int bits; - - bits = glyphp[0][line]; - bits |= SHIFT_L(glyphp[1][line], 8); - bits |= SHIFT_L(glyphp[2][line], 16); - bits |= SHIFT_L(glyphp[3][line], 24); - WRITE_IN_BITORDER(base, 0, bits); - CHECKRETURN(1); - bits = glyphp[4][line]; - bits |= SHIFT_L(glyphp[5][line], 8); - bits |= SHIFT_L(glyphp[6][line], 16); - bits |= SHIFT_L(glyphp[7][line], 24); - WRITE_IN_BITORDER(base, 1, bits); - CHECKRETURN(2); -#ifndef FIXEDBASE - base += 2; -#endif - width -= 64; - glyphp += 8; - } - return base; -} -#endif - -#ifndef USEASSEMBLER -static CARD32 * -DrawTETextScanlineWidth9(CARD32 *base, - unsigned int **glyphp, - int line, int width, int glyphwidth) -{ - while (1) { - unsigned int bits; - - bits = glyphp[0][line]; - bits |= SHIFT_L(glyphp[1][line], 9); - bits |= SHIFT_L(glyphp[2][line], 18); - bits |= SHIFT_L(glyphp[3][line], 27); - WRITE_IN_BITORDER(base, 0, bits); - CHECKRETURN(1); - bits = SHIFT_R(glyphp[3][line], 5); - bits |= SHIFT_L(glyphp[4][line], 4); - bits |= SHIFT_L(glyphp[5][line], 13); - bits |= SHIFT_L(glyphp[6][line], 22); - bits |= SHIFT_L(glyphp[7][line], 31); - WRITE_IN_BITORDER(base, 1, bits); - CHECKRETURN(2); - bits = SHIFT_R(glyphp[7][line], 1); - bits |= SHIFT_L(glyphp[8][line], 8); - bits |= SHIFT_L(glyphp[9][line], 17); - bits |= SHIFT_L(glyphp[10][line], 26); - WRITE_IN_BITORDER(base, 2, bits); - CHECKRETURN(3); - bits = SHIFT_R(glyphp[10][line], 6); - bits |= SHIFT_L(glyphp[11][line], 3); - bits |= SHIFT_L(glyphp[12][line], 12); - bits |= SHIFT_L(glyphp[13][line], 21); - bits |= SHIFT_L(glyphp[14][line], 30); - WRITE_IN_BITORDER(base, 3, bits); - CHECKRETURN(4); - bits = SHIFT_R(glyphp[14][line], 2); - bits |= SHIFT_L(glyphp[15][line], 7); - bits |= SHIFT_L(glyphp[16][line], 16); - bits |= SHIFT_L(glyphp[17][line], 25); - WRITE_IN_BITORDER(base, 4, bits); - CHECKRETURN(5); - bits = SHIFT_R(glyphp[17][line], 7); - bits |= SHIFT_L(glyphp[18][line], 2); - bits |= SHIFT_L(glyphp[19][line], 11); - bits |= SHIFT_L(glyphp[20][line], 20); - bits |= SHIFT_L(glyphp[21][line], 29); - WRITE_IN_BITORDER(base, 5, bits); - CHECKRETURN(6); - bits = SHIFT_R(glyphp[21][line], 3); - bits |= SHIFT_L(glyphp[22][line], 6); - bits |= SHIFT_L(glyphp[23][line], 15); - bits |= SHIFT_L(glyphp[24][line], 24); - WRITE_IN_BITORDER(base, 6, bits); - CHECKRETURN(7); - bits = SHIFT_R(glyphp[24][line], 8); - bits |= SHIFT_L(glyphp[25][line], 1); - bits |= SHIFT_L(glyphp[26][line], 10); - bits |= SHIFT_L(glyphp[27][line], 19); - bits |= SHIFT_L(glyphp[28][line], 28); - WRITE_IN_BITORDER(base, 7, bits); - CHECKRETURN(8); - bits = SHIFT_R(glyphp[28][line], 4); - bits |= SHIFT_L(glyphp[29][line], 5); - bits |= SHIFT_L(glyphp[30][line], 14); - bits |= SHIFT_L(glyphp[31][line], 23); - WRITE_IN_BITORDER(base, 8, bits); - CHECKRETURN(9); -#ifndef FIXEDBASE - base += 9; -#endif - width -= 288; - glyphp += 32; - } - return base; -} -#endif - -static CARD32 * -DrawTETextScanlineWidth10(CARD32 *base, - unsigned int **glyphp, - int line, int width, int glyphwidth) -{ - while (1) { - unsigned int bits; - - bits = glyphp[0][line]; - bits |= SHIFT_L(glyphp[1][line], 10); - bits |= SHIFT_L(glyphp[2][line], 20); - bits |= SHIFT_L(glyphp[3][line], 30); - WRITE_IN_BITORDER(base, 0, bits); - CHECKRETURN(1); - bits = SHIFT_R(glyphp[3][line], 2); - bits |= SHIFT_L(glyphp[4][line], 8); - bits |= SHIFT_L(glyphp[5][line], 18); - bits |= SHIFT_L(glyphp[6][line], 28); - WRITE_IN_BITORDER(base, 1, bits); - CHECKRETURN(2); - bits = SHIFT_R(glyphp[6][line], 4); - bits |= SHIFT_L(glyphp[7][line], 6); - bits |= SHIFT_L(glyphp[8][line], 16); - bits |= SHIFT_L(glyphp[9][line], 26); - WRITE_IN_BITORDER(base, 2, bits); - CHECKRETURN(3); - bits = SHIFT_R(glyphp[9][line], 6); - bits |= SHIFT_L(glyphp[10][line], 4); - bits |= SHIFT_L(glyphp[11][line], 14); - bits |= SHIFT_L(glyphp[12][line], 24); - WRITE_IN_BITORDER(base, 3, bits); - CHECKRETURN(4); - bits = SHIFT_R(glyphp[12][line], 8); - bits |= SHIFT_L(glyphp[13][line], 2); - bits |= SHIFT_L(glyphp[14][line], 12); - bits |= SHIFT_L(glyphp[15][line], 22); - WRITE_IN_BITORDER(base, 4, bits); - CHECKRETURN(5); -#ifndef FIXEDBASE - base += 5; -#endif - width -= 160; - glyphp += 16; - } - return base; -} - -static CARD32 * -DrawTETextScanlineWidth12(CARD32 *base, - unsigned int **glyphp, - int line, int width, int glyphwidth) -{ - while (1) { - unsigned int bits; - - bits = glyphp[0][line]; - bits |= SHIFT_L(glyphp[1][line], 12); - bits |= SHIFT_L(glyphp[2][line], 24); - WRITE_IN_BITORDER(base, 0, bits); - CHECKRETURN(1); - bits = SHIFT_R(glyphp[2][line], 8); - bits |= SHIFT_L(glyphp[3][line], 4); - bits |= SHIFT_L(glyphp[4][line], 16); - bits |= SHIFT_L(glyphp[5][line], 28); - WRITE_IN_BITORDER(base, 1, bits); - CHECKRETURN(2); - bits = SHIFT_R(glyphp[5][line], 4); - bits |= SHIFT_L(glyphp[6][line], 8); - bits |= SHIFT_L(glyphp[7][line], 20); - WRITE_IN_BITORDER(base, 2, bits); - CHECKRETURN(3); -#ifndef FIXEDBASE - base += 3; -#endif - width -= 96; - glyphp += 8; - } - return base; -} - -static CARD32 * -DrawTETextScanlineWidth14(CARD32 *base, - unsigned int **glyphp, - int line, int width, int glyphwidth) -{ - while (1) { - unsigned int bits; - - bits = glyphp[0][line]; - bits |= SHIFT_L(glyphp[1][line], 14); - bits |= SHIFT_L(glyphp[2][line], 28); - WRITE_IN_BITORDER(base, 0, bits); - CHECKRETURN(1); - bits = SHIFT_R(glyphp[2][line], 4); - bits |= SHIFT_L(glyphp[3][line], 10); - bits |= SHIFT_L(glyphp[4][line], 24); - WRITE_IN_BITORDER(base, 1, bits); - CHECKRETURN(2); - bits = SHIFT_R(glyphp[4][line], 8); - bits |= SHIFT_L(glyphp[5][line], 6); - bits |= SHIFT_L(glyphp[6][line], 20); - WRITE_IN_BITORDER(base, 2, bits); - CHECKRETURN(3); - bits = SHIFT_R(glyphp[6][line], 12); - bits |= SHIFT_L(glyphp[7][line], 2); - bits |= SHIFT_L(glyphp[8][line], 16); - bits |= SHIFT_L(glyphp[9][line], 30); - WRITE_IN_BITORDER(base, 3, bits); - CHECKRETURN(4); - bits = SHIFT_R(glyphp[9][line], 2); - bits |= SHIFT_L(glyphp[10][line], 12); - bits |= SHIFT_L(glyphp[11][line], 26); - WRITE_IN_BITORDER(base, 4, bits); - CHECKRETURN(5); - bits = SHIFT_R(glyphp[11][line], 6); - bits |= SHIFT_L(glyphp[12][line], 8); - bits |= SHIFT_L(glyphp[13][line], 22); - WRITE_IN_BITORDER(base, 5, bits); - CHECKRETURN(6); - bits = SHIFT_R(glyphp[13][line], 10); - bits |= SHIFT_L(glyphp[14][line], 4); - bits |= SHIFT_L(glyphp[15][line], 18); - WRITE_IN_BITORDER(base, 6, bits); - CHECKRETURN(7); -#ifndef FIXEDBASE - base += 7; -#endif - width -= 224; - glyphp += 16; - } - return base; -} - -static CARD32 * -DrawTETextScanlineWidth16(CARD32 *base, - unsigned int **glyphp, - int line, int width, int glyphwidth) -{ - while (1) { - unsigned int bits; - - bits = glyphp[0][line]; - bits |= SHIFT_L(glyphp[1][line], 16); - WRITE_IN_BITORDER(base, 0, bits); - CHECKRETURN(1); - bits = glyphp[2][line]; - bits |= SHIFT_L(glyphp[3][line], 16); - WRITE_IN_BITORDER(base, 1, bits); - CHECKRETURN(2); - bits = glyphp[4][line]; - bits |= SHIFT_L(glyphp[5][line], 16); - WRITE_IN_BITORDER(base, 2, bits); - CHECKRETURN(3); - bits = glyphp[6][line]; - bits |= SHIFT_L(glyphp[7][line], 16); - WRITE_IN_BITORDER(base, 3, bits); - CHECKRETURN(4); -#ifndef FIXEDBASE - base += 4; -#endif - width -= 128; - glyphp += 8; - } - return base; -} - -static CARD32 * -DrawTETextScanlineWidth18(CARD32 *base, - unsigned int **glyphp, - int line, int width, int glyphwidth) -{ - while (1) { - unsigned int bits; - - bits = glyphp[0][line]; - bits |= SHIFT_L(glyphp[1][line], 18); - WRITE_IN_BITORDER(base, 0, bits); - CHECKRETURN(1); - bits = SHIFT_R(glyphp[1][line], 14); - bits |= SHIFT_L(glyphp[2][line], 4); - bits |= SHIFT_L(glyphp[3][line], 22); - WRITE_IN_BITORDER(base, 1, bits); - CHECKRETURN(2); - bits = SHIFT_R(glyphp[3][line], 10); - bits |= SHIFT_L(glyphp[4][line], 8); - bits |= SHIFT_L(glyphp[5][line], 26); - WRITE_IN_BITORDER(base, 2, bits); - CHECKRETURN(3); - bits = SHIFT_R(glyphp[5][line], 6); - bits |= SHIFT_L(glyphp[6][line], 12); - bits |= SHIFT_L(glyphp[7][line], 30); - WRITE_IN_BITORDER(base, 3, bits); - CHECKRETURN(4); - bits = SHIFT_R(glyphp[7][line], 2); - bits |= SHIFT_L(glyphp[8][line], 16); - WRITE_IN_BITORDER(base, 4, bits); - CHECKRETURN(5); - bits = SHIFT_R(glyphp[8][line], 16); - bits |= SHIFT_L(glyphp[9][line], 2); - bits |= SHIFT_L(glyphp[10][line], 20); - WRITE_IN_BITORDER(base, 5, bits); - CHECKRETURN(6); - bits = SHIFT_R(glyphp[10][line], 12); - bits |= SHIFT_L(glyphp[11][line], 6); - bits |= SHIFT_L(glyphp[12][line], 24); - WRITE_IN_BITORDER(base, 6, bits); - CHECKRETURN(7); - bits = SHIFT_R(glyphp[12][line], 8); - bits |= SHIFT_L(glyphp[13][line], 10); - bits |= SHIFT_L(glyphp[14][line], 28); - WRITE_IN_BITORDER(base, 7, bits); - CHECKRETURN(8); - bits = SHIFT_R(glyphp[14][line], 4); - bits |= SHIFT_L(glyphp[15][line], 14); - WRITE_IN_BITORDER(base, 8, bits); - CHECKRETURN(9); -#ifndef FIXEDBASE - base += 9; -#endif - width -= 288; - glyphp += 16; - } - return base; -} - -static CARD32 * -DrawTETextScanlineWidth24(CARD32 *base, - unsigned int **glyphp, - int line, int width, int glyphwidth) -{ - while (1) { - unsigned int bits; - - bits = glyphp[0][line]; - bits |= SHIFT_L(glyphp[1][line], 24); - WRITE_IN_BITORDER(base, 0, bits); - CHECKRETURN(1); - bits = SHIFT_R(glyphp[1][line], 8); - bits |= SHIFT_L(glyphp[2][line], 16); - WRITE_IN_BITORDER(base, 1, bits); - CHECKRETURN(2); - bits = SHIFT_R(glyphp[2][line], 16); - bits |= SHIFT_L(glyphp[3][line], 8); - WRITE_IN_BITORDER(base, 2, bits); - CHECKRETURN(3); -#ifndef FIXEDBASE - base += 3; -#endif - width -= 96; - glyphp += 4; - } - return base; -} diff --git a/xserver/hw/xfree86/xaa/xaaTEText.c b/xserver/hw/xfree86/xaa/xaaTEText.c deleted file mode 100644 index a5ef44768..000000000 --- a/xserver/hw/xfree86/xaa/xaaTEText.c +++ /dev/null @@ -1,295 +0,0 @@ - -/******************************************************************** - - In this file we have GC level replacements for PolyText8/16, - ImageText8/16, ImageGlyphBlt and PolyGlyphBlt for TE (fixed) fonts. - The idea is that everything in this file is device independent. - The mentioned GCOps are merely wrappers for XAAGlyphBltTEColorExpansion - which calculates the boxes containing arbitrarily clipped text - and passes them to the TEGlyphRenderer which will usually be a lower - level XAA function which renders these clipped glyphs using - the basic color expansion functions exported by the chipset driver. - The TEGlyphRenderer itself may optionally be driver supplied to - facilitate work-arounds/optimizations at a higher level than usual. - - v1.0 - Mark Vojkovich (mvojkovi@ucsd.edu) - -********************************************************************/ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" - -#include -#include -#include "scrnintstr.h" -#include "dixfontstr.h" -#include "xf86str.h" -#include "xaa.h" -#include "xaalocal.h" -#include "gcstruct.h" -#include "pixmapstr.h" - -static void XAAGlyphBltTEColorExpansion(ScrnInfoPtr pScrn, int xInit, - int yInit, FontPtr font, int fg, int bg, - int rop, unsigned int planemask, - RegionPtr cclip, int nglyph, - unsigned char *gBase, - CharInfoPtr * ppci); - -/******************************************************************** - - GC level replacements for PolyText8/16 and ImageText8/16 - for TE fonts when using color expansion. - -********************************************************************/ - -int -XAAPolyText8TEColorExpansion(DrawablePtr pDraw, - GCPtr pGC, int x, int y, int count, char *chars) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - unsigned long n; - - (*pGC->font->get_glyphs) (pGC->font, (unsigned long) count, - (unsigned char *) chars, Linear8Bit, &n, - infoRec->CharInfo); - - /* we have divorced XAAGlyphBltTEColorExpansion from the drawable */ - if (n) - XAAGlyphBltTEColorExpansion(infoRec->pScrn, x + pDraw->x, y + pDraw->y, - pGC->font, pGC->fgPixel, -1, pGC->alu, - pGC->planemask, pGC->pCompositeClip, n, - FONTGLYPHS(pGC->font), infoRec->CharInfo); - - return (x + (n * FONTMAXBOUNDS(pGC->font, characterWidth))); -} - -int -XAAPolyText16TEColorExpansion(DrawablePtr pDraw, - GCPtr pGC, - int x, int y, int count, unsigned short *chars) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - unsigned long n; - - (*pGC->font->get_glyphs) (pGC->font, (unsigned long) count, - (unsigned char *) chars, - (FONTLASTROW(pGC->font) == - 0) ? Linear16Bit : TwoD16Bit, &n, - infoRec->CharInfo); - - if (n) - XAAGlyphBltTEColorExpansion(infoRec->pScrn, x + pDraw->x, y + pDraw->y, - pGC->font, pGC->fgPixel, -1, pGC->alu, - pGC->planemask, pGC->pCompositeClip, n, - FONTGLYPHS(pGC->font), infoRec->CharInfo); - - return (x + (n * FONTMAXBOUNDS(pGC->font, characterWidth))); -} - -void -XAAImageText8TEColorExpansion(DrawablePtr pDraw, - GCPtr pGC, int x, int y, int count, char *chars) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - unsigned long n; - - if (!RegionNumRects(pGC->pCompositeClip)) - return; - - (*pGC->font->get_glyphs) (pGC->font, (unsigned long) count, - (unsigned char *) chars, Linear8Bit, &n, - infoRec->CharInfo); - - if (n) - XAAGlyphBltTEColorExpansion(infoRec->pScrn, x + pDraw->x, y + pDraw->y, - pGC->font, pGC->fgPixel, pGC->bgPixel, - GXcopy, pGC->planemask, pGC->pCompositeClip, - n, FONTGLYPHS(pGC->font), - infoRec->CharInfo); -} - -void -XAAImageText16TEColorExpansion(DrawablePtr pDraw, - GCPtr pGC, - int x, int y, int count, unsigned short *chars) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - unsigned long n; - - if (!RegionNumRects(pGC->pCompositeClip)) - return; - - (*pGC->font->get_glyphs) (pGC->font, (unsigned long) count, - (unsigned char *) chars, - (FONTLASTROW(pGC->font) == - 0) ? Linear16Bit : TwoD16Bit, &n, - infoRec->CharInfo); - - if (n) - XAAGlyphBltTEColorExpansion(infoRec->pScrn, x + pDraw->x, y + pDraw->y, - pGC->font, pGC->fgPixel, pGC->bgPixel, - GXcopy, pGC->planemask, pGC->pCompositeClip, - n, FONTGLYPHS(pGC->font), - infoRec->CharInfo); -} - -/******************************************************************** - - GC level replacements for ImageGlyphBlt and PolyGlyphBlt for - TE fonts when using color expansion. - -********************************************************************/ - -void -XAAImageGlyphBltTEColorExpansion(DrawablePtr pDrawable, - GCPtr pGC, - int xInit, int yInit, - unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - - if (!RegionNumRects(pGC->pCompositeClip)) - return; - - XAAGlyphBltTEColorExpansion(infoRec->pScrn, xInit + pDrawable->x, - yInit + pDrawable->y, pGC->font, pGC->fgPixel, - pGC->bgPixel, GXcopy, pGC->planemask, - pGC->pCompositeClip, nglyph, - (unsigned char *) pglyphBase, ppci); -} - -void -XAAPolyGlyphBltTEColorExpansion(DrawablePtr pDrawable, - GCPtr pGC, - int xInit, int yInit, - unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - - if (!RegionNumRects(pGC->pCompositeClip)) - return; - - XAAGlyphBltTEColorExpansion(infoRec->pScrn, xInit + pDrawable->x, - yInit + pDrawable->y, pGC->font, pGC->fgPixel, - -1, pGC->alu, pGC->planemask, - pGC->pCompositeClip, nglyph, - (unsigned char *) pglyphBase, ppci); -} - -/******************************************************************** - - XAAGlyphBltTEColorExpansion - - - This guy computes the clipped pieces of text and sends it to - the lower-level function which will handle acceleration of - arbitrarily clipped text. - -********************************************************************/ - -static void -XAAGlyphBltTEColorExpansion(ScrnInfoPtr pScrn, - int xInit, int yInit, - FontPtr font, - int fg, int bg, - int rop, - unsigned int planemask, - RegionPtr cclip, - int nglyph, - unsigned char *gBase, CharInfoPtr * ppci) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - int skippix, skipglyphs; - int Left, Right, Top, Bottom; - int LeftEdge, RightEdge, ytop, ybot; - int nbox = RegionNumRects(cclip); - BoxPtr pbox = RegionRects(cclip); - unsigned int **glyphs = NULL; - int glyphWidth = FONTMAXBOUNDS(font, characterWidth); - - /* find the size of the box */ - Left = xInit; - Right = Left + (glyphWidth * nglyph); - Top = yInit - FONTASCENT(font); - Bottom = yInit + FONTDESCENT(font); - - /* get into the first band that may contain part of our string */ - while (nbox && (Top >= pbox->y2)) { - pbox++; - nbox--; - } - - /* stop when the lower edge of the box is beyond our string */ - while (nbox && (Bottom > pbox->y1)) { - LeftEdge = max(Left, pbox->x1); - RightEdge = min(Right, pbox->x2); - - if (RightEdge > LeftEdge) { /* we have something to draw */ - unsigned int *fallbackBits = NULL; - - ytop = max(Top, pbox->y1); - ybot = min(Bottom, pbox->y2); - - if ((skippix = LeftEdge - Left)) { - skipglyphs = skippix / glyphWidth; - skippix %= glyphWidth; - } - else - skipglyphs = 0; - - if (!glyphs) { - int count; - - glyphs = (unsigned int **) (infoRec->PreAllocMem); - - for (count = 0; count < nglyph; count++) { - glyphs[count] = (unsigned int *) - FONTGLYPHBITS(gBase, *ppci++); - if (!glyphs[count]) { - /* Glyphs with NULL bits do exist in the wild. - Replace with blank bits in that case */ - - if (!fallbackBits) { - int fontHeight = Bottom - Top + 1; - - fallbackBits = calloc(glyphWidth * fontHeight, 1); - if (!fallbackBits) - return; - } - glyphs[count] = fallbackBits; - } - } - - /* our new unrolled TE code only writes DWORDS at a time - so it can read up to 6 characters past the last one - we're displaying */ - glyphs[count + 0] = glyphs[0]; - glyphs[count + 1] = glyphs[0]; - glyphs[count + 2] = glyphs[0]; - glyphs[count + 3] = glyphs[0]; - glyphs[count + 4] = glyphs[0]; - glyphs[count + 5] = glyphs[0]; - } - - /* x, y, w, h, skipleft, skiptop, glyphp, glyphWidth, fg, bg, rop, pm */ - - (*infoRec->TEGlyphRenderer) (pScrn, - LeftEdge, ytop, RightEdge - LeftEdge, - ybot - ytop, skippix, ytop - Top, - glyphs + skipglyphs, glyphWidth, fg, - bg, rop, planemask); - - free(fallbackBits); - } - - nbox--; - pbox++; - } -} diff --git a/xserver/hw/xfree86/xaa/xaaTables.c b/xserver/hw/xfree86/xaa/xaaTables.c deleted file mode 100644 index 35641da59..000000000 --- a/xserver/hw/xfree86/xaa/xaaTables.c +++ /dev/null @@ -1,152 +0,0 @@ -#ifdef HAVE_XORG_CONFIG_H -#include -#endif -#include "xaalocal.h" -/* - * This is a table of 24-bit values, indexed with an 8-bit byte value, then - * expands each bit to three consecutive bits. This is required for color - * expansion in 24bpp mode with the coprocessor in 8bpp mode, with LSB-first - * bit order within a byte. - */ - -unsigned int byte_expand3[256] = { - 0x000000, 0x000007, 0x000038, 0x00003F, 0x0001C0, 0x0001C7, 0x0001F8, - 0x0001FF, - 0x000E00, 0x000E07, 0x000E38, 0x000E3F, 0x000FC0, 0x000FC7, 0x000FF8, - 0x000FFF, - 0x007000, 0x007007, 0x007038, 0x00703F, 0x0071C0, 0x0071C7, 0x0071F8, - 0x0071FF, - 0x007E00, 0x007E07, 0x007E38, 0x007E3F, 0x007FC0, 0x007FC7, 0x007FF8, - 0x007FFF, - 0x038000, 0x038007, 0x038038, 0x03803F, 0x0381C0, 0x0381C7, 0x0381F8, - 0x0381FF, - 0x038E00, 0x038E07, 0x038E38, 0x038E3F, 0x038FC0, 0x038FC7, 0x038FF8, - 0x038FFF, - 0x03F000, 0x03F007, 0x03F038, 0x03F03F, 0x03F1C0, 0x03F1C7, 0x03F1F8, - 0x03F1FF, - 0x03FE00, 0x03FE07, 0x03FE38, 0x03FE3F, 0x03FFC0, 0x03FFC7, 0x03FFF8, - 0x03FFFF, - 0x1C0000, 0x1C0007, 0x1C0038, 0x1C003F, 0x1C01C0, 0x1C01C7, 0x1C01F8, - 0x1C01FF, - 0x1C0E00, 0x1C0E07, 0x1C0E38, 0x1C0E3F, 0x1C0FC0, 0x1C0FC7, 0x1C0FF8, - 0x1C0FFF, - 0x1C7000, 0x1C7007, 0x1C7038, 0x1C703F, 0x1C71C0, 0x1C71C7, 0x1C71F8, - 0x1C71FF, - 0x1C7E00, 0x1C7E07, 0x1C7E38, 0x1C7E3F, 0x1C7FC0, 0x1C7FC7, 0x1C7FF8, - 0x1C7FFF, - 0x1F8000, 0x1F8007, 0x1F8038, 0x1F803F, 0x1F81C0, 0x1F81C7, 0x1F81F8, - 0x1F81FF, - 0x1F8E00, 0x1F8E07, 0x1F8E38, 0x1F8E3F, 0x1F8FC0, 0x1F8FC7, 0x1F8FF8, - 0x1F8FFF, - 0x1FF000, 0x1FF007, 0x1FF038, 0x1FF03F, 0x1FF1C0, 0x1FF1C7, 0x1FF1F8, - 0x1FF1FF, - 0x1FFE00, 0x1FFE07, 0x1FFE38, 0x1FFE3F, 0x1FFFC0, 0x1FFFC7, 0x1FFFF8, - 0x1FFFFF, - 0xE00000, 0xE00007, 0xE00038, 0xE0003F, 0xE001C0, 0xE001C7, 0xE001F8, - 0xE001FF, - 0xE00E00, 0xE00E07, 0xE00E38, 0xE00E3F, 0xE00FC0, 0xE00FC7, 0xE00FF8, - 0xE00FFF, - 0xE07000, 0xE07007, 0xE07038, 0xE0703F, 0xE071C0, 0xE071C7, 0xE071F8, - 0xE071FF, - 0xE07E00, 0xE07E07, 0xE07E38, 0xE07E3F, 0xE07FC0, 0xE07FC7, 0xE07FF8, - 0xE07FFF, - 0xE38000, 0xE38007, 0xE38038, 0xE3803F, 0xE381C0, 0xE381C7, 0xE381F8, - 0xE381FF, - 0xE38E00, 0xE38E07, 0xE38E38, 0xE38E3F, 0xE38FC0, 0xE38FC7, 0xE38FF8, - 0xE38FFF, - 0xE3F000, 0xE3F007, 0xE3F038, 0xE3F03F, 0xE3F1C0, 0xE3F1C7, 0xE3F1F8, - 0xE3F1FF, - 0xE3FE00, 0xE3FE07, 0xE3FE38, 0xE3FE3F, 0xE3FFC0, 0xE3FFC7, 0xE3FFF8, - 0xE3FFFF, - 0xFC0000, 0xFC0007, 0xFC0038, 0xFC003F, 0xFC01C0, 0xFC01C7, 0xFC01F8, - 0xFC01FF, - 0xFC0E00, 0xFC0E07, 0xFC0E38, 0xFC0E3F, 0xFC0FC0, 0xFC0FC7, 0xFC0FF8, - 0xFC0FFF, - 0xFC7000, 0xFC7007, 0xFC7038, 0xFC703F, 0xFC71C0, 0xFC71C7, 0xFC71F8, - 0xFC71FF, - 0xFC7E00, 0xFC7E07, 0xFC7E38, 0xFC7E3F, 0xFC7FC0, 0xFC7FC7, 0xFC7FF8, - 0xFC7FFF, - 0xFF8000, 0xFF8007, 0xFF8038, 0xFF803F, 0xFF81C0, 0xFF81C7, 0xFF81F8, - 0xFF81FF, - 0xFF8E00, 0xFF8E07, 0xFF8E38, 0xFF8E3F, 0xFF8FC0, 0xFF8FC7, 0xFF8FF8, - 0xFF8FFF, - 0xFFF000, 0xFFF007, 0xFFF038, 0xFFF03F, 0xFFF1C0, 0xFFF1C7, 0xFFF1F8, - 0xFFF1FF, - 0xFFFE00, 0xFFFE07, 0xFFFE38, 0xFFFE3F, 0xFFFFC0, 0xFFFFC7, 0xFFFFF8, - 0xFFFFFF -}; - -/* - * This is a table of 24-bit values, indexed with an 8-bit byte value, - * that reverses the bit order of a byte and then expands each bit to three - * consecutive bits. This is required for color expansion in 24bpp mode - * with the coprocessor in 8bpp mode, with MSB-first bit order within a - * byte. - */ - -unsigned int byte_reversed_expand3[256] = { - 0x000000, 0x0000E0, 0x00001C, 0x0000FC, 0x008003, 0x0080E3, 0x00801F, - 0x0080FF, - 0x007000, 0x0070E0, 0x00701C, 0x0070FC, 0x00F003, 0x00F0E3, 0x00F01F, - 0x00F0FF, - 0x000E00, 0x000EE0, 0x000E1C, 0x000EFC, 0x008E03, 0x008EE3, 0x008E1F, - 0x008EFF, - 0x007E00, 0x007EE0, 0x007E1C, 0x007EFC, 0x00FE03, 0x00FEE3, 0x00FE1F, - 0x00FEFF, - 0xC00100, 0xC001E0, 0xC0011C, 0xC001FC, 0xC08103, 0xC081E3, 0xC0811F, - 0xC081FF, - 0xC07100, 0xC071E0, 0xC0711C, 0xC071FC, 0xC0F103, 0xC0F1E3, 0xC0F11F, - 0xC0F1FF, - 0xC00F00, 0xC00FE0, 0xC00F1C, 0xC00FFC, 0xC08F03, 0xC08FE3, 0xC08F1F, - 0xC08FFF, - 0xC07F00, 0xC07FE0, 0xC07F1C, 0xC07FFC, 0xC0FF03, 0xC0FFE3, 0xC0FF1F, - 0xC0FFFF, - 0x380000, 0x3800E0, 0x38001C, 0x3800FC, 0x388003, 0x3880E3, 0x38801F, - 0x3880FF, - 0x387000, 0x3870E0, 0x38701C, 0x3870FC, 0x38F003, 0x38F0E3, 0x38F01F, - 0x38F0FF, - 0x380E00, 0x380EE0, 0x380E1C, 0x380EFC, 0x388E03, 0x388EE3, 0x388E1F, - 0x388EFF, - 0x387E00, 0x387EE0, 0x387E1C, 0x387EFC, 0x38FE03, 0x38FEE3, 0x38FE1F, - 0x38FEFF, - 0xF80100, 0xF801E0, 0xF8011C, 0xF801FC, 0xF88103, 0xF881E3, 0xF8811F, - 0xF881FF, - 0xF87100, 0xF871E0, 0xF8711C, 0xF871FC, 0xF8F103, 0xF8F1E3, 0xF8F11F, - 0xF8F1FF, - 0xF80F00, 0xF80FE0, 0xF80F1C, 0xF80FFC, 0xF88F03, 0xF88FE3, 0xF88F1F, - 0xF88FFF, - 0xF87F00, 0xF87FE0, 0xF87F1C, 0xF87FFC, 0xF8FF03, 0xF8FFE3, 0xF8FF1F, - 0xF8FFFF, - 0x070000, 0x0700E0, 0x07001C, 0x0700FC, 0x078003, 0x0780E3, 0x07801F, - 0x0780FF, - 0x077000, 0x0770E0, 0x07701C, 0x0770FC, 0x07F003, 0x07F0E3, 0x07F01F, - 0x07F0FF, - 0x070E00, 0x070EE0, 0x070E1C, 0x070EFC, 0x078E03, 0x078EE3, 0x078E1F, - 0x078EFF, - 0x077E00, 0x077EE0, 0x077E1C, 0x077EFC, 0x07FE03, 0x07FEE3, 0x07FE1F, - 0x07FEFF, - 0xC70100, 0xC701E0, 0xC7011C, 0xC701FC, 0xC78103, 0xC781E3, 0xC7811F, - 0xC781FF, - 0xC77100, 0xC771E0, 0xC7711C, 0xC771FC, 0xC7F103, 0xC7F1E3, 0xC7F11F, - 0xC7F1FF, - 0xC70F00, 0xC70FE0, 0xC70F1C, 0xC70FFC, 0xC78F03, 0xC78FE3, 0xC78F1F, - 0xC78FFF, - 0xC77F00, 0xC77FE0, 0xC77F1C, 0xC77FFC, 0xC7FF03, 0xC7FFE3, 0xC7FF1F, - 0xC7FFFF, - 0x3F0000, 0x3F00E0, 0x3F001C, 0x3F00FC, 0x3F8003, 0x3F80E3, 0x3F801F, - 0x3F80FF, - 0x3F7000, 0x3F70E0, 0x3F701C, 0x3F70FC, 0x3FF003, 0x3FF0E3, 0x3FF01F, - 0x3FF0FF, - 0x3F0E00, 0x3F0EE0, 0x3F0E1C, 0x3F0EFC, 0x3F8E03, 0x3F8EE3, 0x3F8E1F, - 0x3F8EFF, - 0x3F7E00, 0x3F7EE0, 0x3F7E1C, 0x3F7EFC, 0x3FFE03, 0x3FFEE3, 0x3FFE1F, - 0x3FFEFF, - 0xFF0100, 0xFF01E0, 0xFF011C, 0xFF01FC, 0xFF8103, 0xFF81E3, 0xFF811F, - 0xFF81FF, - 0xFF7100, 0xFF71E0, 0xFF711C, 0xFF71FC, 0xFFF103, 0xFFF1E3, 0xFFF11F, - 0xFFF1FF, - 0xFF0F00, 0xFF0FE0, 0xFF0F1C, 0xFF0FFC, 0xFF8F03, 0xFF8FE3, 0xFF8F1F, - 0xFF8FFF, - 0xFF7F00, 0xFF7FE0, 0xFF7F1C, 0xFF7FFC, 0xFFFF03, 0xFFFFE3, 0xFFFF1F, - 0xFFFFFF, -}; diff --git a/xserver/hw/xfree86/xaa/xaaWideLine.c b/xserver/hw/xfree86/xaa/xaaWideLine.c deleted file mode 100644 index b8a53c1c8..000000000 --- a/xserver/hw/xfree86/xaa/xaaWideLine.c +++ /dev/null @@ -1,924 +0,0 @@ -/* - -XAAPolylinesWideSolid does not maintain a span list and subsequently does -not follow the "touch-each-pixel-once" rules for wide lines and arcs. -This means it can only be used in the case where we have -miSpansEasyRop(pGC->alu). Since we clip spans on the fly, we -limited usage of this function to one rect situations. This -function is used only for solid lines. - - Adapted from miWideLine by Mark Vojkovich (mvojkovi@ucsd.edu) -Original mi code written by Keith Packard. - -*/ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include - -#include "misc.h" -#include "xf86.h" -#include "xf86_OSproc.h" - -#include -#include "windowstr.h" -#include "gcstruct.h" -#include "regionstr.h" -#include "miwideline.h" -#include "mi.h" -#include "xf86str.h" -#include "xaa.h" -#include "xaalocal.h" - -#define DRAW_POINT(pScrn, x, y) \ - if(hardClip) (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, 1, 1); \ - else XAAPointHelper(pScrn, x, y) - -#define FILL_RECT(pScrn, x, y, w, h) \ - if(hardClip) (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, w, h); \ - else XAAFillRectHelper(pScrn, x, y, w, h) - -#define FILL_SPAN(pScrn, x, y, w) \ - if(hardClip) (*infoRec->SubsequentSolidFillRect)(pScrn, x, y, w, 1); \ - else XAASpanHelper(pScrn, x, y, w) - -#define CLIPSTEPEDGE(edgey,edge,edgeleft) \ - if (ybase == edgey) { \ - if (edgeleft) { \ - if (edge->x > xcl) \ - xcl = edge->x; \ - } else { \ - if (edge->x < xcr) \ - xcr = edge->x; \ - } \ - edgey++; \ - edge->x += edge->stepx; \ - edge->e += edge->dx; \ - if (edge->e > 0) { \ - edge->x += edge->signdx; \ - edge->e -= edge->dy; \ - } \ - } - -static void -XAAPointHelper(ScrnInfoPtr pScrn, int x, int y) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - BoxPtr extents = infoRec->ClipBox; - - if ((x >= extents->x1) && (x < extents->x2) && - (y >= extents->y1) && (y < extents->y2)) - (*infoRec->SubsequentSolidFillRect) (pScrn, x, y, 1, 1); -} - -static void -XAAFillRectHelper(ScrnInfoPtr pScrn, int x1, int y1, int dx, int dy) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - BoxPtr extents = infoRec->ClipBox; - int x2 = x1 + dx; - int y2 = y1 + dy; - - if (x1 < extents->x1) - x1 = extents->x1; - if (x2 >= extents->x2) - x2 = extents->x2; - if ((dx = x2 - x1) < 1) - return; - if (y1 < extents->y1) - y1 = extents->y1; - if (y2 >= extents->y2) - y2 = extents->y2; - if ((dy = y2 - y1) < 1) - return; - - (*infoRec->SubsequentSolidFillRect) (pScrn, x1, y1, dx, dy); -} - -static void -XAASpanHelper(ScrnInfoPtr pScrn, int x1, int y, int width) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn); - BoxPtr extents = infoRec->ClipBox; - int x2; - - if ((y < extents->y1) || (y >= extents->y2)) - return; - - x2 = x1 + width; - if (x1 < extents->x1) - x1 = extents->x1; - if (x2 > extents->x2) - x2 = extents->x2; - width = x2 - x1; - - if (width > 0) - (*infoRec->SubsequentSolidFillRect) (pScrn, x1, y, width, 1); - -} - -#define FixError(x, dx, dy, e, sign, step, h) { \ - e += (h) * dx; \ - x += (h) * step; \ - if(e > 0) { \ - x += e * sign/dy; \ - e %= dy; \ - if(e) { \ - x += sign; \ - e -= dy; \ - } \ - } \ -} - -static void -XAAFillPolyHelper(GCPtr pGC, int y, /* start y coordinate */ - int overall_height, /* height of entire segment */ - PolyEdgePtr left, PolyEdgePtr right, - int left_count, int right_count) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - BoxPtr extents = infoRec->ClipBox; - int left_x, left_e, left_stepx, left_signdx, left_dy, left_dx; - int right_x, right_e, right_stepx, right_signdx, right_dy, right_dx; - int height, left_height, right_height; - int xorg; - Bool hardClip; - - if ((y >= extents->y2) || ((y + overall_height) <= extents->y1)) - return; - - /* Muffle compiler */ - left_x = left_e = left_stepx = left_signdx = left_dy = left_dx = 0; - right_x = right_e = right_stepx = right_signdx = right_dy = right_dx = 0; - - left_height = right_height = 0; - xorg = 0; - - hardClip = (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL); - - while ((left_count || left_height) && (right_count || right_height)) { - if (!left_height && left_count) { - left_height = left->height; - left_x = left->x + xorg; - left_stepx = left->stepx; - left_signdx = left->signdx; - left_e = left->e; - left_dy = left->dy; - left_dx = left->dx; - left_count--; - left++; - } - if (!right_height && right_count) { - right_height = right->height; - right_x = right->x + xorg + 1; - right_stepx = right->stepx; - right_signdx = right->signdx; - right_e = right->e; - right_dy = right->dy; - right_dx = right->dx; - right_count--; - right++; - } - - height = (left_height > right_height) ? right_height : left_height; - - left_height -= height; - right_height -= height; - - if (hardClip && infoRec->SubsequentSolidFillTrap && (height > 6)) { - int right_DX, left_DX; - - right_DX = (right_dx * right_signdx) + (right_stepx * right_dy); - left_DX = (left_dx * left_signdx) + (left_stepx * left_dy); - - (*infoRec->SubsequentSolidFillTrap) (infoRec->pScrn, y, height, - left_x, left_DX, left_dy, - left_e, right_x - 1, right_DX, - right_dy, right_e); - - FixError(left_x, left_dx, left_dy, left_e, left_signdx, - left_stepx, height); - FixError(right_x, right_dx, right_dy, right_e, right_signdx, - right_stepx, height); - y += height; - continue; - } - - while (height--) { - if (right_x > left_x) { - FILL_SPAN(infoRec->pScrn, left_x, y, right_x - left_x); - } - y++; - - left_x += left_stepx; - left_e += left_dx; - if (left_e > 0) { - left_x += left_signdx; - left_e -= left_dy; - } - right_x += right_stepx; - right_e += right_dx; - if (right_e > 0) { - right_x += right_signdx; - right_e -= right_dy; - } - - } - } -} - -static void -XAAWideSegment(GCPtr pGC, - int x1, int y1, int x2, int y2, - Bool projectLeft, Bool projectRight, - LineFacePtr leftFace, LineFacePtr rightFace) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - double l, L, r; - double xa, ya; - double projectXoff, projectYoff; - double k; - double maxy; - int x, y; - int dx, dy; - int finaly; - PolyEdgePtr left, right; - PolyEdgePtr top, bottom; - int lefty, righty, topy, bottomy; - int signdx; - PolyEdgeRec lefts[2], rights[2]; - LineFacePtr tface; - int lw = pGC->lineWidth; - Bool hardClip = (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL); - - /* draw top-to-bottom always */ - if ((y2 < y1) || ((y2 == y1) && (x2 < x1))) { - x = x1; - x1 = x2; - x2 = x; - - y = y1; - y1 = y2; - y2 = y; - - x = projectLeft; - projectLeft = projectRight; - projectRight = x; - - tface = leftFace; - leftFace = rightFace; - rightFace = tface; - } - - dy = y2 - y1; - signdx = 1; - dx = x2 - x1; - if (dx < 0) - signdx = -1; - - leftFace->x = x1; - leftFace->y = y1; - leftFace->dx = dx; - leftFace->dy = dy; - - rightFace->x = x2; - rightFace->y = y2; - rightFace->dx = -dx; - rightFace->dy = -dy; - - if (!dy) { - rightFace->xa = 0; - rightFace->ya = (double) lw / 2.0; - rightFace->k = -(double) (lw * dx) / 2.0; - leftFace->xa = 0; - leftFace->ya = -rightFace->ya; - leftFace->k = rightFace->k; - x = x1; - if (projectLeft) - x -= (lw >> 1); - y = y1 - (lw >> 1); - dx = x2 - x; - if (projectRight) - dx += ((lw + 1) >> 1); - dy = lw; - FILL_RECT(infoRec->pScrn, x, y, dx, dy); - } - else if (!dx) { - leftFace->xa = (double) lw / 2.0; - leftFace->ya = 0; - leftFace->k = (double) (lw * dy) / 2.0; - rightFace->xa = -leftFace->xa; - rightFace->ya = 0; - rightFace->k = leftFace->k; - y = y1; - if (projectLeft) - y -= lw >> 1; - x = x1 - (lw >> 1); - dy = y2 - y; - if (projectRight) - dy += ((lw + 1) >> 1); - dx = lw; - FILL_RECT(infoRec->pScrn, x, y, dx, dy); - } - else { - l = ((double) lw) / 2.0; - L = sqrt((double) (dx * dx + dy * dy)); - - if (dx < 0) { - right = &rights[1]; - left = &lefts[0]; - top = &rights[0]; - bottom = &lefts[1]; - } - else { - right = &rights[0]; - left = &lefts[1]; - top = &lefts[0]; - bottom = &rights[1]; - } - r = l / L; - - /* coord of upper bound at integral y */ - ya = -r * dx; - xa = r * dy; - - projectXoff = -ya; - projectYoff = xa; - - /* xa * dy - ya * dx */ - k = l * L; - - leftFace->xa = xa; - leftFace->ya = ya; - leftFace->k = k; - rightFace->xa = -xa; - rightFace->ya = -ya; - rightFace->k = k; - - if (projectLeft) - righty = miPolyBuildEdge(xa - projectXoff, ya - projectYoff, - k, dx, dy, x1, y1, 0, right); - else - righty = miPolyBuildEdge(xa, ya, k, dx, dy, x1, y1, 0, right); - - /* coord of lower bound at integral y */ - ya = -ya; - xa = -xa; - - /* xa * dy - ya * dx */ - k = -k; - - if (projectLeft) - lefty = miPolyBuildEdge(xa - projectXoff, ya - projectYoff, - k, dx, dy, x1, y1, 1, left); - else - lefty = miPolyBuildEdge(xa, ya, k, dx, dy, x1, y1, 1, left); - - /* coord of top face at integral y */ - - if (signdx > 0) { - ya = -ya; - xa = -xa; - } - - if (projectLeft) { - double xap = xa - projectXoff; - double yap = ya - projectYoff; - - topy = miPolyBuildEdge(xap, yap, xap * dx + yap * dy, - -dy, dx, x1, y1, dx > 0, top); - } - else - topy = miPolyBuildEdge(xa, ya, 0.0, -dy, dx, x1, y1, dx > 0, top); - - /* coord of bottom face at integral y */ - - if (projectRight) { - double xap = xa + projectXoff; - double yap = ya + projectYoff; - - bottomy = miPolyBuildEdge(xap, yap, xap * dx + yap * dy, - -dy, dx, x2, y2, dx < 0, bottom); - maxy = -ya + projectYoff; - } - else { - bottomy = miPolyBuildEdge(xa, ya, 0.0, - -dy, dx, x2, y2, dx < 0, bottom); - maxy = -ya; - } - - finaly = ICEIL(maxy) + y2; - - if (dx < 0) { - left->height = bottomy - lefty; - right->height = finaly - righty; - top->height = righty - topy; - } - else { - right->height = bottomy - righty; - left->height = finaly - lefty; - top->height = lefty - topy; - } - bottom->height = finaly - bottomy; - XAAFillPolyHelper(pGC, topy, - bottom->height + bottomy - topy, lefts, rights, 2, 2); - } -} - -static void -XAALineArcI(GCPtr pGC, int xorg, int yorg) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - int x, y, e, ex; - int slw = pGC->lineWidth; - Bool hardClip = (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL); - - y = (slw >> 1) + 1; - if (slw & 1) - e = -((y << 2) + 3); - else - e = -(y << 3); - ex = -4; - x = 0; - while (y) { - e += (y << 3) - 4; - while (e >= 0) { - x++; - e += (ex = -((x << 3) + 4)); - } - y--; - slw = (x << 1) + 1; - if ((e == ex) && (slw > 1)) - slw--; - - FILL_SPAN(infoRec->pScrn, xorg - x, yorg - y, slw); - - if ((y != 0) && ((slw > 1) || (e != ex))) { - FILL_SPAN(infoRec->pScrn, xorg - x, yorg + y, slw); - } - } -} - -static void -XAALineArcD(GCPtr pGC, - double xorg, - double yorg, - PolyEdgePtr edge1, - int edgey1, - Bool edgeleft1, PolyEdgePtr edge2, int edgey2, Bool edgeleft2) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - double radius, x0, y0, el, er, yk, xlk, xrk, k; - int xbase, ybase, y, boty, xl, xr, xcl, xcr; - int ymin, ymax; - Bool edge1IsMin, edge2IsMin; - int ymin1, ymin2; - Bool hardClip = (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL); - - xbase = floor(xorg); - x0 = xorg - xbase; - ybase = ICEIL(yorg); - y0 = yorg - ybase; - - xlk = x0 + x0 + 1.0; - xrk = x0 + x0 - 1.0; - yk = y0 + y0 - 1.0; - radius = ((double) pGC->lineWidth) / 2.0; - y = floor(radius - y0 + 1.0); - ybase -= y; - ymin = ybase; - ymax = 65536; - edge1IsMin = FALSE; - ymin1 = edgey1; - if (edge1->dy >= 0) { - if (!edge1->dy) { - if (edgeleft1) - edge1IsMin = TRUE; - else - ymax = edgey1; - edgey1 = 65536; - } - else if ((edge1->signdx < 0) == edgeleft1) - edge1IsMin = TRUE; - } - edge2IsMin = FALSE; - ymin2 = edgey2; - if (edge2->dy >= 0) { - if (!edge2->dy) { - if (edgeleft2) - edge2IsMin = TRUE; - else - ymax = edgey2; - edgey2 = 65536; - } - else if ((edge2->signdx < 0) == edgeleft2) - edge2IsMin = TRUE; - } - if (edge1IsMin) { - ymin = ymin1; - if (edge2IsMin && (ymin1 > ymin2)) - ymin = ymin2; - } - else if (edge2IsMin) - ymin = ymin2; - el = radius * radius - ((y + y0) * (y + y0)) - (x0 * x0); - er = el + xrk; - xl = 1; - xr = 0; - if (x0 < 0.5) { - xl = 0; - el -= xlk; - } - boty = (y0 < -0.5) ? 1 : 0; - if (ybase + y - boty > ymax) - boty = ymax - ybase - y; - while (y > boty) { - k = (y << 1) + yk; - er += k; - while (er > 0.0) { - xr++; - er += xrk - (xr << 1); - } - el += k; - while (el >= 0.0) { - xl--; - el += (xl << 1) - xlk; - } - y--; - ybase++; - if (ybase < ymin) - continue; - xcl = xl + xbase; - xcr = xr + xbase; - CLIPSTEPEDGE(edgey1, edge1, edgeleft1); - CLIPSTEPEDGE(edgey2, edge2, edgeleft2); - if (xcr >= xcl) { - FILL_SPAN(infoRec->pScrn, xcl, ybase, xcr - xcl + 1); - } - } - er = xrk - (xr << 1) - er; - el = (xl << 1) - xlk - el; - boty = floor(-y0 - radius + 1.0); - if (ybase + y - boty > ymax) - boty = ymax - ybase - y; - while (y > boty) { - k = (y << 1) + yk; - er -= k; - while ((er >= 0.0) && (xr >= 0)) { - xr--; - er += xrk - (xr << 1); - } - el -= k; - while ((el > 0.0) && (xl <= 0)) { - xl++; - el += (xl << 1) - xlk; - } - y--; - ybase++; - if (ybase < ymin) - continue; - xcl = xl + xbase; - xcr = xr + xbase; - CLIPSTEPEDGE(edgey1, edge1, edgeleft1); - CLIPSTEPEDGE(edgey2, edge2, edgeleft2); - if (xcr >= xcl) { - FILL_SPAN(infoRec->pScrn, xcl, ybase, xcr - xcl + 1); - } - } -} - -static void -XAALineArc(GCPtr pGC, - LineFacePtr leftFace, - LineFacePtr rightFace, double xorg, double yorg, Bool isInt) -{ - int xorgi, yorgi; - PolyEdgeRec edge1, edge2; - int edgey1, edgey2; - Bool edgeleft1, edgeleft2; - - if (isInt) { - xorgi = leftFace ? leftFace->x : rightFace->x; - yorgi = leftFace ? leftFace->y : rightFace->y; - } - else { /* Muffle compiler */ - xorgi = yorgi = 0; - } - edgey1 = 65536; - edgey2 = 65536; - edge1.x = 0; /* not used, keep memory checkers happy */ - edge1.dy = -1; - edge2.x = 0; /* not used, keep memory checkers happy */ - edge2.dy = -1; - edgeleft1 = FALSE; - edgeleft2 = FALSE; - - if ((pGC->lineWidth > 2) && - ((pGC->capStyle == CapRound && pGC->joinStyle != JoinRound) || - (pGC->joinStyle == JoinRound && pGC->capStyle == CapButt))) { - if (isInt) { - xorg = (double) xorgi; - yorg = (double) yorgi; - } - - if (leftFace && rightFace) - miRoundJoinClip(leftFace, rightFace, &edge1, &edge2, - &edgey1, &edgey2, &edgeleft1, &edgeleft2); - else if (leftFace) - edgey1 = miRoundCapClip(leftFace, isInt, &edge1, &edgeleft1); - else if (rightFace) - edgey2 = miRoundCapClip(rightFace, isInt, &edge2, &edgeleft2); - - isInt = FALSE; - } - - if (isInt) { - if (pGC->lineWidth == 1) { - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - Bool hardClip = (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL); - - DRAW_POINT(infoRec->pScrn, xorgi, yorgi); - } - else - XAALineArcI(pGC, xorgi, yorgi); - } - else - XAALineArcD(pGC, xorg, yorg, &edge1, edgey1, edgeleft1, - &edge2, edgey2, edgeleft2); - -} - -static void -XAALineJoin(GCPtr pGC, LineFacePtr pLeft, LineFacePtr pRight) -{ - double mx = 0, my = 0; - double denom = 0; - PolyVertexRec vertices[4]; - PolySlopeRec slopes[4]; - int edgecount; - PolyEdgeRec left[4], right[4]; - int nleft, nright; - int y, height; - int swapslopes; - int joinStyle = pGC->joinStyle; - int lw = pGC->lineWidth; - - if (lw == 1) { - /* Lines going in the same direction have no join */ - if ((pLeft->dx >= 0) == (pRight->dx <= 0)) - return; - if (joinStyle != JoinRound) { - denom = -pLeft->dx * (double) pRight->dy + pRight->dx * - (double) pLeft->dy; - if (denom == 0.0) - return; /* no join to draw */ - } - if (joinStyle != JoinMiter) { - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - Bool hardClip = (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL); - - DRAW_POINT(infoRec->pScrn, pLeft->x, pLeft->y); - return; - } - } - else { - if (joinStyle == JoinRound) { - XAALineArc(pGC, pLeft, pRight, (double) 0.0, (double) 0.0, TRUE); - return; - } - denom = -pLeft->dx * (double) pRight->dy + pRight->dx * - (double) pLeft->dy; - if (denom == 0.0) - return; /* no join to draw */ - } - - swapslopes = 0; - if (denom > 0) { - pLeft->xa = -pLeft->xa; - pLeft->ya = -pLeft->ya; - pLeft->dx = -pLeft->dx; - pLeft->dy = -pLeft->dy; - } - else { - swapslopes = 1; - pRight->xa = -pRight->xa; - pRight->ya = -pRight->ya; - pRight->dx = -pRight->dx; - pRight->dy = -pRight->dy; - } - - vertices[0].x = pRight->xa; - vertices[0].y = pRight->ya; - slopes[0].dx = -pRight->dy; - slopes[0].dy = pRight->dx; - slopes[0].k = 0; - - vertices[1].x = 0; - vertices[1].y = 0; - slopes[1].dx = pLeft->dy; - slopes[1].dy = -pLeft->dx; - slopes[1].k = 0; - - vertices[2].x = pLeft->xa; - vertices[2].y = pLeft->ya; - - if (joinStyle == JoinMiter) { - my = (pLeft->dy * (pRight->xa * pRight->dy - pRight->ya * pRight->dx) - - pRight->dy * (pLeft->xa * pLeft->dy - pLeft->ya * pLeft->dx)) / - denom; - if (pLeft->dy != 0) - mx = pLeft->xa + (my - pLeft->ya) * - (double) pLeft->dx / (double) pLeft->dy; - else - mx = pRight->xa + (my - pRight->ya) * - (double) pRight->dx / (double) pRight->dy; - - /* check miter limit */ - if ((mx * mx + my * my) * 4 > SQSECANT * lw * lw) - joinStyle = JoinBevel; - } - - if (joinStyle == JoinMiter) { - slopes[2].dx = pLeft->dx; - slopes[2].dy = pLeft->dy; - slopes[2].k = pLeft->k; - if (swapslopes) { - slopes[2].dx = -slopes[2].dx; - slopes[2].dy = -slopes[2].dy; - slopes[2].k = -slopes[2].k; - } - vertices[3].x = mx; - vertices[3].y = my; - slopes[3].dx = pRight->dx; - slopes[3].dy = pRight->dy; - slopes[3].k = pRight->k; - if (swapslopes) { - slopes[3].dx = -slopes[3].dx; - slopes[3].dy = -slopes[3].dy; - slopes[3].k = -slopes[3].k; - } - edgecount = 4; - } - else { - double scale, dx, dy, adx, ady; - - adx = dx = pRight->xa - pLeft->xa; - ady = dy = pRight->ya - pLeft->ya; - if (adx < 0) - adx = -adx; - if (ady < 0) - ady = -ady; - scale = ady; - if (adx > ady) - scale = adx; - slopes[2].dx = (dx * 65536) / scale; - slopes[2].dy = (dy * 65536) / scale; - slopes[2].k = ((pLeft->xa + pRight->xa) * slopes[2].dy - - (pLeft->ya + pRight->ya) * slopes[2].dx) / 2.0; - edgecount = 3; - } - - y = miPolyBuildPoly(vertices, slopes, edgecount, pLeft->x, pLeft->y, - left, right, &nleft, &nright, &height); - XAAFillPolyHelper(pGC, y, height, left, right, nleft, nright); -} - -void -XAAPolylinesWideSolid(DrawablePtr pDrawable, - GCPtr pGC, int mode, int npt, DDXPointPtr pPts) -{ - XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - int x1, y1, x2, y2; - Bool projectLeft, projectRight; - LineFaceRec leftFace, rightFace, prevRightFace, firstFace; - int first = TRUE; - Bool somethingDrawn = FALSE; - Bool selfJoin = FALSE; - int xorg = pDrawable->x; - int yorg = pDrawable->y; - Bool hardClip = FALSE; - - if (!RegionNumRects(pGC->pCompositeClip)) - return; - - if (RegionNumRects(pGC->pCompositeClip) != 1) { - miWideLine(pDrawable, pGC, mode, npt, pPts); - return; - } - - x2 = pPts->x; - y2 = pPts->y; - if (npt > 1) { - if (mode == CoordModePrevious) { - int nptTmp; - register DDXPointPtr pPtsTmp; - - x1 = x2; - y1 = y2; - nptTmp = npt; - pPtsTmp = pPts + 1; - while (--nptTmp) { - x1 += pPtsTmp->x; - y1 += pPtsTmp->y; - ++pPtsTmp; - } - if ((x2 == x1) && (y2 == y1)) - selfJoin = TRUE; - } - else if ((x2 == pPts[npt - 1].x) && (y2 == pPts[npt - 1].y)) - selfJoin = TRUE; - } - - projectLeft = ((pGC->capStyle == CapProjecting) && !selfJoin); - projectRight = FALSE; - - (*infoRec->SetupForSolidFill) (infoRec->pScrn, pGC->fgPixel, pGC->alu, - pGC->planemask); - - infoRec->ClipBox = &pGC->pCompositeClip->extents; - - if (infoRec->ClippingFlags & HARDWARE_CLIP_SOLID_FILL) { - hardClip = TRUE; - (*infoRec->SetClippingRectangle) (infoRec->pScrn, - infoRec->ClipBox->x1, - infoRec->ClipBox->y1, - infoRec->ClipBox->x2 - 1, - infoRec->ClipBox->y2 - 1); - } - - x2 += xorg; - y2 += yorg; - while (--npt) { - x1 = x2; - y1 = y2; - ++pPts; - x2 = pPts->x; - y2 = pPts->y; - if (mode == CoordModePrevious) { - x2 += x1; - y2 += y1; - } - else { - x2 += xorg; - y2 += yorg; - } - if ((x1 != x2) || (y1 != y2)) { - somethingDrawn = TRUE; - if ((npt == 1) && (pGC->capStyle == CapProjecting) && !selfJoin) - projectRight = TRUE; - XAAWideSegment(pGC, x1, y1, x2, y2, - projectLeft, projectRight, &leftFace, &rightFace); - if (first) { - if (selfJoin) - firstFace = leftFace; - else if (pGC->capStyle == CapRound) { - if (pGC->lineWidth == 1) { - DRAW_POINT(infoRec->pScrn, x1, y1); - } - else - XAALineArc(pGC, &leftFace, (LineFacePtr) NULL, - (double) 0.0, (double) 0.0, TRUE); - } - } - else - XAALineJoin(pGC, &leftFace, &prevRightFace); - - prevRightFace = rightFace; - first = FALSE; - projectLeft = FALSE; - } - if (npt == 1 && somethingDrawn) { - if (selfJoin) - XAALineJoin(pGC, &firstFace, &rightFace); - else if (pGC->capStyle == CapRound) { - if (pGC->lineWidth == 1) { - DRAW_POINT(infoRec->pScrn, x2, y2); - } - else - XAALineArc(pGC, (LineFacePtr) NULL, &rightFace, - (double) 0.0, (double) 0.0, TRUE); - } - } - } - /* handle crock where all points are coincedent */ - if (!somethingDrawn) { - projectLeft = (pGC->capStyle == CapProjecting); - XAAWideSegment(pGC, x2, y2, x2, y2, projectLeft, projectLeft, - &leftFace, &rightFace); - if (pGC->capStyle == CapRound) { - XAALineArc(pGC, &leftFace, (LineFacePtr) NULL, - (double) 0.0, (double) 0.0, TRUE); - rightFace.dx = -1; /* sleezy hack to make it work */ - XAALineArc(pGC, (LineFacePtr) NULL, &rightFace, - (double) 0.0, (double) 0.0, TRUE); - } - } - - infoRec->ClipBox = NULL; - if (hardClip) - (*infoRec->DisableClipping) (infoRec->pScrn); - - SET_SYNC_FLAG(infoRec); -} diff --git a/xserver/hw/xfree86/xaa/xaacexp.h b/xserver/hw/xfree86/xaa/xaacexp.h deleted file mode 100644 index 6fde54c65..000000000 --- a/xserver/hw/xfree86/xaa/xaacexp.h +++ /dev/null @@ -1,126 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include - -#ifndef FIXEDBASE -#define CHECKRETURN(b) if(width <= ((b) * 32)) return(base + (b)) -#else -#define CHECKRETURN(b) if(width <= ((b) * 32)) return(base) -#endif - -#if X_BYTE_ORDER == X_BIG_ENDIAN -#define SHIFT_L(value, shift) ((value) >> (shift)) -#define SHIFT_R(value, shift) ((value) << (shift)) -#else -#define SHIFT_L(value, shift) ((value) << (shift)) -#define SHIFT_R(value, shift) ((value) >> (shift)) -#endif - -#ifndef MSBFIRST -#ifdef FIXEDBASE -#define WRITE_IN_BITORDER(dest, offset, data) *(dest) = data; -#else -#define WRITE_IN_BITORDER(dest, offset, data) *(dest + offset) = data; -#endif -#else -#ifdef FIXEDBASE -#define WRITE_IN_BITORDER(dest, offset, data) *(dest) = SWAP_BITS_IN_BYTES(data); -#else -#define WRITE_IN_BITORDER(dest, offset, data) *(dest + offset) = SWAP_BITS_IN_BYTES(data) -#endif -#endif - -#ifdef FIXEDBASE -#ifdef MSBFIRST -#define WRITE_BITS(b) *base = SWAP_BITS_IN_BYTES(b) -#define WRITE_BITS1(b) { \ - *base = byte_reversed_expand3[(b) & 0xFF] | \ - byte_reversed_expand3[((b) & 0xFF00) >> 8] << 24; } -#define WRITE_BITS2(b) { \ - *base = byte_reversed_expand3[(b) & 0xFF] | \ - byte_reversed_expand3[((b) & 0xFF00) >> 8] << 24; \ - *base = byte_reversed_expand3[((b) & 0xFF00) >> 8] >> 8 | \ - byte_reversed_expand3[((b) & 0xFF0000) >> 16] << 16; } -#define WRITE_BITS3(b) { \ - *base = byte_reversed_expand3[(b) & 0xFF] | \ - byte_reversed_expand3[((b) & 0xFF00) >> 8] << 24; \ - *base = byte_reversed_expand3[((b) & 0xFF00) >> 8] >> 8 | \ - byte_reversed_expand3[((b) & 0xFF0000) >> 16] << 16; \ - *base = byte_reversed_expand3[((b) & 0xFF0000) >> 16] >> 16 | \ - byte_reversed_expand3[((b) & 0xFF000000) >> 24] << 8; } -#else -#define WRITE_BITS(b) *base = (b) -#define WRITE_BITS1(b) { \ - *base = byte_expand3[(b) & 0xFF] | \ - byte_expand3[((b) & 0xFF00) >> 8] << 24; } -#define WRITE_BITS2(b) { \ - *base = byte_expand3[(b) & 0xFF] | \ - byte_expand3[((b) & 0xFF00) >> 8] << 24; \ - *base = byte_expand3[((b) & 0xFF00) >> 8] >> 8 | \ - byte_expand3[((b) & 0xFF0000) >> 16] << 16; } -#define WRITE_BITS3(b) { \ - *base = byte_expand3[(b) & 0xFF] | \ - byte_expand3[((b) & 0xFF00) >> 8] << 24; \ - *base = byte_expand3[((b) & 0xFF00) >> 8] >> 8 | \ - byte_expand3[((b) & 0xFF0000) >> 16] << 16; \ - *base = byte_expand3[((b) & 0xFF0000) >> 16] >> 16 | \ - byte_expand3[((b) & 0xFF000000) >> 24] << 8; } -#endif -#else -#ifdef MSBFIRST -#define WRITE_BITS(b) *(base++) = SWAP_BITS_IN_BYTES(b) -#define WRITE_BITS1(b) { \ - *(base++) = byte_reversed_expand3[(b) & 0xFF] | \ - byte_reversed_expand3[((b) & 0xFF00) >> 8] << 24; } -#define WRITE_BITS2(b) { \ - *(base) = byte_reversed_expand3[(b) & 0xFF] | \ - byte_reversed_expand3[((b) & 0xFF00) >> 8] << 24; \ - *(base + 1) = byte_reversed_expand3[((b) & 0xFF00) >> 8] >> 8 | \ - byte_reversed_expand3[((b) & 0xFF0000) >> 16] << 16; \ - base += 2; } -#define WRITE_BITS3(b) { \ - *(base) = byte_reversed_expand3[(b) & 0xFF] | \ - byte_reversed_expand3[((b) & 0xFF00) >> 8] << 24; \ - *(base + 1) = byte_reversed_expand3[((b) & 0xFF00) >> 8] >> 8 | \ - byte_reversed_expand3[((b) & 0xFF0000) >> 16] << 16; \ - *(base + 2) = byte_reversed_expand3[((b) & 0xFF0000) >> 16] >> 16 | \ - byte_reversed_expand3[((b) & 0xFF000000) >> 24] << 8; \ - base += 3; } -#else -#define WRITE_BITS(b) *(base++) = (b) -#define WRITE_BITS1(b) { \ - *(base++) = byte_expand3[(b) & 0xFF] | \ - byte_expand3[((b) & 0xFF00) >> 8] << 24; } -#define WRITE_BITS2(b) { \ - *(base) = byte_expand3[(b) & 0xFF] | \ - byte_expand3[((b) & 0xFF00) >> 8] << 24; \ - *(base + 1) = byte_expand3[((b) & 0xFF00) >> 8] >> 8 | \ - byte_expand3[((b) & 0xFF0000) >> 16] << 16; \ - base += 2; } -#define WRITE_BITS3(b) { \ - *(base) = byte_expand3[(b) & 0xFF] | \ - byte_expand3[((b) & 0xFF00) >> 8] << 24; \ - *(base + 1) = byte_expand3[((b) & 0xFF00) >> 8] >> 8 | \ - byte_expand3[((b) & 0xFF0000) >> 16] << 16; \ - *(base + 2) = byte_expand3[((b) & 0xFF0000) >> 16] >> 16 | \ - byte_expand3[((b) & 0xFF000000) >> 24] << 8; \ - base += 3; } -#endif -#endif - -#ifdef FIXEDBASE -#ifdef MSBFIRST -#define EXPNAME(x) x##MSBFirstFixedBase -#else -#define EXPNAME(x) x##LSBFirstFixedBase -#endif -#else -#ifdef MSBFIRST -#define EXPNAME(x) x##MSBFirst -#else -#define EXPNAME(x) x##LSBFirst -#endif -#endif diff --git a/xserver/hw/xfree86/xaa/xaalocal.h b/xserver/hw/xfree86/xaa/xaalocal.h deleted file mode 100644 index c028ef033..000000000 --- a/xserver/hw/xfree86/xaa/xaalocal.h +++ /dev/null @@ -1,1437 +0,0 @@ - -#ifndef _XAALOCAL_H -#define _XAALOCAL_H - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -/* This file is very unorganized ! */ - -#include "gcstruct.h" -#include "regionstr.h" -#include "xf86fbman.h" -#include "xaa.h" -#include "mi.h" -#include "picturestr.h" - -#define GCWhenForced (GCArcMode << 1) - -#define DO_COLOR_8x8 0x00000001 -#define DO_MONO_8x8 0x00000002 -#define DO_CACHE_BLT 0x00000003 -#define DO_COLOR_EXPAND 0x00000004 -#define DO_CACHE_EXPAND 0x00000005 -#define DO_IMAGE_WRITE 0x00000006 -#define DO_PIXMAP_COPY 0x00000007 -#define DO_SOLID 0x00000008 - -typedef CARD32 *(*GlyphScanlineFuncPtr) (CARD32 *base, unsigned int **glyphp, - int line, int nglyph, int width); - -typedef CARD32 *(*StippleScanlineProcPtr) (CARD32 *, CARD32 *, int, int, int); - -typedef void (*RectFuncPtr) (ScrnInfoPtr, int, int, int, int, int, int, - XAACacheInfoPtr); -typedef void (*TrapFuncPtr) (ScrnInfoPtr, int, int, int, int, int, int, - int, int, int, int, int, int, XAACacheInfoPtr); - -typedef struct _XAAScreen { - CreateGCProcPtr CreateGC; - CloseScreenProcPtr CloseScreen; - GetImageProcPtr GetImage; - GetSpansProcPtr GetSpans; - CopyWindowProcPtr CopyWindow; - WindowExposuresProcPtr WindowExposures; - CreatePixmapProcPtr CreatePixmap; - DestroyPixmapProcPtr DestroyPixmap; - ChangeWindowAttributesProcPtr ChangeWindowAttributes; - XAAInfoRecPtr AccelInfoRec; - Bool (*EnterVT) (int, int); - void (*LeaveVT) (int, int); - int (*SetDGAMode) (int, int, DGADevicePtr); - void (*EnableDisableFBAccess) (int, Bool); - CompositeProcPtr Composite; - GlyphsProcPtr Glyphs; -} XAAScreenRec, *XAAScreenPtr; - -#define OPS_ARE_PIXMAP 0x00000001 -#define OPS_ARE_ACCEL 0x00000002 - -typedef struct _XAAGC { - GCOps *wrapOps; - GCFuncs *wrapFuncs; - GCOps *XAAOps; - int DashLength; - unsigned char *DashPattern; - unsigned long changes; - unsigned long flags; -} XAAGCRec, *XAAGCPtr; - -#define REDUCIBILITY_CHECKED 0x00000001 -#define REDUCIBLE_TO_8x8 0x00000002 -#define REDUCIBLE_TO_2_COLOR 0x00000004 -#define DIRTY 0x00010000 -#define OFFSCREEN 0x00020000 -#define DGA_PIXMAP 0x00040000 -#define SHARED_PIXMAP 0x00080000 -#define LOCKED_PIXMAP 0x00100000 - -#define REDUCIBILITY_MASK \ - (REDUCIBILITY_CHECKED | REDUCIBLE_TO_8x8 | REDUCIBLE_TO_2_COLOR) - -typedef struct _XAAPixmap { - unsigned long flags; - CARD32 pattern0; - CARD32 pattern1; - int fg; - int bg; - FBAreaPtr offscreenArea; - Bool freeData; -} XAAPixmapRec, *XAAPixmapPtr; - -extern _X_EXPORT Bool - XAACreateGC(GCPtr pGC); - -extern _X_EXPORT Bool - XAAInitAccel(ScreenPtr pScreen, XAAInfoRecPtr infoRec); - -extern _X_EXPORT RegionPtr - -XAABitBlt(DrawablePtr pSrcDrawable, - DrawablePtr pDstDrawable, - GC * pGC, - int srcx, - int srcy, - int width, - int height, - int dstx, - int dsty, - void (*doBitBlt) (DrawablePtr, DrawablePtr, GCPtr, RegionPtr, - DDXPointPtr), unsigned long bitPlane); - -extern _X_EXPORT void - -XAAScreenToScreenBitBlt(ScrnInfoPtr pScrn, - int nbox, - DDXPointPtr pptSrc, - BoxPtr pbox, - int xdir, int ydir, int alu, unsigned int planemask); - -extern _X_EXPORT void - -XAADoBitBlt(DrawablePtr pSrc, - DrawablePtr pDst, GC * pGC, RegionPtr prgnDst, DDXPointPtr pptSrc); - -extern _X_EXPORT void - -XAADoImageWrite(DrawablePtr pSrc, - DrawablePtr pDst, - GC * pGC, RegionPtr prgnDst, DDXPointPtr pptSrc); - -extern _X_EXPORT void - -XAADoImageRead(DrawablePtr pSrc, - DrawablePtr pDst, - GC * pGC, RegionPtr prgnDst, DDXPointPtr pptSrc); - -extern _X_EXPORT void - XAACopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); - -extern _X_EXPORT RegionPtr - -XAACopyArea(DrawablePtr pSrcDrawable, - DrawablePtr pDstDrawable, - GC * pGC, - int srcx, int srcy, int width, int height, int dstx, int dsty); - -extern _X_EXPORT void - XAAValidateCopyArea(GCPtr pGC, unsigned long changes, DrawablePtr pDraw); - -extern _X_EXPORT void - XAAValidatePutImage(GCPtr pGC, unsigned long changes, DrawablePtr pDraw); - -extern _X_EXPORT void - XAAValidateCopyPlane(GCPtr pGC, unsigned long changes, DrawablePtr pDraw); - -extern _X_EXPORT void - XAAValidatePushPixels(GCPtr pGC, unsigned long changes, DrawablePtr pDraw); - -extern _X_EXPORT void - XAAValidateFillSpans(GCPtr pGC, unsigned long changes, DrawablePtr pDraw); - -extern _X_EXPORT void - XAAValidatePolyGlyphBlt(GCPtr pGC, unsigned long changes, DrawablePtr pDraw); - -extern _X_EXPORT void - XAAValidateImageGlyphBlt(GCPtr pGC, unsigned long changes, DrawablePtr pDraw); - -extern _X_EXPORT void - XAAValidatePolylines(GCPtr pGC, unsigned long changes, DrawablePtr pDraw); - -extern _X_EXPORT RegionPtr - -XAACopyPlaneColorExpansion(DrawablePtr pSrc, - DrawablePtr pDst, - GCPtr pGC, - int srcx, - int srcy, - int width, - int height, - int dstx, int dsty, unsigned long bitPlane); - -extern _X_EXPORT void - -XAAPushPixelsSolidColorExpansion(GCPtr pGC, - PixmapPtr pBitMap, - DrawablePtr pDrawable, - int dx, int dy, int xOrg, int yOrg); - -extern _X_EXPORT void - -XAAWriteBitmapColorExpandMSBFirstFixedBase(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, - int srcwidth, - int skipleft, - int fg, int bg, - int rop, unsigned int planemask); - -extern _X_EXPORT void - -XAAWriteBitmapColorExpand3MSBFirstFixedBase(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, - int srcwidth, - int skipleft, - int fg, int bg, - int rop, unsigned int planemask); - -extern _X_EXPORT void - -XAAWriteBitmapColorExpandMSBFirst(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, - int srcwidth, - int skipleft, - int fg, int bg, - int rop, unsigned int planemask); - -extern _X_EXPORT void - -XAAWriteBitmapColorExpand3MSBFirst(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, - int srcwidth, - int skipleft, - int fg, int bg, - int rop, unsigned int planemask); - -extern _X_EXPORT void - -XAAWriteBitmapColorExpandLSBFirstFixedBase(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, - int srcwidth, - int skipleft, - int fg, int bg, - int rop, unsigned int planemask); - -extern _X_EXPORT void - -XAAWriteBitmapColorExpand3LSBFirstFixedBase(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, - int srcwidth, - int skipleft, - int fg, int bg, - int rop, unsigned int planemask); - -extern _X_EXPORT void - -XAAWriteBitmapColorExpandLSBFirst(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, - int srcwidth, - int skipleft, - int fg, int bg, - int rop, unsigned int planemask); - -extern _X_EXPORT void - -XAAWriteBitmapColorExpand3LSBFirst(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, - int srcwidth, - int skipleft, - int fg, int bg, - int rop, unsigned int planemask); - -extern _X_EXPORT void - -XAAWriteBitmapScanlineColorExpandMSBFirst(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, - int srcwidth, - int skipleft, - int fg, int bg, - int rop, unsigned int planemask); - -extern _X_EXPORT void - -XAAWriteBitmapScanlineColorExpand3MSBFirst(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, - int srcwidth, - int skipleft, - int fg, int bg, - int rop, unsigned int planemask); - -extern _X_EXPORT void - -XAAWriteBitmapScanlineColorExpandMSBFirstFixedBase(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, - int srcwidth, - int skipleft, - int fg, int bg, - int rop, - unsigned int planemask); - -extern _X_EXPORT void - -XAAWriteBitmapScanlineColorExpand3MSBFirstFixedBase(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, - int srcwidth, - int skipleft, - int fg, int bg, - int rop, - unsigned int planemask); - -extern _X_EXPORT void - -XAAWriteBitmapScanlineColorExpandLSBFirst(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, - int srcwidth, - int skipleft, - int fg, int bg, - int rop, unsigned int planemask); - -extern _X_EXPORT void - -XAAWriteBitmapScanlineColorExpand3LSBFirst(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, - int srcwidth, - int skipleft, - int fg, int bg, - int rop, unsigned int planemask); - -extern _X_EXPORT void - -XAAWriteBitmapScanlineColorExpandLSBFirstFixedBase(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, - int srcwidth, - int skipleft, - int fg, int bg, - int rop, - unsigned int planemask); - -extern _X_EXPORT void - -XAAWriteBitmapScanlineColorExpand3LSBFirstFixedBase(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, - int srcwidth, - int skipleft, - int fg, int bg, - int rop, - unsigned int planemask); - -extern _X_EXPORT void - -XAAWritePixmap(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, - int srcwidth, - int rop, - unsigned int planemask, - int transparency_color, int bpp, int depth); - -extern _X_EXPORT void - -XAAWritePixmapScanline(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, - int srcwidth, - int rop, - unsigned int planemask, - int transparency_color, int bpp, int depth); - -typedef void (*ClipAndRenderRectsFunc) (GCPtr, int, BoxPtr, int, int); - -extern _X_EXPORT void - -XAAClipAndRenderRects(GCPtr pGC, - ClipAndRenderRectsFunc func, - int nrectFill, xRectangle *prectInit, int xorg, int yorg); - -typedef void (*ClipAndRenderSpansFunc) (GCPtr, int, DDXPointPtr, int *, - int, int, int); - -extern _X_EXPORT void - -XAAClipAndRenderSpans(GCPtr pGC, - DDXPointPtr ppt, - int *pwidth, - int nspans, - int fSorted, - ClipAndRenderSpansFunc func, int xorg, int yorg); - -extern _X_EXPORT void - -XAAFillSolidRects(ScrnInfoPtr pScrn, - int fg, int rop, - unsigned int planemask, int nBox, BoxPtr pBox); - -extern _X_EXPORT void - -XAAFillMono8x8PatternRects(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, int pat0, int pat1, int xorg, int yorg); - -extern _X_EXPORT void - -XAAFillMono8x8PatternRectsScreenOrigin(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, - int pat0, int pat1, int xorg, int yorg); - -extern _X_EXPORT void - -XAAFillColor8x8PatternRectsScreenOrigin(ScrnInfoPtr pScrn, - int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, - int xorigin, int yorigin, - XAACacheInfoPtr pCache); - -extern _X_EXPORT void - -XAAFillColor8x8PatternRects(ScrnInfoPtr pScrn, - int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, - int xorigin, int yorigin, XAACacheInfoPtr pCache); - -extern _X_EXPORT void - -XAAFillCacheBltRects(ScrnInfoPtr pScrn, - int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, int xorg, int yorg, XAACacheInfoPtr pCache); - -extern _X_EXPORT void - -XAAFillCacheExpandRects(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, int xorg, int yorg, PixmapPtr pPix); - -extern _X_EXPORT void - -XAAFillImageWriteRects(ScrnInfoPtr pScrn, - int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, int xorg, int yorg, PixmapPtr pPix); - -extern _X_EXPORT void - -XAAPolyFillRect(DrawablePtr pDraw, - GCPtr pGC, int nrectFill, xRectangle *prectInit); - -extern _X_EXPORT void - -XAATEGlyphRendererMSBFirstFixedBase(ScrnInfoPtr pScrn, - int x, int y, int w, int h, int skipleft, - int startline, unsigned int **glyphs, - int glyphWidth, int fg, int bg, int rop, - unsigned planemask); - -extern _X_EXPORT void - -XAATEGlyphRenderer3MSBFirstFixedBase(ScrnInfoPtr pScrn, - int x, int y, int w, int h, int skipleft, - int startline, unsigned int **glyphs, - int glyphWidth, int fg, int bg, int rop, - unsigned planemask); - -extern _X_EXPORT void - -XAATEGlyphRendererMSBFirst(ScrnInfoPtr pScrn, - int x, int y, int w, int h, int skipleft, - int startline, unsigned int **glyphs, int glyphWidth, - int fg, int bg, int rop, unsigned planemask); - -extern _X_EXPORT void - -XAATEGlyphRenderer3MSBFirst(ScrnInfoPtr pScrn, - int x, int y, int w, int h, int skipleft, - int startline, unsigned int **glyphs, - int glyphWidth, int fg, int bg, int rop, - unsigned planemask); - -extern _X_EXPORT void - -XAATEGlyphRendererLSBFirstFixedBase(ScrnInfoPtr pScrn, - int x, int y, int w, int h, int skipleft, - int startline, unsigned int **glyphs, - int glyphWidth, int fg, int bg, int rop, - unsigned planemask); - -extern _X_EXPORT void - -XAATEGlyphRenderer3LSBFirstFixedBase(ScrnInfoPtr pScrn, - int x, int y, int w, int h, int skipleft, - int startline, unsigned int **glyphs, - int glyphWidth, int fg, int bg, int rop, - unsigned planemask); - -extern _X_EXPORT void - -XAATEGlyphRendererLSBFirst(ScrnInfoPtr pScrn, - int x, int y, int w, int h, int skipleft, - int startline, unsigned int **glyphs, int glyphWidth, - int fg, int bg, int rop, unsigned planemask); - -extern _X_EXPORT void - -XAATEGlyphRenderer3LSBFirst(ScrnInfoPtr pScrn, - int x, int y, int w, int h, int skipleft, - int startline, unsigned int **glyphs, - int glyphWidth, int fg, int bg, int rop, - unsigned planemask); - -extern _X_EXPORT void - -XAATEGlyphRendererScanlineMSBFirst(ScrnInfoPtr pScrn, - int x, int y, int w, int h, int skipleft, - int startline, unsigned int **glyphs, - int glyphWidth, int fg, int bg, int rop, - unsigned planemask); - -extern _X_EXPORT void - -XAATEGlyphRendererScanline3MSBFirst(ScrnInfoPtr pScrn, - int x, int y, int w, int h, int skipleft, - int startline, unsigned int **glyphs, - int glyphWidth, int fg, int bg, int rop, - unsigned planemask); - -extern _X_EXPORT void - -XAATEGlyphRendererScanlineLSBFirst(ScrnInfoPtr pScrn, - int x, int y, int w, int h, int skipleft, - int startline, unsigned int **glyphs, - int glyphWidth, int fg, int bg, int rop, - unsigned planemask); - -extern _X_EXPORT void - -XAATEGlyphRendererScanline3LSBFirst(ScrnInfoPtr pScrn, - int x, int y, int w, int h, int skipleft, - int startline, unsigned int **glyphs, - int glyphWidth, int fg, int bg, int rop, - unsigned planemask); - -extern _X_EXPORT CARD32 *(*XAAGlyphScanlineFuncMSBFirstFixedBase[32]) (CARD32 - *base, - unsigned - int - **glyphp, - int line, - int - nglyph, - int - width); - -extern _X_EXPORT CARD32 *(*XAAGlyphScanlineFuncMSBFirst[32]) (CARD32 *base, - unsigned int - **glyphp, - int line, - int nglyph, - int width); - -extern _X_EXPORT CARD32 *(*XAAGlyphScanlineFuncLSBFirstFixedBase[32]) (CARD32 - *base, - unsigned - int - **glyphp, - int line, - int - nglyph, - int - width); - -extern _X_EXPORT CARD32 *(*XAAGlyphScanlineFuncLSBFirst[32]) (CARD32 *base, - unsigned int - **glyphp, - int line, - int nglyph, - int width); - -extern _X_EXPORT GlyphScanlineFuncPtr - *XAAGetGlyphScanlineFuncMSBFirstFixedBase(void); -extern _X_EXPORT GlyphScanlineFuncPtr *XAAGetGlyphScanlineFuncMSBFirst(void); -extern _X_EXPORT GlyphScanlineFuncPtr - *XAAGetGlyphScanlineFuncLSBFirstFixedBase(void); -extern _X_EXPORT GlyphScanlineFuncPtr *XAAGetGlyphScanlineFuncLSBFirst(void); - -extern _X_EXPORT void - -XAAFillColorExpandRectsLSBFirst(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, - int xorg, int yorg, PixmapPtr pPix); - -extern _X_EXPORT void - -XAAFillColorExpandRects3LSBFirst(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, - int xorg, int yorg, PixmapPtr pPix); - -extern _X_EXPORT void - -XAAFillColorExpandRectsLSBFirstFixedBase(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, - int xorg, int yorg, PixmapPtr pPix); - -extern _X_EXPORT void - -XAAFillColorExpandRects3LSBFirstFixedBase(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, - int xorg, int yorg, PixmapPtr pPix); - -extern _X_EXPORT void - -XAAFillColorExpandRectsMSBFirst(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, - int xorg, int yorg, PixmapPtr pPix); - -extern _X_EXPORT void - -XAAFillColorExpandRects3MSBFirst(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, - int xorg, int yorg, PixmapPtr pPix); - -extern _X_EXPORT void - -XAAFillColorExpandRectsMSBFirstFixedBase(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, - int xorg, int yorg, PixmapPtr pPix); - -extern _X_EXPORT void - -XAAFillColorExpandRects3MSBFirstFixedBase(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, - int xorg, int yorg, PixmapPtr pPix); - -extern _X_EXPORT void - -XAAFillScanlineColorExpandRectsLSBFirst(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, - int xorg, int yorg, PixmapPtr pPix); - -extern _X_EXPORT void - -XAAFillScanlineColorExpandRects3LSBFirst(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, - int xorg, int yorg, PixmapPtr pPix); - -extern _X_EXPORT void - -XAAFillScanlineColorExpandRectsMSBFirst(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, - int xorg, int yorg, PixmapPtr pPix); - -extern _X_EXPORT void - -XAAFillScanlineColorExpandRects3MSBFirst(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int nBox, - BoxPtr pBox, - int xorg, int yorg, PixmapPtr pPix); - -extern _X_EXPORT void - -XAAFillColorExpandSpansLSBFirst(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int n, - DDXPointPtr ppt, - int *pwidth, - int fSorted, - int xorg, int yorg, PixmapPtr pPix); - -extern _X_EXPORT void - -XAAFillColorExpandSpans3LSBFirst(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int n, - DDXPointPtr ppt, - int *pwidth, - int fSorted, - int xorg, int yorg, PixmapPtr pPix); - -extern _X_EXPORT void - -XAAFillColorExpandSpansLSBFirstFixedBase(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int n, - DDXPointPtr ppt, - int *pwidth, - int fSorted, - int xorg, int yorg, PixmapPtr pPix); - -extern _X_EXPORT void - -XAAFillColorExpandSpans3LSBFirstFixedBase(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int n, - DDXPointPtr ppt, - int *pwidth, - int fSorted, - int xorg, int yorg, PixmapPtr pPix); - -extern _X_EXPORT void - -XAAFillColorExpandSpansMSBFirst(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int n, - DDXPointPtr ppt, - int *pwidth, - int fSorted, - int xorg, int yorg, PixmapPtr pPix); - -extern _X_EXPORT void - -XAAFillColorExpandSpans3MSBFirst(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int n, - DDXPointPtr ppt, - int *pwidth, - int fSorted, - int xorg, int yorg, PixmapPtr pPix); - -extern _X_EXPORT void - -XAAFillColorExpandSpansMSBFirstFixedBase(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int n, - DDXPointPtr ppt, - int *pwidth, - int fSorted, - int xorg, int yorg, PixmapPtr pPix); - -extern _X_EXPORT void - -XAAFillColorExpandSpans3MSBFirstFixedBase(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int n, - DDXPointPtr ppt, - int *pwidth, - int fSorted, - int xorg, int yorg, PixmapPtr pPix); - -extern _X_EXPORT void - -XAAFillScanlineColorExpandSpansLSBFirst(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int n, - DDXPointPtr ppt, - int *pwidth, - int fSorted, - int xorg, int yorg, PixmapPtr pPix); - -extern _X_EXPORT void - -XAAFillScanlineColorExpandSpans3LSBFirst(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int n, - DDXPointPtr ppt, - int *pwidth, - int fSorted, - int xorg, int yorg, PixmapPtr pPix); - -extern _X_EXPORT void - -XAAPutImage(DrawablePtr pDraw, - GCPtr pGC, - int depth, - int x, int y, int w, int h, int leftPad, int format, char *pImage); - -extern _X_EXPORT void - -XAAFillScanlineColorExpandSpansMSBFirst(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int n, - DDXPointPtr ppt, - int *pwidth, - int fSorted, - int xorg, int yorg, PixmapPtr pPix); - -extern _X_EXPORT void - -XAAFillScanlineColorExpandSpans3MSBFirst(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int n, - DDXPointPtr ppt, - int *pwidth, - int fSorted, - int xorg, int yorg, PixmapPtr pPix); - -extern _X_EXPORT CARD32 *(*XAAStippleScanlineFuncMSBFirstFixedBase[6]) (CARD32 - *base, - CARD32 - *src, - int - offset, - int - width, - int - dwords); - -extern _X_EXPORT CARD32 *(*XAAStippleScanlineFuncMSBFirst[6]) (CARD32 *base, - CARD32 *src, - int offset, - int width, - int dwords); - -extern _X_EXPORT CARD32 *(*XAAStippleScanlineFuncLSBFirstFixedBase[6]) (CARD32 - *base, - CARD32 - *src, - int - offset, - int - width, - int - dwords); - -extern _X_EXPORT CARD32 *(*XAAStippleScanlineFuncLSBFirst[6]) (CARD32 *base, - CARD32 *src, - int offset, - int width, - int dwords); - -extern _X_EXPORT StippleScanlineProcPtr - *XAAGetStippleScanlineFuncMSBFirstFixedBase(void); -extern _X_EXPORT StippleScanlineProcPtr - *XAAGetStippleScanlineFuncMSBFirst(void); -extern _X_EXPORT StippleScanlineProcPtr - *XAAGetStippleScanlineFuncLSBFirstFixedBase(void); -extern _X_EXPORT StippleScanlineProcPtr - *XAAGetStippleScanlineFuncLSBFirst(void); -extern _X_EXPORT StippleScanlineProcPtr - *XAAGetStippleScanlineFunc3MSBFirstFixedBase(void); -extern _X_EXPORT StippleScanlineProcPtr - *XAAGetStippleScanlineFunc3MSBFirst(void); -extern _X_EXPORT StippleScanlineProcPtr - *XAAGetStippleScanlineFunc3LSBFirstFixedBase(void); -extern _X_EXPORT StippleScanlineProcPtr - *XAAGetStippleScanlineFunc3LSBFirst(void); - -extern _X_EXPORT int - -XAAPolyText8TEColorExpansion(DrawablePtr pDraw, - GCPtr pGC, int x, int y, int count, char *chars); - -extern _X_EXPORT int - -XAAPolyText16TEColorExpansion(DrawablePtr pDraw, - GCPtr pGC, - int x, int y, int count, unsigned short *chars); - -extern _X_EXPORT void - -XAAImageText8TEColorExpansion(DrawablePtr pDraw, - GCPtr pGC, int x, int y, int count, char *chars); - -extern _X_EXPORT void - -XAAImageText16TEColorExpansion(DrawablePtr pDraw, - GCPtr pGC, - int x, int y, int count, unsigned short *chars); - -extern _X_EXPORT void - -XAAImageGlyphBltTEColorExpansion(DrawablePtr pDrawable, - GCPtr pGC, - int xInit, int yInit, - unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase); - -extern _X_EXPORT void - -XAAPolyGlyphBltTEColorExpansion(DrawablePtr pDrawable, - GCPtr pGC, - int xInit, int yInit, - unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase); - -extern _X_EXPORT int - -XAAPolyText8NonTEColorExpansion(DrawablePtr pDraw, - GCPtr pGC, - int x, int y, int count, char *chars); - -extern _X_EXPORT int - -XAAPolyText16NonTEColorExpansion(DrawablePtr pDraw, - GCPtr pGC, - int x, int y, - int count, unsigned short *chars); - -extern _X_EXPORT void - -XAAImageText8NonTEColorExpansion(DrawablePtr pDraw, - GCPtr pGC, - int x, int y, int count, char *chars); - -extern _X_EXPORT void - -XAAImageText16NonTEColorExpansion(DrawablePtr pDraw, - GCPtr pGC, - int x, int y, - int count, unsigned short *chars); - -extern _X_EXPORT void - -XAAImageGlyphBltNonTEColorExpansion(DrawablePtr pDrawable, - GCPtr pGC, - int xInit, int yInit, - unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase); - -extern _X_EXPORT void - -XAAPolyGlyphBltNonTEColorExpansion(DrawablePtr pDrawable, - GCPtr pGC, - int xInit, int yInit, - unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase); - -extern _X_EXPORT void XAANonTEGlyphRenderer(ScrnInfoPtr pScrn, - int x, int y, int n, - NonTEGlyphPtr glyphs, - BoxPtr pbox, - int fg, int rop, - unsigned int planemask); - -extern _X_EXPORT void - -XAAFillSolidSpans(ScrnInfoPtr pScrn, - int fg, int rop, - unsigned int planemask, - int n, DDXPointPtr ppt, int *pwidth, int fSorted); - -extern _X_EXPORT void - -XAAFillMono8x8PatternSpans(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int n, - DDXPointPtr ppt, - int *pwidth, int fSorted, - int patx, int paty, int xorg, int yorg); - -extern _X_EXPORT void - -XAAFillMono8x8PatternSpansScreenOrigin(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int n, - DDXPointPtr ppt, - int *pwidth, int fSorted, - int patx, int paty, int xorg, int yorg); - -extern _X_EXPORT void - -XAAFillColor8x8PatternSpansScreenOrigin(ScrnInfoPtr pScrn, - int rop, - unsigned int planemask, - int n, - DDXPointPtr ppt, - int *pwidth, int fSorted, - XAACacheInfoPtr, - int xorigin, int yorigin); - -extern _X_EXPORT void - -XAAFillColor8x8PatternSpans(ScrnInfoPtr pScrn, - int rop, - unsigned int planemask, - int n, - DDXPointPtr ppt, - int *pwidth, int fSorted, - XAACacheInfoPtr, int xorigin, int yorigin); - -extern _X_EXPORT void - -XAAFillCacheBltSpans(ScrnInfoPtr pScrn, - int rop, - unsigned int planemask, - int n, - DDXPointPtr points, - int *widths, - int fSorted, XAACacheInfoPtr pCache, int xorg, int yorg); - -extern _X_EXPORT void - -XAAFillCacheExpandSpans(ScrnInfoPtr pScrn, - int fg, int bg, int rop, - unsigned int planemask, - int n, - DDXPointPtr ppt, - int *pwidth, - int fSorted, int xorg, int yorg, PixmapPtr pPix); - -extern _X_EXPORT void - -XAAFillSpans(DrawablePtr pDrawable, - GC * pGC, - int nInit, DDXPointPtr pptInit, int *pwidth, int fSorted); - -extern _X_EXPORT void - XAAInitPixmapCache(ScreenPtr pScreen, RegionPtr areas, pointer data); - -extern _X_EXPORT void - -XAAWriteBitmapToCache(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, int srcwidth, int fg, int bg); - -extern _X_EXPORT void - -XAAWriteBitmapToCacheLinear(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, int srcwidth, int fg, int bg); - -extern _X_EXPORT void - -XAAWritePixmapToCache(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, int srcwidth, int bpp, int depth); - -extern _X_EXPORT void - -XAAWritePixmapToCacheLinear(ScrnInfoPtr pScrn, - int x, int y, int w, int h, - unsigned char *src, - int srcwidth, int bpp, int depth); - -extern _X_EXPORT void - XAASolidHorVertLineAsRects(ScrnInfoPtr pScrn, int x, int y, int len, int dir); - -extern _X_EXPORT void - -XAASolidHorVertLineAsTwoPoint(ScrnInfoPtr pScrn, - int x, int y, int len, int dir); - -extern _X_EXPORT void - -XAASolidHorVertLineAsBresenham(ScrnInfoPtr pScrn, - int x, int y, int len, int dir); - -extern _X_EXPORT void - -XAAPolyRectangleThinSolid(DrawablePtr pDrawable, - GCPtr pGC, int nRectsInit, xRectangle *pRectsInit); - -extern _X_EXPORT void - -XAAPolylinesWideSolid(DrawablePtr pDrawable, - GCPtr pGC, int mode, int npt, DDXPointPtr pPts); - -extern _X_EXPORT void - -XAAFillPolygonSolid(DrawablePtr pDrawable, - GCPtr pGC, - int shape, int mode, int count, DDXPointPtr ptsIn); - -extern _X_EXPORT void - -XAAFillPolygonStippled(DrawablePtr pDrawable, - GCPtr pGC, - int shape, int mode, int count, DDXPointPtr ptsIn); - -extern _X_EXPORT void - -XAAFillPolygonTiled(DrawablePtr pDrawable, - GCPtr pGC, - int shape, int mode, int count, DDXPointPtr ptsIn); - -extern _X_EXPORT int - -XAAIsEasyPolygon(DDXPointPtr ptsIn, - int count, - BoxPtr extents, - int origin, - DDXPointPtr * topPoint, int *topY, int *bottomY, int shape); - -extern _X_EXPORT void - -XAAFillPolygonHelper(ScrnInfoPtr pScrn, - DDXPointPtr ptsIn, - int count, - DDXPointPtr topPoint, - int y, - int maxy, - int origin, - RectFuncPtr RectFunc, - TrapFuncPtr TrapFunc, - int xorg, int yorg, XAACacheInfoPtr pCache); - -extern _X_EXPORT void - XAAPolySegment(DrawablePtr pDrawable, GCPtr pGC, int nseg, xSegment * pSeg); - -extern _X_EXPORT void - -XAAPolyLines(DrawablePtr pDrawable, - GCPtr pGC, int mode, int npt, DDXPointPtr pptInit); - -extern _X_EXPORT void - -XAAPolySegmentDashed(DrawablePtr pDrawable, - GCPtr pGC, int nseg, xSegment * pSeg); - -extern _X_EXPORT void - -XAAPolyLinesDashed(DrawablePtr pDrawable, - GCPtr pGC, int mode, int npt, DDXPointPtr pptInit); - -extern _X_EXPORT void - XAAWriteMono8x8PatternToCache(ScrnInfoPtr pScrn, XAACacheInfoPtr pCache); - -extern _X_EXPORT void - -XAAWriteColor8x8PatternToCache(ScrnInfoPtr pScrn, - PixmapPtr pPix, XAACacheInfoPtr pCache); - -extern _X_EXPORT void - -XAARotateMonoPattern(int *pat0, int *pat1, - int xoffset, int yoffset, Bool msbfirst); - -extern _X_EXPORT void XAAComputeDash(GCPtr pGC); - -extern _X_EXPORT void XAAMoveDWORDS_FixedBase(register CARD32 *dest, - register CARD32 *src, - register int dwords); - -extern _X_EXPORT void XAAMoveDWORDS_FixedSrc(register CARD32 *dest, - register CARD32 *src, - register int dwords); - -extern _X_EXPORT void XAAMoveDWORDS(register CARD32 *dest, - register CARD32 *src, register int dwords); - -extern _X_EXPORT int - -XAAGetRectClipBoxes(GCPtr pGC, - BoxPtr pboxClippedBase, - int nrectFill, xRectangle *prectInit); - -extern _X_EXPORT void - XAASetupOverlay8_32Planar(ScreenPtr); - -extern _X_EXPORT void - XAAPolyFillArcSolid(DrawablePtr pDraw, GCPtr pGC, int narcs, xArc * parcs); - -extern _X_EXPORT XAACacheInfoPtr XAACacheTile(ScrnInfoPtr Scrn, PixmapPtr pPix); - -extern _X_EXPORT XAACacheInfoPtr -XAACacheMonoStipple(ScrnInfoPtr Scrn, PixmapPtr pPix); - -extern _X_EXPORT XAACacheInfoPtr -XAACachePlanarMonoStipple(ScrnInfoPtr Scrn, PixmapPtr pPix); - -typedef XAACacheInfoPtr(*XAACachePlanarMonoStippleProc) (ScrnInfoPtr, - PixmapPtr); -extern _X_EXPORT XAACachePlanarMonoStippleProc -XAAGetCachePlanarMonoStipple(void); - -extern _X_EXPORT XAACacheInfoPtr -XAACacheStipple(ScrnInfoPtr Scrn, PixmapPtr pPix, int fg, int bg); - -extern _X_EXPORT XAACacheInfoPtr -XAACacheMono8x8Pattern(ScrnInfoPtr Scrn, int pat0, int pat1); - -extern _X_EXPORT XAACacheInfoPtr -XAACacheColor8x8Pattern(ScrnInfoPtr Scrn, PixmapPtr pPix, int fg, int bg); - -extern _X_EXPORT void - XAATileCache(ScrnInfoPtr pScrn, XAACacheInfoPtr pCache, int w, int h); - -extern _X_EXPORT void XAAClosePixmapCache(ScreenPtr pScreen); -void XAAInvalidatePixmapCache(ScreenPtr pScreen); - -extern _X_EXPORT Bool XAACheckStippleReducibility(PixmapPtr pPixmap); -extern _X_EXPORT Bool XAACheckTileReducibility(PixmapPtr pPixmap, - Bool checkMono); - -extern _X_EXPORT int XAAStippledFillChooser(GCPtr pGC); -extern _X_EXPORT int XAAOpaqueStippledFillChooser(GCPtr pGC); -extern _X_EXPORT int XAATiledFillChooser(GCPtr pGC); - -extern _X_EXPORT void XAAMoveInOffscreenPixmaps(ScreenPtr pScreen); -extern _X_EXPORT void XAAMoveOutOffscreenPixmaps(ScreenPtr pScreen); -extern _X_EXPORT void XAARemoveAreaCallback(FBAreaPtr area); -extern _X_EXPORT void XAAMoveOutOffscreenPixmap(PixmapPtr pPix); -extern _X_EXPORT Bool XAAInitStateWrap(ScreenPtr pScreen, - XAAInfoRecPtr infoRec); - -extern _X_EXPORT void - -XAAComposite(CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height); - -extern _X_EXPORT Bool - -XAADoComposite(CARD8 op, - PicturePtr pSrc, - PicturePtr pMask, - PicturePtr pDst, - INT16 xSrc, - INT16 ySrc, - INT16 xMask, - INT16 yMask, - INT16 xDst, INT16 yDst, CARD16 width, CARD16 height); - -extern _X_EXPORT void - -XAAGlyphs(CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr * glyphs); - -extern _X_EXPORT Bool - -XAADoGlyphs(CARD8 op, - PicturePtr pSrc, - PicturePtr pDst, - PictFormatPtr maskFormat, - INT16 xSrc, - INT16 ySrc, int nlist, GlyphListPtr list, GlyphPtr * glyphs); - -/* helpers */ -extern _X_EXPORT void - XAA_888_plus_PICT_a8_to_8888(CARD32 color, CARD8 *alphaPtr, /* in bytes */ - int alphaPitch, CARD32 *dstPtr, int dstPitch, /* in dwords */ - int width, int height); - -extern _X_EXPORT Bool - -XAAGetRGBAFromPixel(CARD32 pixel, - CARD16 *red, - CARD16 *green, CARD16 *blue, CARD16 *alpha, CARD32 format); - -extern _X_EXPORT Bool - -XAAGetPixelFromRGBA(CARD32 *pixel, - CARD16 red, - CARD16 green, CARD16 blue, CARD16 alpha, CARD32 format); - -/* XXX should be static */ -extern _X_EXPORT GCOps XAAFallbackOps; -extern _X_EXPORT GCOps *XAAGetFallbackOps(void); -extern _X_EXPORT GCFuncs XAAGCFuncs; -extern _X_EXPORT DevPrivateKey XAAGetScreenKey(void); -extern _X_EXPORT DevPrivateKey XAAGetGCKey(void); -extern _X_EXPORT DevPrivateKey XAAGetPixmapKey(void); - -extern _X_EXPORT unsigned int XAAShiftMasks[32]; - -extern _X_EXPORT unsigned int byte_expand3[256], byte_reversed_expand3[256]; - -extern _X_EXPORT CARD32 XAAReverseBitOrder(CARD32 data); - -#define GET_XAASCREENPTR_FROM_SCREEN(pScreen)\ - dixLookupPrivate(&(pScreen)->devPrivates, XAAGetScreenKey()) - -#define GET_XAASCREENPTR_FROM_GC(pGC)\ - dixLookupPrivate(&(pGC)->pScreen->devPrivates, XAAGetScreenKey()) - -#define GET_XAASCREENPTR_FROM_DRAWABLE(pDraw)\ - dixLookupPrivate(&(pDraw)->pScreen->devPrivates, XAAGetScreenKey()) - -#define GET_XAAINFORECPTR_FROM_SCREEN(pScreen)\ -((XAAScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, XAAGetScreenKey()))->AccelInfoRec - -#define GET_XAAINFORECPTR_FROM_GC(pGC)\ -((XAAScreenPtr)dixLookupPrivate(&(pGC)->pScreen->devPrivates, XAAGetScreenKey()))->AccelInfoRec - -#define GET_XAAINFORECPTR_FROM_DRAWABLE(pDraw)\ -((XAAScreenPtr)dixLookupPrivate(&(pDraw)->pScreen->devPrivates, XAAGetScreenKey()))->AccelInfoRec - -#define GET_XAAINFORECPTR_FROM_SCRNINFOPTR(pScrn)\ -((XAAScreenPtr)dixLookupPrivate(&(pScrn)->pScreen->devPrivates, XAAGetScreenKey()))->AccelInfoRec - -#define XAA_GET_PIXMAP_PRIVATE(pix)\ - (XAAPixmapPtr)dixLookupPrivate(&(pix)->devPrivates, XAAGetPixmapKey()) - -#define CHECK_RGB_EQUAL(c) (!((((c) >> 8) ^ (c)) & 0xffff)) - -#define CHECK_FG(pGC, flags) \ - (!(flags & RGB_EQUAL) || CHECK_RGB_EQUAL(pGC->fgPixel)) - -#define CHECK_BG(pGC, flags) \ - (!(flags & RGB_EQUAL) || CHECK_RGB_EQUAL(pGC->bgPixel)) - -#define CHECK_ROP(pGC, flags) \ - (!(flags & GXCOPY_ONLY) || (pGC->alu == GXcopy)) - -#define CHECK_ROPSRC(pGC, flags) \ - (!(flags & ROP_NEEDS_SOURCE) || ((pGC->alu != GXclear) && \ - (pGC->alu != GXnoop) && (pGC->alu != GXinvert) && \ - (pGC->alu != GXset))) - -#define CHECK_PLANEMASK(pGC, flags) \ - (!(flags & NO_PLANEMASK) || \ - ((pGC->planemask & infoRec->FullPlanemasks[pGC->depth - 1]) == \ - infoRec->FullPlanemasks[pGC->depth - 1])) - -#define CHECK_COLORS(pGC, flags) \ - (!(flags & RGB_EQUAL) || \ - (CHECK_RGB_EQUAL(pGC->fgPixel) && CHECK_RGB_EQUAL(pGC->bgPixel))) - -#define CHECK_NO_GXCOPY(pGC, flags) \ - ((pGC->alu != GXcopy) || !(flags & NO_GXCOPY) || \ - ((pGC->planemask & infoRec->FullPlanemask) != infoRec->FullPlanemask)) - -#define IS_OFFSCREEN_PIXMAP(pPix)\ - ((XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pPix)))->offscreenArea) - -#define PIXMAP_IS_SHARED(pPix)\ - ((XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pPix)))->flags & SHARED_PIXMAP) - -#define OFFSCREEN_PIXMAP_LOCKED(pPix)\ - ((XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pPix)))->flags & LOCKED_PIXMAP) - -#define XAA_DEPTH_BUG(pGC) \ - ((pGC->depth == 32) && (pGC->bgPixel == 0xffffffff)) - -#define DELIST_OFFSCREEN_PIXMAP(pPix) { \ - PixmapLinkPtr _pLink, _prev; \ - _pLink = infoRec->OffscreenPixmaps; \ - _prev = NULL; \ - while(_pLink) { \ - if(_pLink->pPix == pPix) { \ - if(_prev) _prev->next = _pLink->next; \ - else infoRec->OffscreenPixmaps = _pLink->next; \ - free(_pLink); \ - break; \ - } \ - _prev = _pLink; \ - _pLink = _pLink->next; \ - }} - -#define SWAP_BITS_IN_BYTES(v) \ - (((0x01010101 & (v)) << 7) | ((0x02020202 & (v)) << 5) | \ - ((0x04040404 & (v)) << 3) | ((0x08080808 & (v)) << 1) | \ - ((0x10101010 & (v)) >> 1) | ((0x20202020 & (v)) >> 3) | \ - ((0x40404040 & (v)) >> 5) | ((0x80808080 & (v)) >> 7)) - -/* - * Moved XAAPixmapCachePrivate here from xaaPCache.c, since driver - * replacements for CacheMonoStipple need access to it - */ - -typedef struct { - int Num512x512; - int Current512; - XAACacheInfoPtr Info512; - int Num256x256; - int Current256; - XAACacheInfoPtr Info256; - int Num128x128; - int Current128; - XAACacheInfoPtr Info128; - int NumMono; - int CurrentMono; - XAACacheInfoPtr InfoMono; - int NumColor; - int CurrentColor; - XAACacheInfoPtr InfoColor; - int NumPartial; - int CurrentPartial; - XAACacheInfoPtr InfoPartial; - DDXPointRec MonoOffsets[64]; - DDXPointRec ColorOffsets[64]; -} XAAPixmapCachePrivate, *XAAPixmapCachePrivatePtr; - -#endif /* _XAALOCAL_H */ diff --git a/xserver/hw/xfree86/xaa/xaawrap.h b/xserver/hw/xfree86/xaa/xaawrap.h deleted file mode 100644 index 2d2d7881a..000000000 --- a/xserver/hw/xfree86/xaa/xaawrap.h +++ /dev/null @@ -1,75 +0,0 @@ - -#define XAA_SCREEN_PROLOGUE(pScreen, field)\ - ((pScreen)->field = \ - ((XAAScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, XAAGetScreenKey()))->field) - -#define XAA_SCREEN_EPILOGUE(pScreen, field, wrapper)\ - ((pScreen)->field = wrapper) - -#define XAA_GC_FUNC_PROLOGUE(pGC)\ - XAAGCPtr pGCPriv = (XAAGCPtr)dixLookupPrivate(&(pGC)->devPrivates, XAAGetGCKey()); \ - (pGC)->funcs = pGCPriv->wrapFuncs;\ - if(pGCPriv->flags)\ - (pGC)->ops = pGCPriv->wrapOps - -#define XAA_GC_FUNC_EPILOGUE(pGC)\ - pGCPriv->wrapFuncs = (pGC)->funcs;\ - (pGC)->funcs = &XAAGCFuncs;\ - if(pGCPriv->flags) {\ - pGCPriv->wrapOps = (pGC)->ops;\ - (pGC)->ops = (pGCPriv->flags & OPS_ARE_ACCEL) ? pGCPriv->XAAOps :\ - &XAAPixmapOps;\ - } - -#define XAA_GC_OP_PROLOGUE(pGC)\ - XAAGCPtr pGCPriv = (XAAGCPtr)dixLookupPrivate(&(pGC)->devPrivates, XAAGetGCKey()); \ - GCFuncs *oldFuncs = pGC->funcs;\ - pGC->funcs = pGCPriv->wrapFuncs;\ - pGC->ops = pGCPriv->wrapOps - -#define XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC)\ - XAAGCPtr pGCPriv = (XAAGCPtr)dixLookupPrivate(&(pGC)->devPrivates, XAAGetGCKey()); \ - GCFuncs *oldFuncs = pGC->funcs;\ - if(!RegionNumRects(pGC->pCompositeClip)) return; \ - pGC->funcs = pGCPriv->wrapFuncs;\ - pGC->ops = pGCPriv->wrapOps - -#define XAA_GC_OP_EPILOGUE(pGC)\ - pGCPriv->wrapOps = pGC->ops;\ - pGC->funcs = oldFuncs;\ - pGC->ops = pGCPriv->XAAOps - -#define XAA_PIXMAP_OP_PROLOGUE(pGC, pDraw)\ - XAAGCPtr pGCPriv = (XAAGCPtr)dixLookupPrivate(&(pGC)->devPrivates, XAAGetGCKey()); \ - XAAPixmapPtr pixPriv = XAA_GET_PIXMAP_PRIVATE((PixmapPtr)(pDraw));\ - GCFuncs *oldFuncs = pGC->funcs;\ - pGC->funcs = pGCPriv->wrapFuncs;\ - pGC->ops = pGCPriv->wrapOps; \ - SYNC_CHECK(pGC) - -#define XAA_PIXMAP_OP_EPILOGUE(pGC)\ - pGCPriv->wrapOps = pGC->ops;\ - pGC->funcs = oldFuncs;\ - pGC->ops = &XAAPixmapOps;\ - pixPriv->flags |= DIRTY - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#define XAA_RENDER_PROLOGUE(pScreen,field)\ - (GetPictureScreen(pScreen)->field = \ - ((XAAScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, XAAGetScreenKey()))->field) - -#define XAA_RENDER_EPILOGUE(pScreen, field, wrapper)\ - (GetPictureScreen(pScreen)->field = wrapper) - -/* This also works fine for drawables */ - -#define SYNC_CHECK(pGC) {\ - XAAInfoRecPtr infoRec =\ -((XAAScreenPtr)dixLookupPrivate(&(pGC)->pScreen->devPrivates, XAAGetScreenKey()))->AccelInfoRec; \ - if(infoRec->NeedToSync) {\ - (*infoRec->Sync)(infoRec->pScrn);\ - infoRec->NeedToSync = FALSE;\ - }} diff --git a/xserver/hw/xnest/Init.c b/xserver/hw/xnest/Init.c index 0909826d9..330b8ca17 100644 --- a/xserver/hw/xnest/Init.c +++ b/xserver/hw/xnest/Init.c @@ -142,7 +142,7 @@ OsVendorInit(void) } void -OsVendorFatalError(void) +OsVendorFatalError(const char *f, va_list args) { return; } diff --git a/xserver/hw/xnest/Makefile.am b/xserver/hw/xnest/Makefile.am index c395b4dae..3c099cd6b 100644 --- a/xserver/hw/xnest/Makefile.am +++ b/xserver/hw/xnest/Makefile.am @@ -4,7 +4,6 @@ bin_PROGRAMS = Xnest noinst_LIBRARIES = libfbcmap.a AM_CFLAGS = -DHAVE_XNEST_CONFIG_H \ - -DNO_HW_ONLY_EXTS \ $(DIX_CFLAGS) \ $(XNESTMODULES_CFLAGS) diff --git a/xserver/hw/xnest/Makefile.in b/xserver/hw/xnest/Makefile.in index ce5d3bd95..1537068e5 100644 --- a/xserver/hw/xnest/Makefile.in +++ b/xserver/hw/xnest/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -242,13 +242,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -270,6 +266,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -294,6 +291,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -309,7 +307,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -411,6 +408,7 @@ XNEST_LIBS = \ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -513,7 +511,6 @@ top_srcdir = @top_srcdir@ SUBDIRS = man noinst_LIBRARIES = libfbcmap.a AM_CFLAGS = -DHAVE_XNEST_CONFIG_H \ - -DNO_HW_ONLY_EXTS \ $(DIX_CFLAGS) \ $(XNESTMODULES_CFLAGS) @@ -569,7 +566,7 @@ all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -594,9 +591,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/xnest/Screen.c b/xserver/hw/xnest/Screen.c index dd76cb801..58b5a1199 100644 --- a/xserver/hw/xnest/Screen.c +++ b/xserver/hw/xnest/Screen.c @@ -21,7 +21,6 @@ is" without express or implied warranty. #include "scrnintstr.h" #include "dix.h" #include "mi.h" -#include "mibstore.h" #include "micmap.h" #include "colormapst.h" #include "resource.h" @@ -129,7 +128,7 @@ static miPointerSpriteFuncRec xnestPointerSpriteFuncs = { }; Bool -xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]) +xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) { VisualPtr visuals; DepthPtr depths; @@ -309,8 +308,6 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]) pScreen->BlockHandler = (ScreenBlockHandlerProcPtr) NoopDDA; pScreen->WakeupHandler = (ScreenWakeupHandlerProcPtr) NoopDDA; - pScreen->blockData = NULL; - pScreen->wakeupData = NULL; miDCInitialize(pScreen, &xnestPointerCursorFuncs); /* init SW rendering */ PointPriv = dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey); @@ -409,7 +406,7 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]) } Bool -xnestCloseScreen(int index, ScreenPtr pScreen) +xnestCloseScreen(ScreenPtr pScreen) { int i; diff --git a/xserver/hw/xnest/Screen.h b/xserver/hw/xnest/Screen.h index 1d255d79b..17c514af7 100644 --- a/xserver/hw/xnest/Screen.h +++ b/xserver/hw/xnest/Screen.h @@ -19,7 +19,7 @@ extern Window xnestDefaultWindows[MAXSCREENS]; extern Window xnestScreenSaverWindows[MAXSCREENS]; ScreenPtr xnestScreen(Window window); -Bool xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]); -Bool xnestCloseScreen(int index, ScreenPtr pScreen); +Bool xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[]); +Bool xnestCloseScreen(ScreenPtr pScreen); #endif /* XNESTSCREEN_H */ diff --git a/xserver/hw/xnest/Visual.c b/xserver/hw/xnest/Visual.c index 63198ba4f..11673c44a 100644 --- a/xserver/hw/xnest/Visual.c +++ b/xserver/hw/xnest/Visual.c @@ -21,7 +21,6 @@ is" without express or implied warranty. #include "scrnintstr.h" #include "dix.h" #include "mi.h" -#include "mibstore.h" #include "Xnest.h" #include "Display.h" diff --git a/xserver/hw/xnest/man/Makefile.in b/xserver/hw/xnest/man/Makefile.in index fcb796a67..6ca4631ea 100644 --- a/xserver/hw/xnest/man/Makefile.in +++ b/xserver/hw/xnest/man/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -179,13 +179,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -207,6 +203,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -231,6 +228,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -246,7 +244,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -361,6 +358,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -480,7 +478,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/manpages.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/manpages.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -506,9 +504,9 @@ $(top_srcdir)/manpages.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/xquartz/GL/Makefile.in b/xserver/hw/xquartz/GL/Makefile.in index a899ce739..232d723bf 100644 --- a/xserver/hw/xquartz/GL/Makefile.in +++ b/xserver/hw/xquartz/GL/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -182,13 +182,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -210,6 +206,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -234,6 +231,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -249,7 +247,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -348,6 +345,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -469,7 +467,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -494,9 +492,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/xquartz/GL/capabilities.c b/xserver/hw/xquartz/GL/capabilities.c index 4702595f4..5573629fd 100644 --- a/xserver/hw/xquartz/GL/capabilities.c +++ b/xserver/hw/xquartz/GL/capabilities.c @@ -20,6 +20,10 @@ * DEALINGS IN THE SOFTWARE. */ +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + #include #include #include diff --git a/xserver/hw/xquartz/GL/indirect.c b/xserver/hw/xquartz/GL/indirect.c index d9dc2a15b..c4999b5ff 100644 --- a/xserver/hw/xquartz/GL/indirect.c +++ b/xserver/hw/xquartz/GL/indirect.c @@ -135,12 +135,20 @@ struct __GLXAquaDrawable { static __GLXcontext * __glXAquaScreenCreateContext(__GLXscreen *screen, __GLXconfig *conf, - __GLXcontext *baseShareContext) + __GLXcontext *baseShareContext, + unsigned num_attribs, + const uint32_t *attribs, + int *error) { __GLXAquaContext *context; __GLXAquaContext *shareContext = (__GLXAquaContext *)baseShareContext; CGLError gl_err; + /* Unused (for now?) */ + (void)num_attribs; + (void)attribs; + (void)error; + GLAQUA_DEBUG_MSG("glXAquaScreenCreateContext\n"); context = calloc(1, sizeof(__GLXAquaContext)); diff --git a/xserver/hw/xquartz/GL/visualConfigs.c b/xserver/hw/xquartz/GL/visualConfigs.c index e37eefbe4..03486cd66 100644 --- a/xserver/hw/xquartz/GL/visualConfigs.c +++ b/xserver/hw/xquartz/GL/visualConfigs.c @@ -58,40 +58,38 @@ #include "darwinfb.h" /* Based originally on code from indirect.c which was based on code from i830_dri.c. */ -__GLXconfig * -__glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber) -{ +__GLXconfig *__glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber) { int numConfigs = 0; __GLXconfig *visualConfigs, *c; struct glCapabilities caps; struct glCapabilitiesConfig *conf; int stereo, depth, aux, buffers, stencil, accum, color, msample; - if (getGlCapabilities(&caps)) { + if(getGlCapabilities(&caps)) { ErrorF("error from getGlCapabilities()!\n"); return NULL; } /* - conf->stereo is 0 or 1, but we need at least 1 iteration of the loop, - so we treat a true conf->stereo as 2. + conf->stereo is 0 or 1, but we need at least 1 iteration of the loop, + so we treat a true conf->stereo as 2. - The depth size is 0 or 24. Thus we do 2 iterations for that. + The depth size is 0 or 24. Thus we do 2 iterations for that. - conf->aux_buffers (when available/non-zero) result in 2 iterations instead of 1. + conf->aux_buffers (when available/non-zero) result in 2 iterations instead of 1. - conf->buffers indicates whether we have single or double buffering. + conf->buffers indicates whether we have single or double buffering. - conf->total_stencil_bit_depths + conf->total_stencil_bit_depths - conf->total_color_buffers indicates the RGB/RGBA color depths. + conf->total_color_buffers indicates the RGB/RGBA color depths. - conf->total_accum_buffers iterations for accum (with at least 1 if equal to 0) + conf->total_accum_buffers iterations for accum (with at least 1 if equal to 0) - conf->total_depth_buffer_depths + conf->total_depth_buffer_depths - conf->multisample_buffers iterations (with at least 1 if equal to 0). We add 1 - for the 0 multisampling config. + conf->multisample_buffers iterations (with at least 1 if equal to 0). We add 1 + for the 0 multisampling config. */ @@ -99,57 +97,43 @@ __glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber) numConfigs = 0; - for (conf = caps.configurations; conf; conf = conf->next) { - if (conf->total_color_buffers <= 0) + for(conf = caps.configurations; conf; conf = conf->next) { + if(conf->total_color_buffers <= 0) continue; numConfigs += (conf->stereo ? 2 : 1) - * (conf->aux_buffers ? 2 : 1) - * conf->buffers - * ((conf->total_stencil_bit_depths > - 0) ? conf->total_stencil_bit_depths : 1) - * conf->total_color_buffers - * ((conf->total_accum_buffers > - 0) ? conf->total_accum_buffers : 1) - * conf->total_depth_buffer_depths - * (conf->multisample_buffers + 1); + * (conf->aux_buffers ? 2 : 1) + * conf->buffers + * ((conf->total_stencil_bit_depths > 0) ? conf->total_stencil_bit_depths : 1) + * conf->total_color_buffers + * ((conf->total_accum_buffers > 0) ? conf->total_accum_buffers : 1) + * conf->total_depth_buffer_depths + * (conf->multisample_buffers + 1); } - if (numConfigsPtr) + if(numConfigsPtr) *numConfigsPtr = numConfigs; visualConfigs = calloc(sizeof(*visualConfigs), numConfigs); - if (NULL == visualConfigs) { + if(NULL == visualConfigs) { ErrorF("xcalloc failure when allocating visualConfigs\n"); freeGlCapabilities(&caps); return NULL; } c = visualConfigs; /* current buffer */ - for (conf = caps.configurations; conf; conf = conf->next) { - for (stereo = 0; stereo < (conf->stereo ? 2 : 1); ++stereo) { - for (aux = 0; aux < (conf->aux_buffers ? 2 : 1); ++aux) { - for (buffers = 0; buffers < conf->buffers; ++buffers) { - for (stencil = 0; - stencil < ((conf->total_stencil_bit_depths > 0) ? - conf-> - total_stencil_bit_depths : 1); - ++stencil) { - for (color = 0; color < conf->total_color_buffers; - ++color) { - for (accum = 0; - accum < ((conf->total_accum_buffers > 0) ? - conf-> - total_accum_buffers : 1); - ++accum) { - for (depth = 0; - depth < conf->total_depth_buffer_depths; - ++depth) { - for (msample = 0; - msample < - (conf->multisample_buffers + 1); - ++msample) { + for(conf = caps.configurations; conf; conf = conf->next) { + for(stereo = 0; stereo < (conf->stereo ? 2 : 1); ++stereo) { + for(aux = 0; aux < (conf->aux_buffers ? 2 : 1); ++aux) { + for(buffers = 0; buffers < conf->buffers; ++buffers) { + for(stencil = 0; stencil < ((conf->total_stencil_bit_depths > 0) ? + conf->total_stencil_bit_depths : 1); ++stencil) { + for(color = 0; color < conf->total_color_buffers; ++color) { + for(accum = 0; accum < ((conf->total_accum_buffers > 0) ? + conf->total_accum_buffers : 1); ++accum) { + for(depth = 0; depth < conf->total_depth_buffer_depths; ++depth) { + for(msample = 0; msample < (conf->multisample_buffers + 1); ++msample) { // Global c->visualID = -1; @@ -162,12 +146,10 @@ __glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber) c->indexBits = 0; c->pixmapMode = 0; // TODO: What should this be? - if (conf->accelerated) { + if(conf->accelerated) { c->visualRating = GLX_NONE; - } - else { - c->visualRating = - GLX_SLOW_VISUAL_EXT; + } else { + c->visualRating = GLX_SLOW_VISUAL_EXT; } c->transparentPixel = GLX_NONE; @@ -179,91 +161,52 @@ __glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber) c->visualSelectGroup = 0; - c->swapMethod = - GLX_SWAP_UNDEFINED_OML; + c->swapMethod = GLX_SWAP_UNDEFINED_OML; // Stereo c->stereoMode = stereo ? TRUE : FALSE; // Aux buffers - c->numAuxBuffers = - aux ? conf->aux_buffers : 0; + c->numAuxBuffers = aux ? conf->aux_buffers : 0; // Double Buffered - c->doubleBufferMode = - buffers ? TRUE : FALSE; + c->doubleBufferMode = buffers ? TRUE : FALSE; // Stencil Buffer - if (conf->total_stencil_bit_depths > - 0) { - c->stencilBits = - conf->stencil_bit_depths[ - stencil]; - } - else { + if(conf->total_stencil_bit_depths > 0) { + c->stencilBits = conf->stencil_bit_depths[stencil]; + } else { c->stencilBits = 0; } // Color - if (GLCAPS_COLOR_BUF_INVALID_VALUE != - conf->color_buffers[color].a) { - c->alphaBits = - conf->color_buffers[color].a; - } - else { + if(GLCAPS_COLOR_BUF_INVALID_VALUE != conf->color_buffers[color].a) { + c->alphaBits = conf->color_buffers[color].a; + } else { c->alphaBits = 0; } - c->redBits = - conf->color_buffers[color].r; - c->greenBits = - conf->color_buffers[color].g; - c->blueBits = - conf->color_buffers[color].b; + c->redBits = conf->color_buffers[color].r; + c->greenBits = conf->color_buffers[color].g; + c->blueBits = conf->color_buffers[color].b; - c->rgbBits = c->alphaBits + - c->redBits + - c->greenBits + - c->blueBits; + c->rgbBits = c->alphaBits + c->redBits + c->greenBits + c->blueBits; - c->alphaMask = - AM_ARGB(c->alphaBits, c->redBits, - c->greenBits, - c->blueBits); - c->redMask = - RM_ARGB(c->alphaBits, c->redBits, - c->greenBits, - c->blueBits); - c->greenMask = - GM_ARGB(c->alphaBits, c->redBits, - c->greenBits, - c->blueBits); - c->blueMask = - BM_ARGB(c->alphaBits, c->redBits, - c->greenBits, - c->blueBits); + c->alphaMask = AM_ARGB(c->alphaBits, c->redBits, c->greenBits, c->blueBits); + c->redMask = RM_ARGB(c->alphaBits, c->redBits, c->greenBits, c->blueBits); + c->greenMask = GM_ARGB(c->alphaBits, c->redBits, c->greenBits, c->blueBits); + c->blueMask = BM_ARGB(c->alphaBits, c->redBits, c->greenBits, c->blueBits); // Accumulation Buffers - if (conf->total_accum_buffers > 0) { - c->accumRedBits = - conf->accum_buffers[accum].r; - c->accumGreenBits = - conf->accum_buffers[accum].g; - c->accumBlueBits = - conf->accum_buffers[accum].b; - if ( - GLCAPS_COLOR_BUF_INVALID_VALUE - != - conf->accum_buffers[accum].a) - { - c->accumAlphaBits = - conf->accum_buffers[accum - ].a; - } - else { + if(conf->total_accum_buffers > 0) { + c->accumRedBits = conf->accum_buffers[accum].r; + c->accumGreenBits = conf->accum_buffers[accum].g; + c->accumBlueBits = conf->accum_buffers[accum].b; + if(GLCAPS_COLOR_BUF_INVALID_VALUE != conf->accum_buffers[accum].a) { + c->accumAlphaBits = conf->accum_buffers[accum].a; + } else { c->accumAlphaBits = 0; } - } - else { + } else { c->accumRedBits = 0; c->accumGreenBits = 0; c->accumBlueBits = 0; @@ -271,17 +214,13 @@ __glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber) } // Depth - c->depthBits = - conf->depth_buffers[depth]; + c->depthBits = conf->depth_buffers[depth]; // MultiSample - if (msample > 0) { - c->samples = - conf->multisample_samples; - c->sampleBuffers = - conf->multisample_buffers; - } - else { + if(msample > 0) { + c->samples = conf->multisample_samples; + c->sampleBuffers = conf->multisample_buffers; + } else { c->samples = 0; c->sampleBuffers = 0; } @@ -291,9 +230,7 @@ __glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber) * GLXPbuffers in direct mode. */ /* SGIX_fbconfig / GLX 1.3 */ - c->drawableType = GLX_WINDOW_BIT | - GLX_PIXMAP_BIT | - GLX_PBUFFER_BIT; + c->drawableType = GLX_WINDOW_BIT | GLX_PIXMAP_BIT | GLX_PBUFFER_BIT; c->renderType = GLX_RGBA_BIT; c->xRenderable = GL_TRUE; c->fbconfigID = -1; @@ -310,8 +247,7 @@ __glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber) */ c->maxPbufferWidth = 8192; c->maxPbufferHeight = 8192; - c->maxPbufferPixels = - /*Do we need this?*/ 0; + c->maxPbufferPixels = /*Do we need this?*/ 0; /* * There is no introspection for this sort of thing * with CGL. What should we do realistically? @@ -337,12 +273,10 @@ __glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber) } } - (c - 1)->next = NULL; + (c-1)->next = NULL; if (c - visualConfigs != numConfigs) { - FatalError( - "numConfigs calculation error in setVisualConfigs! numConfigs is %d i is %d\n", - numConfigs, (int)(c - visualConfigs)); + FatalError("numConfigs calculation error in setVisualConfigs! numConfigs is %d i is %d\n", numConfigs, (int)(c - visualConfigs)); } freeGlCapabilities(&caps); diff --git a/xserver/hw/xquartz/Makefile.in b/xserver/hw/xquartz/Makefile.in index 5b7b823eb..c2a60d8e6 100644 --- a/xserver/hw/xquartz/Makefile.in +++ b/xserver/hw/xquartz/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -237,13 +237,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -265,6 +261,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -289,6 +286,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -304,7 +302,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -403,6 +400,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -556,7 +554,7 @@ all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .m .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -581,9 +579,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/xquartz/X11Application.h b/xserver/hw/xquartz/X11Application.h index 740a8070a..87cba6dec 100644 --- a/xserver/hw/xquartz/X11Application.h +++ b/xserver/hw/xquartz/X11Application.h @@ -86,6 +86,9 @@ X11ApplicationLaunchClient(const char *cmd); Bool X11ApplicationCanEnterRandR(void); +void +X11ApplicationFatalError(const char *f, va_list args) __printflike(1, 0); + void X11ApplicationMain(int argc, char **argv, char **envp); diff --git a/xserver/hw/xquartz/X11Application.m b/xserver/hw/xquartz/X11Application.m index 339a93ff7..1f9b05dd1 100644 --- a/xserver/hw/xquartz/X11Application.m +++ b/xserver/hw/xquartz/X11Application.m @@ -72,6 +72,7 @@ static dispatch_queue_t eventTranslationQueue; extern Bool noTestExtensions; extern Bool noRenderExtension; +extern BOOL serverRunning; #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050 static TISInputSourceRef last_key_layout; @@ -1073,6 +1074,53 @@ X11ApplicationCanEnterRandR(void) } } +void +X11ApplicationFatalError(const char *f, va_list args) +{ +#ifdef HAVE_LIBDISPATCH + NSString *title, *msg; + char *error_msg; + + /* This is called by FatalError() in the server thread just before + * we would abort. If the server never got off the ground, We should + * inform the user of the error rather than letting the ever-so-friendly + * CrashReporter do it for us. + * + * This also has the benefit of forcing user interaction rather than + * allowing an infinite throttled-restart if the crash occurs before + * we can drain the launchd socket. + */ + + if (serverRunning) { + return; + } + + title = NSLocalizedString(@"The application X11 could not be opened.", + @"Dialog title when encountering a fatal error"); + msg = NSLocalizedString( + @"An error occurred while starting the X11 server: \"%s\"\n\nClick Quit to quit X11. Click Report to see more details or send a report to Apple.", + @"Dialog when encountering a fatal error"); + + vasprintf(&error_msg, f, args); + msg = [NSString stringWithFormat:msg, error_msg]; + + /* We want the AppKit thread to actually service the alert or we will race [NSApp run] and create an + * 'NSInternalInconsistencyException', reason: 'NSApp with wrong _running count' + */ + dispatch_sync(dispatch_get_main_queue(), ^{ + if (NSAlertDefaultReturn == + NSRunAlertPanel (title, msg, + NSLocalizedString (@"Quit", @""), + NSLocalizedString ( + @"Report...", @""), nil)) { + exit (EXIT_FAILURE); + } + }); + + /* fall back to caller to do the abort() in the DIX */ +#endif +} + static void check_xinitrc(void) { diff --git a/xserver/hw/xquartz/X11Controller.m b/xserver/hw/xquartz/X11Controller.m index 393bc1abe..737db42e7 100644 --- a/xserver/hw/xquartz/X11Controller.m +++ b/xserver/hw/xquartz/X11Controller.m @@ -53,6 +53,11 @@ #include #include #include +#include +#include + +extern aslclient aslc; +extern char *bundle_id_prefix; @implementation X11Controller @@ -342,9 +347,12 @@ const char *newargv[4]; char buf[128]; char *s; +#if 0 && MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 + int stdout_pipe[2]; + int stderr_pipe[2]; +#endif - newargv[0] = - [X11App prefs_get_string:@PREFS_LOGIN_SHELL default:"/bin/sh"]; + newargv[0] = [X11App prefs_get_string:@PREFS_LOGIN_SHELL default:"/bin/sh"]; newargv[1] = "-c"; newargv[2] = [filename UTF8String]; newargv[3] = NULL; @@ -355,6 +363,40 @@ setenv("DISPLAY", buf, TRUE); } +#if 0 && MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 + if (asl_log_descriptor) { + char *asl_sender; + aslmsg amsg = asl_new(ASL_TYPE_MSG); + assert(amsg); + + asprintf(&asl_sender, "%s.%s", bundle_id_prefix, newargv[2]); + assert(asl_sender); + for(s = asl_sender + strlen(bundle_id_prefix) + 1; *s; s++) { + if(! ((*s >= 'a' && *s <= 'z') || + (*s >= 'A' && *s <= 'Z') || + (*s >= '0' && *s <= '9'))) { + *s = '_'; + } + } + + (void)asl_set(amsg, ASL_KEY_SENDER, asl_sender); + free(asl_sender); + + assert(0 == pipe(stdout_pipe)); + fcntl(stdout_pipe[0], F_SETFD, FD_CLOEXEC); + fcntl(stdout_pipe[0], F_SETFL, O_NONBLOCK); + + assert(0 == pipe(stderr_pipe)); + fcntl(stderr_pipe[0], F_SETFD, FD_CLOEXEC); + fcntl(stderr_pipe[0], F_SETFL, O_NONBLOCK); + + asl_log_descriptor(aslc, amsg, ASL_LEVEL_INFO, stdout_pipe[0], ASL_LOG_DESCRIPTOR_READ); + asl_log_descriptor(aslc, amsg, ASL_LEVEL_NOTICE, stderr_pipe[0], ASL_LOG_DESCRIPTOR_READ); + + asl_free(amsg); + } +#endif + /* Do the fork-twice trick to avoid having to reap zombies */ child1 = fork(); switch (child1) { @@ -371,6 +413,14 @@ _exit(1); case 0: /* child2 */ +#if 0 && MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 + if (asl_log_descriptor) { + /* Replace our stdout/stderr */ + dup2(stdout_pipe[1], STDOUT_FILENO); + dup2(stderr_pipe[1], STDERR_FILENO); + } +#endif + /* close all open files except for standard streams */ max_files = sysconf(_SC_OPEN_MAX); for (i = 3; i < max_files; i++) @@ -391,6 +441,14 @@ default: /* parent */ waitpid(child1, &status, 0); } + +#if 0 && MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 + if (asl_log_descriptor) { + /* Close the write ends of the pipe */ + close(stdout_pipe[1]); + close(stderr_pipe[1]); + } +#endif } - (void) app_selected:sender diff --git a/xserver/hw/xquartz/applewm.c b/xserver/hw/xquartz/applewm.c index 81db13ea9..aea0a45f2 100644 --- a/xserver/hw/xquartz/applewm.c +++ b/xserver/hw/xquartz/applewm.c @@ -157,7 +157,7 @@ ProcAppleWMQueryVersion(register ClientPtr client) swaps(&rep.sequenceNumber); swapl(&rep.length); } - WriteToClient(client, sizeof(xAppleWMQueryVersionReply), (char *)&rep); + WriteToClient(client, sizeof(xAppleWMQueryVersionReply),&rep); return Success; } @@ -533,7 +533,7 @@ ProcAppleWMFrameGetRect(register ClientPtr client) rep.w = rr.x2 - rr.x1; rep.h = rr.y2 - rr.y1; - WriteToClient(client, sizeof(xAppleWMFrameGetRectReply), (char *)&rep); + WriteToClient(client, sizeof(xAppleWMFrameGetRectReply),&rep); return Success; } @@ -560,7 +560,7 @@ ProcAppleWMFrameHitTest(register ClientPtr client) rep.ret = ret; - WriteToClient(client, sizeof(xAppleWMFrameHitTestReply), (char *)&rep); + WriteToClient(client, sizeof(xAppleWMFrameHitTestReply),&rep); return Success; } @@ -612,7 +612,7 @@ ProcAppleWMDispatch(register ClientPtr client) return ProcAppleWMQueryVersion(client); } - if (!LocalClient(client)) + if (!client->local) return WMErrorBase + AppleWMClientNotLocal; switch (stuff->data) { @@ -684,7 +684,7 @@ SProcAppleWMDispatch(register ClientPtr client) REQUEST(xReq); /* It is bound to be non-local when there is byte swapping */ - if (!LocalClient(client)) + if (!client->local) return WMErrorBase + AppleWMClientNotLocal; /* only local clients are allowed WM access */ diff --git a/xserver/hw/xquartz/bundle/Info.plist.cpp b/xserver/hw/xquartz/bundle/Info.plist.cpp index 4b6d9d182..b0106c6da 100644 --- a/xserver/hw/xquartz/bundle/Info.plist.cpp +++ b/xserver/hw/xquartz/bundle/Info.plist.cpp @@ -19,13 +19,15 @@ CFBundlePackageType APPL CFBundleShortVersionString - 2.7.2 + 2.7.4 CFBundleVersion - 2.7.2 + 2.7.4 CFBundleSignature x11a CSResourcesFileMapped + NSSupportsAutomaticGraphicsSwitching + #ifdef XQUARTZ_SPARKLE SUEnableAutomaticChecks diff --git a/xserver/hw/xquartz/bundle/Makefile.in b/xserver/hw/xquartz/bundle/Makefile.in index 8fbd116ef..19cdada47 100644 --- a/xserver/hw/xquartz/bundle/Makefile.in +++ b/xserver/hw/xquartz/bundle/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -186,13 +186,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -214,6 +210,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -238,6 +235,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -253,7 +251,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -352,6 +349,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -630,7 +628,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .cpp -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/cpprules.in $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/cpprules.in $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -656,9 +654,9 @@ $(srcdir)/cpprules.in: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings b/xserver/hw/xquartz/bundle/Resources/English.lproj/Localizable.strings index bf2089ca1399c895dc701dfc23fa9bd44a1d8b8f..36ae0ffb3d2ed207a1a73be03bdc898c3306466f 100644 GIT binary patch delta 934 zcmd5*%}T>S5dKIBl!E9{DdLjS9s*7AsuT%=m!A9s54~s`O);h+iT{T@gYFaf21;+< zd;uRx{dSvR)RXoi%j|rcnVp^aX7X&k+Q$2vyfy5n_L6C$*;s5$dgiV%g|cVfOqQz; z)e2fdzARkJE2Hgt2rJHv|r_ z$|dqp0fxjOom1)~UKPXkB@ztdaS5F1?+OihRvl6qCOl93qx?dhz3QT>y;!R@%Wy2@U{+9Ln0!E>5&&!Y B4M6|^ diff --git a/xserver/hw/xquartz/console_redirect.c b/xserver/hw/xquartz/console_redirect.c index 91d693b67..8fdce4699 100644 --- a/xserver/hw/xquartz/console_redirect.c +++ b/xserver/hw/xquartz/console_redirect.c @@ -110,27 +110,33 @@ _read_redirect(int fd, int flush) /* Increment our returned number read */ total_read += nbytes; - nbytes += (aslr->w - aslr->buf); - aslr->buf[nbytes] = '\0'; + /* Increment our write location */ + aslr->w += nbytes; + aslr->w[0] = '\0'; /* One line at a time */ - for (p = aslr->buf; *p && (p - aslr->buf) < nbytes; p = s + 1) { + for (p = aslr->buf; p < aslr->w; p = s + 1) { // Find null or \n for (s = p; *s && *s != '\n'; s++) ; if (*s == '\n') { *s = '\0'; + } + + if (s < aslr->w || aslr->buf == p) { + /* Either the first of multiple messages or one message which is larger than our buffer */ asl_log(aslr->asl, aslr->msg, aslr->level, "%s", p); } - else if (aslr->buf != p) { + else { + /* We reached the end of the buffer, move this chunk to the start. */ memmove(aslr->buf, p, BUF_SIZE - (p - aslr->buf)); aslr->w = aslr->buf + (s - p); break; } - else if (nbytes == BUF_SIZE - 1) { - asl_log(aslr->asl, aslr->msg, aslr->level, "%s", p); - aslr->w = aslr->buf; - break; - } + } + + if (p == aslr->w) { + /* Start writing at the beginning in the case where we flushed */ + aslr->w = aslr->buf; } } @@ -359,8 +365,8 @@ xq_asl_log_fd(aslclient asl, aslmsg msg, int level, int fd) BLOCK_DONE; } redirect_fds = new_array; - memset(redirect_fds + n_redirect_fds, 0, new_n - - n_redirect_fds); + memset(redirect_fds + n_redirect_fds, 0, (new_n - + n_redirect_fds) * sizeof(*redirect_fds)); n_redirect_fds = new_n; } diff --git a/xserver/hw/xquartz/darwin.c b/xserver/hw/xquartz/darwin.c index 74e11feac..e0983d6ef 100644 --- a/xserver/hw/xquartz/darwin.c +++ b/xserver/hw/xquartz/darwin.c @@ -38,7 +38,6 @@ #include "servermd.h" #include "inputstr.h" #include "scrnintstr.h" -#include "mibstore.h" // mi backing store implementation #include "mipointer.h" // mi software cursor #include "micmap.h" // mi colormap code #include "fb.h" // fb framebuffer code @@ -78,6 +77,8 @@ #include "quartzKeyboard.h" #include "quartz.h" +#include "X11Application.h" + aslclient aslc; void @@ -191,7 +192,7 @@ DarwinSaveScreen(ScreenPtr pScreen, int on) * Initialize the screen and communicate information about it back to dix. */ static Bool -DarwinScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) +DarwinScreenInit(ScreenPtr pScreen, int argc, char **argv) { int dpi; static int foundIndex = 0; @@ -202,7 +203,7 @@ DarwinScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) return FALSE; // reset index of found screens for each server generation - if (index == 0) { + if (pScreen->myNum == 0) { foundIndex = 0; // reset the visual list @@ -229,13 +230,15 @@ DarwinScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) } // TODO: Make PseudoColor visuals not suck in TrueColor mode - // if(dfb->depth > 8) - // miSetVisualTypesAndMasks(8, PseudoColorMask, 8, PseudoColor, 0, 0, 0); - if (dfb->depth > 15) - miSetVisualTypesAndMasks(15, TrueColorMask, 5, TrueColor, - RM_ARGB(0, 5, 5, 5), GM_ARGB(0, 5, 5, - 5), - BM_ARGB(0, 5, 5, 5)); + // if(dfb->depth > 8) + // miSetVisualTypesAndMasks(8, PseudoColorMask, 8, PseudoColor, 0, 0, 0); + // + // TODO: Re-add support for 15bit + // if (dfb->depth > 15) + // miSetVisualTypesAndMasks(15, TrueColorMask, 5, TrueColor, + // RM_ARGB(0, 5, 5, 5), GM_ARGB(0, 5, 5, + // 5), + // BM_ARGB(0, 5, 5, 5)); if (dfb->depth > 24) miSetVisualTypesAndMasks(24, TrueColorMask, 8, TrueColor, RM_ARGB(0, 8, 8, 8), GM_ARGB(0, 8, 8, @@ -273,7 +276,7 @@ DarwinScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) pScreen->SaveScreen = DarwinSaveScreen; // finish mode dependent screen setup including cursor support - if (!QuartzSetupScreen(index, pScreen)) { + if (!QuartzSetupScreen(pScreen->myNum, pScreen)) { return FALSE; } @@ -670,9 +673,9 @@ InitOutput(ScreenInfo *pScreenInfo, int argc, char **argv) * OsVendorFatalError */ void -OsVendorFatalError(void) +OsVendorFatalError(const char *f, va_list args) { - ErrorF(" OsVendorFatalError\n"); + X11ApplicationFatalError(f, args); } /* diff --git a/xserver/hw/xquartz/mach-startup/Makefile.in b/xserver/hw/xquartz/mach-startup/Makefile.in index cacf4709d..e555e8a57 100644 --- a/xserver/hw/xquartz/mach-startup/Makefile.in +++ b/xserver/hw/xquartz/mach-startup/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -217,13 +217,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -245,6 +241,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -269,6 +266,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -284,7 +282,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -383,6 +380,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -545,7 +543,7 @@ all: $(BUILT_SOURCES) .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -570,9 +568,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) diff --git a/xserver/hw/xquartz/mach-startup/bundle-main.c b/xserver/hw/xquartz/mach-startup/bundle-main.c index cabdf1eab..b40366244 100644 --- a/xserver/hw/xquartz/mach-startup/bundle-main.c +++ b/xserver/hw/xquartz/mach-startup/bundle-main.c @@ -563,8 +563,25 @@ setup_console_redirect(const char *bundle_id) free(asl_facility); asl_set_filter(aslc, ASL_FILTER_MASK_UPTO(ASL_LEVEL_WARNING)); + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080 +# if MAC_OS_X_VERSION_MIN_REQUIRED < 1080 + if (asl_log_descriptor) +# endif + { + asl_log_descriptor(aslc, NULL, ASL_LEVEL_INFO, STDOUT_FILENO, ASL_LOG_DESCRIPTOR_WRITE); + asl_log_descriptor(aslc, NULL, ASL_LEVEL_NOTICE, STDERR_FILENO, ASL_LOG_DESCRIPTOR_WRITE); + } +# if MAC_OS_X_VERSION_MIN_REQUIRED < 1080 + else { + xq_asl_capture_fd(aslc, NULL, ASL_LEVEL_INFO, STDOUT_FILENO); + xq_asl_capture_fd(aslc, NULL, ASL_LEVEL_NOTICE, STDERR_FILENO); + } +# endif +#else xq_asl_capture_fd(aslc, NULL, ASL_LEVEL_INFO, STDOUT_FILENO); xq_asl_capture_fd(aslc, NULL, ASL_LEVEL_NOTICE, STDERR_FILENO); +#endif } static void diff --git a/xserver/hw/xquartz/man/Makefile.in b/xserver/hw/xquartz/man/Makefile.in index 793c1bb49..9c4715a1f 100644 --- a/xserver/hw/xquartz/man/Makefile.in +++ b/xserver/hw/xquartz/man/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -179,13 +179,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -207,6 +203,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -231,6 +228,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -246,7 +244,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -361,6 +358,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -480,7 +478,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/manpages.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/manpages.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -506,9 +504,9 @@ $(top_srcdir)/manpages.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/xquartz/pbproxy/Makefile.in b/xserver/hw/xquartz/pbproxy/Makefile.in index 023fe9053..ad4d64488 100644 --- a/xserver/hw/xquartz/pbproxy/Makefile.in +++ b/xserver/hw/xquartz/pbproxy/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -212,13 +212,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -240,6 +236,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -264,6 +261,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -279,7 +277,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -378,6 +375,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -500,7 +498,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .m .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -525,9 +523,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/xquartz/pbproxy/x-selection.m b/xserver/hw/xquartz/pbproxy/x-selection.m index 13d5e13ad..57ddb743a 100644 --- a/xserver/hw/xquartz/pbproxy/x-selection.m +++ b/xserver/hw/xquartz/pbproxy/x-selection.m @@ -1499,7 +1499,7 @@ get_property(Window win, Atom property, struct propdata *pdata, Bool delete, /* Allocation */ -- init +- (id) init { unsigned long pixel; diff --git a/xserver/hw/xquartz/pseudoramiX.c b/xserver/hw/xquartz/pseudoramiX.c index 8bb7f2d01..23dbc7328 100644 --- a/xserver/hw/xquartz/pseudoramiX.c +++ b/xserver/hw/xquartz/pseudoramiX.c @@ -37,14 +37,17 @@ #include #endif -#include "darwin.h" #include "pseudoramiX.h" #include "extnsionst.h" +#include "extinit.h" #include "dixstruct.h" #include "window.h" #include #include "globals.h" +#define TRACE PseudoramiXTrace("TRACE " __FILE__ ":%s",__FUNCTION__) +#define DEBUG_LOG PseudoramiXDebug + Bool noPseudoramiXExtension = FALSE; extern int @@ -95,6 +98,26 @@ static int pseudoramiXScreensAllocated = 0; static int pseudoramiXNumScreens = 0; static unsigned long pseudoramiXGeneration = 0; +static void +PseudoramiXTrace(const char *format, ...) +{ + va_list ap; + + va_start(ap, format); + LogVMessageVerb(X_NONE, 10, format, ap); + va_end(ap); +} + +static void +PseudoramiXDebug(const char *format, ...) +{ + va_list ap; + + va_start(ap, format); + LogVMessageVerb(X_NONE, 3, format, ap); + va_end(ap); +} + // Add a PseudoramiX screen. // The rest of the X server will know nothing about this screen. // Can be called before or after extension init. @@ -125,14 +148,14 @@ PseudoramiXAddScreen(int x, int y, int w, int h) // Initialize PseudoramiX. // Copied from PanoramiXExtensionInit void -PseudoramiXExtensionInit(int argc, char *argv[]) +PseudoramiXExtensionInit(void) { Bool success = FALSE; ExtensionEntry *extEntry; if (noPseudoramiXExtension) return; - TRACE(); + TRACE; /* Even with only one screen we need to enable PseudoramiX to allow dynamic screen configuration changes. */ @@ -169,7 +192,7 @@ PseudoramiXExtensionInit(int argc, char *argv[]) void PseudoramiXResetScreens(void) { - TRACE(); + TRACE; pseudoramiXNumScreens = 0; } @@ -177,7 +200,7 @@ PseudoramiXResetScreens(void) static void PseudoramiXResetProc(ExtensionEntry *extEntry) { - TRACE(); + TRACE; PseudoramiXResetScreens(); } @@ -186,7 +209,7 @@ PseudoramiXResetProc(ExtensionEntry *extEntry) static int ProcPseudoramiXQueryVersion(ClientPtr client) { - TRACE(); + TRACE; return ProcPanoramiXQueryVersion(client); } @@ -200,7 +223,7 @@ ProcPseudoramiXGetState(ClientPtr client) xPanoramiXGetStateReply rep; register int rc; - TRACE(); + TRACE; REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); @@ -211,12 +234,13 @@ ProcPseudoramiXGetState(ClientPtr client) rep.length = 0; rep.sequenceNumber = client->sequence; rep.state = !noPseudoramiXExtension; + rep.window = stuff->window; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); - swaps(&rep.state); + swapl(&rep.window); } - WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *)&rep); + WriteToClient(client, sizeof(xPanoramiXGetStateReply),&rep); return Success; } @@ -229,7 +253,7 @@ ProcPseudoramiXGetScreenCount(ClientPtr client) xPanoramiXGetScreenCountReply rep; register int rc; - TRACE(); + TRACE; REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); @@ -240,12 +264,13 @@ ProcPseudoramiXGetScreenCount(ClientPtr client) rep.length = 0; rep.sequenceNumber = client->sequence; rep.ScreenCount = pseudoramiXNumScreens; + rep.window = stuff->window; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); - swaps(&rep.ScreenCount); + swapl(&rep.window); } - WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *)&rep); + WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply),&rep); return Success; } @@ -256,9 +281,12 @@ ProcPseudoramiXGetScreenSize(ClientPtr client) REQUEST(xPanoramiXGetScreenSizeReq); WindowPtr pWin; xPanoramiXGetScreenSizeReply rep; - register int n, rc; + register int rc; - TRACE(); + TRACE; + + if (stuff->screen >= pseudoramiXNumScreens) + return BadMatch; REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); @@ -273,13 +301,17 @@ ProcPseudoramiXGetScreenSize(ClientPtr client) // was screenInfo.screens[stuff->screen]->width; rep.height = pseudoramiXScreens[stuff->screen].h; // was screenInfo.screens[stuff->screen]->height; + rep.window = stuff->window; + rep.screen = stuff->screen; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); - swaps(&rep.width); - swaps(&rep.height); + swapl(&rep.width); + swapl(&rep.height); + swapl(&rep.window); + swapl(&rep.screen); } - WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *)&rep); + WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply),&rep); return Success; } @@ -290,7 +322,7 @@ ProcPseudoramiXIsActive(ClientPtr client) /* REQUEST(xXineramaIsActiveReq); */ xXineramaIsActiveReply rep; - TRACE(); + TRACE; REQUEST_SIZE_MATCH(xXineramaIsActiveReq); @@ -303,7 +335,7 @@ ProcPseudoramiXIsActive(ClientPtr client) swapl(&rep.length); swapl(&rep.state); } - WriteToClient(client, sizeof(xXineramaIsActiveReply), (char *)&rep); + WriteToClient(client, sizeof(xXineramaIsActiveReply),&rep); return Success; } @@ -329,7 +361,7 @@ ProcPseudoramiXQueryScreens(ClientPtr client) swapl(&rep.length); swapl(&rep.number); } - WriteToClient(client, sizeof(xXineramaQueryScreensReply), (char *)&rep); + WriteToClient(client, sizeof(xXineramaQueryScreensReply),&rep); if (!noPseudoramiXExtension) { xXineramaScreenInfo scratch; @@ -347,7 +379,7 @@ ProcPseudoramiXQueryScreens(ClientPtr client) swaps(&scratch.width); swaps(&scratch.height); } - WriteToClient(client, sz_XineramaScreenInfo, (char *)&scratch); + WriteToClient(client, sz_XineramaScreenInfo,&scratch); } } @@ -359,7 +391,7 @@ static int ProcPseudoramiXDispatch(ClientPtr client) { REQUEST(xReq); - TRACE(); + TRACE; switch (stuff->data) { case X_PanoramiXQueryVersion: return ProcPseudoramiXQueryVersion(client); @@ -387,7 +419,7 @@ SProcPseudoramiXQueryVersion(ClientPtr client) { REQUEST(xPanoramiXQueryVersionReq); - TRACE(); + TRACE; swaps(&stuff->length); REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq); @@ -399,7 +431,7 @@ SProcPseudoramiXGetState(ClientPtr client) { REQUEST(xPanoramiXGetStateReq); - TRACE(); + TRACE; swaps(&stuff->length); REQUEST_SIZE_MATCH(xPanoramiXGetStateReq); @@ -411,7 +443,7 @@ SProcPseudoramiXGetScreenCount(ClientPtr client) { REQUEST(xPanoramiXGetScreenCountReq); - TRACE(); + TRACE; swaps(&stuff->length); REQUEST_SIZE_MATCH(xPanoramiXGetScreenCountReq); @@ -423,7 +455,7 @@ SProcPseudoramiXGetScreenSize(ClientPtr client) { REQUEST(xPanoramiXGetScreenSizeReq); - TRACE(); + TRACE; swaps(&stuff->length); REQUEST_SIZE_MATCH(xPanoramiXGetScreenSizeReq); @@ -435,7 +467,7 @@ SProcPseudoramiXIsActive(ClientPtr client) { REQUEST(xXineramaIsActiveReq); - TRACE(); + TRACE; swaps(&stuff->length); REQUEST_SIZE_MATCH(xXineramaIsActiveReq); @@ -447,7 +479,7 @@ SProcPseudoramiXQueryScreens(ClientPtr client) { REQUEST(xXineramaQueryScreensReq); - TRACE(); + TRACE; swaps(&stuff->length); REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); @@ -459,7 +491,7 @@ SProcPseudoramiXDispatch(ClientPtr client) { REQUEST(xReq); - TRACE(); + TRACE; switch (stuff->data) { case X_PanoramiXQueryVersion: diff --git a/xserver/hw/xquartz/pseudoramiX.h b/xserver/hw/xquartz/pseudoramiX.h index f41b5cbe4..f063919dd 100644 --- a/xserver/hw/xquartz/pseudoramiX.h +++ b/xserver/hw/xquartz/pseudoramiX.h @@ -6,6 +6,5 @@ extern int noPseudoramiXExtension; void PseudoramiXAddScreen(int x, int y, int w, int h); -void PseudoramiXExtensionInit(int argc, char *argv[]); void PseudoramiXResetScreens(void); diff --git a/xserver/hw/xquartz/quartz.c b/xserver/hw/xquartz/quartz.c index 62a2852b7..5b977c7f9 100644 --- a/xserver/hw/xquartz/quartz.c +++ b/xserver/hw/xquartz/quartz.c @@ -42,6 +42,8 @@ #include "darwin.h" #include "darwinEvents.h" #include "pseudoramiX.h" +#include "extension.h" +#include "glx_extinit.h" #define _APPLEWM_SERVER_ #include "applewmExt.h" @@ -143,6 +145,28 @@ QuartzSetupScreen(int index, return TRUE; } +static const ExtensionModule quartzExtensions[] = { + /* PseudoramiX needs to be done before RandR, so + * it is in miinitext.c until it can be reordered. + * { PseudoramiXExtensionInit, "PseudoramiX", &noPseudoramiXExtension }, + */ +#ifdef GLXEXT + {GlxExtensionInit, "GLX", &noGlxExtension}, +#endif +}; + +/* + * QuartzExtensionInit + * Initialises XQuartz-specific extensions. + */ +static void QuartzExtensionInit(void) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(quartzExtensions); i++) + LoadExtension(&quartzExtensions[i], TRUE); +} + /* * QuartzInitOutput * Quartz display initialization. @@ -182,6 +206,8 @@ QuartzInitOutput(int argc, // Do display mode specific initialization quartzProcs->DisplayInit(); + + QuartzExtensionInit(); } /* diff --git a/xserver/hw/xquartz/xpr/Makefile.in b/xserver/hw/xquartz/xpr/Makefile.in index c628d22b2..8e147379b 100644 --- a/xserver/hw/xquartz/xpr/Makefile.in +++ b/xserver/hw/xquartz/xpr/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -183,13 +183,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -211,6 +207,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -235,6 +232,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -250,7 +248,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -349,6 +346,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -484,7 +482,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -509,9 +507,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/xquartz/xpr/appledri.c b/xserver/hw/xquartz/xpr/appledri.c index 1bb837958..9aac07240 100644 --- a/xserver/hw/xquartz/xpr/appledri.c +++ b/xserver/hw/xquartz/xpr/appledri.c @@ -105,7 +105,7 @@ ProcAppleDRIQueryVersion(register ClientPtr client) swaps(&rep.minorVersion); swapl(&rep.patchVersion); } - WriteToClient(client, sizeof(xAppleDRIQueryVersionReply), (char *)&rep); + WriteToClient(client, sizeof(xAppleDRIQueryVersionReply), &rep); return Success; } @@ -129,7 +129,7 @@ ProcAppleDRIQueryDirectRenderingCapable(register ClientPtr client) } rep.isCapable = isCapable; - if (!LocalClient(client)) + if (!client->local) rep.isCapable = 0; if (client->swapped) { @@ -139,7 +139,7 @@ ProcAppleDRIQueryDirectRenderingCapable(register ClientPtr client) WriteToClient(client, sizeof(xAppleDRIQueryDirectRenderingCapableReply), - (char *)&rep); + &rep); return Success; } @@ -168,7 +168,7 @@ ProcAppleDRIAuthConnection(register ClientPtr client) swapl(&rep.authenticated); /* Yes, this is a CARD32 ... sigh */ } - WriteToClient(client, sizeof(xAppleDRIAuthConnectionReply), (char *)&rep); + WriteToClient(client, sizeof(xAppleDRIAuthConnectionReply), &rep); return Success; } @@ -232,7 +232,7 @@ ProcAppleDRICreateSurface(ClientPtr client) swapl(&rep.uid); } - WriteToClient(client, sizeof(xAppleDRICreateSurfaceReply), (char *)&rep); + WriteToClient(client, sizeof(xAppleDRICreateSurfaceReply), &rep); return Success; } @@ -354,7 +354,7 @@ ProcAppleDRIDispatch(register ClientPtr client) return ProcAppleDRIQueryDirectRenderingCapable(client); } - if (!LocalClient(client)) + if (!client->local) return DRIErrorBase + AppleDRIClientNotLocal; switch (stuff->data) { @@ -469,7 +469,7 @@ SProcAppleDRIDispatch(register ClientPtr client) return SProcAppleDRIQueryDirectRenderingCapable(client); } - if (!LocalClient(client)) + if (!client->local) return DRIErrorBase + AppleDRIClientNotLocal; switch (stuff->data) { diff --git a/xserver/hw/xquartz/xpr/dri.c b/xserver/hw/xquartz/xpr/dri.c index 002ec94a7..adba69cca 100644 --- a/xserver/hw/xquartz/xpr/dri.c +++ b/xserver/hw/xquartz/xpr/dri.c @@ -38,13 +38,8 @@ #include #endif -#ifdef XFree86LOADER -#include "xf86.h" -#include "xf86_ansic.h" -#else #include #include -#endif #include #include @@ -55,6 +50,7 @@ #include "misc.h" #include "dixstruct.h" #include "extnsionst.h" +#include "extinit.h" #include "colormapst.h" #include "cursorstr.h" #include "scrnintstr.h" @@ -68,6 +64,7 @@ #include "mi.h" #include "mipointer.h" #include "rootless.h" +#include "rootlessCommon.h" #include "x-hash.h" #include "x-hook.h" #include "driWrap.h" @@ -384,6 +381,11 @@ DRICreateSurface(ScreenPtr pScreen, Drawable id, DRIDrawablePrivPtr pDRIDrawablePriv; if (pDrawable->type == DRAWABLE_WINDOW) { + /* + * http://bugs.winehq.org/show_bug.cgi?id=31751 + */ + RootlessStopDrawing((WindowPtr)pDrawable, FALSE); + pDRIDrawablePriv = CreateSurfaceForWindow(pScreen, (WindowPtr)pDrawable, &wid); diff --git a/xserver/hw/xquartz/xpr/xprEvent.c b/xserver/hw/xquartz/xpr/xprEvent.c index 106a91931..398177ca8 100644 --- a/xserver/hw/xquartz/xpr/xprEvent.c +++ b/xserver/hw/xquartz/xpr/xprEvent.c @@ -52,6 +52,10 @@ #include #include +#ifdef HAVE_LIBDISPATCH +#include +#endif + #include "rootlessWindow.h" #include "xprEvent.h" @@ -72,7 +76,25 @@ QuartzModeEventHandler(int screenNum, XQuartzEvent *e, DeviceIntPtr dev) case kXquartzBringAllToFront: DEBUG_LOG("kXquartzBringAllToFront\n"); + /* There's no need to do xp_window_bring_all_to_front on Leopard, + * and we don't care about the result, so just do it async. + */ +#if defined(HAVE_LIBDISPATCH) && defined(XPLUGIN_VERSION) && XPLUGIN_VERSION >= 6 +# if defined(XPLUGIN_VERSION_MIN_REQUIRED) && XPLUGIN_VERSION_MIN_REQUIRED < 6 + if (&xp_window_bring_all_to_front) { +# endif + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ + xp_window_bring_all_to_front(); + }); +# if defined(XPLUGIN_VERSION_MIN_REQUIRED) && XPLUGIN_VERSION_MIN_REQUIRED < 6 + } else { + RootlessOrderAllWindows(e->data[0]); + } +# endif +#else RootlessOrderAllWindows(e->data[0]); +#endif + return TRUE; default: diff --git a/xserver/hw/xquartz/xpr/xprFrame.c b/xserver/hw/xquartz/xpr/xprFrame.c index 01f1def20..aad375b52 100644 --- a/xserver/hw/xquartz/xpr/xprFrame.c +++ b/xserver/hw/xquartz/xpr/xprFrame.c @@ -49,6 +49,10 @@ #include #endif +#ifdef DEBUG_XP_LOCK_WINDOW +#include +#endif + #define DEFINE_ATOM_HELPER(func, atom_name) \ static Atom func(void) { \ static int generation; \ @@ -376,6 +380,18 @@ xprStartDrawing(RootlessFrameID wid, char **pixelData, int *bytesPerRow) unsigned int rowbytes[2]; xp_error err; +#ifdef DEBUG_XP_LOCK_WINDOW + void* callstack[128]; + int i, frames = backtrace(callstack, 128); + char** strs = backtrace_symbols(callstack, frames); + + ErrorF("=== LOCK %d ===\n", (int)x_cvt_vptr_to_uint(wid)); + for (i = 0; i < frames; ++i) { + ErrorF(" %s\n", strs[i]); + } + free(strs); +#endif + err = xp_lock_window(x_cvt_vptr_to_uint( wid), NULL, NULL, data, rowbytes, NULL); if (err != Success) @@ -395,6 +411,18 @@ xprStopDrawing(RootlessFrameID wid, Bool flush) { xp_error err; +#ifdef DEBUG_XP_LOCK_WINDOW + void* callstack[128]; + int i, frames = backtrace(callstack, 128); + char** strs = backtrace_symbols(callstack, frames); + + ErrorF("=== UNLOCK %d ===\n", (int)x_cvt_vptr_to_uint(wid)); + for (i = 0; i < frames; ++i) { + ErrorF(" %s\n", strs[i]); + } + free(strs); +#endif + err = xp_unlock_window(x_cvt_vptr_to_uint(wid), flush); /* This should be a FatalError, but we started tripping over it. Make it a * FatalError after http://xquartz.macosforge.org/trac/ticket/482 is fixed. diff --git a/xserver/hw/xquartz/xpr/xprScreen.c b/xserver/hw/xquartz/xpr/xprScreen.c index efe2aa882..e37601995 100644 --- a/xserver/hw/xquartz/xpr/xprScreen.c +++ b/xserver/hw/xquartz/xpr/xprScreen.c @@ -359,6 +359,10 @@ have_depth: dfb->blueMask = 0; break; +#if 0 + // Removed because Mountain Lion removed support for + // 15bit backing stores. We can possibly re-add + // this once libXplugin is updated to work around it. case 15: dfb->visuals = TrueColorMask; //LARGE_VISUALS; dfb->preferredCVC = TrueColor; @@ -369,6 +373,7 @@ have_depth: dfb->greenMask = GM_ARGB(0, 5, 5, 5); dfb->blueMask = BM_ARGB(0, 5, 5, 5); break; +#endif // case 24: default: diff --git a/xserver/hw/xwin/InitOutput.c b/xserver/hw/xwin/InitOutput.c index 4d0df110f..04c17b702 100644 --- a/xserver/hw/xwin/InitOutput.c +++ b/xserver/hw/xwin/InitOutput.c @@ -55,6 +55,7 @@ typedef WINAPI HRESULT(*SHGETFOLDERPATHPROC) (HWND hwndOwner, DWORD dwFlags, LPTSTR pszPath); #endif +#include "glx_extinit.h" /* * References to external symbols */ @@ -76,11 +77,6 @@ static void winClipboardShutdown(void); #endif -#if defined(DDXOSVERRORF) -void - OsVendorVErrorF(const char *pszFormat, va_list va_args); -#endif - static Bool winCheckDisplayNumber(void); @@ -147,15 +143,30 @@ winClipboardShutdown(void) } #endif -void -ddxPushProviders(void) +static const ExtensionModule xwinExtensions[] = { +#ifdef GLXEXT + { GlxExtensionInit, "GLX", &noGlxExtension }, +#endif +}; + +/* + * XwinExtensionInit + * Initialises Xwin-specific extensions. + */ +static +void XwinExtensionInit(void) { + int i; + #ifdef XWIN_GLX_WINDOWS if (g_fNativeGl) { /* install the native GL provider */ glxWinPushNativeProvider(); } #endif + + for (i = 0; i < ARRAY_SIZE(xwinExtensions); i++) + LoadExtension(&xwinExtensions[i], TRUE); } #if defined(DDXBEFORERESET) @@ -193,6 +204,9 @@ ddxGiveUp(enum ExitCode error) } #ifdef XWIN_MULTIWINDOW + /* Unload libraries for taskbar grouping */ + winPropertyStoreDestroy(); + /* Notify the worker threads we're exiting */ winDeinitMultiWindowWM(); #endif @@ -283,11 +297,11 @@ winCheckMount(void) } while ((ent = getmntent(mnt)) != NULL) { - BOOL system = (winCheckMntOpt(ent, "user") != NULL); + BOOL sys = (winCheckMntOpt(ent, "user") != NULL); BOOL root = (strcmp(ent->mnt_dir, "/") == 0); BOOL tmp = (strcmp(ent->mnt_dir, "/tmp") == 0); - if (system) { + if (sys) { if (root) curlevel = sys_root; else if (tmp) @@ -793,7 +807,7 @@ winUseMsg(void) ErrorF("-resize=none|scrollbars|randr" "\tIn windowed mode, [don't] allow resizing of the window. 'scrollbars'\n" "\tmode gives the window scrollbars as needed, 'randr' mode uses the RANR\n" - "\textension to resize the X screen.\n"); + "\textension to resize the X screen. 'randr' is the default.\n"); ErrorF("-rootless\n" "\tRun the server in rootless mode.\n"); @@ -826,7 +840,7 @@ winUseMsg(void) #ifdef XWIN_GLX_WINDOWS ErrorF("-[no]wgl\n" - "\tEnable the GLX extension to use the native Windows WGL interface for accelerated OpenGL\n"); + "\tEnable the GLX extension to use the native Windows WGL interface for hardware-accelerated OpenGL\n"); #endif ErrorF("-[no]winkill\n" "\tAlt+F4 exits the X Server.\n"); @@ -881,10 +895,13 @@ ddxUseMsg(void) */ void -InitOutput(ScreenInfo * screenInfo, int argc, char *argv[]) +InitOutput(ScreenInfo * pScreenInfo, int argc, char *argv[]) { int i; + if (serverGeneration == 1) + XwinExtensionInit(); + /* Log the command line */ winLogCommandLine(argc, argv); @@ -921,15 +938,15 @@ InitOutput(ScreenInfo * screenInfo, int argc, char *argv[]) LoadPreferences(); /* Setup global screen info parameters */ - screenInfo->imageByteOrder = IMAGE_BYTE_ORDER; - screenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD; - screenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT; - screenInfo->bitmapBitOrder = BITMAP_BIT_ORDER; - screenInfo->numPixmapFormats = NUMFORMATS; + pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER; + pScreenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD; + pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT; + pScreenInfo->bitmapBitOrder = BITMAP_BIT_ORDER; + pScreenInfo->numPixmapFormats = NUMFORMATS; /* Describe how we want common pixmap formats padded */ for (i = 0; i < NUMFORMATS; i++) { - screenInfo->formats[i] = g_PixmapFormats[i]; + pScreenInfo->formats[i] = g_PixmapFormats[i]; } /* Load pointers to DirectDraw functions */ @@ -937,6 +954,10 @@ InitOutput(ScreenInfo * screenInfo, int argc, char *argv[]) /* Detect supported engines */ winDetectSupportedEngines(); +#ifdef XWIN_MULTIWINDOW + /* Load libraries for taskbar grouping */ + winPropertyStoreInit(); +#endif /* Store the instance handle */ g_hInstance = GetModuleHandle(NULL); @@ -1021,7 +1042,7 @@ winCheckDisplayNumber(void) NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) & lpMsgBuf, 0, NULL); + (LPTSTR) &lpMsgBuf, 0, NULL); ErrorF("winCheckDisplayNumber - CreateMutex failed: %s\n", (LPSTR) lpMsgBuf); LocalFree(lpMsgBuf); diff --git a/xserver/hw/xwin/Makefile.am b/xserver/hw/xwin/Makefile.am index c49016398..93ce57038 100644 --- a/xserver/hw/xwin/Makefile.am +++ b/xserver/hw/xwin/Makefile.am @@ -5,7 +5,6 @@ SRCS_CLIPBOARD = \ winclipboardinit.c \ winclipboardtextconv.c \ winclipboardthread.c \ - winclipboardunicode.c \ winclipboardwndproc.c \ winclipboardwrappers.c \ winclipboardxevents.c @@ -24,8 +23,11 @@ SRCS_MULTIWINDOW = \ winmultiwindowshape.c \ winmultiwindowwindow.c \ winmultiwindowwm.c \ - winmultiwindowwndproc.c + winmultiwindowwndproc.c \ + propertystore.h \ + winSetAppUserModelID.c DEFS_MULTIWINDOW = -DXWIN_MULTIWINDOW +MULTIWINDOW_LIBS = -lshlwapi -lole32 endif if XWIN_MULTIWINDOWEXTWM @@ -96,11 +98,11 @@ SRCS = InitInput.c \ winprefsyacc.y \ winprefslex.l \ winprocarg.c \ - winregistry.c \ winscrinit.c \ winshaddd.c \ winshadddnl.c \ winshadgdi.c \ + wintaskbar.c \ wintrayicon.c \ winvalargs.c \ winwakeup.c \ @@ -110,13 +112,16 @@ SRCS = InitInput.c \ winclipboard.h \ winconfig.h \ win.h \ + winglobals.h \ winkeybd.h \ winkeynames.h \ winlayouts.h \ winmessages.h \ + winmonitors.h \ winmsg.h \ winms.h \ winmultiwindowclass.h \ + winmultiwindowicons.h \ winprefs.h \ winresource.h \ winwindow.h \ @@ -146,8 +151,10 @@ XWin_SOURCES = $(SRCS) INCLUDES = -I$(top_srcdir)/miext/rootless +XWIN_SYS_LIBS += -ldxguid + XWin_DEPENDENCIES = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) -XWin_LDADD = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_GLX_LINK_FLAGS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS) +XWin_LDADD = $(MULTIWINDOW_LIBS) $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_GLX_LINK_FLAGS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS) XWin_LDFLAGS = -mwindows -static .rc.o: diff --git a/xserver/hw/xwin/Makefile.in b/xserver/hw/xwin/Makefile.in index 419103c7a..84135408b 100644 --- a/xserver/hw/xwin/Makefile.in +++ b/xserver/hw/xwin/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -53,7 +53,7 @@ build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = XWin$(EXEEXT) subdir = hw/xwin -DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp $(top_srcdir)/ylwrap winprefslex.c \ winprefsyacc.c winprefsyacc.h ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -83,34 +83,36 @@ am__XWin_SOURCES_DIST = InitInput.c InitOutput.c winallpriv.c \ winkeybd.c winkeyhook.c winmisc.c winmonitors.c winmouse.c \ winmsg.c winmultiwindowclass.c winmultiwindowicons.c \ winprefs.c winprefsyacc.y winprefslex.l winprocarg.c \ - winregistry.c winscrinit.c winshaddd.c winshadddnl.c \ - winshadgdi.c wintrayicon.c winvalargs.c winwakeup.c \ + winscrinit.c winshaddd.c winshadddnl.c winshadgdi.c \ + wintaskbar.c wintrayicon.c winvalargs.c winwakeup.c \ winwindow.c winwndproc.c ddraw.h winclipboard.h winconfig.h \ - win.h winkeybd.h winkeynames.h winlayouts.h winmessages.h \ - winmsg.h winms.h winmultiwindowclass.h winprefs.h \ + win.h winglobals.h winkeybd.h winkeynames.h winlayouts.h \ + winmessages.h winmonitors.h winmsg.h winms.h \ + winmultiwindowclass.h winmultiwindowicons.h winprefs.h \ winresource.h winwindow.h XWin.rc \ $(top_srcdir)/Xext/dpmsstubs.c $(top_srcdir)/Xi/stubs.c \ $(top_srcdir)/mi/miinitext.c $(top_srcdir)/fb/fbcmap_mi.c \ winclipboardinit.c winclipboardtextconv.c winclipboardthread.c \ - winclipboardunicode.c winclipboardwndproc.c \ - winclipboardwrappers.c winclipboardxevents.c \ - winmultiwindowshape.c winmultiwindowwindow.c \ - winmultiwindowwm.c winmultiwindowwndproc.c winwin32rootless.c \ - winwin32rootlesswindow.c winwin32rootlesswndproc.c \ - winwindowswm.c winclip.c winfillsp.c winfont.c wingc.c \ - wingetsp.c winnativegdi.c winpixmap.c winpolyline.c winrop.c \ - winsetsp.c winpfbdd.c winrandr.c winvideo.c + winclipboardwndproc.c winclipboardwrappers.c \ + winclipboardxevents.c winmultiwindowshape.c \ + winmultiwindowwindow.c winmultiwindowwm.c \ + winmultiwindowwndproc.c propertystore.h winSetAppUserModelID.c \ + winwin32rootless.c winwin32rootlesswindow.c \ + winwin32rootlesswndproc.c winwindowswm.c winclip.c winfillsp.c \ + winfont.c wingc.c wingetsp.c winnativegdi.c winpixmap.c \ + winpolyline.c winrop.c winsetsp.c winpfbdd.c winrandr.c \ + winvideo.c @XWIN_CLIPBOARD_TRUE@am__objects_1 = winclipboardinit.$(OBJEXT) \ @XWIN_CLIPBOARD_TRUE@ winclipboardtextconv.$(OBJEXT) \ @XWIN_CLIPBOARD_TRUE@ winclipboardthread.$(OBJEXT) \ -@XWIN_CLIPBOARD_TRUE@ winclipboardunicode.$(OBJEXT) \ @XWIN_CLIPBOARD_TRUE@ winclipboardwndproc.$(OBJEXT) \ @XWIN_CLIPBOARD_TRUE@ winclipboardwrappers.$(OBJEXT) \ @XWIN_CLIPBOARD_TRUE@ winclipboardxevents.$(OBJEXT) @XWIN_MULTIWINDOW_TRUE@am__objects_2 = winmultiwindowshape.$(OBJEXT) \ @XWIN_MULTIWINDOW_TRUE@ winmultiwindowwindow.$(OBJEXT) \ @XWIN_MULTIWINDOW_TRUE@ winmultiwindowwm.$(OBJEXT) \ -@XWIN_MULTIWINDOW_TRUE@ winmultiwindowwndproc.$(OBJEXT) +@XWIN_MULTIWINDOW_TRUE@ winmultiwindowwndproc.$(OBJEXT) \ +@XWIN_MULTIWINDOW_TRUE@ winSetAppUserModelID.$(OBJEXT) @XWIN_MULTIWINDOWEXTWM_TRUE@am__objects_3 = \ @XWIN_MULTIWINDOWEXTWM_TRUE@ winwin32rootless.$(OBJEXT) \ @XWIN_MULTIWINDOWEXTWM_TRUE@ winwin32rootlesswindow.$(OBJEXT) \ @@ -135,8 +137,8 @@ am__objects_8 = InitInput.$(OBJEXT) InitOutput.$(OBJEXT) \ winmultiwindowclass.$(OBJEXT) winmultiwindowicons.$(OBJEXT) \ winprefs.$(OBJEXT) winprefsyacc.$(OBJEXT) \ winprefslex.$(OBJEXT) winprocarg.$(OBJEXT) \ - winregistry.$(OBJEXT) winscrinit.$(OBJEXT) winshaddd.$(OBJEXT) \ - winshadddnl.$(OBJEXT) winshadgdi.$(OBJEXT) \ + winscrinit.$(OBJEXT) winshaddd.$(OBJEXT) winshadddnl.$(OBJEXT) \ + winshadgdi.$(OBJEXT) wintaskbar.$(OBJEXT) \ wintrayicon.$(OBJEXT) winvalargs.$(OBJEXT) winwakeup.$(OBJEXT) \ winwindow.$(OBJEXT) winwndproc.$(OBJEXT) XWin.$(OBJEXT) \ dpmsstubs.$(OBJEXT) stubs.$(OBJEXT) miinitext.$(OBJEXT) \ @@ -187,7 +189,6 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -@MAINTAINER_MODE_FALSE@am__skiplex = test -f $@ || LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) LTLEXCOMPILE = $(LIBTOOL) $(AM_V_lt) $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(LEX) $(AM_LFLAGS) $(LFLAGS) @@ -196,7 +197,6 @@ am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@) am__v_LEX_0 = @echo " LEX " $@; am__v_LEX_1 = YLWRAP = $(top_srcdir)/ylwrap -@MAINTAINER_MODE_FALSE@am__skipyacc = test -f $@ || am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \ -e s/c++$$/h++/ -e s/c$$/h/ YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) @@ -346,13 +346,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -374,6 +370,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -398,6 +395,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -413,7 +411,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -512,6 +509,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -543,7 +541,7 @@ XWINMODULES_CFLAGS = @XWINMODULES_CFLAGS@ XWINMODULES_LIBS = @XWINMODULES_LIBS@ XWIN_LIBS = @XWIN_LIBS@ XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ -XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ +XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ -ldxguid YACC = @YACC@ YFLAGS = @YFLAGS@ __XCONFIGDIR__ = @__XCONFIGDIR__@ @@ -615,7 +613,6 @@ top_srcdir = @top_srcdir@ @XWIN_CLIPBOARD_TRUE@ winclipboardinit.c \ @XWIN_CLIPBOARD_TRUE@ winclipboardtextconv.c \ @XWIN_CLIPBOARD_TRUE@ winclipboardthread.c \ -@XWIN_CLIPBOARD_TRUE@ winclipboardunicode.c \ @XWIN_CLIPBOARD_TRUE@ winclipboardwndproc.c \ @XWIN_CLIPBOARD_TRUE@ winclipboardwrappers.c \ @XWIN_CLIPBOARD_TRUE@ winclipboardxevents.c @@ -629,9 +626,12 @@ top_srcdir = @top_srcdir@ @XWIN_MULTIWINDOW_TRUE@ winmultiwindowshape.c \ @XWIN_MULTIWINDOW_TRUE@ winmultiwindowwindow.c \ @XWIN_MULTIWINDOW_TRUE@ winmultiwindowwm.c \ -@XWIN_MULTIWINDOW_TRUE@ winmultiwindowwndproc.c +@XWIN_MULTIWINDOW_TRUE@ winmultiwindowwndproc.c \ +@XWIN_MULTIWINDOW_TRUE@ propertystore.h \ +@XWIN_MULTIWINDOW_TRUE@ winSetAppUserModelID.c @XWIN_MULTIWINDOW_TRUE@DEFS_MULTIWINDOW = -DXWIN_MULTIWINDOW +@XWIN_MULTIWINDOW_TRUE@MULTIWINDOW_LIBS = -lshlwapi -lole32 @XWIN_MULTIWINDOWEXTWM_TRUE@SRCS_MULTIWINDOWEXTWM = \ @XWIN_MULTIWINDOWEXTWM_TRUE@ winwin32rootless.c \ @XWIN_MULTIWINDOWEXTWM_TRUE@ winwin32rootlesswindow.c \ @@ -690,11 +690,11 @@ SRCS = InitInput.c \ winprefsyacc.y \ winprefslex.l \ winprocarg.c \ - winregistry.c \ winscrinit.c \ winshaddd.c \ winshadddnl.c \ winshadgdi.c \ + wintaskbar.c \ wintrayicon.c \ winvalargs.c \ winwakeup.c \ @@ -704,13 +704,16 @@ SRCS = InitInput.c \ winclipboard.h \ winconfig.h \ win.h \ + winglobals.h \ winkeybd.h \ winkeynames.h \ winlayouts.h \ winmessages.h \ + winmonitors.h \ winmsg.h \ winms.h \ winmultiwindowclass.h \ + winmultiwindowicons.h \ winprefs.h \ winresource.h \ winwindow.h \ @@ -730,7 +733,7 @@ SRCS = InitInput.c \ XWin_SOURCES = $(SRCS) INCLUDES = -I$(top_srcdir)/miext/rootless XWin_DEPENDENCIES = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) -XWin_LDADD = $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_GLX_LINK_FLAGS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS) +XWin_LDADD = $(MULTIWINDOW_LIBS) $(MULTIWINDOWEXTWM_LIBS) $(XWIN_GLX_LIBS) $(XWIN_GLX_LINK_FLAGS) $(XWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS) $(XSERVER_SYS_LIBS) $(XWIN_SYS_LIBS) XWin_LDFLAGS = -mwindows -static BUILT_SOURCES = winprefsyacc.h winprefsyacc.c winprefslex.c CLEANFILES = $(BUILT_SOURCES) @@ -756,7 +759,7 @@ all: $(BUILT_SOURCES) .SUFFIXES: .SUFFIXES: .c .l .lo .o .obj .rc .y -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -781,9 +784,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @@ -848,6 +851,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fbcmap_mi.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miinitext.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stubs.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winSetAppUserModelID.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winallpriv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winauth.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winblock.Po@am__quote@ @@ -855,7 +859,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winclipboardinit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winclipboardtextconv.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winclipboardthread.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winclipboardunicode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winclipboardwndproc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winclipboardwrappers.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winclipboardxevents.Po@am__quote@ @@ -892,13 +895,13 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winprefsyacc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winprocarg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winrandr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winregistry.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winrop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winscrinit.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winsetsp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winshaddd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winshadddnl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winshadgdi.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wintaskbar.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wintrayicon.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winvalargs.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winvideo.Po@am__quote@ diff --git a/xserver/hw/xwin/README b/xserver/hw/xwin/README deleted file mode 100644 index 219fd1337..000000000 --- a/xserver/hw/xwin/README +++ /dev/null @@ -1,141 +0,0 @@ -Cygwin/X Release Notes -====================== - -Release X11R6.7 -=============== - -Cygwin/X has continued its rapid pace of development that it has sustained -since Spring 2001 and this release shows it, we now have: a stable and fast -multi-window mode, seamless clipboard integration, a configurable tray menu -icon, popups on error messages pointing users to the log file and our mailing -list, the beginnings of indirect 3D acceleration for OpenGL applications, -improved non-US keyboard and clipboard support, and only a handful of bugs -that continue to be reported. - -Between the XFree86 4.3.0 release and the X.Org X11R6.7 release the Cyg- -win/XFree86 project broke away from The XFree86 Project, Inc. due to a lack -of support from the XFree86 project. As such, the Cygwin/XFree86 project was -renamed to the Cygwin/X project and the upstream source code tree that Cyg- -win/X pulls from and pushes to is now the tree managed by the X.Org Founda- -tion. The Cygwin/X project has seen a rush of development and interest in -the project since the split; one metric showing this is that the number of -CVS committers we have has gone from zero to six. - -The most outstanding features of this release are - - o Major multi-window mode improvements. (Takuma Murakami, Earle F. - Philhower III) - - o Initial work of accelerated OpenGL using the windows OpenGL drivers. - (Alexander Gottwald) - - o Massive rework of clipboard integration with windows. (Harold L Hunt II, - Kensuke Matsuzaki) - - o Improved Japanese clipboard and keyboard support. (Kensuke Matsuzaki, - Takuma Murakami, Alexander Gottwald) - - o Customizable tray menu icon allowing shortcuts to start programs, - etc.(Earle F. Philhower III) - - o New icons. (Jehan Bing, Michael Bax, Benjamin Rienfenstahl) - - o Fix some multi-monitor problems.(Takuma Murakami) - - o Fix repeated key strokes. (Ivan Pascal) - - o Automatic keyboard layouts for the most frequently used keyboard lay- - outs. (Alexander Gottwald) - - o Built in SHM support with detection of the SHM engine (cygserver). - (Ralf Habacker, Harold L Hunt II) - - o Merged in work on the NativeGDI engine. (Alan Hourihane) - -OpenGL with Cygwin/X -==================== - -Cygwin/X has supported GLX only with software rendering provided by the Mesa -library. Starting with X11R6.7 we add support for hardware accelerated OpenGL. - -This support is still under development and still has some bigger problems. -To provide both versions (the stable software rendering and the new hardware -accelerated) we ship to binaries. XWin.exe contains the software rendering -and XWin_GL.exe uses the hardware acceleration provided by the windows drivers. - -The known problems with hardware accelerated OpenGL are: - - o Only multiwindow mode is useful. In the other modes the OpenGL output - does not align with the X11 windows. - - o Using two programs which require different visuals will fail. For example - glxgears and glxinfo will not work without restarting XWin_GL.exe. - - o OpenGL extensions and functions from OpenGL 1.2 and later should work - but are not completely tested. - - o The standard Windows OpenGL driver will produce no output. Use the one - from your video adapter vendor. - -If you notice problems with some programs please send a message with the -logfile /tmp/XWin.log and a short error description to - -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 - -The hardware accelerated OpenGL was tested using: - - o glxgears - o glxinfo - o blender - o tuxkart - o GLUT demos (some did fail) - diff --git a/xserver/hw/xwin/ddraw.h b/xserver/hw/xwin/ddraw.h index 9463049c8..1871d9551 100644 --- a/xserver/hw/xwin/ddraw.h +++ b/xserver/hw/xwin/ddraw.h @@ -1,3 +1,7 @@ +#ifdef __MINGW64_VERSION_MAJOR +#include_next +#define __XWIN_DDRAW_H +#endif #ifndef __XWIN_DDRAW_H #define __XWIN_DDRAW_H diff --git a/xserver/hw/xwin/glx/Makefile.am b/xserver/hw/xwin/glx/Makefile.am index 6b840bacb..59f6879a7 100644 --- a/xserver/hw/xwin/glx/Makefile.am +++ b/xserver/hw/xwin/glx/Makefile.am @@ -6,7 +6,8 @@ libXwinGLX_la_SOURCES = \ glwindows.h \ glwrap.c \ indirect.c \ - wgl_ext_api.c + wgl_ext_api.c \ + wgl_ext_api.h if XWIN_MULTIWINDOW DEFS_MULTIWINDOW = -DXWIN_MULTIWINDOW @@ -32,10 +33,10 @@ AM_CFLAGS = -DHAVE_XWIN_CONFIG_H $(DIX_CFLAGS) \ if XWIN_GLX_WINDOWS generated_gl_wrappers.c: gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/gl.spec $(KHRONOS_SPEC_DIR)/gl.tm - $(srcdir)/gen_gl_wrappers.py --spec=$(KHRONOS_SPEC_DIR)/gl.spec --typemap=$(KHRONOS_SPEC_DIR)/gl.tm --dispatch-header=$(top_srcdir)/glx/dispatch.h --staticwrappers >generated_gl_wrappers.c + $(AM_V_GEN)$(srcdir)/gen_gl_wrappers.py --spec=$(KHRONOS_SPEC_DIR)/gl.spec --typemap=$(KHRONOS_SPEC_DIR)/gl.tm --dispatch-header=$(top_srcdir)/glx/dispatch.h --staticwrappers >generated_gl_wrappers.c generated_wgl_wrappers.c: gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/wglext.spec $(KHRONOS_SPEC_DIR)/wgl.tm - $(srcdir)/gen_gl_wrappers.py --spec=$(KHRONOS_SPEC_DIR)/wglext.spec --typemap=$(KHRONOS_SPEC_DIR)/wgl.tm --prefix=wgl --preresolve >generated_wgl_wrappers.c + $(AM_V_GEN)$(srcdir)/gen_gl_wrappers.py --spec=$(KHRONOS_SPEC_DIR)/wglext.spec --typemap=$(KHRONOS_SPEC_DIR)/wgl.tm --prefix=wgl --preresolve >generated_wgl_wrappers.c endif BUILT_SOURCES = generated_gl_wrappers.c generated_wgl_wrappers.c diff --git a/xserver/hw/xwin/glx/Makefile.in b/xserver/hw/xwin/glx/Makefile.in index 7cb6cee5e..8152e5e5d 100644 --- a/xserver/hw/xwin/glx/Makefile.in +++ b/xserver/hw/xwin/glx/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -182,13 +182,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -210,6 +206,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -234,6 +231,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -249,7 +247,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -348,6 +345,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -454,7 +452,8 @@ libXwinGLX_la_SOURCES = \ glwindows.h \ glwrap.c \ indirect.c \ - wgl_ext_api.c + wgl_ext_api.c \ + wgl_ext_api.h @XWIN_MULTIWINDOW_TRUE@DEFS_MULTIWINDOW = -DXWIN_MULTIWINDOW @XWIN_MULTIWINDOWEXTWM_TRUE@DEFS_MULTIWINDOWEXTWM = -DXWIN_MULTIWINDOWEXTWM @@ -473,7 +472,7 @@ all: $(BUILT_SOURCES) .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -498,9 +497,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): @@ -778,10 +777,10 @@ uninstall-am: @XWIN_GLX_WINDOWS_TRUE@generated_gl_wrappers.c: gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/gl.spec $(KHRONOS_SPEC_DIR)/gl.tm -@XWIN_GLX_WINDOWS_TRUE@ $(srcdir)/gen_gl_wrappers.py --spec=$(KHRONOS_SPEC_DIR)/gl.spec --typemap=$(KHRONOS_SPEC_DIR)/gl.tm --dispatch-header=$(top_srcdir)/glx/dispatch.h --staticwrappers >generated_gl_wrappers.c +@XWIN_GLX_WINDOWS_TRUE@ $(AM_V_GEN)$(srcdir)/gen_gl_wrappers.py --spec=$(KHRONOS_SPEC_DIR)/gl.spec --typemap=$(KHRONOS_SPEC_DIR)/gl.tm --dispatch-header=$(top_srcdir)/glx/dispatch.h --staticwrappers >generated_gl_wrappers.c @XWIN_GLX_WINDOWS_TRUE@generated_wgl_wrappers.c: gen_gl_wrappers.py $(KHRONOS_SPEC_DIR)/wglext.spec $(KHRONOS_SPEC_DIR)/wgl.tm -@XWIN_GLX_WINDOWS_TRUE@ $(srcdir)/gen_gl_wrappers.py --spec=$(KHRONOS_SPEC_DIR)/wglext.spec --typemap=$(KHRONOS_SPEC_DIR)/wgl.tm --prefix=wgl --preresolve >generated_wgl_wrappers.c +@XWIN_GLX_WINDOWS_TRUE@ $(AM_V_GEN)$(srcdir)/gen_gl_wrappers.py --spec=$(KHRONOS_SPEC_DIR)/wglext.spec --typemap=$(KHRONOS_SPEC_DIR)/wgl.tm --prefix=wgl --preresolve >generated_wgl_wrappers.c # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/xserver/hw/xwin/glx/gen_gl_wrappers.py b/xserver/hw/xwin/glx/gen_gl_wrappers.py index e2d960ec6..2273589c9 100644 --- a/xserver/hw/xwin/glx/gen_gl_wrappers.py +++ b/xserver/hw/xwin/glx/gen_gl_wrappers.py @@ -67,7 +67,7 @@ if dispatchheader : fh = open(dispatchheader) dispatchh = fh.readlines() - dispatch_regex = re.compile(r'#define\sSET_(\S*)\(') + dispatch_regex = re.compile(r'^SET_(\S*)\(') for line in dispatchh : line = line.strip() @@ -146,9 +146,8 @@ for line in glspec : arglist_use = m1.group(2) wrappers[function] = {} - # near and far might be reserved words or macros so can't be used as formal parameter names - arglist_use = arglist_use.replace('near','zNear') - arglist_use = arglist_use.replace('far','zFar') + # ensure formal parameter names don't collide with reserved names or shadow global declarations + arglist_use = ',' .join([i.rstrip() + '_' for i in arglist_use.split(",")]) wrappers[function]['arglist_use'] = arglist_use param_count = 0 @@ -217,9 +216,8 @@ for w in sorted(wrappers.keys()) : if k.startswith('param') : l = wrappers[w][k].split() - # near and far might be reserved words or macros so can't be used as formal parameter names - l[0] = l[0].replace('near','zNear') - l[0] = l[0].replace('far','zFar') + # ensure formal parameter names don't collide with reserved names or shadow global declarations + l[0] = l[0] + '_' if l[2] == 'in' : if l[3] == 'array' : @@ -308,12 +306,20 @@ for w in sorted(wrappers.keys()) : if dispatchheader : print 'void glWinSetupDispatchTable(void)' print '{' - print ' struct _glapi_table *disp = _glapi_get_dispatch();' + print ' static struct _glapi_table *disp = NULL;' + print '' + print ' if (!disp)' + print ' {' + print ' disp = calloc(sizeof(void *), _glapi_get_dispatch_table_size());' + print ' assert(disp);' for d in sorted(dispatch.keys()) : if wrappers.has_key(d) : - print ' SET_'+ d + '(disp, (void *)' + prefix + d + 'Wrapper);' + print ' SET_'+ d + '(disp, (void *)' + prefix + d + 'Wrapper);' else : print '#warning No wrapper for ' + prefix + d + ' !' + print ' }' + print '' + print ' _glapi_set_dispatch(disp);' print '}' diff --git a/xserver/hw/xwin/glx/glwrap.c b/xserver/hw/xwin/glx/glwrap.c index 690b82926..73cff3cc1 100644 --- a/xserver/hw/xwin/glx/glwrap.c +++ b/xserver/hw/xwin/glx/glwrap.c @@ -67,7 +67,7 @@ glWinCallDelta(void) } static PROC -glWinResolveHelper(PROC * cache, char *symbol) +glWinResolveHelper(PROC * cache, const char *symbol) { PROC proc = NULL; diff --git a/xserver/hw/xwin/glx/indirect.c b/xserver/hw/xwin/glx/indirect.c index 56f677a8f..00cef3673 100644 --- a/xserver/hw/xwin/glx/indirect.c +++ b/xserver/hw/xwin/glx/indirect.c @@ -86,6 +86,7 @@ #include #include +#include #define NUM_ELEMENTS(x) (sizeof(x)/ sizeof(x[1])) @@ -223,7 +224,7 @@ glxWinErrorMessage(void) if (!FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_MAX_WIDTH_MASK, NULL, last_error, 0, - (LPTSTR) & errorbuffer, sizeof(errorbuffer), NULL)) { + (LPTSTR) &errorbuffer, sizeof(errorbuffer), NULL)) { snprintf(errorbuffer, sizeof(errorbuffer), "Unknown error"); } @@ -341,6 +342,10 @@ swap_method_name(int mthd) static void fbConfigsDump(unsigned int n, __GLXconfig * c) { + LogMessage(X_INFO, "%d fbConfigs\n", n); + + if (g_iLogVerbose < 3) + return; ErrorF("%d fbConfigs\n", n); ErrorF ("pxf vis fb render Ste aux accum MS drawable Group/\n"); @@ -398,7 +403,9 @@ fbConfigsDump(unsigned int n, __GLXconfig * c) static __GLXscreen *glxWinScreenProbe(ScreenPtr pScreen); static __GLXcontext *glxWinCreateContext(__GLXscreen * screen, __GLXconfig * modes, - __GLXcontext * baseShareContext); + __GLXcontext * baseShareContext, + unsigned num_attribs, + const uint32_t * attribs, int *error); static __GLXdrawable *glxWinCreateDrawable(ClientPtr client, __GLXscreen * screen, DrawablePtr pDraw, @@ -473,7 +480,7 @@ static void glxLogExtensions(const char *prefix, const char *extensions) { int length = 0; - char *strl; + const char *strl; char *str = strdup(extensions); if (str == NULL) { @@ -482,6 +489,8 @@ glxLogExtensions(const char *prefix, const char *extensions) } strl = strtok(str, " "); + if (strl == NULL) + strl = ""; ErrorF("%s%s", prefix, strl); length = strlen(prefix) + strlen(strl); @@ -515,6 +524,7 @@ glxWinScreenProbe(ScreenPtr pScreen) { glxWinScreen *screen; const char *gl_extensions; + const char *gl_renderer; const char *wgl_extensions; HWND hwnd; HDC hdc; @@ -538,14 +548,6 @@ glxWinScreenProbe(ScreenPtr pScreen) if (NULL == screen) return NULL; - /* Wrap RealizeWindow, UnrealizeWindow and CopyWindow on this screen */ - screen->RealizeWindow = pScreen->RealizeWindow; - pScreen->RealizeWindow = glxWinRealizeWindow; - screen->UnrealizeWindow = pScreen->UnrealizeWindow; - pScreen->UnrealizeWindow = glxWinUnrealizeWindow; - screen->CopyWindow = pScreen->CopyWindow; - pScreen->CopyWindow = glxWinCopyWindow; - /* Dump out some useful information about the native renderer */ // create window class @@ -595,13 +597,24 @@ glxWinScreenProbe(ScreenPtr pScreen) ErrorF("GL_VERSION: %s\n", glGetStringWrapperNonstatic(GL_VERSION)); ErrorF("GL_VENDOR: %s\n", glGetStringWrapperNonstatic(GL_VENDOR)); - ErrorF("GL_RENDERER: %s\n", glGetStringWrapperNonstatic(GL_RENDERER)); + gl_renderer = (const char *) glGetStringWrapperNonstatic(GL_RENDERER); + ErrorF("GL_RENDERER: %s\n", gl_renderer); gl_extensions = (const char *) glGetStringWrapperNonstatic(GL_EXTENSIONS); - glxLogExtensions("GL_EXTENSIONS: ", gl_extensions); wgl_extensions = wglGetExtensionsStringARBWrapper(hdc); if (!wgl_extensions) wgl_extensions = ""; - glxLogExtensions("WGL_EXTENSIONS: ", wgl_extensions); + + if (g_iLogVerbose >= 3) { + glxLogExtensions("GL_EXTENSIONS: ", gl_extensions); + glxLogExtensions("WGL_EXTENSIONS: ", wgl_extensions); + } + + if (strcasecmp(gl_renderer, "GDI Generic") == 0) { + free(screen); + LogMessage(X_ERROR, + "AIGLX: Won't use generic native renderer as it is not accelerated\n"); + return NULL; + } // Can you see the problem here? The extensions string is DC specific // Different DCs for windows on a multimonitor system driven by multiple cards @@ -720,9 +733,6 @@ glxWinScreenProbe(ScreenPtr pScreen) __glXScreenInit(&screen->base, pScreen); - // dump out fbConfigs now fbConfigIds and visualIDs have been assigned - fbConfigsDump(screen->base.numFBConfigs, screen->base.fbconfigs); - // Override the GL extensions string set by __glXScreenInit() screen->base.GLextensions = strdup(gl_extensions); @@ -765,6 +775,17 @@ glxWinScreenProbe(ScreenPtr pScreen) ReleaseDC(hwnd, hdc); DestroyWindow(hwnd); + // dump out fbConfigs now fbConfigIds and visualIDs have been assigned + fbConfigsDump(screen->base.numFBConfigs, screen->base.fbconfigs); + + /* Wrap RealizeWindow, UnrealizeWindow and CopyWindow on this screen */ + screen->RealizeWindow = pScreen->RealizeWindow; + pScreen->RealizeWindow = glxWinRealizeWindow; + screen->UnrealizeWindow = pScreen->UnrealizeWindow; + pScreen->UnrealizeWindow = glxWinUnrealizeWindow; + screen->CopyWindow = pScreen->CopyWindow; + pScreen->CopyWindow = glxWinCopyWindow; + return &screen->base; } @@ -1349,7 +1370,7 @@ glxWinDeferredCreateContext(__GLXWinContext * gc, __GLXWinDrawable * draw) } draw->hDIB = - CreateDIBSection(draw->dibDC, (BITMAPINFO *) & bmpHeader, + CreateDIBSection(draw->dibDC, (BITMAPINFO *) &bmpHeader, DIB_RGB_COLORS, &pBits, 0, 0); if (draw->dibDC == NULL) { ErrorF("CreateDIBSection error: %s\n", glxWinErrorMessage()); @@ -1571,7 +1592,8 @@ glxWinContextDestroy(__GLXcontext * base) static __GLXcontext * glxWinCreateContext(__GLXscreen * screen, - __GLXconfig * modes, __GLXcontext * baseShareContext) + __GLXconfig * modes, __GLXcontext * baseShareContext, + unsigned num_attribs, const uint32_t * attribs, int *error) { __GLXWinContext *context; __GLXWinContext *shareContext = (__GLXWinContext *) baseShareContext; @@ -1611,6 +1633,18 @@ glxWinCreateContext(__GLXscreen * screen, * Utility functions */ +static int +GetShift(int mask) +{ + int shift = 0; + + while ((mask &1) == 0) { + shift++; + mask >>=1; + } + return shift; +} + static int fbConfigToPixelFormat(__GLXconfig * mode, PIXELFORMATDESCRIPTOR * pfdret, int drawableTypeOverride) @@ -1647,16 +1681,26 @@ fbConfigToPixelFormat(__GLXconfig * mode, PIXELFORMATDESCRIPTOR * pfdret, pfd.dwFlags |= PFD_DOUBLEBUFFER; } - pfd.iPixelType = PFD_TYPE_RGBA; pfd.cColorBits = mode->redBits + mode->greenBits + mode->blueBits; pfd.cRedBits = mode->redBits; - pfd.cRedShift = 0; /* FIXME */ + pfd.cRedShift = GetShift(mode->redMask); pfd.cGreenBits = mode->greenBits; - pfd.cGreenShift = 0; /* FIXME */ + pfd.cGreenShift = GetShift(mode->greenMask); pfd.cBlueBits = mode->blueBits; - pfd.cBlueShift = 0; /* FIXME */ + pfd.cBlueShift = GetShift(mode->blueMask); pfd.cAlphaBits = mode->alphaBits; - pfd.cAlphaShift = 0; /* FIXME */ + pfd.cAlphaShift = GetShift(mode->alphaMask); + + if (mode->visualType == GLX_TRUE_COLOR) { + pfd.iPixelType = PFD_TYPE_RGBA; + pfd.dwVisibleMask = + (pfd.cRedBits << pfd.cRedShift) | (pfd.cGreenBits << pfd.cGreenShift) | + (pfd.cBlueBits << pfd.cBlueShift) | (pfd.cAlphaBits << pfd.cAlphaShift); + } + else { + pfd.iPixelType = PFD_TYPE_COLORINDEX; + pfd.dwVisibleMask = mode->transparentIndex; + } pfd.cAccumBits = mode->accumRedBits + mode->accumGreenBits + mode->accumBlueBits + @@ -1799,8 +1843,8 @@ glxWinCreateConfigs(HDC hdc, glxWinScreen * screen) // get the number of pixelformats numConfigs = DescribePixelFormat(hdc, 1, sizeof(PIXELFORMATDESCRIPTOR), NULL); - GLWIN_DEBUG_MSG("DescribePixelFormat says %d possible pixel formats", - numConfigs); + LogMessage(X_INFO, "%d pixel formats reported by DescribePixelFormat\n", + numConfigs); /* alloc */ result = malloc(sizeof(GLXWinConfig) * numConfigs); @@ -1896,25 +1940,27 @@ glxWinCreateConfigs(HDC hdc, glxWinScreen * screen) /* EXT_visual_info / GLX 1.2 */ if (pfd.iPixelType == PFD_TYPE_COLORINDEX) { c->base.visualType = GLX_STATIC_COLOR; - - if (!getenv("GLWIN_ENABLE_COLORINDEX_FBCONFIGS")) { - GLWIN_DEBUG_MSG - ("pixelFormat %d is PFD_TYPE_COLORINDEX, skipping", i + 1); - continue; - } + c->base.transparentRed = GLX_NONE; + c->base.transparentGreen = GLX_NONE; + c->base.transparentBlue = GLX_NONE; + c->base.transparentAlpha = GLX_NONE; + c->base.transparentIndex = pfd.dwVisibleMask; + c->base.transparentPixel = GLX_TRANSPARENT_INDEX; } else { c->base.visualType = GLX_TRUE_COLOR; + c->base.transparentRed = + (pfd.dwVisibleMask & c->base.redMask) >> pfd.cRedShift; + c->base.transparentGreen = + (pfd.dwVisibleMask & c->base.greenMask) >> pfd.cGreenShift; + c->base.transparentBlue = + (pfd.dwVisibleMask & c->base.blueMask) >> pfd.cBlueShift; + c->base.transparentAlpha = + (pfd.dwVisibleMask & c->base.alphaMask) >> pfd.cAlphaShift; + c->base.transparentIndex = GLX_NONE; + c->base.transparentPixel = GLX_TRANSPARENT_RGB; } - // pfd.dwVisibleMask; ??? - c->base.transparentPixel = GLX_NONE; - c->base.transparentRed = GLX_NONE; - c->base.transparentGreen = GLX_NONE; - c->base.transparentBlue = GLX_NONE; - c->base.transparentAlpha = GLX_NONE; - c->base.transparentIndex = GLX_NONE; - /* ARB_multisample / SGIS_multisample */ c->base.sampleBuffers = 0; c->base.samples = 0; @@ -2045,9 +2091,9 @@ glxWinCreateConfigsExt(HDC hdc, glxWinScreen * screen) return; } - GLWIN_DEBUG_MSG - ("wglGetPixelFormatAttribivARB says %d possible pixel formats", - numConfigs); + LogMessage(X_INFO, + "%d pixel formats reported by wglGetPixelFormatAttribivARB\n", + numConfigs); /* alloc */ result = malloc(sizeof(GLXWinConfig) * numConfigs); @@ -2166,14 +2212,6 @@ glxWinCreateConfigsExt(HDC hdc, glxWinScreen * screen) c->base.indexBits = ATTR_VALUE(WGL_COLOR_BITS_ARB, 0); c->base.rgbBits = 0; c->base.visualType = GLX_STATIC_COLOR; - - if (!getenv("GLWIN_ENABLE_COLORINDEX_FBCONFIGS")) { - GLWIN_DEBUG_MSG - ("pixelFormat %d is WGL_TYPE_COLORINDEX_ARB, skipping", - i + 1); - continue; - } - break; case WGL_TYPE_RGBA_FLOAT_ARB: diff --git a/xserver/hw/xwin/man/Makefile.in b/xserver/hw/xwin/man/Makefile.in index ffe866c07..c880241b1 100644 --- a/xserver/hw/xwin/man/Makefile.in +++ b/xserver/hw/xwin/man/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -179,13 +179,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -207,6 +203,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -231,6 +228,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -246,7 +244,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -361,6 +358,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -481,7 +479,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/manpages.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/manpages.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -507,9 +505,9 @@ $(top_srcdir)/manpages.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/hw/xwin/man/XWin.man b/xserver/hw/xwin/man/XWin.man index d03a36521..18ee667d4 100644 --- a/xserver/hw/xwin/man/XWin.man +++ b/xserver/hw/xwin/man/XWin.man @@ -121,14 +121,16 @@ Alternative name for \fB\-resize=scrollbars\fP. .SH OPTIONS CONTROLLING RESIZE BEHAVIOUR .TP 8 .B \-resize[=none|scrollbars|randr] -Select the resize mode of an X screen. +Select the resize mode of an X screen. The default is randr. .RS .IP \fB\-resize=none\fP 8 -(default). The screen is not resizable. +The screen is not resizable. In windowed mode, if the window has decorations, a fixed frame is used. +Alternative name is \fB\-noresize\fP. + .IP \fB\-resize=scrollbars\fP 8 The screen window is resizeable, but the screen is not resizable. @@ -159,8 +161,8 @@ of the X screen using the RANDR extension is not permitted. The maximum dimensions of the screen are the dimensions of the \fIWindows\fP virtual desktop. -.IP \fB\--resize\fP 8 -on its own is equivalent to \fB\--resize=randr\fP +.IP \fB\-resize\fP 8 +on its own is equivalent to \fB\-resize=randr\fP .RE .SH OPTIONS CONTROLLING WINDOWS INTEGRATION @@ -211,7 +213,7 @@ is disabled by default. .TP 8 .B \-[no]wgl Enable [disable] the GLX extension to use the native Windows WGL interface -for hardware accelerated OpenGL (AIGLX). (Experimental) +for hardware accelerated OpenGL (AIGLX). The default is enabled. .TP 8 .B \-[no]winkill Enable or disable the \fIAlt-F4\fP key combination as a signal to exit the @@ -313,18 +315,22 @@ exit silently and don't display any error message. .B "\-xkbvariant \fIvariant\fp" These options configure the xkeyboard extension to load a particular keyboard map as the X server starts. The behavior is similar -to the \fIsetxkbmap\fP program. The layout data is located at \fI -__datadir__/X11/xkb/\fP. Additional information is found in the -README files therein and in the man page of \fIsetxkbmap\fP. For example -in order to load a German layout for a pc105 keyboard one uses -the options: +to the \fIsetxkbmap\fP(1) program. + +See the \fIxkeyboard-config\fP(__miscmansuffix__) manual page for a list of +keyboard configurations. + +The keyboard layout data is located at \fI__datadir__/X11/xkb/\fP. Additional information +can be found in the README files there and in the \fIsetxkbmap\fP(1) manual page. + +For example, in order to load a German layout for a pc105 keyboard, use the options: .br .I " \-xkblayout de \-xkbmodel pc105" -Alternatively one may use the \fIsetxkbmap\fP program after \fIXWin\fP is +Alternatively, you can use the \fIsetxkbmap\fP(1) program after \fIXWin\fP is running. -The default is to select a configuration matching your current layout as +The default is to select a keyboard configuration matching your current layout as reported by \fIWindows\fP, if known, or the default X server configuration if no matching keyboard configuration was found. @@ -370,7 +376,7 @@ window, in both the generic case and for particular programs. * To change the style that is associated to the \fIWindows\fP window that \fXWin I-multiwindow\fP produces for each top-level X window. .PP -The format of the \fI.XWinrc\fP file is given in the man page XWinrc(5). +The format of the \fI.XWinrc\fP file is given in the XWinrc(5) manual page. .SH EXAMPLES Need some examples @@ -378,15 +384,15 @@ Need some examples .SH "SEE ALSO" X(__miscmansuffix__), Xserver(1), xdm(1), xinit(1), XWinrc(__filemansuffix__), -setxkbmap(1), xkeyboard-config (__miscmansuffix__). +setxkbmap(1), xkeyboard-config(__miscmansuffix__). .SH BUGS .I XWin -and this man page still have many limitations. +and this manual page still have many limitations. The \fIXWin\fP software is continuously developing; it is therefore possible that -this man page is not up to date. It is always prudent to +this manual page is not up to date. It is always prudent to look also at the output of \fIXWin -help\fP in order to check the options that are operative. diff --git a/xserver/hw/xwin/propertystore.h b/xserver/hw/xwin/propertystore.h new file mode 100644 index 000000000..6afc6c954 --- /dev/null +++ b/xserver/hw/xwin/propertystore.h @@ -0,0 +1,83 @@ +/* + * Copyright (C) 2011 Tobias Häußler + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifndef PROPERTYSTORE_H +#define PROPERTYSTORE_H + +#include + +#ifdef __MINGW64_VERSION_MAJOR +/* If we are using headers from mingw-w64 project, it provides the PSDK headers this needs ... */ +#include +#include +#else /* !__MINGW64_VERSION_MAJOR */ +/* ... otherwise, we need to define all this stuff ourselves */ + +typedef struct _tagpropertykey { + GUID fmtid; + DWORD pid; +} PROPERTYKEY; + +#define REFPROPERTYKEY const PROPERTYKEY * +#define REFPROPVARIANT const PROPVARIANT * + +WINOLEAPI PropVariantClear(PROPVARIANT *pvar); + +#ifdef INTERFACE +#undef INTERFACE +#endif + +#define INTERFACE IPropertyStore +DECLARE_INTERFACE_(IPropertyStore, IUnknown) +{ + STDMETHOD(QueryInterface) (THIS_ REFIID, PVOID *) PURE; + STDMETHOD_(ULONG, AddRef) (THIS) PURE; + STDMETHOD_(ULONG, Release) (THIS) PURE; + STDMETHOD(GetCount) (THIS_ DWORD) PURE; + STDMETHOD(GetAt) (THIS_ DWORD, PROPERTYKEY) PURE; + STDMETHOD(GetValue) (THIS_ REFPROPERTYKEY, PROPVARIANT) PURE; + STDMETHOD(SetValue) (THIS_ REFPROPERTYKEY, REFPROPVARIANT) PURE; + STDMETHOD(Commit) (THIS) PURE; +}; + +#undef INTERFACE +typedef IPropertyStore *LPPROPERTYSTORE; + +DEFINE_GUID(IID_IPropertyStore, 0x886d8eeb, 0x8cf2, 0x4446, 0x8d, 0x02, 0xcd, + 0xba, 0x1d, 0xbd, 0xcf, 0x99); + +#ifdef INITGUID +#define DEFINE_PROPERTYKEY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8, pid) GUID_EXT const PROPERTYKEY DECLSPEC_SELECTANY name = { { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }, pid } +#else +#define DEFINE_PROPERTYKEY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8, pid) GUID_EXT const PROPERTYKEY name +#endif + +DEFINE_PROPERTYKEY(PKEY_AppUserModel_ID, 0x9F4C2855, 0x9F79, 0x4B39, 0xA8, 0xD0, + 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3, 5); + +#endif /* !__MINGW64_VERSION_MAJOR */ + +typedef HRESULT(__stdcall * SHGETPROPERTYSTOREFORWINDOWPROC) (HWND, REFIID, + void **); + +#endif diff --git a/xserver/hw/xwin/win.h b/xserver/hw/xwin/win.h index ce90d05e2..fa774bc00 100644 --- a/xserver/hw/xwin/win.h +++ b/xserver/hw/xwin/win.h @@ -133,6 +133,8 @@ #define WIN_MAX_KEYS_PER_KEY 4 +#define NONAMELESSUNION + #include #include #include @@ -169,7 +171,6 @@ #include "micmap.h" #include "mifillarc.h" #include "mifpoly.h" -#include "mibstore.h" #include "input.h" #include "mipointer.h" #include "X11/keysym.h" @@ -249,9 +250,6 @@ if (++PROFPT##point % thresh == 0)\ ErrorF (#point ": PROFILEPOINT hit %u times\n", PROFPT##point);\ } -/* We use xor this macro for detecting toggle key state changes */ -#define WIN_XOR(a,b) ((!(a) && (b)) || ((a) && !(b))) - #define DEFINE_ATOM_HELPER(func,atom_name) \ static Atom func (void) { \ static int generation; \ @@ -275,7 +273,7 @@ typedef void (*winShadowUpdateProcPtr) (ScreenPtr, shadowBufPtr); typedef Bool (*winInitScreenProcPtr) (ScreenPtr); -typedef Bool (*winCloseScreenProcPtr) (int, ScreenPtr); +typedef Bool (*winCloseScreenProcPtr) (ScreenPtr); typedef Bool (*winInitVisualsProcPtr) (ScreenPtr); @@ -388,6 +386,7 @@ typedef struct { DWORD dwScreen; int iMonitor; + HMONITOR hMonitor; DWORD dwUserWidth; DWORD dwUserHeight; DWORD dwWidth; @@ -578,7 +577,6 @@ typedef struct _winPrivScreenRec { UnrealizeWindowProcPtr UnrealizeWindow; ValidateTreeProcPtr ValidateTree; PostValidateTreeProcPtr PostValidateTree; - WindowExposuresProcPtr WindowExposures; CopyWindowProcPtr CopyWindow; ClearToBackgroundProcPtr ClearToBackground; ClipNotifyProcPtr ClipNotify; @@ -779,8 +777,8 @@ void winSetAuthorization(void); void -winBlockHandler(int nScreen, - pointer pBlockData, pointer pTimeout, pointer pReadMask); +winBlockHandler(ScreenPtr pScreen, + pointer pTimeout, pointer pReadMask); #ifdef XWIN_NATIVEGDI /* @@ -858,11 +856,13 @@ void #ifdef DDXOSVERRORF void - OSVenderVErrorF(const char *pszFormat, va_list va_args); +OsVendorVErrorF(const char *pszFormat, va_list va_args) +_X_ATTRIBUTE_PRINTF(1, 0); #endif void - winMessageBoxF(const char *pszError, UINT uType, ...); +winMessageBoxF(const char *pszError, UINT uType, ...) +_X_ATTRIBUTE_PRINTF(1, 3); #ifdef XWIN_NATIVEGDI /* @@ -1053,24 +1053,12 @@ void winPolyLineNativeGDI(DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, DDXPointPtr ppt); #endif - -#ifdef XWIN_NATIVEGDI -/* - * winpushpxl.c - */ - -void - -winPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDrawable, - int dx, int dy, int xOrg, int yOrg); -#endif - /* * winscrinit.c */ Bool - winScreenInit(int index, ScreenPtr pScreen, int argc, char **argv); + winScreenInit(ScreenPtr pScreen, int argc, char **argv); Bool winFinishScreenInitFB(int index, ScreenPtr pScreen, int argc, char **argv); @@ -1122,8 +1110,7 @@ Bool void -winWakeupHandler(int nScreen, - pointer pWakeupData, +winWakeupHandler(ScreenPtr pScreen, unsigned long ulResult, pointer pReadmask); /* @@ -1175,15 +1162,6 @@ Bool void winSetShapeRootless(WindowPtr pWindow, int kind); -/* - * winmultiwindowicons.c - Used by both multi-window and Win32Rootless - */ - -HICON winXIconToHICON(WindowPtr pWin, int iconSize); - -void - winSelectIcons(WindowPtr pWin, HICON * pIcon, HICON * pSmallIcon); - #ifdef XWIN_MULTIWINDOW /* * winmultiwindowshape.c diff --git a/xserver/hw/xwin/winSetAppUserModelID.c b/xserver/hw/xwin/winSetAppUserModelID.c new file mode 100644 index 000000000..41615e19c --- /dev/null +++ b/xserver/hw/xwin/winSetAppUserModelID.c @@ -0,0 +1,110 @@ +/* + * Copyright (C) 2011 Tobias Häußler + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifdef HAVE_XWIN_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include "winwindow.h" +#include "os.h" +#include "winmsg.h" + +#include + +#define INITGUID +#include "initguid.h" +#include "propertystore.h" +#undef INITGUID + +static HMODULE g_hmodShell32Dll = NULL; +static SHGETPROPERTYSTOREFORWINDOWPROC g_pSHGetPropertyStoreForWindow = NULL; + +void +winPropertyStoreInit(void) +{ + /* + Load library and get function pointer to SHGetPropertyStoreForWindow() + + SHGetPropertyStoreForWindow is only supported since Windows 7. On previous + versions the pointer will be NULL and taskbar grouping is not supported. + winSetAppUserModelID() will do nothing in this case. + */ + g_hmodShell32Dll = LoadLibrary("shell32.dll"); + if (g_hmodShell32Dll == NULL) { + ErrorF("winPropertyStoreInit - Could not load shell32.dll\n"); + return; + } + + g_pSHGetPropertyStoreForWindow = + (SHGETPROPERTYSTOREFORWINDOWPROC) GetProcAddress(g_hmodShell32Dll, + "SHGetPropertyStoreForWindow"); + if (g_pSHGetPropertyStoreForWindow == NULL) { + ErrorF + ("winPropertyStoreInit - Could not get SHGetPropertyStoreForWindow address\n"); + return; + } +} + +void +winPropertyStoreDestroy(void) +{ + if (g_hmodShell32Dll != NULL) { + FreeLibrary(g_hmodShell32Dll); + g_hmodShell32Dll = NULL; + g_pSHGetPropertyStoreForWindow = NULL; + } +} + +void +winSetAppUserModelID(HWND hWnd, const char *AppID) +{ + PROPVARIANT pv; + IPropertyStore *pps = NULL; + HRESULT hr; + + if (g_pSHGetPropertyStoreForWindow == NULL) { + return; + } + + winDebug("winSetAppUserMOdelID - hwnd 0x%08x appid '%s'\n", hWnd, AppID); + + hr = g_pSHGetPropertyStoreForWindow(hWnd, &IID_IPropertyStore, + (void **) &pps); + if (SUCCEEDED(hr) && pps) { + memset(&pv, 0, sizeof(PROPVARIANT)); + if (AppID) { + pv.vt = VT_LPWSTR; + hr = SHStrDupA(AppID, &pv.pwszVal); + } + + if (SUCCEEDED(hr)) { + pps->lpVtbl->SetValue(pps, &PKEY_AppUserModel_ID, &pv); + PropVariantClear(&pv); + } + pps->lpVtbl->Release(pps); + } +} diff --git a/xserver/hw/xwin/winallpriv.c b/xserver/hw/xwin/winallpriv.c index ea3126fa0..cc3b3d1ba 100644 --- a/xserver/hw/xwin/winallpriv.c +++ b/xserver/hw/xwin/winallpriv.c @@ -110,7 +110,7 @@ winAllocatePrivates(ScreenPtr pScreen) */ Bool -winInitCmapPrivates(ColormapPtr pcmap, int index) +winInitCmapPrivates(ColormapPtr pcmap, int i) { #if CYGDEBUG winDebug("winInitCmapPrivates\n"); diff --git a/xserver/hw/xwin/winblock.c b/xserver/hw/xwin/winblock.c index c18d080fa..c3ef4becd 100644 --- a/xserver/hw/xwin/winblock.c +++ b/xserver/hw/xwin/winblock.c @@ -36,20 +36,32 @@ /* See Porting Layer Definition - p. 6 */ void -winBlockHandler(int nScreen, - pointer pBlockData, pointer pTimeout, pointer pReadMask) +winBlockHandler(ScreenPtr pScreen, + pointer pTimeout, pointer pReadMask) { #if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) - winScreenPriv((ScreenPtr) pBlockData); + winScreenPriv(pScreen); #endif - MSG msg; #ifndef HAS_DEVWINDOWS struct timeval **tvp = pTimeout; if (*tvp != NULL) { + if (GetQueueStatus(QS_ALLINPUT | QS_ALLPOSTMESSAGE) != 0) { + /* If there are still messages to process on the Windows message + queue, make sure select() just polls rather than blocking. + */ + (*tvp)->tv_sec = 0; + (*tvp)->tv_usec = 0; + } + else { + /* Otherwise, lacking /dev/windows, we must wake up again in + a reasonable time to check the Windows message queue. without + noticeable delay. + */ (*tvp)->tv_sec = 0; (*tvp)->tv_usec = 100; + } } #endif @@ -58,7 +70,7 @@ winBlockHandler(int nScreen, if (pScreenPriv != NULL && !pScreenPriv->fServerStarted) { int iReturn; - winDebug("winBlockHandler - Releasing pmServerStarted\n"); + ErrorF("winBlockHandler - pthread_mutex_unlock()\n"); /* Flag that modules are to be started */ pScreenPriv->fServerStarted = TRUE; @@ -68,22 +80,19 @@ winBlockHandler(int nScreen, if (iReturn != 0) { ErrorF("winBlockHandler - pthread_mutex_unlock () failed: %d\n", iReturn); - goto winBlockHandler_ProcessMessages; } - - winDebug("winBlockHandler - pthread_mutex_unlock () returned\n"); + else { + winDebug("winBlockHandler - pthread_mutex_unlock () returned\n"); + } } - - winBlockHandler_ProcessMessages: #endif - /* Process all messages on our queue */ - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { - if ((g_hDlgDepthChange == 0 - || !IsDialogMessage(g_hDlgDepthChange, &msg)) - && (g_hDlgExit == 0 || !IsDialogMessage(g_hDlgExit, &msg)) - && (g_hDlgAbout == 0 || !IsDialogMessage(g_hDlgAbout, &msg))) { - DispatchMessage(&msg); - } - } + /* + At least one X client has asked to suspend the screensaver, so + reset Windows' display idle timer + */ +#ifdef SCREENSAVER + if (screenSaverSuspended) + SetThreadExecutionState(ES_DISPLAY_REQUIRED); +#endif } diff --git a/xserver/hw/xwin/winclipboard.h b/xserver/hw/xwin/winclipboard.h index 203a9639a..2cd775d6b 100644 --- a/xserver/hw/xwin/winclipboard.h +++ b/xserver/hw/xwin/winclipboard.h @@ -79,7 +79,6 @@ */ extern char *display; -extern void ErrorF(const char * /*f */ , ...); extern void winDebug(const char *format, ...); extern void winErrorFVerb(int verb, const char *format, ...); @@ -100,7 +99,7 @@ void winClipboardDOStoUNIX(char *pszData, int iLength); void - winClipboardUNIXtoDOS(unsigned char **ppszData, int iLength); + winClipboardUNIXtoDOS(char **ppszData, int iLength); /* * winclipboardthread.c @@ -111,13 +110,6 @@ void *winClipboardProc(void *); void winDeinitClipboard(void); -/* - * winclipboardunicode.c - */ - -Bool - winClipboardDetectUnicodeSupport(void); - /* * winclipboardwndproc.c */ diff --git a/xserver/hw/xwin/winclipboardinit.c b/xserver/hw/xwin/winclipboardinit.c index 696d9e2d6..304e6df9f 100644 --- a/xserver/hw/xwin/winclipboardinit.c +++ b/xserver/hw/xwin/winclipboardinit.c @@ -58,7 +58,7 @@ extern HWND g_hwndClipboard; Bool winInitClipboard(void) { - ErrorF("winInitClipboard ()\n"); + winDebug("winInitClipboard ()\n"); /* Wrap some internal server functions */ if (ProcVector[X_SetSelectionOwner] != winProcSetSelectionOwner) { diff --git a/xserver/hw/xwin/winclipboardtextconv.c b/xserver/hw/xwin/winclipboardtextconv.c index 74a351b17..fd405a02e 100644 --- a/xserver/hw/xwin/winclipboardtextconv.c +++ b/xserver/hw/xwin/winclipboardtextconv.c @@ -38,7 +38,7 @@ void winClipboardDOStoUNIX(char *pszSrc, int iLength); void - winClipboardUNIXtoDOS(unsigned char **ppszData, int iLength); + winClipboardUNIXtoDOS(char **ppszData, int iLength); /* * Convert \r\n to \n @@ -75,12 +75,12 @@ winClipboardDOStoUNIX(char *pszSrc, int iLength) */ void -winClipboardUNIXtoDOS(unsigned char **ppszData, int iLength) +winClipboardUNIXtoDOS(char **ppszData, int iLength) { int iNewlineCount = 0; - unsigned char *pszSrc = *ppszData; - unsigned char *pszEnd = pszSrc + iLength; - unsigned char *pszDest = NULL, *pszDestBegin = NULL; + char *pszSrc = *ppszData; + char *pszEnd = pszSrc + iLength; + char *pszDest = NULL, *pszDestBegin = NULL; winDebug("UNIXtoDOS () - Original data:'%s'\n", *ppszData); diff --git a/xserver/hw/xwin/winclipboardthread.c b/xserver/hw/xwin/winclipboardthread.c index 181cb7203..c8508a9b8 100644 --- a/xserver/hw/xwin/winclipboardthread.c +++ b/xserver/hw/xwin/winclipboardthread.c @@ -36,6 +36,7 @@ #define HAS_WINSOCK 1 #endif #include +#include #include "winclipboard.h" #ifdef __CYGWIN__ #include @@ -47,7 +48,6 @@ */ extern Bool g_fUnicodeClipboard; -extern unsigned long serverGeneration; extern Bool g_fClipboardStarted; extern Bool g_fClipboardLaunched; extern Bool g_fClipboard; @@ -64,7 +64,6 @@ static int clipboardRestarts = 0; static XIOErrorHandler g_winClipboardOldIOErrorHandler; static pthread_t g_winClipboardProcThread; -Bool g_fUnicodeSupport = FALSE; Bool g_fUseUnicode = FALSE; /* @@ -103,14 +102,11 @@ winClipboardProc(void *pvNotUsed) char szDisplay[512]; int iSelectError; - ErrorF("winClipboardProc - Hello\n"); + winDebug("winClipboardProc - Hello\n"); ++clipboardRestarts; - /* Do we have Unicode support? */ - g_fUnicodeSupport = winClipboardDetectUnicodeSupport(); - /* Do we use Unicode clipboard? */ - fUseUnicode = g_fUnicodeClipboard && g_fUnicodeSupport; + fUseUnicode = g_fUnicodeClipboard; /* Save the Unicode support flag in a global */ g_fUseUnicode = fUseUnicode; @@ -417,7 +413,7 @@ winClipboardProc(void *pvNotUsed) ("winClipboardProc - the clipboard thread has restarted %d times and seems to be unstable, disabling clipboard integration\n", clipboardRestarts); g_fClipboard = FALSE; - return; + return NULL; } if (g_fClipboard) { @@ -426,7 +422,7 @@ winClipboardProc(void *pvNotUsed) /* Create the clipboard client thread */ if (!winInitClipboard()) { ErrorF("winClipboardProc - winClipboardInit failed.\n"); - return; + return NULL; } winDebug("winClipboardProc - winInitClipboard returned.\n"); @@ -436,7 +432,7 @@ winClipboardProc(void *pvNotUsed) else { ErrorF("winClipboardProc - Clipboard disabled - Exit from server \n"); /* clipboard thread has exited, stop server as well */ - kill(getpid(), SIGTERM); + raise(SIGTERM); } return NULL; diff --git a/xserver/hw/xwin/winclipboardunicode.c b/xserver/hw/xwin/winclipboardunicode.c deleted file mode 100644 index 9c06f7b4d..000000000 --- a/xserver/hw/xwin/winclipboardunicode.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - *Copyright (C) 2003-2004 Harold L Hunt II All Rights Reserved. - * - *Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - *"Software"), to deal in the Software without restriction, including - *without limitation the rights to use, copy, modify, merge, publish, - *distribute, sublicense, and/or sell copies of the Software, and to - *permit persons to whom the Software is furnished to do so, subject to - *the following conditions: - * - *The above copyright notice and this permission notice shall be - *included in all copies or substantial portions of the Software. - * - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - *NONINFRINGEMENT. IN NO EVENT SHALL HAROLD L HUNT II BE LIABLE FOR - *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - *Except as contained in this notice, the name of Harold L Hunt II - *shall not be used in advertising or otherwise to promote the sale, use - *or other dealings in this Software without prior written authorization - *from Harold L Hunt II. - * - * Authors: Harold L Hunt II - */ - -#ifdef HAVE_XWIN_CONFIG_H -#include -#endif -#include "winclipboard.h" - -/* - * Determine whether we suport Unicode or not. - * NOTE: Currently, just check if we are on an NT-based platform or not. - */ - -Bool -winClipboardDetectUnicodeSupport(void) -{ - Bool fReturn = FALSE; - OSVERSIONINFO osvi = { 0 }; - - /* Get operating system version information */ - osvi.dwOSVersionInfoSize = sizeof(osvi); - GetVersionEx(&osvi); - - /* Branch on platform ID */ - switch (osvi.dwPlatformId) { - case VER_PLATFORM_WIN32_NT: - /* Unicode supported on NT only */ - fReturn = TRUE; - break; - - case VER_PLATFORM_WIN32_WINDOWS: - /* Unicode is not supported on non-NT */ - fReturn = FALSE; - break; - } - - return fReturn; -} diff --git a/xserver/hw/xwin/winclipboardwndproc.c b/xserver/hw/xwin/winclipboardwndproc.c index 78b061517..e19f678a7 100644 --- a/xserver/hw/xwin/winclipboardwndproc.c +++ b/xserver/hw/xwin/winclipboardwndproc.c @@ -49,7 +49,6 @@ */ extern Bool g_fUseUnicode; -extern Bool g_fUnicodeSupport; extern void *g_pClipboardDisplay; extern Window g_iClipboardWindow; extern Atom g_atomLastOwnedSelection; @@ -60,6 +59,7 @@ extern Atom g_atomLastOwnedSelection; static int + winProcessXEventsTimeout(HWND hwnd, int iWindow, Display * pDisplay, Bool fUseUnicode, int iTimeoutSec); @@ -74,10 +74,10 @@ winProcessXEventsTimeout(HWND hwnd, int iWindow, Display * pDisplay, int iConnNumber; struct timeval tv; int iReturn; - DWORD dwStopTime = (GetTickCount() / 1000) + iTimeoutSec; + DWORD dwStopTime = GetTickCount() + iTimeoutSec * 1000; - /* We need to ensure that all pending events are processed */ - XSync(pDisplay, FALSE); + winDebug("winProcessXEventsTimeout () - pumping X events for %d seconds\n", + iTimeoutSec); /* Get our connection number */ iConnNumber = ConnectionNumber(pDisplay); @@ -85,17 +85,24 @@ winProcessXEventsTimeout(HWND hwnd, int iWindow, Display * pDisplay, /* Loop for X events */ while (1) { fd_set fdsRead; + long remainingTime; + + /* We need to ensure that all pending events are processed */ + XSync(pDisplay, FALSE); /* Setup the file descriptor set */ FD_ZERO(&fdsRead); FD_SET(iConnNumber, &fdsRead); /* Adjust timeout */ - tv.tv_sec = dwStopTime - (GetTickCount() / 1000); - tv.tv_usec = 0; + remainingTime = dwStopTime - GetTickCount(); + tv.tv_sec = remainingTime / 1000; + tv.tv_usec = (remainingTime % 1000) * 1000; + winDebug("winProcessXEventsTimeout () - %d milliseconds left\n", + remainingTime); /* Break out if no time left */ - if (tv.tv_sec < 0) + if (remainingTime <= 0) return WIN_XEVENTS_SUCCESS; /* Wait for an X event */ @@ -103,7 +110,7 @@ winProcessXEventsTimeout(HWND hwnd, int iWindow, Display * pDisplay, &fdsRead, /* Read mask */ NULL, /* No write mask */ NULL, /* No exception mask */ - &tv); /* No timeout */ + &tv); /* Timeout */ if (iReturn < 0) { ErrorF("winProcessXEventsTimeout - Call to select () failed: %d. " "Bailing.\n", iReturn); @@ -116,11 +123,19 @@ winProcessXEventsTimeout(HWND hwnd, int iWindow, Display * pDisplay, /* Exit when we see that server is shutting down */ iReturn = winClipboardFlushXEvents(hwnd, iWindow, pDisplay, fUseUnicode); + + winDebug + ("winProcessXEventsTimeout () - winClipboardFlushXEvents returned %d\n", + iReturn); + if (WIN_XEVENTS_NOTIFY == iReturn) { /* Bail out if notify processed */ return iReturn; } } + else { + winDebug("winProcessXEventsTimeout - Spurious wake\n"); + } } return WIN_XEVENTS_SUCCESS; @@ -415,7 +430,7 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) if (message == WM_RENDERALLFORMATS) fConvertToUnicode = FALSE; else - fConvertToUnicode = g_fUnicodeSupport && (CF_UNICODETEXT == wParam); + fConvertToUnicode = (CF_UNICODETEXT == wParam); /* Request the selection contents */ iReturn = XConvertSelection(pDisplay, @@ -470,8 +485,7 @@ winClipboardWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) */ if (WIN_XEVENTS_NOTIFY != iReturn) { /* Paste no data, to satisfy required call to SetClipboardData */ - if (g_fUnicodeSupport) - SetClipboardData(CF_UNICODETEXT, NULL); + SetClipboardData(CF_UNICODETEXT, NULL); SetClipboardData(CF_TEXT, NULL); ErrorF diff --git a/xserver/hw/xwin/winclipboardwrappers.c b/xserver/hw/xwin/winclipboardwrappers.c index 53b419ea0..008088b6a 100644 --- a/xserver/hw/xwin/winclipboardwrappers.c +++ b/xserver/hw/xwin/winclipboardwrappers.c @@ -49,10 +49,6 @@ * Local function prototypes */ -int winProcEstablishConnection(ClientPtr /* client */ ); -int winProcQueryTree(ClientPtr /* client */ ); -int winProcSetSelectionOwner(ClientPtr /* client */ ); - DISPATCH_PROC(winProcEstablishConnection); DISPATCH_PROC(winProcSetSelectionOwner); @@ -60,11 +56,8 @@ DISPATCH_PROC(winProcSetSelectionOwner); * References to external symbols */ -extern Bool g_fUnicodeSupport; -extern int g_iNumScreens; extern unsigned int g_uiAuthDataLen; extern char *g_pAuthData; -extern Bool g_fXdmcpEnabled; extern Bool g_fClipboardLaunched; extern Bool g_fClipboardStarted; extern Bool g_fClipboard; @@ -72,9 +65,6 @@ extern Window g_iClipboardWindow; extern Atom g_atomLastOwnedSelection; extern HWND g_hwndClipboard; -extern winDispatchProcPtr winProcEstablishConnectionOrig; -extern winDispatchProcPtr winProcQueryTreeOrig; -extern winDispatchProcPtr winProcSetSelectionOwnerOrig; /* * Wrapper for internal EstablishConnection function. @@ -90,7 +80,7 @@ winProcEstablishConnection(ClientPtr client) static unsigned long s_ulServerGeneration = 0; if (s_iCallCount == 0) - ErrorF("winProcEstablishConnection - Hello\n"); + winDebug("winProcEstablishConnection - Hello\n"); /* Do nothing if clipboard is not enabled */ if (!g_fClipboard) { @@ -362,11 +352,8 @@ winProcSetSelectionOwner(ClientPtr client) goto winProcSetSelectionOwner_Done; } - /* Advertise Unicode if we support it */ - if (g_fUnicodeSupport) - SetClipboardData(CF_UNICODETEXT, NULL); - - /* Always advertise regular text */ + /* Advertise regular text and unicode */ + SetClipboardData(CF_UNICODETEXT, NULL); SetClipboardData(CF_TEXT, NULL); /* Save handle to last owned selection */ diff --git a/xserver/hw/xwin/winclipboardxevents.c b/xserver/hw/xwin/winclipboardxevents.c index 59b1f0715..226c3f055 100644 --- a/xserver/hw/xwin/winclipboardxevents.c +++ b/xserver/hw/xwin/winclipboardxevents.c @@ -36,12 +36,6 @@ #include "winclipboard.h" #include "misc.h" -/* - * References to external symbols - */ - -extern Bool g_fUnicodeSupport; - /* * Process any pending X events */ @@ -163,7 +157,7 @@ winClipboardFlushXEvents(HWND hwnd, */ iReturn = XSendEvent(pDisplay, eventSelection.requestor, - False, 0L, (XEvent *) & eventSelection); + False, 0L, (XEvent *) &eventSelection); if (iReturn == BadValue || iReturn == BadWindow) { ErrorF("winClipboardFlushXEvents - SelectionRequest - " "XSendEvent () failed\n"); @@ -171,6 +165,24 @@ winClipboardFlushXEvents(HWND hwnd, break; } + /* Close clipboard if we have it open already */ + if (GetOpenClipboardWindow() == hwnd) { + CloseClipboard(); + } + + /* Access the clipboard */ + if (!OpenClipboard(hwnd)) { + ErrorF("winClipboardFlushXEvents - SelectionRequest - " + "OpenClipboard () failed: %08lx\n", GetLastError()); + + /* Abort */ + fAbort = TRUE; + goto winClipboardFlushXEvents_SelectionRequest_Done; + } + + /* Indicate that clipboard was opened */ + fCloseClipboard = TRUE; + /* Check that clipboard format is available */ if (fUseUnicode && !IsClipboardFormatAvailable(CF_UNICODETEXT)) { static int count; /* Hack to stop acroread spamming the log */ @@ -198,24 +210,6 @@ winClipboardFlushXEvents(HWND hwnd, goto winClipboardFlushXEvents_SelectionRequest_Done; } - /* Close clipboard if we have it open already */ - if (GetOpenClipboardWindow() == hwnd) { - CloseClipboard(); - } - - /* Access the clipboard */ - if (!OpenClipboard(hwnd)) { - ErrorF("winClipboardFlushXEvents - SelectionRequest - " - "OpenClipboard () failed: %08lx\n", GetLastError()); - - /* Abort */ - fAbort = TRUE; - goto winClipboardFlushXEvents_SelectionRequest_Done; - } - - /* Indicate that clipboard was opened */ - fCloseClipboard = TRUE; - /* Setup the string style */ if (event.xselectionrequest.target == XA_STRING) xiccesStyle = XStringStyle; @@ -228,10 +222,6 @@ winClipboardFlushXEvents(HWND hwnd, else xiccesStyle = XStringStyle; - /* - * FIXME: Can't pass CF_UNICODETEXT on Windows 95/98/Me - */ - /* Get a pointer to the clipboard text, in desired format */ if (fUseUnicode) { /* Retrieve clipboard data */ @@ -351,7 +341,7 @@ winClipboardFlushXEvents(HWND hwnd, /* Notify the requesting window that the operation has completed */ iReturn = XSendEvent(pDisplay, eventSelection.requestor, - False, 0L, (XEvent *) & eventSelection); + False, 0L, (XEvent *) &eventSelection); if (iReturn == BadValue || iReturn == BadWindow) { ErrorF("winClipboardFlushXEvents - SelectionRequest - " "XSendEvent () failed\n"); @@ -390,7 +380,7 @@ winClipboardFlushXEvents(HWND hwnd, /* Notify the requesting window that the operation is complete */ iReturn = XSendEvent(pDisplay, eventSelection.requestor, - False, 0L, (XEvent *) & eventSelection); + False, 0L, (XEvent *) &eventSelection); if (iReturn == BadValue || iReturn == BadWindow) { /* * Should not be a problem if XSendEvent fails because @@ -687,10 +677,10 @@ winClipboardFlushXEvents(HWND hwnd, free(pwszUnicodeStr); if (hGlobal && pszGlobalData) GlobalUnlock(hGlobal); - if (fSetClipboardData && g_fUnicodeSupport) + if (fSetClipboardData) { SetClipboardData(CF_UNICODETEXT, NULL); - if (fSetClipboardData) SetClipboardData(CF_TEXT, NULL); + } return WIN_XEVENTS_NOTIFY; case SelectionClear: diff --git a/xserver/hw/xwin/winconfig.c b/xserver/hw/xwin/winconfig.c index 313320f1a..9e38113a5 100644 --- a/xserver/hw/xwin/winconfig.c +++ b/xserver/hw/xwin/winconfig.c @@ -762,7 +762,7 @@ ParseOptionValue(int scrnIndex, pointer options, OptionInfoPtr p) case OPTV_STRING: if (*s == '\0') { winDrvMsg(scrnIndex, X_WARNING, - "Option \"%s\" requires an string value\n", p->name); + "Option \"%s\" requires a string value\n", p->name); p->found = FALSE; } else { diff --git a/xserver/hw/xwin/wincreatewnd.c b/xserver/hw/xwin/wincreatewnd.c index 0a18a6a29..6732dcb58 100644 --- a/xserver/hw/xwin/wincreatewnd.c +++ b/xserver/hw/xwin/wincreatewnd.c @@ -34,10 +34,6 @@ #include "win.h" #include "shellapi.h" -#ifndef ABS_AUTOHIDE -#define ABS_AUTOHIDE 1 -#endif - /* * Local function prototypes */ @@ -46,7 +42,7 @@ static Bool winGetWorkArea(RECT * prcWorkArea, winScreenInfo * pScreenInfo); static Bool - winAdjustForAutoHide(RECT * prcWorkArea); + winAdjustForAutoHide(RECT * prcWorkArea, winScreenInfo * pScreenInfo); /* * Create a full screen window @@ -218,7 +214,7 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen) winGetWorkArea(&rcWorkArea, pScreenInfo); /* Adjust for auto-hide taskbars */ - winAdjustForAutoHide(&rcWorkArea); + winAdjustForAutoHide(&rcWorkArea, pScreenInfo); /* Did the user specify a position? */ if (pScreenInfo->fUserGavePosition) { @@ -501,14 +497,32 @@ winGetWorkArea(RECT * prcWorkArea, winScreenInfo * pScreenInfo) int iLeft, iTop; int iPrimaryNonWorkAreaWidth, iPrimaryNonWorkAreaHeight; + /* Use GetMonitorInfo to get work area for monitor */ + if (!pScreenInfo->fMultipleMonitors) { + MONITORINFO mi; + + mi.cbSize = sizeof(MONITORINFO); + if (GetMonitorInfo(pScreenInfo->hMonitor, &mi)) { + *prcWorkArea = mi.rcWork; + + winDebug("winGetWorkArea - Monitor %d WorkArea: %d %d %d %d\n", + pScreenInfo->iMonitor, + (int) prcWorkArea->top, (int) prcWorkArea->left, + (int) prcWorkArea->bottom, (int) prcWorkArea->right); + } + else { + ErrorF("winGetWorkArea - GetMonitorInfo() failed for monitor %d\n", + pScreenInfo->iMonitor); + } + + /* Bail out here if we aren't using multiple monitors */ + return TRUE; + } + /* SPI_GETWORKAREA only gets the work area of the primary screen. */ SystemParametersInfo(SPI_GETWORKAREA, 0, prcWorkArea, 0); - /* Bail out here if we aren't using multiple monitors */ - if (!pScreenInfo->fMultipleMonitors) - return TRUE; - - winDebug("winGetWorkArea - Original WorkArea: %d %d %d %d\n", + winDebug("winGetWorkArea - Primary Monitor WorkArea: %d %d %d %d\n", (int) prcWorkArea->top, (int) prcWorkArea->left, (int) prcWorkArea->bottom, (int) prcWorkArea->right); @@ -556,16 +570,39 @@ winGetWorkArea(RECT * prcWorkArea, winScreenInfo * pScreenInfo) return TRUE; } +static Bool +winTaskbarOnScreenEdge(unsigned int uEdge, winScreenInfo * pScreenInfo) +{ + APPBARDATA abd; + HWND hwndAutoHide; + + ZeroMemory(&abd, sizeof(abd)); + abd.cbSize = sizeof(abd); + abd.uEdge = uEdge; + + hwndAutoHide = (HWND) SHAppBarMessage(ABM_GETAUTOHIDEBAR, &abd); + if (hwndAutoHide != NULL) { + /* + Found an autohide taskbar on that edge, but is it on the + same monitor as the screen window? + */ + if (pScreenInfo->fMultipleMonitors || + (MonitorFromWindow(hwndAutoHide, MONITOR_DEFAULTTONULL) == + pScreenInfo->hMonitor)) + return TRUE; + } + return FALSE; +} + /* * Adjust the client area so that any auto-hide toolbars * will work correctly. */ static Bool -winAdjustForAutoHide(RECT * prcWorkArea) +winAdjustForAutoHide(RECT * prcWorkArea, winScreenInfo * pScreenInfo) { APPBARDATA abd; - HWND hwndAutoHide; winDebug("winAdjustForAutoHide - Original WorkArea: %d %d %d %d\n", (int) prcWorkArea->top, (int) prcWorkArea->left, @@ -577,34 +614,31 @@ winAdjustForAutoHide(RECT * prcWorkArea) if (SHAppBarMessage(ABM_GETSTATE, &abd) & ABS_AUTOHIDE) winDebug("winAdjustForAutoHide - Taskbar is auto hide\n"); + /* + Despite the forgoing, we are checking for any AppBar + hiding along a monitor edge, not just the Windows TaskBar. + */ + /* Look for a TOP auto-hide taskbar */ - abd.uEdge = ABE_TOP; - hwndAutoHide = (HWND) SHAppBarMessage(ABM_GETAUTOHIDEBAR, &abd); - if (hwndAutoHide != NULL) { + if (winTaskbarOnScreenEdge(ABE_TOP, pScreenInfo)) { winDebug("winAdjustForAutoHide - Found TOP auto-hide taskbar\n"); prcWorkArea->top += 1; } /* Look for a LEFT auto-hide taskbar */ - abd.uEdge = ABE_LEFT; - hwndAutoHide = (HWND) SHAppBarMessage(ABM_GETAUTOHIDEBAR, &abd); - if (hwndAutoHide != NULL) { + if (winTaskbarOnScreenEdge(ABE_LEFT, pScreenInfo)) { winDebug("winAdjustForAutoHide - Found LEFT auto-hide taskbar\n"); prcWorkArea->left += 1; } /* Look for a BOTTOM auto-hide taskbar */ - abd.uEdge = ABE_BOTTOM; - hwndAutoHide = (HWND) SHAppBarMessage(ABM_GETAUTOHIDEBAR, &abd); - if (hwndAutoHide != NULL) { + if (winTaskbarOnScreenEdge(ABE_BOTTOM, pScreenInfo)) { winDebug("winAdjustForAutoHide - Found BOTTOM auto-hide taskbar\n"); prcWorkArea->bottom -= 1; } /* Look for a RIGHT auto-hide taskbar */ - abd.uEdge = ABE_RIGHT; - hwndAutoHide = (HWND) SHAppBarMessage(ABM_GETAUTOHIDEBAR, &abd); - if (hwndAutoHide != NULL) { + if (winTaskbarOnScreenEdge(ABE_RIGHT, pScreenInfo)) { winDebug("winAdjustForAutoHide - Found RIGHT auto-hide taskbar\n"); prcWorkArea->right -= 1; } @@ -613,14 +647,5 @@ winAdjustForAutoHide(RECT * prcWorkArea) (int) prcWorkArea->top, (int) prcWorkArea->left, (int) prcWorkArea->bottom, (int) prcWorkArea->right); -#if 0 - /* Obtain the task bar window dimensions */ - abd.hWnd = hwndAutoHide; - hwndAutoHide = (HWND) SHAppBarMessage(ABM_GETTASKBARPOS, &abd); - winDebug("hwndAutoHide %08x abd.hWnd %08x %d %d %d %d\n", - hwndAutoHide, abd.hWnd, - abd.rc.top, abd.rc.left, abd.rc.bottom, abd.rc.right); -#endif - return TRUE; } diff --git a/xserver/hw/xwin/wincursor.c b/xserver/hw/xwin/wincursor.c index b56104fde..2962d06ad 100644 --- a/xserver/hw/xwin/wincursor.c +++ b/xserver/hw/xwin/wincursor.c @@ -104,7 +104,7 @@ winPointerWarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) /* Translate the client area coords to screen coords */ MapWindowPoints(pScreenPriv->hwndScreen, - HWND_DESKTOP, (LPPOINT) & rcClient, 2); + HWND_DESKTOP, (LPPOINT) &rcClient, 2); /* * Update the Windows cursor position so that we don't @@ -158,7 +158,6 @@ winLoadCursor(ScreenPtr pScreen, CursorPtr pCursor, int screen) HBITMAP hAnd, hXor; ICONINFO ii; unsigned char *pCur; - int x, y; unsigned char bit; HDC hDC; BITMAPV4HEADER bi; @@ -262,6 +261,7 @@ winLoadCursor(ScreenPtr pScreen, CursorPtr pCursor, int screen) sizeof(unsigned long)); if (lpBits) { + int y; for (y = 0; y < nCY; y++) { unsigned long *src, *dst; @@ -275,7 +275,7 @@ winLoadCursor(ScreenPtr pScreen, CursorPtr pCursor, int screen) if (!lpBits) { /* Bicolor, use a palettized DIB */ WIN_DEBUG_MSG("winLoadCursor: Trying two color cursor\n"); - pbmi = (BITMAPINFO *) & bi; + pbmi = (BITMAPINFO *) &bi; memset(pbmi, 0, sizeof(BITMAPINFOHEADER)); pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER); pbmi->bmiHeader.biWidth = pScreenPriv->cursor.sm_cx; @@ -305,6 +305,7 @@ winLoadCursor(ScreenPtr pScreen, CursorPtr pCursor, int screen) pCur = (unsigned char *) lpBits; if (lpBits) { + int x, y; for (y = 0; y < pScreenPriv->cursor.sm_cy; y++) { for (x = 0; x < pScreenPriv->cursor.sm_cx; x++) { if (x >= nCX || y >= nCY) /* Outside of X11 icon bounds */ @@ -357,7 +358,7 @@ winLoadCursor(ScreenPtr pScreen, CursorPtr pCursor, int screen) CreateCompatibleBitmap(hDC, pScreenPriv->cursor.sm_cx, pScreenPriv->cursor.sm_cy); SetDIBits(hDC, hXor, 0, pScreenPriv->cursor.sm_cy, lpBits, - (BITMAPINFO *) & bi, DIB_RGB_COLORS); + (BITMAPINFO *) &bi, DIB_RGB_COLORS); ReleaseDC(NULL, hDC); } free(lpBits); diff --git a/xserver/hw/xwin/windialogs.c b/xserver/hw/xwin/windialogs.c index c62b5dbe9..a02146e95 100644 --- a/xserver/hw/xwin/windialogs.c +++ b/xserver/hw/xwin/windialogs.c @@ -492,7 +492,7 @@ winChangeDepthDlgProc(HWND hwndDialog, UINT message, switch (LOWORD(wParam)) { case IDOK: case IDCANCEL: - ErrorF("winChangeDepthDlgProc - WM_COMMAND - IDOK or IDCANCEL\n"); + winDebug("winChangeDepthDlgProc - WM_COMMAND - IDOK or IDCANCEL\n"); /* * User dismissed the dialog, hide it until the @@ -504,7 +504,7 @@ winChangeDepthDlgProc(HWND hwndDialog, UINT message, break; case WM_CLOSE: - ErrorF("winChangeDepthDlgProc - WM_CLOSE\n"); + winDebug("winChangeDepthDlgProc - WM_CLOSE\n"); DestroyWindow(g_hDlgAbout); g_hDlgAbout = NULL; @@ -609,7 +609,7 @@ winAboutDlgProc(HWND hwndDialog, UINT message, WPARAM wParam, LPARAM lParam) switch (LOWORD(wParam)) { case IDOK: case IDCANCEL: - ErrorF("winAboutDlgProc - WM_COMMAND - IDOK or IDCANCEL\n"); + winDebug("winAboutDlgProc - WM_COMMAND - IDOK or IDCANCEL\n"); DestroyWindow(g_hDlgAbout); g_hDlgAbout = NULL; @@ -699,7 +699,7 @@ winAboutDlgProc(HWND hwndDialog, UINT message, WPARAM wParam, LPARAM lParam) break; case WM_CLOSE: - ErrorF("winAboutDlgProc - WM_CLOSE\n"); + winDebug("winAboutDlgProc - WM_CLOSE\n"); DestroyWindow(g_hDlgAbout); g_hDlgAbout = NULL; diff --git a/xserver/hw/xwin/winengine.c b/xserver/hw/xwin/winengine.c index 67489598b..1f55ada58 100644 --- a/xserver/hw/xwin/winengine.c +++ b/xserver/hw/xwin/winengine.c @@ -92,7 +92,7 @@ winDetectSupportedEngines(void) else { /* We have DirectDraw */ winErrorFVerb(2, - "winDetectSupportedEngines - DirectDraw installed\n"); + "winDetectSupportedEngines - DirectDraw installed, allowing ShadowDD\n"); g_dwEnginesSupported |= WIN_SERVER_SHADOW_DD; #ifdef XWIN_PRIMARYFB @@ -100,7 +100,7 @@ winDetectSupportedEngines(void) if (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT) { g_dwEnginesSupported |= WIN_SERVER_PRIMARY_DD; winErrorFVerb(2, - "winDetectSupportedEngines - Allowing PrimaryDD\n"); + "winDetectSupportedEngines - Windows NT, allowing PrimaryDD\n"); } #endif } @@ -108,11 +108,11 @@ winDetectSupportedEngines(void) /* Try to query for DirectDraw4 interface */ ddrval = IDirectDraw_QueryInterface(lpdd, &IID_IDirectDraw4, - (LPVOID *) & lpdd4); + (LPVOID *) &lpdd4); if (SUCCEEDED(ddrval)) { /* We have DirectDraw4 */ winErrorFVerb(2, - "winDetectSupportedEngines - DirectDraw4 installed\n"); + "winDetectSupportedEngines - DirectDraw4 installed, allowing ShadowDDNL\n"); g_dwEnginesSupported |= WIN_SERVER_SHADOW_DDNL; } diff --git a/xserver/hw/xwin/winerror.c b/xserver/hw/xwin/winerror.c index 4049e9735..1318b0f36 100644 --- a/xserver/hw/xwin/winerror.c +++ b/xserver/hw/xwin/winerror.c @@ -36,10 +36,6 @@ #include "win.h" #ifdef DDXOSVERRORF -/* Prototype */ -void - OsVendorVErrorF(const char *pszFormat, va_list va_args); - void OsVendorVErrorF(const char *pszFormat, va_list va_args) { @@ -63,15 +59,16 @@ OsVendorVErrorF(const char *pszFormat, va_list va_args) #endif /* - * os/util.c/FatalError () calls our vendor ErrorF, so the message - * from a FatalError will be logged. Thus, the message for the - * fatal error is not passed to this function. + * os/log.c:FatalError () calls our vendor ErrorF, so the message + * from a FatalError will be logged. * * Attempt to do last-ditch, safe, important cleanup here. */ void -OsVendorFatalError(void) +OsVendorFatalError(const char *f, va_list args) { + char errormsg[1024] = ""; + /* Don't give duplicate warning if UseMsg was called */ if (g_fSilentFatalError) return; @@ -82,9 +79,28 @@ OsVendorFatalError(void) } LogClose(EXIT_ERR_ABORT); - winMessageBoxF("A fatal error has occurred and " PROJECT_NAME - " will now exit.\n" "Please open %s for more information.\n", - MB_ICONERROR, (g_pszLogFile ? g_pszLogFile : "the logfile")); + /* Format the error message */ + vsnprintf(errormsg, sizeof(errormsg), f, args); + + /* + Sometimes the error message needs a bit of cosmetic cleaning + up for use in a dialog box... + */ + { + char *s; + + while ((s = strstr(errormsg, "\n\t")) != NULL) { + s[0] = ' '; + s[1] = '\n'; + } + } + + winMessageBoxF("A fatal error has occurred and " PROJECT_NAME " will now exit.\n\n" + "%s\n\n" + "Please open %s for more information.\n", + MB_ICONERROR, + errormsg, + (g_pszLogFile ? g_pszLogFile : "the logfile")); } /* @@ -111,7 +127,7 @@ winMessageBoxF(const char *pszError, UINT uType, ...) #define MESSAGEBOXF \ "%s\n" \ "Vendor: %s\n" \ - "Release: %d.%d.%d.%d (%d)\n" \ + "Release: %d.%d.%d.%d\n" \ "Contact: %s\n" \ "%s\n\n" \ "XWin was started with the following command-line:\n\n" \ @@ -120,7 +136,7 @@ winMessageBoxF(const char *pszError, UINT uType, ...) size = asprintf(&pszMsgBox, MESSAGEBOXF, pszErrorF, XVENDORNAME, XORG_VERSION_MAJOR, XORG_VERSION_MINOR, XORG_VERSION_PATCH, - XORG_VERSION_SNAP, XORG_VERSION_CURRENT, + XORG_VERSION_SNAP, BUILDERADDR, BUILDERSTRING, g_pszCommandLine); if (size == -1) { diff --git a/xserver/hw/xwin/wingc.c b/xserver/hw/xwin/wingc.c index 8b7c7040c..814d53113 100644 --- a/xserver/hw/xwin/wingc.c +++ b/xserver/hw/xwin/wingc.c @@ -33,11 +33,6 @@ #endif #include "win.h" -void - -winPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDrawable, int dx, - int dy, int xOrg, int yOrg); - /* * Local prototypes */ @@ -135,8 +130,8 @@ winCreateGCNativeGDI(GCPtr pGC) ErrorF("winCreateGCNativeGDI - depth: %d\n", pGC->depth); #endif - pGC->ops = (GCOps *) & winGCOps; - pGC->funcs = (GCFuncs *) & winGCFuncs; + pGC->ops = (GCOps *) &winGCOps; + pGC->funcs = (GCFuncs *) &winGCFuncs; /* We want all coordinates passed to spans functions to be screen relative */ pGC->miTranslate = TRUE; diff --git a/xserver/hw/xwin/winglobals.c b/xserver/hw/xwin/winglobals.c index 4953bd0cf..b34d1a751 100644 --- a/xserver/hw/xwin/winglobals.c +++ b/xserver/hw/xwin/winglobals.c @@ -77,7 +77,7 @@ Bool g_fKeyboardHookLL = FALSE; Bool g_fNoHelpMessageBox = FALSE; Bool g_fSoftwareCursor = FALSE; Bool g_fSilentDupError = FALSE; -Bool g_fNativeGl = FALSE; +Bool g_fNativeGl = TRUE; #ifdef XWIN_CLIPBOARD /* diff --git a/xserver/hw/xwin/winglobals.h b/xserver/hw/xwin/winglobals.h index 2edf9571e..d2e2ba2b4 100644 --- a/xserver/hw/xwin/winglobals.h +++ b/xserver/hw/xwin/winglobals.h @@ -26,6 +26,10 @@ #ifndef WINGLOBALS_H #define WINGLOBALS_H +#ifdef HAVE_XWIN_CONFIG_H +#include +#endif + /* * References to external symbols */ diff --git a/xserver/hw/xwin/winkeybd.c b/xserver/hw/xwin/winkeybd.c index 2ffb9a943..27c114c99 100644 --- a/xserver/hw/xwin/winkeybd.c +++ b/xserver/hw/xwin/winkeybd.c @@ -41,6 +41,9 @@ #include "xkbsrv.h" +/* C does not have a logical XOR operator, so we use a macro instead */ +#define LOGICAL_XOR(a,b) ((!(a) && (b)) || ((a) && !(b))) + static Bool g_winKeyState[NUM_KEYCODES]; /* @@ -53,7 +56,7 @@ static void static void winKeybdCtrl(DeviceIntPtr pDevice, KeybdCtrl * pCtrl); -/* +/* * Translate a Windows WM_[SYS]KEY(UP/DOWN) message * into an ASCII scan code. * @@ -131,7 +134,7 @@ winKeybdCtrl(DeviceIntPtr pDevice, KeybdCtrl * pCtrl) { } -/* +/* * See Porting Layer Definition - p. 18 * winKeybdProc is known as a DeviceProc. */ @@ -259,36 +262,54 @@ winRestoreModeKeyStates(void) XkbStateFieldFromRec(&inputInfo.keyboard->key->xkbInfo->state); winDebug("winRestoreModeKeyStates: state %d\n", internalKeyStates); - /* - * NOTE: The C XOR operator, ^, will not work here because it is - * a bitwise operator, not a logical operator. C does not - * have a logical XOR operator, so we use a macro instead. - */ + /* Check if modifier keys are pressed, and if so, fake a press */ + { + BOOL ctrl = (GetAsyncKeyState(VK_CONTROL) < 0); + BOOL shift = (GetAsyncKeyState(VK_SHIFT) < 0); + BOOL alt = (GetAsyncKeyState(VK_LMENU) < 0); + BOOL altgr = (GetAsyncKeyState(VK_RMENU) < 0); - /* Has the key state changed? */ + if (ctrl && altgr) + ctrl = FALSE; + + if (LOGICAL_XOR(internalKeyStates & ControlMask, ctrl)) + winSendKeyEvent(KEY_LCtrl, ctrl); + + if (LOGICAL_XOR(internalKeyStates & ShiftMask, shift)) + winSendKeyEvent(KEY_ShiftL, shift); + + if (LOGICAL_XOR(internalKeyStates & Mod1Mask, alt)) + winSendKeyEvent(KEY_Alt, alt); + + if (LOGICAL_XOR(internalKeyStates & Mod5Mask, altgr)) + winSendKeyEvent(KEY_AltLang, altgr); + } + + /* + Check if latching modifier key states have changed, and if so, + fake a press and a release to toggle the modifier to the correct + state + */ dwKeyState = GetKeyState(VK_NUMLOCK) & 0x0001; - if (WIN_XOR(internalKeyStates & NumLockMask, dwKeyState)) { + if (LOGICAL_XOR(internalKeyStates & NumLockMask, dwKeyState)) { winSendKeyEvent(KEY_NumLock, TRUE); winSendKeyEvent(KEY_NumLock, FALSE); } - /* Has the key state changed? */ dwKeyState = GetKeyState(VK_CAPITAL) & 0x0001; - if (WIN_XOR(internalKeyStates & LockMask, dwKeyState)) { + if (LOGICAL_XOR(internalKeyStates & LockMask, dwKeyState)) { winSendKeyEvent(KEY_CapsLock, TRUE); winSendKeyEvent(KEY_CapsLock, FALSE); } - /* Has the key state changed? */ dwKeyState = GetKeyState(VK_SCROLL) & 0x0001; - if (WIN_XOR(internalKeyStates & ScrollLockMask, dwKeyState)) { + if (LOGICAL_XOR(internalKeyStates & ScrollLockMask, dwKeyState)) { winSendKeyEvent(KEY_ScrollLock, TRUE); winSendKeyEvent(KEY_ScrollLock, FALSE); } - /* Has the key state changed? */ dwKeyState = GetKeyState(VK_KANA) & 0x0001; - if (WIN_XOR(internalKeyStates & KanaMask, dwKeyState)) { + if (LOGICAL_XOR(internalKeyStates & KanaMask, dwKeyState)) { winSendKeyEvent(KEY_HKTG, TRUE); winSendKeyEvent(KEY_HKTG, FALSE); } @@ -488,8 +509,8 @@ winCheckKeyPressed(WPARAM wParam, LPARAM lParam) return FALSE; } -/* Only on shift release message is sent even if both are pressed. - * Fix this here +/* Only one shift release message is sent even if both are pressed. + * Fix this here */ void winFixShiftKeys(int iScanCode) diff --git a/xserver/hw/xwin/winkeyhook.c b/xserver/hw/xwin/winkeyhook.c index 124150850..fe77b2190 100644 --- a/xserver/hw/xwin/winkeyhook.c +++ b/xserver/hw/xwin/winkeyhook.c @@ -133,24 +133,6 @@ winKeyboardMessageHookLL(int iCode, WPARAM wParam, LPARAM lParam) Bool winInstallKeyboardHookLL(void) { - OSVERSIONINFO osvi = { 0 }; - - /* Get operating system version information */ - osvi.dwOSVersionInfoSize = sizeof(osvi); - GetVersionEx(&osvi); - - /* Branch on platform ID */ - switch (osvi.dwPlatformId) { - case VER_PLATFORM_WIN32_NT: - /* Low-level is supported on NT 4.0 SP3+ only */ - /* TODO: Return FALSE on NT 4.0 with no SP, SP1, or SP2 */ - break; - - case VER_PLATFORM_WIN32_WINDOWS: - /* Low-level hook is not supported on non-NT */ - return FALSE; - } - /* Install the hook only once */ if (!g_hhookKeyboardLL) g_hhookKeyboardLL = SetWindowsHookEx(WH_KEYBOARD_LL, diff --git a/xserver/hw/xwin/winlayouts.h b/xserver/hw/xwin/winlayouts.h index d8875ceb5..8b6b98407 100644 --- a/xserver/hw/xwin/winlayouts.h +++ b/xserver/hw/xwin/winlayouts.h @@ -30,11 +30,11 @@ typedef struct { unsigned int winlayout; int winkbtype; - char *xkbmodel; - char *xkblayout; - char *xkbvariant; - char *xkboptions; - char *layoutname; + const char *xkbmodel; + const char *xkblayout; + const char *xkbvariant; + const char *xkboptions; + const char *layoutname; } WinKBLayoutRec, *WinKBLayoutPtr; /* diff --git a/xserver/hw/xwin/winmonitors.c b/xserver/hw/xwin/winmonitors.c index 26e20b743..955fb9214 100644 --- a/xserver/hw/xwin/winmonitors.c +++ b/xserver/hw/xwin/winmonitors.c @@ -27,6 +27,10 @@ from The Open Group. */ +#ifdef HAVE_XWIN_CONFIG_H +#include +#endif + #include "win.h" #include "winmonitors.h" @@ -48,20 +52,23 @@ getMonitorInfo(HMONITOR hMonitor, HDC hdc, LPRECT rect, LPARAM _data) data->monitorOffsetY = rect->top; data->monitorHeight = rect->bottom - rect->top; data->monitorWidth = rect->right - rect->left; + data->monitorHandle = hMonitor; return FALSE; } return TRUE; } Bool -QueryMonitor(int index, struct GetMonitorInfoData *data) +QueryMonitor(int i, struct GetMonitorInfoData *data) { /* prepare data */ if (data == NULL) return FALSE; memset(data, 0, sizeof(*data)); - data->requestedMonitor = index; + data->requestedMonitor = i; /* query information */ - return EnumDisplayMonitors(NULL, NULL, getMonitorInfo, (LPARAM) data); + EnumDisplayMonitors(NULL, NULL, getMonitorInfo, (LPARAM) data); + + return TRUE; } diff --git a/xserver/hw/xwin/winmonitors.h b/xserver/hw/xwin/winmonitors.h index acef48274..8201e47f4 100644 --- a/xserver/hw/xwin/winmonitors.h +++ b/xserver/hw/xwin/winmonitors.h @@ -1,3 +1,31 @@ +/* + +Copyright 1993, 1998 The Open Group +Copyright (C) Colin Harrison 2005-2008 + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +*/ /* data returned for monitor information */ struct GetMonitorInfoData { @@ -9,6 +37,7 @@ struct GetMonitorInfoData { int monitorOffsetY; int monitorHeight; int monitorWidth; + HMONITOR monitorHandle; }; Bool QueryMonitor(int index, struct GetMonitorInfoData *data); diff --git a/xserver/hw/xwin/winms.h b/xserver/hw/xwin/winms.h index 4355baeb8..32923e503 100644 --- a/xserver/hw/xwin/winms.h +++ b/xserver/hw/xwin/winms.h @@ -30,7 +30,6 @@ * Authors: Harold L Hunt II */ -#define NONAMELESSUNION #define DIRECTDRAW_VERSION 0x0300 #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN @@ -42,7 +41,11 @@ #include #include +#pragma push_macro("Status") +#undef Status +#define Status wStatus #include "ddraw.h" +#pragma pop_macro("Status") #undef CreateWindow diff --git a/xserver/hw/xwin/winmsg.c b/xserver/hw/xwin/winmsg.c index 07c2f30eb..56e7a097c 100644 --- a/xserver/hw/xwin/winmsg.c +++ b/xserver/hw/xwin/winmsg.c @@ -38,7 +38,9 @@ #endif #include -void winVMsg(int, MessageType, int verb, const char *, va_list); +void +winVMsg(int, MessageType, int verb, const char *, va_list) +_X_ATTRIBUTE_PRINTF(4, 0); void winVMsg(int scrnIndex, MessageType type, int verb, const char *format, @@ -135,7 +137,7 @@ winW32ErrorEx(int verb, const char *msg, DWORD errorcode) NULL, errorcode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) & buffer, 0, NULL)) { + (LPTSTR) &buffer, 0, NULL)) { winErrorFVerb(verb, "Unknown error in FormatMessage!\n"); } else { diff --git a/xserver/hw/xwin/winmsg.h b/xserver/hw/xwin/winmsg.h index ec285ba1f..b638f2cb3 100644 --- a/xserver/hw/xwin/winmsg.h +++ b/xserver/hw/xwin/winmsg.h @@ -34,15 +34,29 @@ * Function prototypes */ -void winDrvMsgVerb(int scrnIndex, - MessageType type, int verb, const char *format, ...); -void winDrvMsg(int scrnIndex, MessageType type, const char *format, ...); -void winMsgVerb(MessageType type, int verb, const char *format, ...); -void winMsg(MessageType type, const char *format, ...); -void winDebug(const char *format, ...); -void winTrace(const char *format, ...); +void +winDrvMsgVerb(int scrnIndex, + MessageType type, int verb, const char *format, ...) +_X_ATTRIBUTE_PRINTF(4, 5); +void +winDrvMsg(int scrnIndex, MessageType type, const char *format, ...) +_X_ATTRIBUTE_PRINTF(3, 4); +void +winMsgVerb(MessageType type, int verb, const char *format, ...) +_X_ATTRIBUTE_PRINTF(3, 4); +void +winMsg(MessageType type, const char *format, ...) +_X_ATTRIBUTE_PRINTF(2, 3); +void +winDebug(const char *format, ...) +_X_ATTRIBUTE_PRINTF(1, 2); +void +winTrace(const char *format, ...) +_X_ATTRIBUTE_PRINTF(1, 2); -void winErrorFVerb(int verb, const char *format, ...); +void +winErrorFVerb(int verb, const char *format, ...) +_X_ATTRIBUTE_PRINTF(2, 3); void winW32Error(int verb, const char *message); void winW32ErrorEx(int verb, const char *message, DWORD errorcode); void winDebugWin32Message(const char *function, HWND hwnd, UINT message, diff --git a/xserver/hw/xwin/winmultiwindowicons.c b/xserver/hw/xwin/winmultiwindowicons.c index df59f6066..0322d9816 100644 --- a/xserver/hw/xwin/winmultiwindowicons.c +++ b/xserver/hw/xwin/winmultiwindowicons.c @@ -31,75 +31,65 @@ #ifdef HAVE_XWIN_CONFIG_H #include #endif -#include "win.h" -#include "dixevents.h" -#include "winmultiwindowclass.h" + +#ifndef WINVER +#define WINVER 0x0500 +#endif + +#include +#include +#include + +#include "winresource.h" #include "winprefs.h" - -#include "propertyst.h" -#include "windowstr.h" +#include "winmsg.h" +#include "winmultiwindowicons.h" +#include "winglobals.h" +/* + * global variables + */ +extern HINSTANCE g_hInstance; /* - * Prototypes for local functions + * Scale an X icon ZPixmap into a Windoze icon bitmap */ static void - -winScaleXBitmapToWindows(int iconSize, int effBPP, - PixmapPtr pixmap, unsigned char *image); - -/* - * Scale an X icon bitmap into a Windoze icon bitmap - */ - -static void -winScaleXBitmapToWindows(int iconSize, - int effBPP, PixmapPtr pixmap, unsigned char *image) +winScaleXImageToWindowsIcon(int iconSize, + int effBPP, + int stride, XImage * pixmap, unsigned char *image) { int row, column, effXBPP, effXDepth; unsigned char *outPtr; - char *iconData = 0; - int stride, xStride; + unsigned char *iconData = 0; + int xStride; float factX, factY; int posX, posY; unsigned char *ptr; unsigned int zero; unsigned int color; - effXBPP = BitsPerPixel(pixmap->drawable.depth); - effXDepth = pixmap->drawable.depth; - - if (pixmap->drawable.bitsPerPixel == 15) + effXBPP = pixmap->bits_per_pixel; + if (pixmap->bits_per_pixel == 15) effXBPP = 16; - if (pixmap->drawable.depth == 15) + effXDepth = pixmap->depth; + if (pixmap->depth == 15) effXDepth = 16; - /* Need 16-bit aligned rows for DDBitmaps */ - stride = ((iconSize * effBPP + 15) & (~15)) / 8; - xStride = PixmapBytePad(pixmap->drawable.width, pixmap->drawable.depth); + xStride = pixmap->bytes_per_line; if (stride == 0 || xStride == 0) { ErrorF("winScaleXBitmapToWindows - stride or xStride is zero. " "Bailing.\n"); return; } - /* Allocate memory for icon data */ - iconData = malloc(xStride * pixmap->drawable.height); - if (!iconData) { - ErrorF("winScaleXBitmapToWindows - malloc failed for iconData. " - "Bailing.\n"); - return; - } - /* Get icon data */ - miGetImage((DrawablePtr) &(pixmap->drawable), 0, 0, - pixmap->drawable.width, pixmap->drawable.height, - ZPixmap, 0xffffffff, iconData); + iconData = (unsigned char *) pixmap->data; /* Keep aspect ratio */ - factX = ((float) pixmap->drawable.width) / ((float) iconSize); - factY = ((float) pixmap->drawable.height) / ((float) iconSize); + factX = ((float) pixmap->width) / ((float) iconSize); + factY = ((float) pixmap->height) / ((float) iconSize); if (factX > factY) factY = factX; else @@ -119,8 +109,7 @@ winScaleXBitmapToWindows(int iconSize, ptr += posX / 8; /* Out of X icon bounds, leave space blank */ - if (posX >= pixmap->drawable.width - || posY >= pixmap->drawable.height) + if (posX >= pixmap->width || posY >= pixmap->height) ptr = (unsigned char *) &zero; if ((*ptr) & (1 << (posX & 7))) @@ -162,8 +151,7 @@ winScaleXBitmapToWindows(int iconSize, ptr += posX * (effXBPP / 8); /* Out of X icon bounds, leave space blank */ - if (posX >= pixmap->drawable.width - || posY >= pixmap->drawable.height) + if (posX >= pixmap->width || posY >= pixmap->height) ptr = (unsigned char *) &zero; color = (((*ptr) << 16) + ((*(ptr + 1)) << 8) @@ -203,8 +191,7 @@ winScaleXBitmapToWindows(int iconSize, ptr += posX * (effXBPP / 8); /* Out of X icon bounds, leave space blank */ - if (posX >= pixmap->drawable.width - || posY >= pixmap->drawable.height) + if (posX >= pixmap->width || posY >= pixmap->height) ptr = (unsigned char *) &zero; color = ((*ptr) << 8) + (*(ptr + 1)); switch (effBPP) { @@ -238,7 +225,6 @@ winScaleXBitmapToWindows(int iconSize, } /* end if effxbpp==16) */ } /* end for column */ } /* end for row */ - free(iconData); } static HICON @@ -250,7 +236,7 @@ NetWMToWinIconAlpha(uint32_t * icon) HICON result; HDC hdc = GetDC(NULL); uint32_t *DIB_pixels; - ICONINFO ii = { TRUE }; + ICONINFO ii; BITMAPV4HEADER bmh = { sizeof(bmh) }; /* Define an ARGB pixel format used for Color+Alpha icons */ @@ -264,7 +250,10 @@ NetWMToWinIconAlpha(uint32_t * icon) bmh.bV4GreenMask = 0x0000FF00; bmh.bV4BlueMask = 0x000000FF; - ii.hbmColor = CreateDIBSection(hdc, (BITMAPINFO *) & bmh, + ii.fIcon = TRUE; + ii.xHotspot = 0; /* ignored */ + ii.yHotspot = 0; /* ignored */ + ii.hbmColor = CreateDIBSection(hdc, (BITMAPINFO *) &bmh, DIB_RGB_COLORS, (void **) &DIB_pixels, NULL, 0); ReleaseDC(NULL, hdc); @@ -291,12 +280,15 @@ NetWMToWinIconThreshold(uint32_t * icon) uint32_t *pixels = &icon[2]; int row, col; HICON result; - ICONINFO ii = { TRUE }; + ICONINFO ii; HDC hdc = GetDC(NULL); HDC xorDC = CreateCompatibleDC(hdc); HDC andDC = CreateCompatibleDC(hdc); + ii.fIcon = TRUE; + ii.xHotspot = 0; /* ignored */ + ii.yHotspot = 0; /* ignored */ ii.hbmColor = CreateCompatibleBitmap(hdc, width, height); ii.hbmMask = CreateCompatibleBitmap(hdc, width, height); ReleaseDC(NULL, hdc); @@ -365,202 +357,220 @@ NetWMToWinIcon(int bpp, uint32_t * icon) return NetWMToWinIconThreshold(icon); } -static pointer -GetWindowProp(WindowPtr pWin, Atom name, long int *size_return) -{ - struct _Window *pwin; - struct _Property *prop; - - if (!pWin || !name) { - ErrorF("GetWindowProp - pWin or name was NULL\n"); - return 0; - } - pwin = (struct _Window *) pWin; - if (!pwin->optional) - return NULL; - for (prop = (struct _Property *) pwin->optional->userProps; - prop; prop = prop->next) { - if (prop->propertyName == name) { - *size_return = prop->size; - return prop->data; - } - } - return NULL; -} - /* * Attempt to create a custom icon from the WM_HINTS bitmaps */ -HICON -winXIconToHICON(WindowPtr pWin, int iconSize) +static + HICON +winXIconToHICON(Display * pDisplay, Window id, int iconSize) { - unsigned char *mask, *image, *imageMask; + unsigned char *mask, *image = NULL, *imageMask; unsigned char *dst, *src; - PixmapPtr iconPtr; - PixmapPtr maskPtr; - int planes, bpp, effBPP, stride, maskStride, i; + int planes, bpp, i; int biggest_size = 0; HDC hDC; ICONINFO ii; - WinXWMHints hints; + XWMHints *hints; HICON hIcon = NULL; uint32_t *biggest_icon = NULL; - /* Try to get _NET_WM_ICON icons first */ static Atom _XA_NET_WM_ICON; static int generation; uint32_t *icon, *icon_data = NULL; - long int size = 0; + unsigned long int size; + unsigned long int type; + int format; + unsigned long int left; hDC = GetDC(GetDesktopWindow()); planes = GetDeviceCaps(hDC, PLANES); bpp = GetDeviceCaps(hDC, BITSPIXEL); ReleaseDC(GetDesktopWindow(), hDC); + /* Always prefer _NET_WM_ICON icons */ if (generation != serverGeneration) { generation = serverGeneration; - _XA_NET_WM_ICON = MakeAtom("_NET_WM_ICON", 12, TRUE); + _XA_NET_WM_ICON = XInternAtom(pDisplay, "_NET_WM_ICON", FALSE); } - if (_XA_NET_WM_ICON) - icon_data = GetWindowProp(pWin, _XA_NET_WM_ICON, &size); - if (icon_data) { - for (icon = icon_data; - icon < &icon_data[size] && *icon; + if ((XGetWindowProperty(pDisplay, id, _XA_NET_WM_ICON, + 0, MAXINT, FALSE, + AnyPropertyType, &type, &format, &size, &left, + (unsigned char **) &icon_data) == Success) && + (icon_data != NULL)) { + for (icon = icon_data; icon < &icon_data[size] && *icon; icon = &icon[icon[0] * icon[1] + 2]) { - if (icon[0] == iconSize && icon[1] == iconSize) - return NetWMToWinIcon(bpp, icon); - /* Find the biggest icon and let Windows scale the size */ + /* Find an exact match to the size we require... */ + if (icon[0] == iconSize && icon[1] == iconSize) { + winDebug("winXIconToHICON: found %lu x %lu NetIcon\n", icon[0], + icon[1]); + hIcon = NetWMToWinIcon(bpp, icon); + break; + } + /* Otherwise, find the biggest icon and let Windows scale the size */ else if (biggest_size < icon[0]) { biggest_icon = icon; biggest_size = icon[0]; } } - if (biggest_icon) - return NetWMToWinIcon(bpp, biggest_icon); - } - winDebug("winXIconToHICON - pWin %x: no suitable NetIcon\n", (int) pWin, - iconSize); - winMultiWindowGetWMHints(pWin, &hints); - if (!hints.icon_pixmap) - return NULL; + if (!hIcon && biggest_icon) { + winDebug + ("winXIconToHICON: selected %lu x %lu NetIcon for scaling to %u x %u\n", + biggest_icon[0], biggest_icon[1], iconSize, iconSize); - dixLookupResourceByType((pointer) &iconPtr, hints.icon_pixmap, RT_PIXMAP, - NullClient, DixUnknownAccess); + hIcon = NetWMToWinIcon(bpp, biggest_icon); + } - if (!iconPtr) - return NULL; - - /* 15 BPP is really 16BPP as far as we care */ - if (bpp == 15) - effBPP = 16; - else - effBPP = bpp; - - /* Need 16-bit aligned rows for DDBitmaps */ - stride = ((iconSize * effBPP + 15) & (~15)) / 8; - - /* Mask is 1-bit deep */ - maskStride = ((iconSize * 1 + 15) & (~15)) / 8; - - image = malloc(stride * iconSize); - imageMask = malloc(stride * iconSize); - /* Default to a completely black mask */ - mask = calloc(maskStride, iconSize); - - winScaleXBitmapToWindows(iconSize, effBPP, iconPtr, image); - dixLookupResourceByType((pointer) &maskPtr, hints.icon_mask, RT_PIXMAP, - NullClient, DixUnknownAccess); - - if (maskPtr) { - winScaleXBitmapToWindows(iconSize, 1, maskPtr, mask); - - winScaleXBitmapToWindows(iconSize, effBPP, maskPtr, imageMask); - - /* Now we need to set all bits of the icon which are not masked */ - /* on to 0 because Color is really an XOR, not an OR function */ - dst = image; - src = imageMask; - - for (i = 0; i < (stride * iconSize); i++) - if ((*(src++))) - *(dst++) = 0; - else - dst++; + XFree(icon_data); } - ii.fIcon = TRUE; - ii.xHotspot = 0; /* ignored */ - ii.yHotspot = 0; /* ignored */ + if (!hIcon) { + winDebug("winXIconToHICON: no suitable NetIcon\n"); - /* Create Win32 mask from pixmap shape */ - ii.hbmMask = CreateBitmap(iconSize, iconSize, planes, 1, mask); + hints = XGetWMHints(pDisplay, id); + if (hints) { + winDebug("winXIconToHICON: id 0x%x icon_pixmap hint %x\n", id, + hints->icon_pixmap); - /* Create Win32 bitmap from pixmap */ - ii.hbmColor = CreateBitmap(iconSize, iconSize, planes, bpp, image); + if (hints->icon_pixmap) { + Window root; + int x, y; + unsigned int width, height, border_width, depth; + XImage *xImageIcon; + XImage *xImageMask = NULL; - /* Merge Win32 mask and bitmap into icon */ - hIcon = CreateIconIndirect(&ii); + XGetGeometry(pDisplay, hints->icon_pixmap, &root, &x, &y, + &width, &height, &border_width, &depth); - /* Release Win32 mask and bitmap */ - DeleteObject(ii.hbmMask); - DeleteObject(ii.hbmColor); + xImageIcon = + XGetImage(pDisplay, hints->icon_pixmap, 0, 0, width, height, + 0xFFFFFFFF, ZPixmap); + winDebug("winXIconToHICON: id 0x%x icon Ximage 0x%x\n", id, + xImageIcon); - /* Free X mask and bitmap */ - free(mask); - free(image); - free(imageMask); + if (hints->icon_mask) + xImageMask = + XGetImage(pDisplay, hints->icon_mask, 0, 0, width, + height, 0xFFFFFFFF, ZPixmap); + if (xImageIcon) { + int effBPP, stride, maskStride; + + /* 15 BPP is really 16BPP as far as we care */ + if (bpp == 15) + effBPP = 16; + else + effBPP = bpp; + + /* Need 16-bit aligned rows for DDBitmaps */ + stride = ((iconSize * effBPP + 15) & (~15)) / 8; + + /* Mask is 1-bit deep */ + maskStride = ((iconSize * 1 + 15) & (~15)) / 8; + + image = malloc(stride * iconSize); + imageMask = malloc(stride * iconSize); + mask = malloc(maskStride * iconSize); + + /* Default to a completely black mask */ + memset(imageMask, 0, stride * iconSize); + memset(mask, 0, maskStride * iconSize); + + winScaleXImageToWindowsIcon(iconSize, effBPP, stride, + xImageIcon, image); + + if (xImageMask) { + winScaleXImageToWindowsIcon(iconSize, 1, maskStride, + xImageMask, mask); + winScaleXImageToWindowsIcon(iconSize, effBPP, stride, + xImageMask, imageMask); + } + + /* Now we need to set all bits of the icon which are not masked */ + /* on to 0 because Color is really an XOR, not an OR function */ + dst = image; + src = imageMask; + + for (i = 0; i < (stride * iconSize); i++) + if ((*(src++))) + *(dst++) = 0; + else + dst++; + + ii.fIcon = TRUE; + ii.xHotspot = 0; /* ignored */ + ii.yHotspot = 0; /* ignored */ + + /* Create Win32 mask from pixmap shape */ + ii.hbmMask = + CreateBitmap(iconSize, iconSize, planes, 1, mask); + + /* Create Win32 bitmap from pixmap */ + ii.hbmColor = + CreateBitmap(iconSize, iconSize, planes, bpp, image); + + /* Merge Win32 mask and bitmap into icon */ + hIcon = CreateIconIndirect(&ii); + + /* Release Win32 mask and bitmap */ + DeleteObject(ii.hbmMask); + DeleteObject(ii.hbmColor); + + /* Free X mask and bitmap */ + free(mask); + free(image); + free(imageMask); + + if (xImageMask) + XDestroyImage(xImageMask); + + XDestroyImage(xImageIcon); + } + } + XFree(hints); + } + } return hIcon; } /* - * Change the Windows window icon + * Change the Windows window icon */ #ifdef XWIN_MULTIWINDOW void -winUpdateIcon(Window id) +winUpdateIcon(HWND hWnd, Display * pDisplay, Window id, HICON hIconNew) { - WindowPtr pWin; HICON hIcon, hIconSmall = NULL, hIconOld; - dixLookupResourceByType((pointer) &pWin, id, RT_WINDOW, NullClient, - DixUnknownAccess); - if (pWin) { - winWindowPriv(pWin); - if (pWinPriv->hWnd) { - hIcon = winOverrideIcon((unsigned long) pWin); - if (!hIcon) { - hIcon = winXIconToHICON(pWin, GetSystemMetrics(SM_CXICON)); - if (!hIcon) { - hIcon = g_hIconX; - hIconSmall = g_hSmallIconX; - } - else { - /* Leave undefined if not found */ - hIconSmall = - winXIconToHICON(pWin, GetSystemMetrics(SM_CXSMICON)); - } - } + /* Start with the icon from preferences, if any */ + hIcon = hIconNew; + hIconSmall = hIconNew; - /* Set the large icon */ - hIconOld = (HICON) SendMessage(pWinPriv->hWnd, - WM_SETICON, ICON_BIG, - (LPARAM) hIcon); + /* If we still need an icon, try and get the icon from WM_HINTS */ + if (!hIcon) + hIcon = winXIconToHICON(pDisplay, id, GetSystemMetrics(SM_CXICON)); + if (!hIconSmall) + hIconSmall = + winXIconToHICON(pDisplay, id, GetSystemMetrics(SM_CXSMICON)); - /* Delete the icon if its not the default */ - winDestroyIcon(hIconOld); - - /* Same for the small icon */ - hIconOld = (HICON) SendMessage(pWinPriv->hWnd, - WM_SETICON, ICON_SMALL, - (LPARAM) hIconSmall); - winDestroyIcon(hIconOld); - } + /* If we got the small, but not the large one swap them */ + if (!hIcon && hIconSmall) { + hIcon = hIconSmall; + hIconSmall = NULL; } + + /* Set the large icon */ + hIconOld = (HICON) SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM) hIcon); + /* Delete the old icon if its not the default */ + winDestroyIcon(hIconOld); + + /* Same for the small icon */ + hIconOld = + (HICON) SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM) hIconSmall); + winDestroyIcon(hIconOld); } void @@ -591,37 +601,21 @@ winInitGlobalIcons(void) } void -winSelectIcons(WindowPtr pWin, HICON * pIcon, HICON * pSmallIcon) +winSelectIcons(HICON * pIcon, HICON * pSmallIcon) { HICON hIcon, hSmallIcon; winInitGlobalIcons(); - /* Try and get the icon from WM_HINTS */ - hIcon = winXIconToHICON(pWin, GetSystemMetrics(SM_CXICON)); - hSmallIcon = winXIconToHICON(pWin, GetSystemMetrics(SM_CXSMICON)); - - /* If we got the small, but not the large one swap them */ - if (!hIcon && hSmallIcon) { - hIcon = hSmallIcon; - hSmallIcon = NULL; - } - - /* Use default X icon if no icon loaded from WM_HINTS */ - if (!hIcon) { - hIcon = g_hIconX; - hSmallIcon = g_hSmallIconX; - } + /* Use default X icon */ + hIcon = g_hIconX; + hSmallIcon = g_hSmallIconX; if (pIcon) *pIcon = hIcon; - else - winDestroyIcon(hIcon); if (pSmallIcon) *pSmallIcon = hSmallIcon; - else - winDestroyIcon(hSmallIcon); } void diff --git a/xserver/hw/xwin/winmultiwindowicons.h b/xserver/hw/xwin/winmultiwindowicons.h new file mode 100644 index 000000000..bf7f6eda7 --- /dev/null +++ b/xserver/hw/xwin/winmultiwindowicons.h @@ -0,0 +1,42 @@ +/* + * File: winmultiwindowicons.h + * Purpose: interface for multiwindow mode icon functions + * + * Copyright (c) Jon TURNEY 2012 + * + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifndef WINMULTIWINDOWICONS_H +#define WINMULTIWINDOWICONS_H + +void + winUpdateIcon(HWND hWnd, Display * pDisplay, Window id, HICON hIconNew); + +void + winInitGlobalIcons(void); + +void + winDestroyIcon(HICON hIcon); + +void + winSelectIcons(HICON * pIcon, HICON * pSmallIcon); + +#endif /* WINMULTIWINDOWICONS_H */ diff --git a/xserver/hw/xwin/winmultiwindowshape.c b/xserver/hw/xwin/winmultiwindowshape.c index d5200cdb6..cb0f38950 100644 --- a/xserver/hw/xwin/winmultiwindowshape.c +++ b/xserver/hw/xwin/winmultiwindowshape.c @@ -137,7 +137,7 @@ winReshapeMultiWindow(WindowPtr pWin) /* Translate client rectangle coords to screen coords */ /* NOTE: Only transforms top and left members */ - ClientToScreen(pWinPriv->hWnd, (LPPOINT) & rcClient); + ClientToScreen(pWinPriv->hWnd, (LPPOINT) &rcClient); /* Get window rectangle */ if (!GetWindowRect(pWinPriv->hWnd, &rcWindow)) { diff --git a/xserver/hw/xwin/winmultiwindowwindow.c b/xserver/hw/xwin/winmultiwindowwindow.c index 0093fcbb1..c0c7db2b7 100644 --- a/xserver/hw/xwin/winmultiwindowwindow.c +++ b/xserver/hw/xwin/winmultiwindowwindow.c @@ -63,6 +63,11 @@ winInitMultiWindowClass(void) WNDCLASSEX wcx; if (atomXWinClass == 0) { + HICON hIcon, hIconSmall; + + /* Load the default icons */ + winSelectIcons(&hIcon, &hIconSmall); + /* Setup our window class */ wcx.cbSize = sizeof(WNDCLASSEX); wcx.style = CS_HREDRAW | CS_VREDRAW | (g_fNativeGl ? CS_OWNDC : 0); @@ -70,12 +75,12 @@ winInitMultiWindowClass(void) wcx.cbClsExtra = 0; wcx.cbWndExtra = 0; wcx.hInstance = g_hInstance; - wcx.hIcon = g_hIconX; + wcx.hIcon = hIcon; wcx.hCursor = 0; wcx.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH); wcx.lpszMenuName = NULL; wcx.lpszClassName = WINDOW_CLASS_X; - wcx.hIconSm = g_hSmallIconX; + wcx.hIconSm = hIconSmall; #if CYGMULTIWINDOW_DEBUG ErrorF("winCreateWindowsWindow - Creating class: %s\n", WINDOW_CLASS_X); @@ -479,8 +484,6 @@ winCreateWindowsWindow(WindowPtr pWin) HWND hFore = NULL; winWindowPriv(pWin); - HICON hIcon; - HICON hIconSmall; winPrivScreenPtr pScreenPriv = pWinPriv->pScreenPriv; WinXSizeHints hints; WindowPtr pDaddy; @@ -574,13 +577,6 @@ winCreateWindowsWindow(WindowPtr pWin) } pWinPriv->hWnd = hWnd; - /* Set application or .XWinrc defined Icons */ - winSelectIcons(pWin, &hIcon, &hIconSmall); - if (hIcon) - SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM) hIcon); - if (hIconSmall) - SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM) hIconSmall); - /* Change style back to popup, already placed... */ SetWindowLongPtr(hWnd, GWL_STYLE, WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS); diff --git a/xserver/hw/xwin/winmultiwindowwm.c b/xserver/hw/xwin/winmultiwindowwm.c index c355e8919..4f6dec78b 100644 --- a/xserver/hw/xwin/winmultiwindowwm.c +++ b/xserver/hw/xwin/winmultiwindowwm.c @@ -55,8 +55,6 @@ #include /* Local headers */ -#include "objbase.h" -#include "ddraw.h" #include "winwindow.h" #include "winprefs.h" #include "window.h" @@ -131,13 +129,6 @@ typedef struct _XMsgProcArgRec { HWND hwndScreen; } XMsgProcArgRec, *XMsgProcArgPtr; -/* - * References to external symbols - */ - -extern char *display; -extern void ErrorF(const char * /*f */ , ...); - /* * Prototypes for local functions */ @@ -151,7 +142,7 @@ static Bool InitQueue(WMMsgQueuePtr pQueue); static void - GetWindowName(Display * pDpy, Window iWin, wchar_t ** ppName); + GetWindowName(Display * pDpy, Window iWin, char **ppWindowName); static int SendXMessage(Display * pDisplay, Window iWin, Atom atmType, long nData); @@ -195,7 +186,7 @@ static void winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle); void - winUpdateWindowPosition(HWND hWnd, Bool reshape, HWND * zstyle); + winUpdateWindowPosition(HWND hWnd, HWND * zstyle); /* * Local globals @@ -380,57 +371,38 @@ InitQueue(WMMsgQueuePtr pQueue) pQueue->nQueueSize = 0; #if CYGMULTIWINDOW_DEBUG - ErrorF("InitQueue - Queue Size %d %d\n", pQueue->nQueueSize, - QueueSize(pQueue)); + winDebug("InitQueue - Queue Size %d %d\n", pQueue->nQueueSize, + QueueSize(pQueue)); #endif - ErrorF("InitQueue - Calling pthread_mutex_init\n"); + winDebug("InitQueue - Calling pthread_mutex_init\n"); /* Create synchronization objects */ pthread_mutex_init(&pQueue->pmMutex, NULL); - ErrorF("InitQueue - pthread_mutex_init returned\n"); - ErrorF("InitQueue - Calling pthread_cond_init\n"); + winDebug("InitQueue - pthread_mutex_init returned\n"); + winDebug("InitQueue - Calling pthread_cond_init\n"); pthread_cond_init(&pQueue->pcNotEmpty, NULL); - ErrorF("InitQueue - pthread_cond_init returned\n"); + winDebug("InitQueue - pthread_cond_init returned\n"); return TRUE; } -/* - * GetWindowName - Retrieve the title of an X Window - */ - -static void -GetWindowName(Display * pDisplay, Window iWin, wchar_t ** ppName) +static +char * +Xutf8TextPropertyToString(Display * pDisplay, XTextProperty * xtp) { - int nResult, nNum; + int nNum; char **ppList; char *pszReturnData; - int iLen, i; - XTextProperty xtpName; -#if CYGMULTIWINDOW_DEBUG - ErrorF("GetWindowName\n"); -#endif + if (Xutf8TextPropertyToTextList(pDisplay, xtp, &ppList, &nNum) >= Success && + nNum > 0 && *ppList) { + int i; + int iLen = 0; - /* Intialize ppName to NULL */ - *ppName = NULL; - - /* Try to get --- */ - nResult = XGetWMName(pDisplay, iWin, &xtpName); - if (!nResult || !xtpName.value || !xtpName.nitems) { -#if CYGMULTIWINDOW_DEBUG - ErrorF("GetWindowName - XGetWMName failed. No name.\n"); -#endif - return; - } - - if (Xutf8TextPropertyToTextList(pDisplay, &xtpName, &ppList, &nNum) >= - Success && nNum > 0 && *ppList) { - iLen = 0; for (i = 0; i < nNum; i++) iLen += strlen(ppList[i]); pszReturnData = (char *) malloc(iLen + 1); @@ -444,15 +416,40 @@ GetWindowName(Display * pDisplay, Window iWin, wchar_t ** ppName) pszReturnData = (char *) malloc(1); pszReturnData[0] = '\0'; } - iLen = MultiByteToWideChar(CP_UTF8, 0, pszReturnData, -1, NULL, 0); - *ppName = (wchar_t *) malloc(sizeof(wchar_t) * (iLen + 1)); - MultiByteToWideChar(CP_UTF8, 0, pszReturnData, -1, *ppName, iLen); - XFree(xtpName.value); - free(pszReturnData); + + return pszReturnData; +} + +/* + * GetWindowName - Retrieve the title of an X Window + */ + +static void +GetWindowName(Display * pDisplay, Window iWin, char **ppWindowName) +{ + int nResult; + XTextProperty xtpWindowName; + char *pszWindowName; #if CYGMULTIWINDOW_DEBUG - ErrorF("GetWindowName - Returning\n"); + ErrorF("GetWindowName\n"); #endif + + /* Intialize ppWindowName to NULL */ + *ppWindowName = NULL; + + /* Try to get window name */ + nResult = XGetWMName(pDisplay, iWin, &xtpWindowName); + if (!nResult || !xtpWindowName.value || !xtpWindowName.nitems) { +#if CYGMULTIWINDOW_DEBUG + ErrorF("GetWindowName - XGetWMName failed. No name.\n"); +#endif + return; + } + + pszWindowName = Xutf8TextPropertyToString(pDisplay, &xtpWindowName); + XFree(xtpWindowName.value); + *ppWindowName = pszWindowName; } /* @@ -477,23 +474,23 @@ SendXMessage(Display * pDisplay, Window iWin, Atom atmType, long nData) } /* - * Updates the name of a HWND according to its X WM_NAME property + * See if we can get the stored HWND for this window... */ - -static void -UpdateName(WMInfoPtr pWMInfo, Window iWindow) +static HWND +getHwnd(WMInfoPtr pWMInfo, Window iWindow) { - wchar_t *pszName; Atom atmType; int fmtRet; unsigned long items, remain; - HWND *retHwnd, hWnd; - XWindowAttributes attr; + HWND *retHwnd, hWnd = NULL; - hWnd = 0; - - /* See if we can get the cached HWND for this window... */ - if (XGetWindowProperty(pWMInfo->pDisplay, iWindow, pWMInfo->atmPrivMap, 0, 1, False, XA_INTEGER, //pWMInfo->atmPrivMap, + if (XGetWindowProperty(pWMInfo->pDisplay, + iWindow, + pWMInfo->atmPrivMap, + 0, + 1, + False, + XA_INTEGER, &atmType, &fmtRet, &items, @@ -506,24 +503,132 @@ UpdateName(WMInfoPtr pWMInfo, Window iWindow) /* Some sanity checks */ if (!hWnd) - return; + return NULL; if (!IsWindow(hWnd)) + return NULL; + + return hWnd; +} + +/* + * Updates the name of a HWND according to its X WM_NAME property + */ + +static void +UpdateName(WMInfoPtr pWMInfo, Window iWindow) +{ + HWND hWnd; + XWindowAttributes attr; + + hWnd = getHwnd(pWMInfo, iWindow); + if (!hWnd) return; - /* Set the Windows window name */ - GetWindowName(pWMInfo->pDisplay, iWindow, &pszName); - if (pszName) { - /* Get the window attributes */ - XGetWindowAttributes(pWMInfo->pDisplay, iWindow, &attr); - if (!attr.override_redirect) { - SetWindowTextW(hWnd, pszName); - winUpdateIcon(iWindow); - } + /* If window isn't override-redirect */ + XGetWindowAttributes(pWMInfo->pDisplay, iWindow, &attr); + if (!attr.override_redirect) { + char *pszWindowName; - free(pszName); + /* Get the X windows window name */ + GetWindowName(pWMInfo->pDisplay, iWindow, &pszWindowName); + + if (pszWindowName) { + /* Convert from UTF-8 to wide char */ + int iLen = + MultiByteToWideChar(CP_UTF8, 0, pszWindowName, -1, NULL, 0); + wchar_t *pwszWideWindowName = + (wchar_t *) malloc(sizeof(wchar_t) * (iLen + 1)); + MultiByteToWideChar(CP_UTF8, 0, pszWindowName, -1, + pwszWideWindowName, iLen); + + /* Set the Windows window name */ + SetWindowTextW(hWnd, pwszWideWindowName); + + free(pwszWideWindowName); + free(pszWindowName); + } } } +/* + * Updates the icon of a HWND according to its X icon properties + */ + +static void +UpdateIcon(WMInfoPtr pWMInfo, Window iWindow) +{ + HWND hWnd; + HICON hIconNew = NULL; + XWindowAttributes attr; + + hWnd = getHwnd(pWMInfo, iWindow); + if (!hWnd) + return; + + /* If window isn't override-redirect */ + XGetWindowAttributes(pWMInfo->pDisplay, iWindow, &attr); + if (!attr.override_redirect) { + XClassHint class_hint = { 0, 0 }; + char *window_name = 0; + + if (XGetClassHint(pWMInfo->pDisplay, iWindow, &class_hint)) { + XFetchName(pWMInfo->pDisplay, iWindow, &window_name); + + hIconNew = + (HICON) winOverrideIcon(class_hint.res_name, + class_hint.res_class, window_name); + + if (class_hint.res_name) + XFree(class_hint.res_name); + if (class_hint.res_class) + XFree(class_hint.res_class); + if (window_name) + XFree(window_name); + } + } + + winUpdateIcon(hWnd, pWMInfo->pDisplay, iWindow, hIconNew); +} + +/* + * Updates the style of a HWND according to its X style properties + */ + +static void +UpdateStyle(WMInfoPtr pWMInfo, Window iWindow) +{ + HWND hWnd; + HWND zstyle = HWND_NOTOPMOST; + UINT flags; + + hWnd = getHwnd(pWMInfo, iWindow); + if (!hWnd) + return; + + /* Determine the Window style, which determines borders and clipping region... */ + winApplyHints(pWMInfo->pDisplay, iWindow, hWnd, &zstyle); + winUpdateWindowPosition(hWnd, &zstyle); + + /* Apply the updated window style, without changing it's show or activation state */ + flags = SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE; + if (zstyle == HWND_NOTOPMOST) + flags |= SWP_NOZORDER | SWP_NOOWNERZORDER; + SetWindowPos(hWnd, NULL, 0, 0, 0, 0, flags); + + /* + Use the WS_EX_TOOLWINDOW style to remove window from Alt-Tab window switcher + + According to MSDN, this is supposed to remove the window from the taskbar as well, + if we SW_HIDE before changing the style followed by SW_SHOW afterwards. + + But that doesn't seem to work reliably, and causes the window to flicker, so use + the iTaskbarList interface to tell the taskbar to show or hide this window. + */ + winShowWindowOnTaskbar(hWnd, + (GetWindowLongPtr(hWnd, GWL_EXSTYLE) & + WS_EX_APPWINDOW) ? TRUE : FALSE); +} + #if 0 /* * Fix up any differences between the X11 and Win32 window stacks @@ -532,27 +637,12 @@ UpdateName(WMInfoPtr pWMInfo, Window iWindow) static void PreserveWin32Stack(WMInfoPtr pWMInfo, Window iWindow, UINT direction) { - Atom atmType; - int fmtRet; - unsigned long items, remain; - HWND hWnd, *retHwnd; + HWND hWnd; DWORD myWinProcID, winProcID; Window xWindow; WINDOWPLACEMENT wndPlace; - hWnd = NULL; - /* See if we can get the cached HWND for this window... */ - if (XGetWindowProperty(pWMInfo->pDisplay, iWindow, pWMInfo->atmPrivMap, 0, 1, False, XA_INTEGER, //pWMInfo->atmPrivMap, - &atmType, - &fmtRet, - &items, - &remain, (unsigned char **) &retHwnd) == Success) { - if (retHwnd) { - hWnd = *retHwnd; - XFree(retHwnd); - } - } - + hWnd = getHwnd(pWMInfo, iWindow); if (!hWnd) return; @@ -662,7 +752,7 @@ winMultiWindowWMProc(void *pArg) PropModeReplace, (unsigned char *) &(pNode->msg.hwndWindow), 1); UpdateName(pWMInfo, pNode->msg.iWindow); - winUpdateIcon(pNode->msg.iWindow); + UpdateIcon(pWMInfo, pNode->msg.iWindow); break; case WM_WM_MAP2: @@ -685,14 +775,20 @@ winMultiWindowWMProc(void *pArg) PropModeReplace, (unsigned char *) &(pNode->msg.hwndWindow), 1); UpdateName(pWMInfo, pNode->msg.iWindow); - winUpdateIcon(pNode->msg.iWindow); - { - HWND zstyle = HWND_NOTOPMOST; + UpdateIcon(pWMInfo, pNode->msg.iWindow); + UpdateStyle(pWMInfo, pNode->msg.iWindow); - winApplyHints(pWMInfo->pDisplay, pNode->msg.iWindow, - pNode->msg.hwndWindow, &zstyle); - winUpdateWindowPosition(pNode->msg.hwndWindow, TRUE, &zstyle); + + /* Reshape */ + { + WindowPtr pWin = + GetProp(pNode->msg.hwndWindow, WIN_WINDOW_PROP); + if (pWin) { + winReshapeMultiWindow(pWin); + winUpdateRgnMultiWindow(pWin); + } } + break; case WM_WM_UNMAP: @@ -747,8 +843,21 @@ winMultiWindowWMProc(void *pArg) UpdateName(pWMInfo, pNode->msg.iWindow); break; + case WM_WM_ICON_EVENT: + UpdateIcon(pWMInfo, pNode->msg.iWindow); + break; + case WM_WM_HINTS_EVENT: - winUpdateIcon(pNode->msg.iWindow); + { + XWindowAttributes attr; + + /* Don't do anything if this is an override-redirect window */ + XGetWindowAttributes (pWMInfo->pDisplay, pNode->msg.iWindow, &attr); + if (attr.override_redirect) + break; + + UpdateStyle(pWMInfo, pNode->msg.iWindow); + } break; case WM_WM_CHANGE_STATE: @@ -799,10 +908,12 @@ winMultiWindowXMsgProc(void *pArg) Atom atmWmName; Atom atmWmHints; Atom atmWmChange; + Atom atmNetWmIcon; + Atom atmWindowState, atmMotifWmHints, atmWindowType, atmNormalHints; int iReturn; XIconSize *xis; - ErrorF("winMultiWindowXMsgProc - Hello\n"); + winDebug("winMultiWindowXMsgProc - Hello\n"); /* Check that argument pointer is not invalid */ if (pProcArg == NULL) { @@ -924,6 +1035,11 @@ winMultiWindowXMsgProc(void *pArg) atmWmName = XInternAtom(pProcArg->pDisplay, "WM_NAME", False); atmWmHints = XInternAtom(pProcArg->pDisplay, "WM_HINTS", False); atmWmChange = XInternAtom(pProcArg->pDisplay, "WM_CHANGE_STATE", False); + atmNetWmIcon = XInternAtom(pProcArg->pDisplay, "_NET_WM_ICON", False); + atmWindowState = XInternAtom(pProcArg->pDisplay, "_NET_WM_STATE", False); + atmMotifWmHints = XInternAtom(pProcArg->pDisplay, "_MOTIF_WM_HINTS", False); + atmWindowType = XInternAtom(pProcArg->pDisplay, "_NET_WM_WINDOW_TYPE", False); + atmNormalHints = XInternAtom(pProcArg->pDisplay, "WM_NORMAL_HINTS", False); /* iiimxcf had a bug until 2009-04-27, assuming that the @@ -1051,25 +1167,45 @@ winMultiWindowXMsgProc(void *pArg) True, StructureNotifyMask, &event_send); } } - else if (event.type == PropertyNotify - && event.xproperty.atom == atmWmName) { - memset(&msg, 0, sizeof(msg)); + else if (event.type == PropertyNotify) { + if (event.xproperty.atom == atmWmName) { + memset(&msg, 0, sizeof(msg)); - msg.msg = WM_WM_NAME_EVENT; - msg.iWindow = event.xproperty.window; + msg.msg = WM_WM_NAME_EVENT; + msg.iWindow = event.xproperty.window; - /* Other fields ignored */ - winSendMessageToWM(pProcArg->pWMInfo, &msg); - } - else if (event.type == PropertyNotify - && event.xproperty.atom == atmWmHints) { - memset(&msg, 0, sizeof(msg)); + /* Other fields ignored */ + winSendMessageToWM(pProcArg->pWMInfo, &msg); + } + else { + /* + Several properties are considered for WM hints, check if this property change affects any of them... + (this list needs to be kept in sync with winApplyHints()) + */ + if ((event.xproperty.atom == atmWmHints) || + (event.xproperty.atom == atmWindowState) || + (event.xproperty.atom == atmMotifWmHints) || + (event.xproperty.atom == atmWindowType) || + (event.xproperty.atom == atmNormalHints)) { + memset(&msg, 0, sizeof(msg)); + msg.msg = WM_WM_HINTS_EVENT; + msg.iWindow = event.xproperty.window; - msg.msg = WM_WM_HINTS_EVENT; - msg.iWindow = event.xproperty.window; + /* Other fields ignored */ + winSendMessageToWM(pProcArg->pWMInfo, &msg); + } - /* Other fields ignored */ - winSendMessageToWM(pProcArg->pWMInfo, &msg); + /* Not an else as WM_HINTS affects both style and icon */ + if ((event.xproperty.atom == atmWmHints) || + (event.xproperty.atom == atmNetWmIcon)) { + memset(&msg, 0, sizeof(msg)); + msg.msg = WM_WM_ICON_EVENT; + msg.iWindow = event.xproperty.window; + + /* Other fields ignored */ + winSendMessageToWM(pProcArg->pWMInfo, &msg); + } + } } else if (event.type == ClientMessage && event.xclient.message_type == atmWmChange @@ -1172,7 +1308,7 @@ winInitMultiWindowWM(WMInfoPtr pWMInfo, WMProcArgPtr pProcArg) char pszDisplay[512]; int iReturn; - ErrorF("winInitMultiWindowWM - Hello\n"); + winDebug("winInitMultiWindowWM - Hello\n"); /* Check that argument pointer is not invalid */ if (pProcArg == NULL) { @@ -1450,6 +1586,7 @@ winDeinitMultiWindowWM(void) #define HINT_NOMAXIMIZE (1L<<4) #define HINT_NOMINIMIZE (1L<<5) #define HINT_NOSYSMENU (1L<<6) +#define HINT_SKIPTASKBAR (1L<<7) /* These two are used on their own */ #define HINT_MAX (1L<<0) #define HINT_MIN (1L<<1) @@ -1458,12 +1595,14 @@ static void winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle) { static Atom windowState, motif_wm_hints, windowType; - static Atom hiddenState, fullscreenState, belowState, aboveState; + static Atom hiddenState, fullscreenState, belowState, aboveState, + skiptaskbarState; static Atom dockWindow; static int generation; Atom type, *pAtom = NULL; int format; - unsigned long hint = 0, maxmin = 0, style, nitems = 0, left = 0; + unsigned long hint = 0, maxmin = 0, nitems = 0, left = 0; + unsigned long style, exStyle; MwmHints *mwm_hint = NULL; if (!hWnd) @@ -1482,6 +1621,8 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle) belowState = XInternAtom(pDisplay, "_NET_WM_STATE_BELOW", False); aboveState = XInternAtom(pDisplay, "_NET_WM_STATE_ABOVE", False); dockWindow = XInternAtom(pDisplay, "_NET_WM_WINDOW_TYPE_DOCK", False); + skiptaskbarState = + XInternAtom(pDisplay, "_NET_WM_STATE_SKIP_TASKBAR", False); } if (XGetWindowProperty(pDisplay, iWindow, windowState, 0L, @@ -1489,6 +1630,8 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle) &nitems, &left, (unsigned char **) &pAtom) == Success) { if (pAtom && nitems == 1) { + if (*pAtom == skiptaskbarState) + hint |= HINT_SKIPTASKBAR; if (*pAtom == hiddenState) maxmin |= HINT_MIN; else if (*pAtom == fullscreenState) @@ -1577,10 +1720,14 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle) XFree(normal_hint); } - /* Override hint settings from above with settings from config file */ + /* + Override hint settings from above with settings from config file and set + application id for grouping. + */ { XClassHint class_hint = { 0, 0 }; char *window_name = 0; + char *application_id = 0; if (XGetClassHint(pDisplay, iWindow, &class_hint)) { XFetchName(pDisplay, iWindow, &window_name); @@ -1589,10 +1736,24 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle) winOverrideStyle(class_hint.res_name, class_hint.res_class, window_name); +#define APPLICATION_ID_FORMAT "%s.xwin.%s" +#define APPLICATION_ID_UNKNOWN "unknown" + if (class_hint.res_class) { + asprintf(&application_id, APPLICATION_ID_FORMAT, XVENDORNAME, + class_hint.res_class); + } + else { + asprintf(&application_id, APPLICATION_ID_FORMAT, XVENDORNAME, + APPLICATION_ID_UNKNOWN); + } + winSetAppUserModelID(hWnd, application_id); + if (class_hint.res_name) XFree(class_hint.res_name); if (class_hint.res_class) XFree(class_hint.res_class); + if (application_id) + free(application_id); if (window_name) XFree(window_name); } @@ -1629,13 +1790,15 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle) HINT_NOFRAME; /* Now apply styles to window */ - style = GetWindowLongPtr(hWnd, GWL_STYLE) & ~WS_CAPTION & ~WS_SIZEBOX; /* Just in case */ + style = GetWindowLongPtr(hWnd, GWL_STYLE); if (!style) - return; + return; /* GetWindowLongPointer returns 0 on failure, we hope this isn't a valid style */ - if (!hint) /* All on */ + style &= ~WS_CAPTION & ~WS_SIZEBOX; /* Just in case */ + + if (!(hint & ~HINT_SKIPTASKBAR)) /* No hints, default */ style = style | WS_CAPTION | WS_SIZEBOX; - else if (hint & HINT_NOFRAME) /* All off */ + else if (hint & HINT_NOFRAME) /* No frame, no decorations */ style = style & ~WS_CAPTION & ~WS_SIZEBOX; else style = style | ((hint & HINT_BORDER) ? WS_BORDER : 0) | @@ -1651,11 +1814,25 @@ winApplyHints(Display * pDisplay, Window iWindow, HWND hWnd, HWND * zstyle) if (hint & HINT_NOSYSMENU) style = style & ~WS_SYSMENU; + if (hint & HINT_SKIPTASKBAR) + style = style & ~WS_MINIMIZEBOX; /* window will become lost if minimized */ + SetWindowLongPtr(hWnd, GWL_STYLE, style); + + exStyle = GetWindowLongPtr(hWnd, GWL_EXSTYLE); + if (hint & HINT_SKIPTASKBAR) + exStyle = (exStyle & ~WS_EX_APPWINDOW) | WS_EX_TOOLWINDOW; + else + exStyle = (exStyle & ~WS_EX_TOOLWINDOW) | WS_EX_APPWINDOW; + SetWindowLongPtr(hWnd, GWL_EXSTYLE, exStyle); + + winDebug + ("winApplyHints: iWindow 0x%08x hints 0x%08x style 0x%08x exstyle 0x%08x\n", + iWindow, hint, style, exStyle); } void -winUpdateWindowPosition(HWND hWnd, Bool reshape, HWND * zstyle) +winUpdateWindowPosition(HWND hWnd, HWND * zstyle) { int iX, iY, iWidth, iHeight; int iDx, iDy; @@ -1680,13 +1857,11 @@ winUpdateWindowPosition(HWND hWnd, Bool reshape, HWND * zstyle) /* Setup a rectangle with the X window position and size */ SetRect(&rcNew, iX, iY, iX + iWidth, iY + iHeight); -#if 0 - ErrorF("winUpdateWindowPosition - (%d, %d)-(%d, %d)\n", - rcNew.left, rcNew.top, rcNew.right, rcNew.bottom); -#endif + winDebug("winUpdateWindowPosition - drawable extent (%d, %d)-(%d, %d)\n", + rcNew.left, rcNew.top, rcNew.right, rcNew.bottom); AdjustWindowRectEx(&rcNew, GetWindowLongPtr(hWnd, GWL_STYLE), FALSE, - WS_EX_APPWINDOW); + GetWindowLongPtr(hWnd, GWL_EXSTYLE)); /* Don't allow window decoration to disappear off to top-left as a result of this adjustment */ if (rcNew.left < GetSystemMetrics(SM_XVIRTUALSCREEN)) { @@ -1701,17 +1876,11 @@ winUpdateWindowPosition(HWND hWnd, Bool reshape, HWND * zstyle) rcNew.bottom += iDy; } -#if 0 - ErrorF("winUpdateWindowPosition - (%d, %d)-(%d, %d)\n", - rcNew.left, rcNew.top, rcNew.right, rcNew.bottom); -#endif + winDebug("winUpdateWindowPosition - Window extent (%d, %d)-(%d, %d)\n", + rcNew.left, rcNew.top, rcNew.right, rcNew.bottom); /* Position the Windows window */ SetWindowPos(hWnd, *zstyle, rcNew.left, rcNew.top, rcNew.right - rcNew.left, rcNew.bottom - rcNew.top, 0); - if (reshape) { - winReshapeMultiWindow(pWin); - winUpdateRgnMultiWindow(pWin); - } } diff --git a/xserver/hw/xwin/winmultiwindowwndproc.c b/xserver/hw/xwin/winmultiwindowwndproc.c index af917d6fc..0e46ea7fe 100644 --- a/xserver/hw/xwin/winmultiwindowwndproc.c +++ b/xserver/hw/xwin/winmultiwindowwndproc.c @@ -42,7 +42,7 @@ #include "winmsg.h" #include "inputstr.h" -extern void winUpdateWindowPosition(HWND hWnd, Bool reshape, HWND * zstyle); +extern void winUpdateWindowPosition(HWND hWnd, HWND * zstyle); /* * Local globals @@ -498,7 +498,7 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) & lpMsgBuf, 0, NULL); + (LPTSTR) &lpMsgBuf, 0, NULL); ErrorF("winTopLevelWindowProc - BitBlt failed: %s\n", (LPSTR) lpMsgBuf); @@ -825,6 +825,8 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) break; case WM_CLOSE: + /* Removep AppUserModelID property */ + winSetAppUserModelID(hwnd, NULL); /* Branch on if the window was killed in X already */ if (pWinPriv->fXKilled) { /* Window was killed, go ahead and destroy the window */ @@ -868,41 +870,36 @@ winTopLevelWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) /* */ if (!pWin->overrideRedirect) { + HWND zstyle = HWND_NOTOPMOST; + /* Flag that this window needs to be made active when clicked */ SetProp(hwnd, WIN_NEEDMANAGE_PROP, (HANDLE) 1); - if (!(GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_APPWINDOW)) { - HWND zstyle = HWND_NOTOPMOST; + /* Set the transient style flags */ + if (GetParent(hwnd)) + SetWindowLongPtr(hwnd, GWL_STYLE, + WS_POPUP | WS_OVERLAPPED | WS_SYSMENU | + WS_CLIPCHILDREN | WS_CLIPSIBLINGS); + /* Set the window standard style flags */ + else + SetWindowLongPtr(hwnd, GWL_STYLE, + (WS_POPUP | WS_OVERLAPPEDWINDOW | + WS_CLIPCHILDREN | WS_CLIPSIBLINGS) + & ~WS_CAPTION & ~WS_SIZEBOX); - /* Set the window extended style flags */ - SetWindowLongPtr(hwnd, GWL_EXSTYLE, WS_EX_APPWINDOW); + winUpdateWindowPosition(hwnd, &zstyle); - /* Set the transient style flags */ - if (GetParent(hwnd)) - SetWindowLongPtr(hwnd, GWL_STYLE, - WS_POPUP | WS_OVERLAPPED | WS_SYSMENU | - WS_CLIPCHILDREN | WS_CLIPSIBLINGS); - /* Set the window standard style flags */ - else - SetWindowLongPtr(hwnd, GWL_STYLE, - (WS_POPUP | WS_OVERLAPPEDWINDOW | - WS_CLIPCHILDREN | WS_CLIPSIBLINGS) - & ~WS_CAPTION & ~WS_SIZEBOX); + { + WinXWMHints hints; - winUpdateWindowPosition(hwnd, FALSE, &zstyle); - - { - WinXWMHints hints; - - if (winMultiWindowGetWMHints(pWin, &hints)) { - /* - Give the window focus, unless it has an InputHint - which is FALSE (this is used by e.g. glean to - avoid every test window grabbing the focus) - */ - if (!((hints.flags & InputHint) && (!hints.input))) { - SetForegroundWindow(hwnd); - } + if (winMultiWindowGetWMHints(pWin, &hints)) { + /* + Give the window focus, unless it has an InputHint + which is FALSE (this is used by e.g. glean to + avoid every test window grabbing the focus) + */ + if (!((hints.flags & InputHint) && (!hints.input))) { + SetForegroundWindow(hwnd); } } } diff --git a/xserver/hw/xwin/winnativegdi.c b/xserver/hw/xwin/winnativegdi.c index 8a1455b90..a2a5123a0 100644 --- a/xserver/hw/xwin/winnativegdi.c +++ b/xserver/hw/xwin/winnativegdi.c @@ -44,7 +44,7 @@ static void winShadowUpdateNativeGDI(ScreenPtr pScreen, shadowBufPtr pBuf); static Bool - winCloseScreenNativeGDI(int nIndex, ScreenPtr pScreen); + winCloseScreenNativeGDI(ScreenPtr pScreen); static Bool winInitVisualsNativeGDI(ScreenPtr pScreen); @@ -104,7 +104,7 @@ winInitScreenNativeGDI(ScreenPtr pScreen) */ static Bool -winCloseScreenNativeGDI(int nIndex, ScreenPtr pScreen) +winCloseScreenNativeGDI(ScreenPtr pScreen) { winScreenPriv(pScreen); winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; diff --git a/xserver/hw/xwin/winpfbdd.c b/xserver/hw/xwin/winpfbdd.c index 3fddd85f4..ee6ea7290 100644 --- a/xserver/hw/xwin/winpfbdd.c +++ b/xserver/hw/xwin/winpfbdd.c @@ -44,7 +44,7 @@ static Bool winAllocateFBPrimaryDD(ScreenPtr pScreen); static Bool - winCloseScreenPrimaryDD(int nIndex, ScreenPtr pScreen); + winCloseScreenPrimaryDD(ScreenPtr pScreen); static Bool winInitVisualsPrimaryDD(ScreenPtr pScreen); @@ -78,7 +78,7 @@ winAllocateFBPrimaryDD(ScreenPtr pScreen) /* Get client area location in screen coords */ GetClientRect(pScreenPriv->hwndScreen, &rcClient); MapWindowPoints(pScreenPriv->hwndScreen, - HWND_DESKTOP, (LPPOINT) & rcClient, 2); + HWND_DESKTOP, (LPPOINT) &rcClient, 2); /* Create a DirectDraw object, store the address at lpdd */ ddrval = (*g_fpDirectDrawCreate) (NULL, &pScreenPriv->pdd, NULL); @@ -88,7 +88,7 @@ winAllocateFBPrimaryDD(ScreenPtr pScreen) /* Get a DirectDraw2 interface pointer */ ddrval = IDirectDraw_QueryInterface(pScreenPriv->pdd, &IID_IDirectDraw2, - (LPVOID *) & pScreenPriv->pdd2); + (LPVOID *) &pScreenPriv->pdd2); if (FAILED(ddrval)) { ErrorF("winAllocateFBShadowDD - Failed DD2 query: %08x\n", (unsigned int) ddrval); @@ -264,7 +264,7 @@ winInitScreenPrimaryDD(ScreenPtr pScreen) */ static Bool -winCloseScreenPrimaryDD(int nIndex, ScreenPtr pScreen) +winCloseScreenPrimaryDD(ScreenPtr pScreen) { winScreenPriv(pScreen); winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; @@ -279,7 +279,7 @@ winCloseScreenPrimaryDD(int nIndex, ScreenPtr pScreen) /* Call the wrapped CloseScreen procedure */ WIN_UNWRAP(CloseScreen); if (pScreen->CloseScreen) - fReturn = (*pScreen->CloseScreen) (nIndex, pScreen); + fReturn = (*pScreen->CloseScreen) (pScreen); /* Delete the window property */ RemoveProp(pScreenPriv->hwndScreen, WIN_SCR_PROP); @@ -465,7 +465,7 @@ winActivateAppPrimaryDD(ScreenPtr pScreen) /* Get client area in screen coords */ GetClientRect(pScreenPriv->hwndScreen, &rcClient); MapWindowPoints(pScreenPriv->hwndScreen, - HWND_DESKTOP, (LPPOINT) & rcClient, 2); + HWND_DESKTOP, (LPPOINT) &rcClient, 2); /* Setup a source rectangle */ rcSrc.left = 0; @@ -530,7 +530,7 @@ winHotKeyAltTabPrimaryDD(ScreenPtr pScreen) /* Get client area in screen coords */ GetClientRect(pScreenPriv->hwndScreen, &rcClient); MapWindowPoints(pScreenPriv->hwndScreen, - HWND_DESKTOP, (LPPOINT) & rcClient, 2); + HWND_DESKTOP, (LPPOINT) &rcClient, 2); /* Did we loose the primary surface? */ ddrval = IDirectDrawSurface2_IsLost(pScreenPriv->pddsPrimary); diff --git a/xserver/hw/xwin/winpixmap.c b/xserver/hw/xwin/winpixmap.c index cb8ba9103..d8a12d58e 100644 --- a/xserver/hw/xwin/winpixmap.c +++ b/xserver/hw/xwin/winpixmap.c @@ -109,7 +109,7 @@ winCreatePixmapNativeGDI(ScreenPtr pScreen, /* Create a DIB for the pixmap */ pPixmapPriv->hBitmap = winCreateDIBNativeGDI(iWidth, iHeight, iDepth, &pPixmapPriv->pbBits, - (BITMAPINFO **) & pPixmapPriv-> + (BITMAPINFO **) &pPixmapPriv-> pbmih); #if CYGDEBUG diff --git a/xserver/hw/xwin/winprefs.c b/xserver/hw/xwin/winprefs.c index 86a788287..6cbd7ad80 100644 --- a/xserver/hw/xwin/winprefs.c +++ b/xserver/hw/xwin/winprefs.c @@ -57,9 +57,6 @@ extern int parse_file(FILE * fp); /* Currently in use command ID, incremented each new menu item created */ static int g_cmdid = STARTMENUID; -/* Defined in DIX */ -extern char *display; - /* Local function to handle comma-ified icon names */ static HICON LoadImageComma(char *fname, int sx, int sy, int flags); @@ -148,7 +145,6 @@ static wBOOL CALLBACK ReloadEnumWindowsProc(HWND hwnd, LPARAM lParam) { HICON hicon; - Window wid; if (!hwnd) { ErrorF("ReloadEnumWindowsProc: hwnd==NULL!\n"); @@ -173,10 +169,23 @@ ReloadEnumWindowsProc(HWND hwnd, LPARAM lParam) /* This window is now clean of our taint (but with undefined icons) */ } else { - /* winUpdateIcon() will set the icon default, dynamic, or from xwinrc */ - wid = (Window) GetProp(hwnd, WIN_WID_PROP); - if (wid) - winUpdateIcon(wid); + /* Send a message to WM thread telling it re-evaluate the icon for this window */ + { + winWMMessageRec wmMsg; + + WindowPtr pWin = GetProp(hwnd, WIN_WINDOW_PROP); + + if (pWin) { + winPrivWinPtr pWinPriv = winGetWindowPriv(pWin); + winPrivScreenPtr s_pScreenPriv = pWinPriv->pScreenPriv; + + wmMsg.msg = WM_WM_ICON_EVENT; + wmMsg.hwndWindow = hwnd; + wmMsg.iWindow = (Window) GetProp(hwnd, WIN_WID_PROP); + + winSendMessageToWM(s_pScreenPriv->pWMInfo, &wmMsg); + } + } /* Update the system menu for this window */ SetupSysMenu((unsigned long) hwnd); @@ -318,12 +327,12 @@ HandleCustomWM_COMMAND(unsigned long hwndIn, int command) case CMD_EXEC: if (fork() == 0) { struct rlimit rl; - unsigned long i; + int fd; /* Close any open descriptors except for STD* */ getrlimit(RLIMIT_NOFILE, &rl); - for (i = STDERR_FILENO + 1; i < rl.rlim_cur; i++) - close(i); + for (fd = STDERR_FILENO + 1; fd < rl.rlim_cur; fd++) + close(fd); /* Disassociate any TTYs */ setsid(); @@ -526,21 +535,21 @@ static HICON LoadImageComma(char *fname, int sx, int sy, int flags) { HICON hicon; - int index; + int i; char file[PATH_MAX + NAME_MAX + 2]; /* Some input error checking */ if (!fname || !fname[0]) return NULL; - index = 0; + i = 0; hicon = NULL; if (fname[0] == ',') { /* It's the XWIN.EXE resource they want */ - index = atoi(fname + 1); + i = atoi(fname + 1); hicon = LoadImage(g_hInstance, - MAKEINTRESOURCE(index), IMAGE_ICON, sx, sy, flags); + MAKEINTRESOURCE(i), IMAGE_ICON, sx, sy, flags); } else { file[0] = 0; @@ -557,8 +566,8 @@ LoadImageComma(char *fname, int sx, int sy, int flags) /* Specified as , */ *(strrchr(file, ',')) = 0; /* End string at comma */ - index = atoi(strrchr(fname, ',') + 1); - hicon = ExtractIcon(g_hInstance, file, index); + i = atoi(strrchr(fname, ',') + 1); + hicon = ExtractIcon(g_hInstance, file, i); } else { /* Just an .ico file... */ @@ -577,31 +586,15 @@ LoadImageComma(char *fname, int sx, int sy, int flags) * ICONS{} section in the prefs file, and load the icon from a file */ HICON -winOverrideIcon(unsigned long longWin) +winOverrideIcon(char *res_name, char *res_class, char *wmName) { - WindowPtr pWin = (WindowPtr) longWin; - char *res_name, *res_class; int i; HICON hicon; - char *wmName; - - if (pWin == NULL) - return 0; - - /* If we can't find the class, we can't override from default! */ - if (!winMultiWindowGetClassHint(pWin, &res_name, &res_class)) - return 0; - - winMultiWindowGetWMName(pWin, &wmName); for (i = 0; i < pref.iconItems; i++) { - if (!strcmp(pref.icon[i].match, res_name) || - !strcmp(pref.icon[i].match, res_class) || + if ((res_name && !strcmp(pref.icon[i].match, res_name)) || + (res_class && !strcmp(pref.icon[i].match, res_class)) || (wmName && strstr(wmName, pref.icon[i].match))) { - free(res_name); - free(res_class); - free(wmName); - if (pref.icon[i].hicon) return pref.icon[i].hicon; @@ -616,10 +609,6 @@ winOverrideIcon(unsigned long longWin) } /* Didn't find the icon, fail gracefully */ - free(res_name); - free(res_class); - free(wmName); - return 0; } @@ -656,6 +645,7 @@ winPrefsLoadPreferences(char *path) if (path) prefFile = fopen(path, "r"); +#ifdef __CYGWIN__ else { char defaultPrefs[] = "MENU rmenu {\n" @@ -667,6 +657,7 @@ winPrefsLoadPreferences(char *path) path = "built-in default"; prefFile = fmemopen(defaultPrefs, strlen(defaultPrefs), "r"); } +#endif if (!prefFile) { ErrorF("LoadPreferences: %s not found\n", path); diff --git a/xserver/hw/xwin/winprefs.h b/xserver/hw/xwin/winprefs.h index fcce8d840..5de5719e1 100644 --- a/xserver/hw/xwin/winprefs.h +++ b/xserver/hw/xwin/winprefs.h @@ -164,7 +164,7 @@ Bool int winIconIsOverride(unsigned hiconIn); -HICON winOverrideIcon(unsigned long longpWin); +HICON winOverrideIcon(char *res_name, char *res_class, char *wmName); unsigned long winOverrideStyle(char *res_name, char *res_class, char *wmName); diff --git a/xserver/hw/xwin/winprefslex.l b/xserver/hw/xwin/winprefslex.l index ba8aea696..15f707766 100644 --- a/xserver/hw/xwin/winprefslex.l +++ b/xserver/hw/xwin/winprefslex.l @@ -37,14 +37,10 @@ #include #include "winprefsyacc.h" -extern YYSTYPE yylval; -extern char *yytext; extern int yyparse(void); extern void ErrorF (const char* /*f*/, ...); -int yylineno; - /* Copy the parsed string, must be free()d in yacc parser */ static char *makestr(char *str) { @@ -62,6 +58,9 @@ static char *makestr(char *str) %} %option yylineno +%option nounput +%option noinput +%option never-interactive %% \#.*[\r\n] { /* comment */ return NEWLINE; } diff --git a/xserver/hw/xwin/winprefsyacc.y b/xserver/hw/xwin/winprefsyacc.y index 0acf160e4..3b376b3e7 100644 --- a/xserver/hw/xwin/winprefsyacc.y +++ b/xserver/hw/xwin/winprefsyacc.y @@ -37,6 +37,7 @@ #endif #include #include +#define _STDLIB_H 1 /* bison checks this to know if stdlib has been included */ #include #include "winprefs.h" @@ -80,7 +81,6 @@ static void CloseSysMenu(void); static int yyerror (char *s); -extern void ErrorF (const char* /*f*/, ...); extern char *yytext; extern int yylex(void); @@ -283,16 +283,16 @@ SetTrayIcon (char *fname) } static void -SetRootMenu (char *menu) +SetRootMenu (char *menuname) { - strncpy (pref.rootMenuName, menu, MENU_MAX); + strncpy (pref.rootMenuName, menuname, MENU_MAX); pref.rootMenuName[MENU_MAX] = 0; } static void -SetDefaultSysMenu (char *menu, int pos) +SetDefaultSysMenu (char *menuname, int pos) { - strncpy (pref.defaultSysMenuName, menu, MENU_MAX); + strncpy (pref.defaultSysMenuName, menuname, MENU_MAX); pref.defaultSysMenuName[MENU_MAX] = 0; pref.defaultSysMenuPos = pos; } diff --git a/xserver/hw/xwin/winprocarg.c b/xserver/hw/xwin/winprocarg.c index 0f789f09d..858be4a56 100644 --- a/xserver/hw/xwin/winprocarg.c +++ b/xserver/hw/xwin/winprocarg.c @@ -56,10 +56,6 @@ void void winLogVersionInfo(void); -#ifdef DDXOSVERRORF -void OsVendorVErrorF(const char *pszFormat, va_list va_args); -#endif - /* * Process arguments on the command line */ @@ -101,20 +97,22 @@ winInitializeScreenDefaults(void) int dpiY = GetDeviceCaps(hdc, LOGPIXELSY); winErrorFVerb(2, - "winInitializeDefaultScreens - native DPI x %d y %d\n", + "winInitializeScreenDefaults - native DPI x %d y %d\n", dpiX, dpiY); + monitorResolution = dpiY; ReleaseDC(NULL, hdc); } else { winErrorFVerb(1, - "winInitializeDefaultScreens - Failed to retrieve native DPI, falling back to default of %d DPI\n", + "winInitializeScreenDefaults - Failed to retrieve native DPI, falling back to default of %d DPI\n", WIN_DEFAULT_DPI); monitorResolution = WIN_DEFAULT_DPI; } } defaultScreenInfo.iMonitor = 1; + defaultScreenInfo.hMonitor = MonitorFromWindow(NULL, MONITOR_DEFAULTTOPRIMARY); defaultScreenInfo.dwWidth = dwWidth; defaultScreenInfo.dwHeight = dwHeight; defaultScreenInfo.dwUserWidth = dwWidth; @@ -144,7 +142,7 @@ winInitializeScreenDefaults(void) #endif defaultScreenInfo.fMultipleMonitors = FALSE; defaultScreenInfo.fLessPointer = FALSE; - defaultScreenInfo.iResizeMode = notAllowed; + defaultScreenInfo.iResizeMode = resizeWithRandr; defaultScreenInfo.fNoTrayIcon = FALSE; defaultScreenInfo.iE3BTimeout = WIN_E3B_DEFAULT; defaultScreenInfo.fUseWinKillKey = WIN_DEFAULT_WIN_KILL; @@ -159,7 +157,7 @@ winInitializeScreenDefaults(void) static void winInitializeScreen(int i) { - winErrorFVerb(2, "winInitializeScreen - %d\n", i); + winErrorFVerb(3, "winInitializeScreen - %d\n", i); /* Initialize default screen values, if needed */ winInitializeScreenDefaults(); @@ -176,7 +174,7 @@ winInitializeScreens(int maxscreens) { int i; - winErrorFVerb(2, "winInitializeScreens - %i\n", maxscreens); + winErrorFVerb(3, "winInitializeScreens - %i\n", maxscreens); if (maxscreens > g_iNumScreens) { /* Reallocate the memory for DDX-specific screen info */ @@ -333,6 +331,7 @@ ddxProcessArgument(int argc, char *argv[], int i) g_ScreenInfo[nScreenNum].fUserGaveHeightAndWidth = FALSE; g_ScreenInfo[nScreenNum].fUserGavePosition = TRUE; g_ScreenInfo[nScreenNum].iMonitor = iMonitor; + g_ScreenInfo[nScreenNum].hMonitor = data.monitorHandle; g_ScreenInfo[nScreenNum].dwWidth = data.monitorWidth; g_ScreenInfo[nScreenNum].dwHeight = data.monitorHeight; g_ScreenInfo[nScreenNum].dwUserWidth = data.monitorWidth; @@ -383,6 +382,7 @@ ddxProcessArgument(int argc, char *argv[], int i) } else if (data.bMonitorSpecifiedExists == TRUE) { g_ScreenInfo[nScreenNum].iMonitor = iMonitor; + g_ScreenInfo[nScreenNum].hMonitor = data.monitorHandle; g_ScreenInfo[nScreenNum].dwInitialX += data.monitorOffsetX; g_ScreenInfo[nScreenNum].dwInitialY += @@ -415,6 +415,7 @@ ddxProcessArgument(int argc, char *argv[], int i) iMonitor); g_ScreenInfo[nScreenNum].fUserGavePosition = TRUE; g_ScreenInfo[nScreenNum].iMonitor = iMonitor; + g_ScreenInfo[nScreenNum].hMonitor = data.monitorHandle; g_ScreenInfo[nScreenNum].dwInitialX = data.monitorOffsetX; g_ScreenInfo[nScreenNum].dwInitialY = data.monitorOffsetY; } @@ -1158,9 +1159,10 @@ winLogVersionInfo(void) ErrorF("Welcome to the XWin X Server\n"); ErrorF("Vendor: %s\n", XVENDORNAME); - ErrorF("Release: %d.%d.%d.%d (%d)\n", XORG_VERSION_MAJOR, - XORG_VERSION_MINOR, XORG_VERSION_PATCH, XORG_VERSION_SNAP, - XORG_VERSION_CURRENT); - ErrorF("%s\n\n", BUILDERSTRING); + ErrorF("Release: %d.%d.%d.%d\n", XORG_VERSION_MAJOR, + XORG_VERSION_MINOR, XORG_VERSION_PATCH, XORG_VERSION_SNAP); + if (strlen(BUILDERSTRING)) + ErrorF("%s\n", BUILDERSTRING); ErrorF("Contact: %s\n", BUILDERADDR); + ErrorF("\n"); } diff --git a/xserver/hw/xwin/winregistry.c b/xserver/hw/xwin/winregistry.c deleted file mode 100644 index d33f8c363..000000000 --- a/xserver/hw/xwin/winregistry.c +++ /dev/null @@ -1,65 +0,0 @@ -/* - *Copyright (C) 2002-2004 Harold L Hunt II All Rights Reserved. - * - *Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - *"Software"), to deal in the Software without restriction, including - *without limitation the rights to use, copy, modify, merge, publish, - *distribute, sublicense, and/or sell copies of the Software, and to - *permit persons to whom the Software is furnished to do so, subject to - *the following conditions: - * - *The above copyright notice and this permission notice shall be - *included in all copies or substantial portions of the Software. - * - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - *NONINFRINGEMENT. IN NO EVENT SHALL HAROLD L HUNT II BE LIABLE FOR - *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF - *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - *Except as contained in this notice, the name of Harold L Hunt II - *shall not be used in advertising or otherwise to promote the sale, use - *or other dealings in this Software without prior written authorization - *from Harold L Hunt II. - * - * Authors: Harold L Hunt II - */ - -#ifdef HAVE_XWIN_CONFIG_H -#include -#endif -#include "win.h" - -/* Prototypes */ -DWORD winGetRegistryDWORD(HKEY hkey, char *pszRegistryKey); - -DWORD -winGetRegistryDWORD(HKEY hkey, char *pszRegistryKey) -{ - HKEY hkResult; - DWORD dwDisposition; - - RegCreateKeyEx(hkey, - pszRegistryKey, - 0, - '\0', - REG_OPTION_NON_VOLATILE, - KEY_READ, NULL, &hkResult, &dwDisposition); - - if (dwDisposition == REG_CREATED_NEW_KEY) { - ErrorF("winGetRegistryDWORD - Created new key: %s\n", pszRegistryKey); - } - else if (dwDisposition == REG_OPENED_EXISTING_KEY) { - ErrorF("winGetRegistryDWORD - Opened existing key: %s\n", - pszRegistryKey); - } - - /* Free the registry key handle */ - RegCloseKey(hkResult); - hkResult = NULL; - - return 0; -} diff --git a/xserver/hw/xwin/winscrinit.c b/xserver/hw/xwin/winscrinit.c index cf7d2c0f8..e776bdba6 100644 --- a/xserver/hw/xwin/winscrinit.c +++ b/xserver/hw/xwin/winscrinit.c @@ -81,9 +81,9 @@ static Bool */ Bool -winScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) +winScreenInit(ScreenPtr pScreen, int argc, char **argv) { - winScreenInfoPtr pScreenInfo = &g_ScreenInfo[index]; + winScreenInfoPtr pScreenInfo = &g_ScreenInfo[pScreen->myNum]; winPrivScreenPtr pScreenPriv; HDC hdc; DWORD dwInitialBPP; @@ -202,11 +202,11 @@ winScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) miClearVisualTypes(); /* Call the engine dependent screen initialization procedure */ - if (!((*pScreenPriv->pwinFinishScreenInit) (index, pScreen, argc, argv))) { + if (!((*pScreenPriv->pwinFinishScreenInit) (pScreen->myNum, pScreen, argc, argv))) { ErrorF("winScreenInit - winFinishScreenInit () failed\n"); /* call the engine dependent screen close procedure to clean up from a failure */ - pScreenPriv->pwinCloseScreen(index, pScreen); + pScreenPriv->pwinCloseScreen(pScreen); return FALSE; } @@ -224,7 +224,7 @@ winScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) pScreen->y = pScreenInfo->dwInitialY - GetSystemMetrics(SM_YVIRTUALSCREEN); ErrorF("Screen %d added at virtual desktop coordinate (%d,%d).\n", - index, pScreen->x, pScreen->y); + pScreen->myNum, pScreen->x, pScreen->y); #if CYGDEBUG || YES winDebug("winScreenInit - returning\n"); @@ -254,7 +254,7 @@ winCreateScreenResources(ScreenPtr pScreen) /* See Porting Layer Definition - p. 20 */ Bool -winFinishScreenInitFB(int index, ScreenPtr pScreen, int argc, char **argv) +winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv) { winScreenPriv(pScreen); winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; @@ -355,8 +355,6 @@ winFinishScreenInitFB(int index, ScreenPtr pScreen, int argc, char **argv) */ pScreen->BlockHandler = winBlockHandler; pScreen->WakeupHandler = winWakeupHandler; - pScreen->blockData = pScreen; - pScreen->wakeupData = pScreen; /* Render extension initialization, calls miPictureInit */ if (!fbPictureInit(pScreen, NULL, 0)) { @@ -434,7 +432,7 @@ winFinishScreenInitFB(int index, ScreenPtr pScreen, int argc, char **argv) if (pScreen->a) { \ pScreenPriv->a = pScreen->a; \ } else { \ - ErrorF("null screen fn " #a "\n"); \ + winDebug("winScreenInit - null screen fn " #a "\n"); \ pScreenPriv->a = NULL; \ } @@ -468,7 +466,7 @@ winFinishScreenInitFB(int index, ScreenPtr pScreen, int argc, char **argv) if (pScreen->a) { \ pScreenPriv->a = pScreen->a; \ } else { \ - ErrorF("null screen fn " #a "\n"); \ + winDebug("null screen fn " #a "\n"); \ pScreenPriv->a = NULL; \ } @@ -552,7 +550,7 @@ winFinishScreenInitFB(int index, ScreenPtr pScreen, int argc, char **argv) &pScreenPriv->ptWMProc, &pScreenPriv->ptXMsgProc, &pScreenPriv->pmServerStarted, - pScreenInfo->dwScreen, (HWND) & pScreenPriv->hwndScreen, + pScreenInfo->dwScreen, (HWND) &pScreenPriv->hwndScreen, #ifdef XWIN_MULTIWINDOWEXTWM pScreenInfo->fInternalWM || #endif @@ -580,11 +578,11 @@ winFinishScreenInitFB(int index, ScreenPtr pScreen, int argc, char **argv) /* See Porting Layer Definition - p. 20 */ Bool -winFinishScreenInitNativeGDI(int index, +winFinishScreenInitNativeGDI(int i, ScreenPtr pScreen, int argc, char **argv) { winScreenPriv(pScreen); - winScreenInfoPtr pScreenInfo = &g_ScreenInfo[index]; + winScreenInfoPtr pScreenInfo = &g_ScreenInfo[i]; VisualPtr pVisuals = NULL; DepthPtr pDepths = NULL; VisualID rootVisual = 0; @@ -636,8 +634,6 @@ winFinishScreenInitNativeGDI(int index, */ pScreen->BlockHandler = winBlockHandler; pScreen->WakeupHandler = winWakeupHandler; - pScreen->blockData = pScreen; - pScreen->wakeupData = pScreen; /* Place our save screen function */ pScreen->SaveScreen = winSaveScreen; diff --git a/xserver/hw/xwin/winsetsp.c b/xserver/hw/xwin/winsetsp.c index 8f75991ff..f102f9ff5 100644 --- a/xserver/hw/xwin/winsetsp.c +++ b/xserver/hw/xwin/winsetsp.c @@ -107,7 +107,7 @@ winSetSpansNativeGDI(DrawablePtr pDrawable, 0, 0, *piWidths, 1, pSrcs, - (BITMAPINFO *) & bmi, + (BITMAPINFO *) &bmi, DIB_RGB_COLORS, g_copyROP[pGC->alu]); pSrcs += PixmapBytePad(*piWidths, pDrawable->depth); @@ -150,7 +150,7 @@ winSetSpansNativeGDI(DrawablePtr pDrawable, 0, 0, *piWidths, 1, pSrcs, - (BITMAPINFO *) & bmi, + (BITMAPINFO *) &bmi, DIB_RGB_COLORS, g_copyROP[pGC->alu]); pSrcs += PixmapBytePad(*piWidths, pDrawable->depth); diff --git a/xserver/hw/xwin/winshaddd.c b/xserver/hw/xwin/winshaddd.c index a2aaa395e..2e7060838 100644 --- a/xserver/hw/xwin/winshaddd.c +++ b/xserver/hw/xwin/winshaddd.c @@ -36,24 +36,6 @@ #endif #include "win.h" -/* - * FIXME: Headers are broken, DEFINE_GUID doesn't work correctly, - * so we have to redefine it here. - */ -#ifdef DEFINE_GUID -#undef DEFINE_GUID -#define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) const GUID n GUID_SECT = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}} -#endif /* DEFINE_GUID */ - -/* - * FIXME: Headers are broken, IID_IDirectDraw2 has to be defined - * here manually. Should be handled by ddraw.h - */ -#ifndef IID_IDirectDraw2 -DEFINE_GUID(IID_IDirectDraw2, 0xB3A6F3E0, 0x2B43, 0x11CF, 0xA2, 0xDE, 0x00, - 0xAA, 0x00, 0xB9, 0x33, 0x56); -#endif /* IID_IDirectDraw2 */ - /* * Local prototypes */ @@ -65,7 +47,7 @@ static void winShadowUpdateDD(ScreenPtr pScreen, shadowBufPtr pBuf); static Bool - winCloseScreenShadowDD(int nIndex, ScreenPtr pScreen); + winCloseScreenShadowDD(ScreenPtr pScreen); static Bool winInitVisualsShadowDD(ScreenPtr pScreen); @@ -250,7 +232,7 @@ winAllocateFBShadowDD(ScreenPtr pScreen) /* Get a DirectDraw2 interface pointer */ ddrval = IDirectDraw_QueryInterface(pScreenPriv->pdd, &IID_IDirectDraw2, - (LPVOID *) & pScreenPriv->pdd2); + (LPVOID *) &pScreenPriv->pdd2); if (FAILED(ddrval)) { ErrorF("winAllocateFBShadowDD - Failed DD2 query: %08x\n", (unsigned int) ddrval); @@ -507,7 +489,7 @@ winShadowUpdateDD(ScreenPtr pScreen, shadowBufPtr pBuf) POINT ptOrigin; DWORD dwBox = RegionNumRects(damage); BoxPtr pBox = RegionRects(damage); - HRGN hrgnTemp = NULL, hrgnCombined = NULL; + HRGN hrgnCombined = NULL; /* * Return immediately if the app is not active @@ -525,7 +507,7 @@ winShadowUpdateDD(ScreenPtr pScreen, shadowBufPtr pBuf) ptOrigin.x = pScreenInfo->dwXOffset; ptOrigin.y = pScreenInfo->dwYOffset; MapWindowPoints(pScreenPriv->hwndScreen, - HWND_DESKTOP, (LPPOINT) & ptOrigin, 1); + HWND_DESKTOP, (LPPOINT) &ptOrigin, 1); /* Unlock the shadow surface, so we can blit */ ddrval = IDirectDrawSurface2_Unlock(pScreenPriv->pddsShadow, NULL); @@ -569,15 +551,9 @@ winShadowUpdateDD(ScreenPtr pScreen, shadowBufPtr pBuf) BoxPtr pBoxExtents = RegionExtents(damage); /* Compute a GDI region from the damaged region */ - hrgnCombined = CreateRectRgn(pBox->x1, pBox->y1, pBox->x2, pBox->y2); - dwBox--; - pBox++; - while (dwBox--) { - hrgnTemp = CreateRectRgn(pBox->x1, pBox->y1, pBox->x2, pBox->y2); - CombineRgn(hrgnCombined, hrgnCombined, hrgnTemp, RGN_OR); - DeleteObject(hrgnTemp); - pBox++; - } + hrgnCombined = + CreateRectRgn(pBoxExtents->x1, pBoxExtents->y1, pBoxExtents->x2, + pBoxExtents->y2); /* Install the GDI region as a clipping region */ SelectClipRgn(pScreenPriv->hdcScreen, hrgnCombined); @@ -648,7 +624,7 @@ winInitScreenShadowDD(ScreenPtr pScreen) */ static Bool -winCloseScreenShadowDD(int nIndex, ScreenPtr pScreen) +winCloseScreenShadowDD(ScreenPtr pScreen) { winScreenPriv(pScreen); winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; @@ -665,7 +641,7 @@ winCloseScreenShadowDD(int nIndex, ScreenPtr pScreen) /* Call the wrapped CloseScreen procedure */ WIN_UNWRAP(CloseScreen); if (pScreen->CloseScreen) - fReturn = (*pScreen->CloseScreen) (nIndex, pScreen); + fReturn = (*pScreen->CloseScreen) (pScreen); winFreeFBShadowDD(pScreen); @@ -877,7 +853,7 @@ winBltExposedRegionsShadowDD(ScreenPtr pScreen) ptOrigin.y = pScreenInfo->dwYOffset; MapWindowPoints(pScreenPriv->hwndScreen, - HWND_DESKTOP, (LPPOINT) & ptOrigin, 1); + HWND_DESKTOP, (LPPOINT) &ptOrigin, 1); rcDest.left = ptOrigin.x; rcDest.right = ptOrigin.x + pScreenInfo->dwWidth; rcDest.top = ptOrigin.y; @@ -1020,7 +996,7 @@ winRedrawScreenShadowDD(ScreenPtr pScreen) ptOrigin.x = pScreenInfo->dwXOffset; ptOrigin.y = pScreenInfo->dwYOffset; MapWindowPoints(pScreenPriv->hwndScreen, - HWND_DESKTOP, (LPPOINT) & ptOrigin, 1); + HWND_DESKTOP, (LPPOINT) &ptOrigin, 1); rcDest.left = ptOrigin.x; rcDest.right = ptOrigin.x + pScreenInfo->dwWidth; rcDest.top = ptOrigin.y; diff --git a/xserver/hw/xwin/winshadddnl.c b/xserver/hw/xwin/winshadddnl.c index 6e71dd24c..01097f295 100644 --- a/xserver/hw/xwin/winshadddnl.c +++ b/xserver/hw/xwin/winshadddnl.c @@ -36,24 +36,6 @@ #endif #include "win.h" -/* - * FIXME: Headers are broken, DEFINE_GUID doesn't work correctly, - * so we have to redefine it here. - */ -#ifdef DEFINE_GUID -#undef DEFINE_GUID -#define DEFINE_GUID(n,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) const GUID n GUID_SECT = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}} -#endif /* DEFINE_GUID */ - -/* - * FIXME: Headers are broken, IID_IDirectDraw4 has to be defined - * here manually. Should be handled by ddraw.h - */ -#ifndef IID_IDirectDraw4 -DEFINE_GUID(IID_IDirectDraw4, 0x9c59509a, 0x39bd, 0x11d1, 0x8c, 0x4a, 0x00, - 0xc0, 0x4f, 0xd9, 0x30, 0xc5); -#endif /* IID_IDirectDraw4 */ - #define FAIL_MSG_MAX_BLT 10 /* @@ -67,7 +49,7 @@ static void winShadowUpdateDDNL(ScreenPtr pScreen, shadowBufPtr pBuf); static Bool - winCloseScreenShadowDDNL(int nIndex, ScreenPtr pScreen); + winCloseScreenShadowDDNL(ScreenPtr pScreen); static Bool winInitVisualsShadowDDNL(ScreenPtr pScreen); @@ -267,7 +249,7 @@ winAllocateFBShadowDDNL(ScreenPtr pScreen) /* Create a DirectDraw object, store the address at lpdd */ ddrval = (*g_fpDirectDrawCreate) (NULL, - (LPDIRECTDRAW *) & pScreenPriv->pdd, + (LPDIRECTDRAW *) &pScreenPriv->pdd, NULL); if (FAILED(ddrval)) { ErrorF("winAllocateFBShadowDDNL - Could not start " @@ -282,7 +264,7 @@ winAllocateFBShadowDDNL(ScreenPtr pScreen) /* Get a DirectDraw4 interface pointer */ ddrval = IDirectDraw_QueryInterface(pScreenPriv->pdd, &IID_IDirectDraw4, - (LPVOID *) & pScreenPriv->pdd4); + (LPVOID *) &pScreenPriv->pdd4); if (FAILED(ddrval)) { ErrorF("winAllocateFBShadowDDNL - Failed DD4 query: %08x\n", (unsigned int) ddrval); @@ -526,50 +508,6 @@ winFreeFBShadowDDNL(ScreenPtr pScreen) pScreenInfo->pfb = NULL; } -#if defined(XWIN_MULTIWINDOW) || defined(XWIN_MULTIWINDOWEXTWM) -/* - * Create a DirectDraw surface for the new multi-window window - */ - -static - Bool -winFinishCreateWindowsWindowDDNL(WindowPtr pWin) -{ - winWindowPriv(pWin); - winPrivScreenPtr pScreenPriv = pWinPriv->pScreenPriv; - HRESULT ddrval = DD_OK; - DDSURFACEDESC2 ddsd; - int iWidth, iHeight; - int iX, iY; - - winDebug("winFinishCreateWindowsWindowDDNL!\n\n"); - - iX = pWin->drawable.x + GetSystemMetrics(SM_XVIRTUALSCREEN); - iY = pWin->drawable.y + GetSystemMetrics(SM_YVIRTUALSCREEN); - - iWidth = pWin->drawable.width; - iHeight = pWin->drawable.height; - - /* Describe the primary surface */ - ZeroMemory(&ddsd, sizeof(ddsd)); - ddsd.dwSize = sizeof(ddsd); - ddsd.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; - ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE; - ddsd.dwHeight = iHeight; - ddsd.dwWidth = iWidth; - - /* Create the primary surface */ - ddrval = IDirectDraw4_CreateSurface(pScreenPriv->pdd4, - &ddsd, &pWinPriv->pddsPrimary4, NULL); - if (FAILED(ddrval)) { - ErrorF("winFinishCreateWindowsWindowDDNL - Could not create primary " - "surface: %08x\n", (unsigned int) ddrval); - return FALSE; - } - return TRUE; -} -#endif - /* * Transfer the damaged regions of the shadow framebuffer to the display. */ @@ -585,7 +523,7 @@ winShadowUpdateDDNL(ScreenPtr pScreen, shadowBufPtr pBuf) POINT ptOrigin; DWORD dwBox = RegionNumRects(damage); BoxPtr pBox = RegionRects(damage); - HRGN hrgnTemp = NULL, hrgnCombined = NULL; + HRGN hrgnCombined = NULL; /* * Return immediately if the app is not active @@ -603,7 +541,7 @@ winShadowUpdateDDNL(ScreenPtr pScreen, shadowBufPtr pBuf) ptOrigin.x = pScreenInfo->dwXOffset; ptOrigin.y = pScreenInfo->dwYOffset; MapWindowPoints(pScreenPriv->hwndScreen, - HWND_DESKTOP, (LPPOINT) & ptOrigin, 1); + HWND_DESKTOP, (LPPOINT) &ptOrigin, 1); /* * Handle small regions with multiple blits, @@ -657,15 +595,9 @@ winShadowUpdateDDNL(ScreenPtr pScreen, shadowBufPtr pBuf) BoxPtr pBoxExtents = RegionExtents(damage); /* Compute a GDI region from the damaged region */ - hrgnCombined = CreateRectRgn(pBox->x1, pBox->y1, pBox->x2, pBox->y2); - dwBox--; - pBox++; - while (dwBox--) { - hrgnTemp = CreateRectRgn(pBox->x1, pBox->y1, pBox->x2, pBox->y2); - CombineRgn(hrgnCombined, hrgnCombined, hrgnTemp, RGN_OR); - DeleteObject(hrgnTemp); - pBox++; - } + hrgnCombined = + CreateRectRgn(pBoxExtents->x1, pBoxExtents->y1, pBoxExtents->x2, + pBoxExtents->y2); /* Install the GDI region as a clipping region */ SelectClipRgn(pScreenPriv->hdcScreen, hrgnCombined); @@ -719,7 +651,7 @@ winInitScreenShadowDDNL(ScreenPtr pScreen) */ static Bool -winCloseScreenShadowDDNL(int nIndex, ScreenPtr pScreen) +winCloseScreenShadowDDNL(ScreenPtr pScreen) { winScreenPriv(pScreen); winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; @@ -736,7 +668,7 @@ winCloseScreenShadowDDNL(int nIndex, ScreenPtr pScreen) /* Call the wrapped CloseScreen procedure */ WIN_UNWRAP(CloseScreen); if (pScreen->CloseScreen) - fReturn = (*pScreen->CloseScreen) (nIndex, pScreen); + fReturn = (*pScreen->CloseScreen) (pScreen); winFreeFBShadowDDNL(pScreen); @@ -948,7 +880,7 @@ winBltExposedRegionsShadowDDNL(ScreenPtr pScreen) ptOrigin.y = pScreenInfo->dwYOffset; MapWindowPoints(pScreenPriv->hwndScreen, - HWND_DESKTOP, (LPPOINT) & ptOrigin, 1); + HWND_DESKTOP, (LPPOINT) &ptOrigin, 1); rcDest.left = ptOrigin.x; rcDest.right = ptOrigin.x + pScreenInfo->dwWidth; rcDest.top = ptOrigin.y; @@ -1058,7 +990,7 @@ winRedrawScreenShadowDDNL(ScreenPtr pScreen) ptOrigin.x = pScreenInfo->dwXOffset; ptOrigin.y = pScreenInfo->dwYOffset; MapWindowPoints(pScreenPriv->hwndScreen, - HWND_DESKTOP, (LPPOINT) & ptOrigin, 1); + HWND_DESKTOP, (LPPOINT) &ptOrigin, 1); rcDest.left = ptOrigin.x; rcDest.right = ptOrigin.x + pScreenInfo->dwWidth; rcDest.top = ptOrigin.y; @@ -1278,7 +1210,7 @@ winSetEngineFunctionsShadowDDNL(ScreenPtr pScreen) pScreenPriv->pwinReleasePrimarySurface = winReleasePrimarySurfaceShadowDDNL; #ifdef XWIN_MULTIWINDOW pScreenPriv->pwinFinishCreateWindowsWindow - = winFinishCreateWindowsWindowDDNL; + = (winFinishCreateWindowsWindowProcPtr) (void (*)(void)) NoopDDA; #endif return TRUE; diff --git a/xserver/hw/xwin/winshadgdi.c b/xserver/hw/xwin/winshadgdi.c index 3b7b8b5a8..ebc233924 100644 --- a/xserver/hw/xwin/winshadgdi.c +++ b/xserver/hw/xwin/winshadgdi.c @@ -50,7 +50,7 @@ static void winShadowUpdateGDI(ScreenPtr pScreen, shadowBufPtr pBuf); static Bool - winCloseScreenShadowGDI(int nIndex, ScreenPtr pScreen); + winCloseScreenShadowGDI(ScreenPtr pScreen); static Bool winInitVisualsShadowGDI(ScreenPtr pScreen); @@ -337,7 +337,7 @@ winAllocateFBShadowGDI(ScreenPtr pScreen) pScreenPriv->hbmpShadow = CreateDIBSection(pScreenPriv->hdcScreen, (BITMAPINFO *) pScreenPriv-> pbmih, DIB_RGB_COLORS, - (VOID **) & pScreenInfo->pfb, + (VOID **) &pScreenInfo->pfb, NULL, 0); if (pScreenPriv->hbmpShadow == NULL || pScreenInfo->pfb == NULL) { winW32Error(2, "winAllocateFBShadowGDI - CreateDIBSection failed:"); @@ -439,7 +439,7 @@ winShadowUpdateGDI(ScreenPtr pScreen, shadowBufPtr pBuf) DWORD dwBox = RegionNumRects(damage); BoxPtr pBox = RegionRects(damage); int x, y, w, h; - HRGN hrgnTemp = NULL, hrgnCombined = NULL; + HRGN hrgnCombined = NULL; #ifdef XWIN_UPDATESTATS static DWORD s_dwNonUnitRegions = 0; @@ -500,16 +500,11 @@ winShadowUpdateGDI(ScreenPtr pScreen, shadowBufPtr pBuf) } } else if (!pScreenInfo->fMultiWindow) { + /* Compute a GDI region from the damaged region */ - hrgnCombined = CreateRectRgn(pBox->x1, pBox->y1, pBox->x2, pBox->y2); - dwBox--; - pBox++; - while (dwBox--) { - hrgnTemp = CreateRectRgn(pBox->x1, pBox->y1, pBox->x2, pBox->y2); - CombineRgn(hrgnCombined, hrgnCombined, hrgnTemp, RGN_OR); - DeleteObject(hrgnTemp); - pBox++; - } + hrgnCombined = + CreateRectRgn(pBoxExtents->x1, pBoxExtents->y1, pBoxExtents->x2, + pBoxExtents->y2); /* Install the GDI region as a clipping region */ SelectClipRgn(pScreenPriv->hdcScreen, hrgnCombined); @@ -579,7 +574,7 @@ winInitScreenShadowGDI(ScreenPtr pScreen) */ static Bool -winCloseScreenShadowGDI(int nIndex, ScreenPtr pScreen) +winCloseScreenShadowGDI(ScreenPtr pScreen) { winScreenPriv(pScreen); winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; @@ -596,7 +591,7 @@ winCloseScreenShadowGDI(int nIndex, ScreenPtr pScreen) /* Call the wrapped CloseScreen procedure */ WIN_UNWRAP(CloseScreen); if (pScreen->CloseScreen) - fReturn = (*pScreen->CloseScreen) (nIndex, pScreen); + fReturn = (*pScreen->CloseScreen) (pScreen); /* Delete the window property */ RemoveProp(pScreenPriv->hwndScreen, WIN_SCR_PROP); diff --git a/xserver/hw/xwin/wintaskbar.c b/xserver/hw/xwin/wintaskbar.c new file mode 100644 index 000000000..7dd4ec30b --- /dev/null +++ b/xserver/hw/xwin/wintaskbar.c @@ -0,0 +1,92 @@ +/* + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice (including the next + paragraph) shall be included in all copies or substantial portions of the + Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#ifdef HAVE_XWIN_CONFIG_H +#include +#endif + +#include "win.h" +#include "winwindow.h" + +const GUID CLSID_TaskbarList = {0x56fdf344,0xfd6d,0x11d0,{0x95,0x8a,0x0,0x60,0x97,0xc9,0xa0,0x90}}; +const GUID IID_ITaskbarList = {0x56fdf342,0xfd6d,0x11d0,{0x95,0x8a,0x0,0x60,0x97,0xc9,0xa0,0x90}}; + +#ifdef INTERFACE +#undef INTERFACE +#endif + +#define INTERFACE ITaskbarList +DECLARE_INTERFACE_(ITaskbarList, IUnknown) +{ + /* IUnknown methods */ + STDMETHOD(QueryInterface) (THIS_ REFIID riid, void **ppv) PURE; + STDMETHOD_(ULONG, AddRef) (THIS) PURE; + STDMETHOD_(ULONG, Release) (THIS) PURE; + + /* ITaskbarList methods */ + STDMETHOD(HrInit) (THIS) PURE; + STDMETHOD(AddTab) (THIS_ HWND hWnd) PURE; + STDMETHOD(DeleteTab) (THIS_ HWND hWnd) PURE; + STDMETHOD(ActivateTab) (THIS_ HWND hWnd) PURE; + STDMETHOD(SetActiveAlt) (THIS_ HWND hWnd) PURE; +}; +#undef INTERFACE + +/* + The stuff above needs to be in win32api headers, not defined here, + or at least generated from the MIDL :-) +*/ + +/* + This is unnecessarily heavyweight, we could just call CoInitialize() once at + startup and CoUninitialize() once at shutdown +*/ + +/* + The documentation for ITaskbarList::AddTab says that we are responsible for + deleting the tab ourselves when the window is deleted, but that doesn't actually + seem to be the case +*/ + +void winShowWindowOnTaskbar(HWND hWnd, BOOL show) +{ + ITaskbarList* pTaskbarList = NULL; + + if (SUCCEEDED(CoInitialize(NULL))) + { + if (SUCCEEDED(CoCreateInstance((const CLSID *)&CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER, (const IID *)&IID_ITaskbarList, (void**)&pTaskbarList))) + { + if (SUCCEEDED(pTaskbarList->lpVtbl->HrInit(pTaskbarList))) + { + if (show) + { + pTaskbarList->lpVtbl->AddTab(pTaskbarList,hWnd); + } + else + { + pTaskbarList->lpVtbl->DeleteTab(pTaskbarList,hWnd); + } + } + pTaskbarList->lpVtbl->Release(pTaskbarList); + } + CoUninitialize(); + } +} diff --git a/xserver/hw/xwin/wintrayicon.c b/xserver/hw/xwin/wintrayicon.c index dbc47257b..f168b884a 100644 --- a/xserver/hw/xwin/wintrayicon.c +++ b/xserver/hw/xwin/wintrayicon.c @@ -114,7 +114,7 @@ winHandleIconMessage(HWND hwnd, UINT message, switch (lParam) { case WM_LBUTTONUP: /* Restack and bring all windows to top */ - SetForegroundWindow(hwnd); + SetForegroundWindow (pScreenPriv->hwndScreen); #ifdef XWIN_MULTIWINDOWEXTWM if (pScreenInfo->fMWExtWM) diff --git a/xserver/hw/xwin/winvalargs.c b/xserver/hw/xwin/winvalargs.c index eb6e973b8..edfd71f72 100644 --- a/xserver/hw/xwin/winvalargs.c +++ b/xserver/hw/xwin/winvalargs.c @@ -57,9 +57,7 @@ Bool winValidateArgs(void) { int i; - int iMaxConsecutiveScreen = 0; BOOL fHasNormalScreen0 = FALSE; - BOOL fImplicitScreenFound = FALSE; /* * Check for a malformed set of -screen parameters. diff --git a/xserver/hw/xwin/winwakeup.c b/xserver/hw/xwin/winwakeup.c index 1d2bfedbe..795221a1a 100644 --- a/xserver/hw/xwin/winwakeup.c +++ b/xserver/hw/xwin/winwakeup.c @@ -38,13 +38,13 @@ /* See Porting Layer Definition - p. 7 */ void -winWakeupHandler(int nScreen, - pointer pWakeupData, unsigned long ulResult, pointer pReadmask) +winWakeupHandler(ScreenPtr pScreen, + unsigned long ulResult, pointer pReadmask) { MSG msg; - /* Process all messages on our queue */ - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { + /* Process one message from our queue */ + if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { if ((g_hDlgDepthChange == 0 || !IsDialogMessage(g_hDlgDepthChange, &msg)) && (g_hDlgExit == 0 || !IsDialogMessage(g_hDlgExit, &msg)) diff --git a/xserver/hw/xwin/winwin32rootless.c b/xserver/hw/xwin/winwin32rootless.c index cef49b57c..210fea3fa 100644 --- a/xserver/hw/xwin/winwin32rootless.c +++ b/xserver/hw/xwin/winwin32rootless.c @@ -231,7 +231,7 @@ winMWExtWMCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen, // Store the implementation private frame ID pFrame->wid = (RootlessFrameID) pRLWinPriv; - winSelectIcons(pFrame->win, &hIcon, &hIconSmall); + winSelectIcons(&hIcon, &hIconSmall); /* Set standard class name prefix so we can identify window easily */ strncpy(pszClass, WINDOW_CLASS_X, sizeof(pszClass)); @@ -263,7 +263,7 @@ winMWExtWMCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen, strcat(pszClass, pszWindowID); #if CYGMULTIWINDOW_DEBUG - winDebug("winCreateWindowsWindow - Creating class: %s\n", pszClass); + winDebug("winMWExtWMCreateFrame - Creating class: %s\n", pszClass); #endif /* Setup our window class */ @@ -634,7 +634,7 @@ winMWExtWMReshapeFrame(RootlessFrameID wid, RegionPtr pShape) /* Create region for non-client area */ GetWindowRect(pRLWinPriv->hWnd, &rcWindow); GetClientRect(pRLWinPriv->hWnd, &rcClient); - MapWindowPoints(pRLWinPriv->hWnd, HWND_DESKTOP, (LPPOINT) & rcClient, 2); + MapWindowPoints(pRLWinPriv->hWnd, HWND_DESKTOP, (LPPOINT) &rcClient, 2); OffsetRgn(hRgn, rcClient.left - rcWindow.left, rcClient.top - rcWindow.top); OffsetRect(&rcClient, -rcWindow.left, -rcWindow.top); OffsetRect(&rcWindow, -rcWindow.left, -rcWindow.top); @@ -725,7 +725,7 @@ winMWExtWMStartDrawing(RootlessFrameID wid, char **pixelData, int *bytesPerRow) hbmpNew = CreateDIBSection(pRLWinPriv->hdcScreen, (BITMAPINFO *) pRLWinPriv->pbmihShadow, DIB_RGB_COLORS, - (VOID **) & pRLWinPriv->pfb, NULL, 0); + (VOID **) &pRLWinPriv->pfb, NULL, 0); if (hbmpNew == NULL || pRLWinPriv->pfb == NULL) { ErrorF("winMWExtWMStartDrawing - CreateDIBSection failed\n"); //return FALSE; @@ -883,7 +883,7 @@ winMWExtWMUpdateRegion(RootlessFrameID wid, RegionPtr pDamage) NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) & lpMsgBuf, 0, NULL); + (LPTSTR) &lpMsgBuf, 0, NULL); ErrorF("winMWExtWMUpdateRegion - UpdateLayeredWindow failed: %s\n", (LPSTR) lpMsgBuf); diff --git a/xserver/hw/xwin/winwin32rootlesswindow.c b/xserver/hw/xwin/winwin32rootlesswindow.c index bfba1bfd0..f2d68cb46 100644 --- a/xserver/hw/xwin/winwin32rootlesswindow.c +++ b/xserver/hw/xwin/winwin32rootlesswindow.c @@ -147,39 +147,8 @@ winMWExtWMMoveResizeXWindow(WindowPtr pWin, int x, int y, int w, int h) } /* - * winMWExtWMUpdateIcon - * Change the Windows window icon - */ -void -winMWExtWMUpdateIcon(Window id) -{ - WindowPtr pWin; - HICON hIcon, hiconOld; - dixLookupResourceByType((pointer) &pWin, id, RT_WINDOW, NullClient, - DixUnknownAccess); - hIcon = winOverrideIcon((unsigned long) pWin); - - if (!hIcon) - hIcon = winXIconToHICON(pWin, GetSystemMetrics(SM_CXICON)); - - if (hIcon) { - win32RootlessWindowPtr pRLWinPriv - = (win32RootlessWindowPtr) RootlessFrameForWindow(pWin, FALSE); - - if (pRLWinPriv->hWnd) { - - hiconOld = (HICON) SendMessage(pRLWinPriv->hWnd, - WM_SETICON, ICON_BIG, - (LPARAM) hIcon); - winDestroyIcon(hiconOld); - } - hIcon = NULL; - } -} - -/* * winMWExtWMDecorateWindow - Update window style. Called by EnumWindows. */ diff --git a/xserver/hw/xwin/winwin32rootlesswndproc.c b/xserver/hw/xwin/winwin32rootlesswndproc.c index 436f9edd6..13df18677 100644 --- a/xserver/hw/xwin/winwin32rootlesswndproc.c +++ b/xserver/hw/xwin/winwin32rootlesswndproc.c @@ -780,7 +780,7 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) & lpMsgBuf, 0, NULL); + (LPTSTR) &lpMsgBuf, 0, NULL); ErrorF("winMWExtWMWindowProc - BitBlt failed: %s\n", (LPSTR) lpMsgBuf); @@ -1058,7 +1058,7 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) if (!pRLWinPriv->fMovingOrSizing /*&& (pWinPos->flags & SWP_SHOWWINDOW) */ ) { GetClientRect(hwnd, &rcClient); - MapWindowPoints(hwnd, HWND_DESKTOP, (LPPOINT) & rcClient, 2); + MapWindowPoints(hwnd, HWND_DESKTOP, (LPPOINT) &rcClient, 2); if (!(pWinPos->flags & SWP_NOMOVE) && !(pWinPos->flags & SWP_NOSIZE)) { @@ -1263,7 +1263,7 @@ winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) GetClientRect(hwnd, &rcClient); - MapWindowPoints(hwnd, HWND_DESKTOP, (LPPOINT) & rcClient, 2); + MapWindowPoints(hwnd, HWND_DESKTOP, (LPPOINT) &rcClient, 2); if (winIsInternalWMRunning(pScreenInfo)) winAdjustXWindow(pWin, hwnd); diff --git a/xserver/hw/xwin/winwindow.c b/xserver/hw/xwin/winwindow.c index 594791789..ab6d8dec2 100644 --- a/xserver/hw/xwin/winwindow.c +++ b/xserver/hw/xwin/winwindow.c @@ -59,7 +59,6 @@ winCreateWindowNativeGDI(WindowPtr pWin) Bool fResult = TRUE; ScreenPtr pScreen = pWin->drawable.pScreen; - winWindowPriv(pWin); winScreenPriv(pScreen); #if CYGDEBUG @@ -82,7 +81,6 @@ winDestroyWindowNativeGDI(WindowPtr pWin) Bool fResult = TRUE; ScreenPtr pScreen = pWin->drawable.pScreen; - winWindowPriv(pWin); winScreenPriv(pScreen); #if CYGDEBUG @@ -105,7 +103,6 @@ winPositionWindowNativeGDI(WindowPtr pWin, int x, int y) Bool fResult = TRUE; ScreenPtr pScreen = pWin->drawable.pScreen; - winWindowPriv(pWin); winScreenPriv(pScreen); #if CYGDEBUG @@ -210,7 +207,6 @@ winChangeWindowAttributesNativeGDI(WindowPtr pWin, unsigned long mask) Bool fResult = TRUE; ScreenPtr pScreen = pWin->drawable.pScreen; - winWindowPriv(pWin); winScreenPriv(pScreen); #if CYGDEBUG @@ -238,7 +234,6 @@ winUnmapWindowNativeGDI(WindowPtr pWin) Bool fResult = TRUE; ScreenPtr pScreen = pWin->drawable.pScreen; - winWindowPriv(pWin); winScreenPriv(pScreen); #if CYGDEBUG @@ -262,7 +257,6 @@ winMapWindowNativeGDI(WindowPtr pWin) Bool fResult = TRUE; ScreenPtr pScreen = pWin->drawable.pScreen; - winWindowPriv(pWin); winScreenPriv(pScreen); #if CYGDEBUG diff --git a/xserver/hw/xwin/winwindow.h b/xserver/hw/xwin/winwindow.h index c357f8d08..25826ecc7 100644 --- a/xserver/hw/xwin/winwindow.h +++ b/xserver/hw/xwin/winwindow.h @@ -81,15 +81,6 @@ typedef struct { #ifdef XWIN_GLX_WINDOWS Bool fWglUsed; #endif - - /* Privates used by primary fb DirectDraw server */ - LPDDSURFACEDESC pddsdPrimary; - - /* Privates used by shadow fb DirectDraw Nonlocking server */ - LPDIRECTDRAWSURFACE4 pddsPrimary4; - - /* Privates used by both shadow fb DirectDraw servers */ - LPDIRECTDRAWCLIPPER pddcPrimary; } winPrivWinRec, *winPrivWinPtr; #ifdef XWIN_MULTIWINDOW @@ -115,10 +106,11 @@ typedef struct _winWMMessageRec { #define WM_WM_KILL (WM_USER + 7) #define WM_WM_ACTIVATE (WM_USER + 8) #define WM_WM_NAME_EVENT (WM_USER + 9) -#define WM_WM_HINTS_EVENT (WM_USER + 10) +#define WM_WM_ICON_EVENT (WM_USER + 10) #define WM_WM_CHANGE_STATE (WM_USER + 11) #define WM_WM_MAP2 (WM_USER + 12) #define WM_WM_MAP3 (WM_USER + 13) +#define WM_WM_HINTS_EVENT (WM_USER + 14) #define WM_MANAGE (WM_USER + 100) #define WM_UNMANAGE (WM_USER + 102) @@ -157,18 +149,17 @@ void void winMinimizeWindow(Window id); -/* - * winmultiwindowicons.c - */ +void + winPropertyStoreInit(void); void - winUpdateIcon(Window id); + winPropertyStoreDestroy(void); void - winInitGlobalIcons(void); + winSetAppUserModelID(HWND hWnd, const char *AppID); void - winDestroyIcon(HICON hIcon); + winShowWindowOnTaskbar(HWND hWnd, BOOL show); #endif /* XWIN_MULTIWINDOW */ #endif diff --git a/xserver/hw/xwin/winwindowswm.c b/xserver/hw/xwin/winwindowswm.c index f67c383f3..fbd41aaa8 100644 --- a/xserver/hw/xwin/winwindowswm.c +++ b/xserver/hw/xwin/winwindowswm.c @@ -82,7 +82,6 @@ static int ProcWindowsWMQueryVersion(ClientPtr client) { xWindowsWMQueryVersionReply rep; - int n; REQUEST_SIZE_MATCH(xWindowsWMQueryVersionReq); rep.type = X_Reply; @@ -95,7 +94,7 @@ ProcWindowsWMQueryVersion(ClientPtr client) swaps(&rep.sequenceNumber); swapl(&rep.length); } - WriteToClient(client, sizeof(xWindowsWMQueryVersionReply), (char *) &rep); + WriteToClient(client, sizeof(xWindowsWMQueryVersionReply), &rep); return Success; } @@ -366,7 +365,7 @@ ProcWindowsWMFrameGetRect(ClientPtr client) rep.x, rep.y, rep.w, rep.h); #endif - WriteToClient(client, sizeof(xWindowsWMFrameGetRectReply), (char *) &rep); + WriteToClient(client, sizeof(xWindowsWMFrameGetRectReply), &rep); return Success; } @@ -439,8 +438,6 @@ ProcWindowsWMFrameDraw(ClientPtr client) ShowWindow(pRLWinPriv->hWnd, nCmdShow); - winMWExtWMUpdateIcon(pWin->drawable.id); - if (wBoundingShape(pWin) != NULL) { /* wBoundingShape is relative to *inner* origin of window. Translate by borderWidth to get the outside-relative position. */ @@ -493,7 +490,7 @@ ProcWindowsWMFrameSetTitle(ClientPtr client) #endif title_bytes = malloc(title_length + 1); - strncpy(title_bytes, (unsigned char *) &stuff[1], title_length); + strncpy(title_bytes, (char *) &stuff[1], title_length); title_bytes[title_length] = '\0'; pRLWinPriv = (win32RootlessWindowPtr) RootlessFrameForWindow(pWin, FALSE); @@ -527,7 +524,7 @@ ProcWindowsWMDispatch(ClientPtr client) return ProcWindowsWMQueryVersion(client); } - if (!LocalClient(client)) + if (!client->local) return WMErrorBase + WindowsWMClientNotLocal; switch (stuff->data) { @@ -564,8 +561,6 @@ SNotifyEvent(xWindowsWMNotifyEvent * from, xWindowsWMNotifyEvent * to) static int SProcWindowsWMQueryVersion(ClientPtr client) { - int n; - REQUEST(xWindowsWMQueryVersionReq); swaps(&stuff->length); return ProcWindowsWMQueryVersion(client); @@ -577,7 +572,7 @@ SProcWindowsWMDispatch(ClientPtr client) REQUEST(xReq); /* It is bound to be non-local when there is byte swapping */ - if (!LocalClient(client)) + if (!client->local) return WMErrorBase + WindowsWMClientNotLocal; /* only local clients are allowed WM access */ diff --git a/xserver/hw/xwin/winwndproc.c b/xserver/hw/xwin/winwndproc.c index 3f5d66b96..7ba028042 100644 --- a/xserver/hw/xwin/winwndproc.c +++ b/xserver/hw/xwin/winwndproc.c @@ -428,6 +428,13 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) } return 0; + case WM_SYSCOMMAND: + if (s_pScreenInfo->iResizeMode == resizeWithRandr && + ((wParam & 0xfff0) == SC_MAXIMIZE || + (wParam & 0xfff0) == SC_RESTORE)) + PostMessage(hwnd, WM_EXITSIZEMOVE, 0, 0); + break; + case WM_ENTERSIZEMOVE: ErrorF("winWindowProc - WM_ENTERSIZEMOVE\n"); break; @@ -923,6 +930,7 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) case WIN_POLLING_MOUSE_TIMER_ID: { + static POINT last_point; POINT point; WPARAM wL, wM, wR, wShift, wCtrl; LPARAM lPos; @@ -934,8 +942,12 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) point.x -= GetSystemMetrics(SM_XVIRTUALSCREEN); point.y -= GetSystemMetrics(SM_YVIRTUALSCREEN); - /* Deliver absolute cursor position to X Server */ - winEnqueueMotion(point.x, point.y); + /* If the mouse pointer has moved, deliver absolute cursor position to X Server */ + if (last_point.x != point.x || last_point.y != point.y) { + winEnqueueMotion(point.x, point.y); + last_point.x = point.x; + last_point.y = point.y; + } /* Check if a button was released but we didn't see it */ GetCursorPos(&point); diff --git a/xserver/include/Makefile.am b/xserver/include/Makefile.am index 972f403ce..5cdea1d15 100644 --- a/xserver/include/Makefile.am +++ b/xserver/include/Makefile.am @@ -26,6 +26,7 @@ sdk_HEADERS = \ gc.h \ gcstruct.h \ globals.h \ + glx_extinit.h \ input.h \ inputstr.h \ list.h \ @@ -68,6 +69,6 @@ AM_CFLAGS = $(DIX_CFLAGS) EXTRA_DIST = \ dix-config-apple-verbatim.h \ - eventconvert.h eventstr.h inpututils.h \ + dixfontstubs.h eventconvert.h eventstr.h inpututils.h \ protocol-versions.h \ xsha1.h diff --git a/xserver/include/Makefile.in b/xserver/include/Makefile.in index c5e9b9b21..b16193398 100644 --- a/xserver/include/Makefile.in +++ b/xserver/include/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -123,12 +123,12 @@ am__sdk_HEADERS_DIST = XIstubs.h Xprintf.h callback.h client.h \ cursor.h cursorstr.h dix.h dixaccess.h dixevents.h dixfont.h \ dixfontstr.h dixgrabs.h dixstruct.h events.h exevents.h \ extension.h extinit.h extnsionst.h gc.h gcstruct.h globals.h \ - input.h inputstr.h list.h misc.h miscstruct.h opaque.h \ - optionstr.h os.h pixmap.h pixmapstr.h privates.h property.h \ - propertyst.h ptrveloc.h region.h regionstr.h registry.h \ - resource.h rgb.h screenint.h scrnintstr.h selection.h \ - servermd.h site.h swaprep.h swapreq.h validate.h window.h \ - windowstr.h xkbfile.h xkbsrv.h xkbstr.h xkbrules.h \ + glx_extinit.h input.h inputstr.h list.h misc.h miscstruct.h \ + opaque.h optionstr.h os.h pixmap.h pixmapstr.h privates.h \ + property.h propertyst.h ptrveloc.h region.h regionstr.h \ + registry.h resource.h rgb.h screenint.h scrnintstr.h \ + selection.h servermd.h site.h swaprep.h swapreq.h validate.h \ + window.h windowstr.h xkbfile.h xkbsrv.h xkbstr.h xkbrules.h \ xserver-properties.h HEADERS = $(nodist_sdk_HEADERS) $(sdk_HEADERS) ETAGS = etags @@ -191,13 +191,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -219,6 +215,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -243,6 +240,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -258,7 +256,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -357,6 +354,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -483,6 +481,7 @@ top_srcdir = @top_srcdir@ @XORG_TRUE@ gc.h \ @XORG_TRUE@ gcstruct.h \ @XORG_TRUE@ globals.h \ +@XORG_TRUE@ glx_extinit.h \ @XORG_TRUE@ input.h \ @XORG_TRUE@ inputstr.h \ @XORG_TRUE@ list.h \ @@ -522,7 +521,7 @@ top_srcdir = @top_srcdir@ AM_CFLAGS = $(DIX_CFLAGS) EXTRA_DIST = \ dix-config-apple-verbatim.h \ - eventconvert.h eventstr.h inpututils.h \ + dixfontstubs.h eventconvert.h eventstr.h inpututils.h \ protocol-versions.h \ xsha1.h @@ -530,7 +529,7 @@ all: do-not-use-config.h xorg-server.h dix-config.h xorg-config.h xkb-config.h x $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -555,9 +554,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): @@ -568,7 +567,7 @@ do-not-use-config.h: stamp-h1 stamp-h1: $(srcdir)/do-not-use-config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status include/do-not-use-config.h -$(srcdir)/do-not-use-config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(srcdir)/do-not-use-config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ diff --git a/xserver/include/dix-config.h.in b/xserver/include/dix-config.h.in index 9e8284286..b40d8b3ec 100644 --- a/xserver/include/dix-config.h.in +++ b/xserver/include/dix-config.h.in @@ -148,12 +148,18 @@ /* Define to use CommonCrypto SHA1 functions */ #undef HAVE_SHA1_IN_COMMONCRYPTO +/* Define to use CryptoAPI SHA1 functions */ +#undef HAVE_SHA1_IN_CRYPTOAPI + /* Define to use libmd SHA1 functions */ #undef HAVE_SHA1_IN_LIBMD /* Define to use libgcrypt SHA1 functions */ #undef HAVE_SHA1_IN_LIBGCRYPT +/* Define to use libnettle SHA1 functions */ +#undef HAVE_SHA1_IN_LIBNETTLE + /* Define to use libsha1 for SHA1 */ #undef HAVE_SHA1_IN_LIBSHA1 @@ -387,6 +393,9 @@ /* Use libudev for input hotplug */ #undef CONFIG_UDEV +/* Use libudev for kms enumeration */ +#undef CONFIG_UDEV_KMS + /* Use udev_monitor_filter_add_match_tag() */ #undef HAVE_UDEV_MONITOR_FILTER_ADD_MATCH_TAG @@ -423,6 +432,12 @@ /* Define to 64-bit byteswap macro */ #undef bswap_64 +/* Define to 1 if typeof works with your compiler. */ +#undef HAVE_TYPEOF + +/* Define to __typeof__ if your compiler spells it that way. */ +#undef typeof + /* The compiler supported TLS storage class, prefering initial-exec if tls_model is supported */ #undef TLS diff --git a/xserver/include/dix.h b/xserver/include/dix.h index d604e0676..171e56e11 100644 --- a/xserver/include/dix.h +++ b/xserver/include/dix.h @@ -64,6 +64,8 @@ SOFTWARE. #define REQUEST(type) \ type *stuff = (type *)client->requestBuffer +#define ARRAY_SIZE(a) (sizeof((a)) / sizeof((a)[0])) + #define REQUEST_SIZE_MATCH(req)\ if ((sizeof(req) >> 2) != client->req_len)\ return(BadLength) @@ -86,12 +88,12 @@ SOFTWARE. #define VALIDATE_DRAWABLE_AND_GC(drawID, pDraw, mode)\ {\ - int rc = dixLookupDrawable(&(pDraw), drawID, client, M_ANY, mode);\ - if (rc != Success)\ - return rc;\ - rc = dixLookupGC(&(pGC), stuff->gc, client, DixUseAccess);\ - if (rc != Success)\ - return rc;\ + int tmprc = dixLookupDrawable(&(pDraw), drawID, client, M_ANY, mode);\ + if (tmprc != Success)\ + return tmprc;\ + tmprc = dixLookupGC(&(pGC), stuff->gc, client, DixUseAccess);\ + if (tmprc != Success)\ + return tmprc;\ if ((pGC->depth != pDraw->depth) || (pGC->pScreen != pDraw->pScreen))\ return BadMatch;\ }\ @@ -102,12 +104,12 @@ SOFTWARE. if ((pClient)->swapped) \ (*ReplySwapVector[((xReq *)(pClient)->requestBuffer)->reqType]) \ (pClient, (int)(size), pReply); \ - else (void) WriteToClient(pClient, (int)(size), (char *)(pReply)); } + else WriteToClient(pClient, (int)(size), (pReply)); } #define WriteSwappedDataToClient(pClient, size, pbuf) \ if ((pClient)->swapped) \ (*(pClient)->pSwapReplyFunc)(pClient, (int)(size), pbuf); \ - else (void) WriteToClient (pClient, (int)(size), (char *)(pbuf)); + else WriteToClient(pClient, (int)(size), (pbuf)); typedef struct _TimeStamp *TimeStampPtr; @@ -313,7 +315,8 @@ extern _X_EXPORT WindowPtr GetSpriteWindow(DeviceIntPtr pDev); extern _X_EXPORT void -NoticeEventTime(InternalEvent *ev); +NoticeEventTime(InternalEvent *ev, + DeviceIntPtr dev); extern void EnqueueEvent(InternalEvent * /* ev */ , @@ -394,6 +397,8 @@ DeliverTouchEvents(DeviceIntPtr /* dev */ , extern void InitializeSprite(DeviceIntPtr /* pDev */ , WindowPtr /* pWin */ ); +extern void +FreeSprite(DeviceIntPtr pDev); extern void UpdateSpriteForScreen(DeviceIntPtr /* pDev */ , diff --git a/xserver/include/dixevents.h b/xserver/include/dixevents.h index c8f384ea5..d4729697c 100644 --- a/xserver/include/dixevents.h +++ b/xserver/include/dixevents.h @@ -77,11 +77,4 @@ extern _X_EXPORT int ProcUngrabButton(ClientPtr /* client */ ); extern _X_EXPORT int ProcRecolorCursor(ClientPtr /* client */ ); -#ifdef PANORAMIX -extern _X_EXPORT void PostSyntheticMotion(DeviceIntPtr pDev, - int x, - int y, - int screen, unsigned long time); -#endif - #endif /* DIXEVENTS_H */ diff --git a/xserver/include/dixfont.h b/xserver/include/dixfont.h index 9333041fb..0a5f105c0 100644 --- a/xserver/include/dixfont.h +++ b/xserver/include/dixfont.h @@ -28,6 +28,7 @@ SOFTWARE. #include #include "closure.h" #include +#include #define NullDIXFontProp ((DIXFontPropPtr)0) @@ -117,12 +118,13 @@ extern _X_EXPORT void FreeFonts(void); extern _X_EXPORT FontPtr find_old_font(XID /*id */ ); -extern _X_EXPORT void GetGlyphs(FontPtr /*font */ , - unsigned long /*count */ , - unsigned char * /*chars */ , - FontEncoding /*fontEncoding */ , - unsigned long * /*glyphcount */ , - CharInfoPtr * /*glyphs */ ); +#define GetGlyphs dixGetGlyphs +extern _X_EXPORT void dixGetGlyphs(FontPtr /*font */ , + unsigned long /*count */ , + unsigned char * /*chars */ , + FontEncoding /*fontEncoding */ , + unsigned long * /*glyphcount */ , + CharInfoPtr * /*glyphs */ ); extern _X_EXPORT void QueryGlyphExtents(FontPtr /*pFont */ , CharInfoPtr * /*charinfo */ , @@ -142,42 +144,4 @@ extern _X_EXPORT void SetGlyphCachingMode(int /*newmode */ ); extern _X_EXPORT void register_fpe_functions(void); -/* - * libXfont stubs. - */ -extern _X_EXPORT int client_auth_generation(ClientPtr client); - -extern _X_EXPORT void DeleteFontClientID(Font id); - -extern _X_EXPORT FontResolutionPtr GetClientResolutions(int *num); - -extern _X_EXPORT int GetDefaultPointSize(void); - -extern _X_EXPORT Font GetNewFontClientID(void); - -extern _X_EXPORT int init_fs_handlers(FontPathElementPtr fpe, - BlockHandlerProcPtr block_handler); - -extern _X_EXPORT int RegisterFPEFunctions(NameCheckFunc name_func, - InitFpeFunc init_func, - FreeFpeFunc free_func, - ResetFpeFunc reset_func, - OpenFontFunc open_func, - CloseFontFunc close_func, - ListFontsFunc list_func, - StartLfwiFunc start_lfwi_func, - NextLfwiFunc next_lfwi_func, - WakeupFpeFunc wakeup_func, - ClientDiedFunc client_died, - LoadGlyphsFunc load_glyphs, - StartLaFunc start_list_alias_func, - NextLaFunc next_list_alias_func, - SetPathFunc set_path_func); - -extern _X_EXPORT void remove_fs_handlers(FontPathElementPtr fpe, - BlockHandlerProcPtr blockHandler, - Bool all); - -extern _X_EXPORT int StoreFontClientFont(FontPtr pfont, Font id); - #endif /* DIXFONT_H */ diff --git a/xserver/include/dixfontstubs.h b/xserver/include/dixfontstubs.h new file mode 100644 index 000000000..0454ffa6c --- /dev/null +++ b/xserver/include/dixfontstubs.h @@ -0,0 +1,45 @@ +#ifndef DIXFONTSTUBS_H +#define DIXFONTSTUBS_H 1 + +/* + * libXfont stubs replacements + * This header exists solely for the purpose of sdksyms generation; + * source code should #include "dixfonts.h" instead, which pulls in these + * declarations from + */ +extern _X_EXPORT int client_auth_generation(ClientPtr client); + +extern _X_EXPORT void DeleteFontClientID(Font id); + +extern _X_EXPORT FontResolutionPtr GetClientResolutions(int *num); + +extern _X_EXPORT int GetDefaultPointSize(void); + +extern _X_EXPORT Font GetNewFontClientID(void); + +extern _X_EXPORT int init_fs_handlers(FontPathElementPtr fpe, + BlockHandlerProcPtr block_handler); + +extern _X_EXPORT int RegisterFPEFunctions(NameCheckFunc name_func, + InitFpeFunc init_func, + FreeFpeFunc free_func, + ResetFpeFunc reset_func, + OpenFontFunc open_func, + CloseFontFunc close_func, + ListFontsFunc list_func, + StartLfwiFunc start_lfwi_func, + NextLfwiFunc next_lfwi_func, + WakeupFpeFunc wakeup_func, + ClientDiedFunc client_died, + LoadGlyphsFunc load_glyphs, + StartLaFunc start_list_alias_func, + NextLaFunc next_list_alias_func, + SetPathFunc set_path_func); + +extern _X_EXPORT void remove_fs_handlers(FontPathElementPtr fpe, + BlockHandlerProcPtr blockHandler, + Bool all); + +extern _X_EXPORT int StoreFontClientFont(FontPtr pfont, Font id); + +#endif diff --git a/xserver/include/dixstruct.h b/xserver/include/dixstruct.h index 75685a2dc..aef822ca2 100644 --- a/xserver/include/dixstruct.h +++ b/xserver/include/dixstruct.h @@ -56,8 +56,7 @@ ReplyNotSwappd(ClientPtr /* pClient */ , void * /* pbuf */ ) _X_NORETURN; typedef enum { ClientStateInitial, - /* 1 is unused now, was ClientStateAuthenticating */ - ClientStateRunning = 2, + ClientStateRunning, ClientStateRetained, ClientStateGone } ClientState; @@ -86,26 +85,29 @@ typedef struct _Window *SaveSetElt; #endif typedef struct _Client { - int index; - Mask clientAsMask; pointer requestBuffer; pointer osPrivate; /* for OS layer, including scheduler */ - Bool swapped; + Mask clientAsMask; + short index; + unsigned char majorOp, minorOp; + unsigned int swapped:1; + unsigned int local:1; + unsigned int big_requests:1; /* supports large requests */ + unsigned int clientGone:1; + unsigned int closeDownMode:2; + unsigned int clientState:2; + signed char smart_priority; + short noClientException; /* this client died or needs to be killed */ + int priority; ReplySwapPtr pSwapReplyFunc; XID errorValue; int sequence; - int closeDownMode; - int clientGone; - int noClientException; /* this client died or needs to be - * killed */ int ignoreCount; /* count for Attend/IgnoreClient */ - SaveSetElt *saveSet; int numSaved; + SaveSetElt *saveSet; int (**requestVector) (ClientPtr /* pClient */ ); CARD32 req_len; /* length of current request */ - Bool big_requests; /* supports large requests */ - int priority; - ClientState clientState; + unsigned int replyBytesRemaining; PrivateRec *devPrivates; unsigned short xkbClientFlags; unsigned short mapNotifyMask; @@ -113,15 +115,12 @@ typedef struct _Client { unsigned short vMajor, vMinor; KeyCode minKC, maxKC; - unsigned long replyBytesRemaining; - int smart_priority; - long smart_start_tick; - long smart_stop_tick; - long smart_check_tick; + int smart_start_tick; + int smart_stop_tick; + int smart_check_tick; DeviceIntPtr clientPtr; ClientIdPtr clientIds; - unsigned short majorOp, minorOp; } ClientRec; /* @@ -156,7 +155,7 @@ typedef struct _WorkQueue { } WorkQueueRec; extern _X_EXPORT TimeStamp currentTime; -extern _X_EXPORT TimeStamp lastDeviceEventTime; +extern _X_EXPORT TimeStamp lastDeviceEventTime[MAXDEVICES]; extern _X_EXPORT int CompareTimeStamps(TimeStamp /*a */ , diff --git a/xserver/include/do-not-use-config.h.in b/xserver/include/do-not-use-config.h.in index 48fd999c1..0851744b4 100644 --- a/xserver/include/do-not-use-config.h.in +++ b/xserver/include/do-not-use-config.h.in @@ -45,6 +45,9 @@ /* Use libudev for input hotplug */ #undef CONFIG_UDEV +/* Use libudev for kms enumeration */ +#undef CONFIG_UDEV_KMS + /* Use wscons for input auto configuration */ #undef CONFIG_WSCONS @@ -247,6 +250,9 @@ /* Use CommonCrypto SHA1 functions */ #undef HAVE_SHA1_IN_COMMONCRYPTO +/* Use CryptoAPI SHA1 functions */ +#undef HAVE_SHA1_IN_CRYPTOAPI + /* Use libc SHA1 functions */ #undef HAVE_SHA1_IN_LIBC @@ -256,6 +262,9 @@ /* Use libmd SHA1 functions */ #undef HAVE_SHA1_IN_LIBMD +/* Use libnettle SHA1 functions */ +#undef HAVE_SHA1_IN_LIBNETTLE + /* Use libsha1 for SHA1 */ #undef HAVE_SHA1_IN_LIBSHA1 @@ -336,6 +345,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_VT_H +/* Define to 1 if typeof works with your compiler. */ +#undef HAVE_TYPEOF + /* Define to 1 if you have the `udev_enumerate_add_match_tag' function. */ #undef HAVE_UDEV_ENUMERATE_ADD_MATCH_TAG @@ -591,9 +603,6 @@ /* Support XFixes extension */ #undef XFIXES -/* Building loadable XFree86 server */ -#undef XFree86LOADER - /* Building XFree86 server */ #undef XFree86Server @@ -666,6 +675,9 @@ /* Use libpciaccess for all pci manipulation */ #undef XSERVER_LIBPCIACCESS +/* X server supports platform device enumeration */ +#undef XSERVER_PLATFORM_BUS + /* Support XSync extension */ #undef XSYNC @@ -737,3 +749,6 @@ /* Define to `int' if does not define. */ #undef pid_t + +/* Define to __typeof__ if your compiler spells it that way. */ +#undef typeof diff --git a/xserver/include/eventconvert.h b/xserver/include/eventconvert.h index 4c56d534a..01172f0ee 100644 --- a/xserver/include/eventconvert.h +++ b/xserver/include/eventconvert.h @@ -29,8 +29,6 @@ #include "events.h" #include "eventstr.h" -#define FP1616(integral, frac) ((integral) * (1 << 16) + (frac) * (1 << 16)) - _X_EXPORT int EventToCore(InternalEvent *event, xEvent **core, int *count); _X_EXPORT int EventToXI(InternalEvent *ev, xEvent **xi, int *count); _X_EXPORT int EventToXI2(InternalEvent *ev, xEvent **xi); diff --git a/xserver/include/events.h b/xserver/include/events.h index 222bf328b..c0ef45d5f 100644 --- a/xserver/include/events.h +++ b/xserver/include/events.h @@ -27,6 +27,7 @@ typedef struct _DeviceEvent DeviceEvent; typedef struct _DeviceChangedEvent DeviceChangedEvent; typedef struct _TouchOwnershipEvent TouchOwnershipEvent; +typedef struct _BarrierEvent BarrierEvent; #if XFreeXDGA typedef struct _DGAEvent DGAEvent; diff --git a/xserver/include/eventstr.h b/xserver/include/eventstr.h index dd6fbeffb..38fab4f3c 100644 --- a/xserver/include/eventstr.h +++ b/xserver/include/eventstr.h @@ -72,6 +72,8 @@ enum EventType { ET_RawTouchUpdate, ET_RawTouchEnd, ET_XQuartz, + ET_BarrierHit, + ET_BarrierLeave, ET_Internal = 0xFF /* First byte */ }; @@ -130,7 +132,7 @@ struct _DeviceEvent { */ struct _TouchOwnershipEvent { unsigned char header; /**< Always ET_Internal */ - enum EventType type; /**< One of EventType */ + enum EventType type; /**< ET_TouchOwnership */ int length; /**< Length in bytes */ Time time; /**< Time in ms */ int deviceid; /**< Device to post this event for */ @@ -227,6 +229,25 @@ struct _RawDeviceEvent { uint32_t flags; /**< Flags to be copied into the generated event */ }; +struct _BarrierEvent { + unsigned char header; /**< Always ET_Internal */ + enum EventType type; /**< ET_BarrierHit, ET_BarrierLeave */ + int length; /**< Length in bytes */ + Time time; /**< Time in ms */ + int deviceid; /**< Device to post this event for */ + int sourceid; /**< The physical source device */ + int barrierid; + Window window; + Window root; + double dx; + double dy; + double root_x; + double root_y; + int16_t dt; + int32_t event_id; + uint32_t flags; +}; + #ifdef XQUARTZ #define XQUARTZ_EVENT_MAXARGS 5 struct _XQuartzEvent { @@ -253,6 +274,7 @@ union _InternalEvent { DeviceEvent device_event; DeviceChangedEvent changed_event; TouchOwnershipEvent touch_ownership_event; + BarrierEvent barrier_event; #if XFreeXDGA DGAEvent dga_event; #endif diff --git a/xserver/include/exevents.h b/xserver/include/exevents.h index feea170d2..321fc422d 100644 --- a/xserver/include/exevents.h +++ b/xserver/include/exevents.h @@ -162,13 +162,6 @@ extern void ProcessOtherEvent(InternalEvent * /* ev */ , DeviceIntPtr /* other */ ); -extern void - DeviceFocusEvent(DeviceIntPtr /* dev */ , - int /* type */ , - int /* mode */ , - int /* detail */ , - WindowPtr /* pWin */ ); - extern int CheckGrabValues(ClientPtr /* client */ , GrabParameters * /* param */ ); diff --git a/xserver/include/extension.h b/xserver/include/extension.h index c7f51b9d1..acc6addb7 100644 --- a/xserver/include/extension.h +++ b/xserver/include/extension.h @@ -44,10 +44,47 @@ SOFTWARE. ******************************************************************/ +/* + * Copyright (c) 1997-2003 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of the copyright holder(s) + * and author(s) shall not be used in advertising or otherwise to promote + * the sale, use or other dealings in this Software without prior written + * authorization from the copyright holder(s) and author(s). + */ + #ifndef EXTENSION_H #define EXTENSION_H -_XFUNCPROTOBEGIN +#include + +#include "dixstruct.h" + +typedef void (*InitExtension) (void); + +typedef struct { + InitExtension initFunc; + const char *name; + Bool *disablePtr; +} ExtensionModule; extern _X_EXPORT unsigned short StandardMinorOpcode(ClientPtr /*client */ ); @@ -60,5 +97,6 @@ extern _X_EXPORT void InitExtensions(int argc, char **argv); extern _X_EXPORT void CloseDownExtensions(void); -_XFUNCPROTOEND +extern _X_EXPORT void LoadExtension(const ExtensionModule *ext, Bool external); + #endif /* EXTENSION_H */ diff --git a/xserver/include/extinit.h b/xserver/include/extinit.h index a048b7254..5690d7b01 100644 --- a/xserver/include/extinit.h +++ b/xserver/include/extinit.h @@ -23,8 +23,29 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ********************************************************/ -/******************************************************************** - * Interface of extinit.c +/* + * Copyright (C) 1994-2003 The XFree86 Project, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is furnished to do + * so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT- + * NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of the XFree86 Project shall not + * be used in advertising or otherwise to promote the sale, use or other dealings + * in this Software without prior written authorization from the XFree86 Project. */ #ifndef EXTINIT_H @@ -32,14 +53,129 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include "extnsionst.h" -extern void - XInputExtensionInit(void - ); +#ifdef COMPOSITE +extern _X_EXPORT Bool noCompositeExtension; +extern void CompositeExtensionInit(void); +#endif -extern _X_EXPORT void - AssignTypeAndName(DeviceIntPtr /* dev */ , - Atom /* type */ , - const char * /* name */ - ); +#ifdef DAMAGE +extern _X_EXPORT Bool noDamageExtension; +extern void DamageExtensionInit(void); +#endif -#endif /* EXTINIT_H */ +#if defined(DBE) +extern _X_EXPORT Bool noDbeExtension; +extern void DbeExtensionInit(void); +#endif + +#if defined(DPMSExtension) +#include +extern _X_EXPORT Bool noDPMSExtension; +extern void DPMSExtensionInit(void); +#endif + +extern Bool noGEExtension; +extern void GEExtensionInit(void); + +#ifdef GLXEXT +extern _X_EXPORT Bool noGlxExtension; +#endif + +#ifdef PANORAMIX +#include +extern _X_EXPORT Bool noPanoramiXExtension; +extern void PanoramiXExtensionInit(void); +#endif + +#ifdef RANDR +extern _X_EXPORT Bool noRRExtension; +extern void RRExtensionInit(void); +#endif + +#if defined(XRECORD) +extern void RecordExtensionInit(void); +#endif + +extern _X_EXPORT Bool noRenderExtension; +extern void RenderExtensionInit(void); + +#if defined(RES) +#include +extern _X_EXPORT Bool noResExtension; +extern void ResExtensionInit(void); +#endif + +#if defined(SCREENSAVER) +#include +extern _X_EXPORT Bool noScreenSaverExtension; +extern void ScreenSaverExtensionInit(void); +#endif + +#include +extern void ShapeExtensionInit(void); + +#ifdef MITSHM +#include +#include +extern _X_EXPORT Bool noMITShmExtension; +extern void ShmExtensionInit(void); +#endif + +extern void SyncExtensionInit(void); + +extern void XCMiscExtensionInit(void); + +#ifdef XCSECURITY +#include +#include "securitysrv.h" +extern _X_EXPORT Bool noSecurityExtension; +extern void SecurityExtensionInit(void); +#endif + +#ifdef XF86BIGFONT +#include +extern _X_EXPORT Bool noXFree86BigfontExtension; +extern void XFree86BigfontExtensionInit(void); +#endif + +extern void BigReqExtensionInit(void); + +#ifdef XFIXES +extern _X_EXPORT Bool noXFixesExtension; +extern void XFixesExtensionInit(void); +#endif + +extern void XInputExtensionInit(void); +extern _X_EXPORT void AssignTypeAndName(DeviceIntPtr dev, + Atom type, + const char *name); + +#include +extern void XkbExtensionInit(void); + +#if defined(XSELINUX) +#include "xselinux.h" +extern _X_EXPORT Bool noSELinuxExtension; +extern void SELinuxExtensionInit(void); +#endif + +#ifdef XTEST +#include +#include +extern void XTestExtensionInit(void); +#endif + +#ifdef INXQUARTZ +extern _X_EXPORT Bool noPseudoramiXExtension; +extern void PseudoramiXExtensionInit(void); +#endif + +#if defined(XV) +#include +#include +extern _X_EXPORT Bool noXvExtension; +extern void XvExtensionInit(void); +extern void XvMCExtensionInit(void); +#endif + +#endif diff --git a/xserver/include/globals.h b/xserver/include/globals.h index d147df90f..7786987a4 100644 --- a/xserver/include/globals.h +++ b/xserver/include/globals.h @@ -2,7 +2,10 @@ #ifndef _XSERV_GLOBAL_H_ #define _XSERV_GLOBAL_H_ +#include + #include "window.h" /* for WindowPtr */ +#include "extinit.h" /* Global X server variables that are visible to mi, dix, os, and ddx */ @@ -23,6 +26,7 @@ extern _X_EXPORT int GrabInProgress; extern _X_EXPORT Bool noTestExtensions; extern _X_EXPORT char *SeatId; extern _X_EXPORT char *ConnectionInfo; +extern _X_EXPORT sig_atomic_t inSignalContext; #ifdef DPMSExtension extern _X_EXPORT CARD32 DPMSStandbyTime; @@ -38,75 +42,7 @@ extern _X_EXPORT Bool DPMSCapableFlag; extern _X_EXPORT Bool PanoramiXExtensionDisabledHack; #endif -#ifdef COMPOSITE -extern _X_EXPORT Bool noCompositeExtension; -#endif - -#ifdef DAMAGE -extern _X_EXPORT Bool noDamageExtension; -#endif - -#ifdef DBE -extern _X_EXPORT Bool noDbeExtension; -#endif - -#ifdef DPMSExtension -extern _X_EXPORT Bool noDPMSExtension; -#endif - -#ifdef GLXEXT -extern _X_EXPORT Bool noGlxExtension; -#endif - -#ifdef SCREENSAVER -extern _X_EXPORT Bool noScreenSaverExtension; -#endif - -#ifdef MITSHM -extern _X_EXPORT Bool noMITShmExtension; -#endif - -#ifdef RANDR -extern _X_EXPORT Bool noRRExtension; -#endif - -extern _X_EXPORT Bool noRenderExtension; - -#ifdef XCSECURITY -extern _X_EXPORT Bool noSecurityExtension; -#endif - -#ifdef RES -extern _X_EXPORT Bool noResExtension; -#endif - -#ifdef XF86BIGFONT -extern _X_EXPORT Bool noXFree86BigfontExtension; -#endif - -#ifdef XFreeXDGA -extern _X_EXPORT Bool noXFree86DGAExtension; -#endif - -#ifdef XF86DRI -extern _X_EXPORT Bool noXFree86DRIExtension; -#endif - -#ifdef XF86VIDMODE -extern _X_EXPORT Bool noXFree86VidModeExtension; -#endif - -#ifdef XFIXES -extern _X_EXPORT Bool noXFixesExtension; -#endif - -#ifdef PANORAMIX -extern _X_EXPORT Bool noPanoramiXExtension; -#endif - #ifdef XSELINUX -extern _X_EXPORT Bool noSELinuxExtension; - #define SELINUX_MODE_DEFAULT 0 #define SELINUX_MODE_DISABLED 1 #define SELINUX_MODE_PERMISSIVE 2 @@ -114,12 +50,4 @@ extern _X_EXPORT Bool noSELinuxExtension; extern _X_EXPORT int selinuxEnforcingState; #endif -#ifdef XV -extern _X_EXPORT Bool noXvExtension; -#endif - -#ifdef DRI2 -extern _X_EXPORT Bool noDRI2Extension; -#endif - #endif /* !_XSERV_GLOBAL_H_ */ diff --git a/xserver/include/glx_extinit.h b/xserver/include/glx_extinit.h new file mode 100644 index 000000000..ad4741dd1 --- /dev/null +++ b/xserver/include/glx_extinit.h @@ -0,0 +1,34 @@ +/* + * Copyright (C) 1994-2003 The XFree86 Project, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is furnished to do + * so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT- + * NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of the XFree86 Project shall not + * be used in advertising or otherwise to promote the sale, use or other dealings + * in this Software without prior written authorization from the XFree86 Project. + */ + +#ifndef GLX_EXT_INIT_H +#define GLX_EXT_INIT_H + +/* this is separate due to sdksyms pulling in extinit.h */ +#ifdef GLXEXT +extern void GlxExtensionInit(void); +#endif + +#endif diff --git a/xserver/include/hotplug.h b/xserver/include/hotplug.h index caa3201e7..2a95b4524 100644 --- a/xserver/include/hotplug.h +++ b/xserver/include/hotplug.h @@ -26,7 +26,49 @@ #ifndef HOTPLUG_H #define HOTPLUG_H +#include "list.h" + +extern _X_EXPORT void config_pre_init(void); extern _X_EXPORT void config_init(void); extern _X_EXPORT void config_fini(void); +struct OdevAttribute { + struct xorg_list member; + int attrib_id; + char *attrib_name; +}; + +struct OdevAttributes { + struct xorg_list list; +}; + +struct OdevAttributes * +config_odev_allocate_attribute_list(void); + +void +config_odev_free_attribute_list(struct OdevAttributes *attribs); + +Bool +config_odev_add_attribute(struct OdevAttributes *attribs, int attrib, + const char *attrib_name); + +void +config_odev_free_attributes(struct OdevAttributes *attribs); + +/* path to kernel device node - Linux e.g. /dev/dri/card0 */ +#define ODEV_ATTRIB_PATH 1 +/* system device path - Linux e.g. /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card1 */ +#define ODEV_ATTRIB_SYSPATH 2 +/* DRI-style bus id */ +#define ODEV_ATTRIB_BUSID 3 + +typedef void (*config_odev_probe_proc_ptr)(struct OdevAttributes *attribs); +void config_odev_probe(config_odev_probe_proc_ptr probe_callback); + +#ifdef CONFIG_UDEV_KMS +void NewGPUDeviceRequest(struct OdevAttributes *attribs); +void DeleteGPUDeviceRequest(struct OdevAttributes *attribs); +#endif + +#define ServerIsNotSeat0() (SeatId && strcmp(SeatId, "seat0")) #endif /* HOTPLUG_H */ diff --git a/xserver/include/input.h b/xserver/include/input.h index 991d64813..5c65597e4 100644 --- a/xserver/include/input.h +++ b/xserver/include/input.h @@ -62,6 +62,7 @@ SOFTWARE. #define DEVICE_ON 1 #define DEVICE_OFF 2 #define DEVICE_CLOSE 3 +#define DEVICE_ABORT 4 #define POINTER_RELATIVE (1 << 1) #define POINTER_ABSOLUTE (1 << 2) @@ -69,6 +70,7 @@ SOFTWARE. #define POINTER_SCREEN (1 << 4) /* Data in screen coordinates */ #define POINTER_NORAW (1 << 5) /* Don't generate RawEvents */ #define POINTER_EMULATED (1 << 6) /* Event was emulated from another event */ +#define POINTER_DESKTOP (1 << 7) /* Data in desktop coordinates */ /* GetTouchEvent flags */ #define TOUCH_ACCEPT (1 << 0) @@ -264,10 +266,11 @@ extern _X_EXPORT Bool ActivateDevice(DeviceIntPtr /*device */ , extern _X_EXPORT Bool DisableDevice(DeviceIntPtr /*device */ , BOOL /* sendevent */ ); - +extern void DisableAllDevices(void); extern int InitAndStartDevices(void); extern void CloseDownDevices(void); +extern void AbortDevices(void); extern void UndisplayDevices(void); @@ -465,6 +468,11 @@ extern int GetTouchOwnershipEvents(InternalEvent *events, TouchPointInfoPtr ti, uint8_t mode, XID resource, uint32_t flags); +extern void GetDixTouchEnd(InternalEvent *ievent, + DeviceIntPtr dev, + TouchPointInfoPtr ti, + uint32_t flags); + extern _X_EXPORT int GetProximityEvents(InternalEvent *events, DeviceIntPtr pDev, int type, const ValuatorMask *mask); @@ -472,6 +480,9 @@ extern _X_EXPORT int GetProximityEvents(InternalEvent *events, extern _X_EXPORT void QueueProximityEvents(DeviceIntPtr pDev, int type, const ValuatorMask *mask); +#ifdef PANORAMIX +_X_EXPORT +#endif extern void PostSyntheticMotion(DeviceIntPtr pDev, int x, int y, int screen, unsigned long time); @@ -557,9 +568,9 @@ extern void TouchEventHistoryPush(TouchPointInfoPtr ti, const DeviceEvent *ev); extern void TouchEventHistoryReplay(TouchPointInfoPtr ti, DeviceIntPtr dev, XID resource); extern Bool TouchResourceIsOwner(TouchPointInfoPtr ti, XID resource); -extern void TouchAddListener(TouchPointInfoPtr ti, XID resource, +extern void TouchAddListener(TouchPointInfoPtr ti, XID resource, int resource_type, enum InputLevel level, enum TouchListenerType type, - enum TouchListenerState state, WindowPtr window); + enum TouchListenerState state, WindowPtr window, GrabPtr grab); extern Bool TouchRemoveListener(TouchPointInfoPtr ti, XID resource); extern void TouchSetupListeners(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev); @@ -576,6 +587,9 @@ extern int TouchListenerAcceptReject(DeviceIntPtr dev, TouchPointInfoPtr ti, int listener, int mode); extern int TouchAcceptReject(ClientPtr client, DeviceIntPtr dev, int mode, uint32_t touchid, Window grab_window, XID *error); +extern void TouchEndPhysicallyActiveTouches(DeviceIntPtr dev); +extern void TouchDeliverDeviceClassesChangedEvent(TouchPointInfoPtr ti, + Time time, XID resource); /* misc event helpers */ extern Mask GetEventMask(DeviceIntPtr dev, xEvent *ev, InputClientsPtr clients); @@ -667,4 +681,10 @@ extern _X_EXPORT void input_option_set_value(InputOption *opt, extern _X_HIDDEN Bool point_on_screen(ScreenPtr pScreen, int x, int y); extern _X_HIDDEN void update_desktop_dimensions(void); +extern _X_HIDDEN void input_constrain_cursor(DeviceIntPtr pDev, ScreenPtr screen, + int current_x, int current_y, + int dest_x, int dest_y, + int *out_x, int *out_y, + int *nevents, InternalEvent* events); + #endif /* INPUT_H */ diff --git a/xserver/include/inputstr.h b/xserver/include/inputstr.h index 841e8052b..de96faeda 100644 --- a/xserver/include/inputstr.h +++ b/xserver/include/inputstr.h @@ -71,7 +71,7 @@ extern _X_EXPORT int CountBits(const uint8_t * mask, int len); * events to the protocol, the server will not support these events until * this number here is bumped. */ -#define XI2LASTEVENT XI_RawTouchEnd +#define XI2LASTEVENT XI_BarrierLeave #define XI2MASKSIZE ((XI2LASTEVENT >> 3) + 1) /* no of bytes for masks */ /** @@ -298,6 +298,17 @@ typedef struct _ValuatorClassRec { int v_scroll_axis; /* vert smooth-scrolling axis */ } ValuatorClassRec; +typedef struct _TouchListener { + XID listener; /* grabs/event selection IDs receiving + * events for this touch */ + int resource_type; /* listener's resource type */ + enum TouchListenerType type; + enum TouchListenerState state; + enum InputLevel level; /* matters only for emulating touches */ + WindowPtr window; + GrabPtr grab; +} TouchListener; + typedef struct _TouchPointInfo { uint32_t client_id; /* touch ID as seen in client events */ int sourceid; /* Source device's ID for this touchpoint */ @@ -306,14 +317,7 @@ typedef struct _TouchPointInfo { * but still owned by a grab */ SpriteRec sprite; /* window trace for delivery */ ValuatorMask *valuators; /* last recorded axis values */ - struct _TouchListener { - XID listener; /* grabs/event selection IDs receiving - * events for this touch */ - enum TouchListenerType type; - enum TouchListenerState state; - enum InputLevel level; /* matters only for emulating touches */ - WindowPtr window; - } *listeners; + TouchListener *listeners; /* set of listeners */ int num_listeners; int num_grabs; /* number of open grabs on this touch * which have not accepted or rejected */ @@ -323,15 +327,13 @@ typedef struct _TouchPointInfo { size_t history_size; /* Size of history in elements */ } TouchPointInfoRec; -typedef struct _TouchListener TouchListener; - typedef struct _DDXTouchPointInfo { uint32_t client_id; /* touch ID as seen in client events */ Bool active; /* whether or not the touch is active */ uint32_t ddx_id; /* touch ID given by the DDX */ Bool emulate_pointer; - ValuatorMask *valuators; /* last recorded axis values */ + ValuatorMask *valuators; /* last axis values as posted, pre-transform */ } DDXTouchPointInfoRec; typedef struct _TouchClassRec { @@ -586,11 +588,17 @@ typedef struct _DeviceIntRec { XIPropertyHandlerPtr handlers; /* NULL-terminated */ } properties; - /* coordinate transformation matrix for absolute input devices */ - struct pixman_f_transform transform; + /* coordinate transformation matrix for relative movement. Matrix with + * the translation component dropped */ + struct pixman_f_transform relative_transform; + /* scale matrix for absolute devices, this is the combined matrix of + [1/scale] . [transform] . [scale]. See DeviceSetTransform */ + struct pixman_f_transform scale_and_transform; /* XTest related master device id */ int xtest_master_id; + + struct _SyncCounter *idle_counter; } DeviceIntRec; typedef struct { diff --git a/xserver/include/inpututils.h b/xserver/include/inpututils.h index cd9a4de82..53c96ba1c 100644 --- a/xserver/include/inpututils.h +++ b/xserver/include/inpututils.h @@ -57,6 +57,7 @@ XI2Mask *xi2mask_new(void); XI2Mask *xi2mask_new_with_size(size_t, size_t); /* don't use it */ void xi2mask_free(XI2Mask **mask); Bool xi2mask_isset(XI2Mask *mask, const DeviceIntPtr dev, int event_type); +Bool xi2mask_isset_for_device(XI2Mask *mask, const DeviceIntPtr dev, int event_type); void xi2mask_set(XI2Mask *mask, int deviceid, int event_type); void xi2mask_zero(XI2Mask *mask, int deviceid); void xi2mask_merge(XI2Mask *dest, const XI2Mask *source); diff --git a/xserver/include/list.h b/xserver/include/list.h index 96c0bcbd6..11de7c561 100644 --- a/xserver/include/list.h +++ b/xserver/include/list.h @@ -26,6 +26,8 @@ #ifndef _XORG_LIST_H_ #define _XORG_LIST_H_ +#include /* offsetof() */ + /** * @file Classic doubly-link circular list implementation. * For real usage examples of the linked list, see the file test/list.c @@ -117,7 +119,7 @@ struct xorg_list { * * @param The list to initialized. */ -static void +static inline void xorg_list_init(struct xorg_list *list) { list->next = list->prev = list; @@ -232,7 +234,7 @@ xorg_list_is_empty(struct xorg_list *head) */ #ifndef container_of #define container_of(ptr, type, member) \ - (type *)((char *)(ptr) - (char *) &((type *)0)->member) + (type *)((char *)(ptr) - offsetof(type, member)) #endif /** @@ -271,9 +273,20 @@ xorg_list_is_empty(struct xorg_list *head) #define xorg_list_last_entry(ptr, type, member) \ xorg_list_entry((ptr)->prev, type, member) -#define __container_of(ptr, sample, member) \ - (void *)((char *)(ptr) \ - - ((char *)&(sample)->member - (char *)(sample))) +#ifdef HAVE_TYPEOF +#define __container_of(ptr, sample, member) \ + container_of(ptr, typeof(*sample), member) +#else +/* This implementation of __container_of has undefined behavior according + * to the C standard, but it works in many cases. If your compiler doesn't + * support typeof() and fails with this implementation, please try a newer + * compiler. + */ +#define __container_of(ptr, sample, member) \ + (void *)((char *)(ptr) \ + - ((char *)&(sample)->member - (char *)(sample))) +#endif + /** * Loop through the list given by head and set pos to struct in the list. * @@ -345,7 +358,7 @@ xorg_list_is_empty(struct xorg_list *head) * struct foo *element = list; * while ((element = nt_list_next(element, next)) { } * - * This macro is not safe for node deletion. Use xorg_list_for_each_entry_safe + * This macro is not safe for node deletion. Use nt_list_for_each_entry_safe * instead. * * @param list The list or current element. @@ -453,7 +466,7 @@ xorg_list_is_empty(struct xorg_list *head) #define nt_list_del(_entry, _list, _type, _member) \ do { \ _type *__e = _entry; \ - if (__e == NULL) break; \ + if (__e == NULL || _list == NULL) break; \ if ((_list) == __e) { \ _list = __e->_member; \ } else { \ diff --git a/xserver/include/misc.h b/xserver/include/misc.h index 41c13332a..0c67f11fe 100644 --- a/xserver/include/misc.h +++ b/xserver/include/misc.h @@ -83,10 +83,14 @@ OF THIS SOFTWARE. #ifndef MAXSCREENS #define MAXSCREENS 16 #endif +#ifndef MAXGPUSCREENS +#define MAXGPUSCREENS 16 +#endif #define MAXCLIENTS 256 #define MAXEXTENSIONS 128 #define MAXFORMATS 8 #define MAXDEVICES 40 /* input devices */ +#define GPU_SCREEN_OFFSET 256 /* 128 event opcodes for core + extension events, excluding GE */ #define MAXEVENTS 128 @@ -228,7 +232,25 @@ pad_to_int32(const int bytes) return (((bytes) + 3) & ~3); } +/** + * Calculate padding needed to bring the number of bytes to an even + * multiple of 4. + * @param bytes The minimum number of bytes needed. + * @return The bytes of padding needed to arrive at the closest multiple of 4 + * that is equal or higher than bytes. + */ +static inline int +padding_for_int32(const int bytes) +{ + return ((-bytes) & 3); +} + + extern char **xstrtokenize(const char *str, const char *separators); +extern void FormatInt64(int64_t num, char *string); +extern void FormatUInt64(uint64_t num, char *string); +extern void FormatUInt64Hex(uint64_t num, char *string); +extern void FormatDouble(double dbl, char *string); /** * Compare the two version numbers comprising of major.minor. @@ -369,10 +391,10 @@ extern _X_EXPORT unsigned long serverGeneration; /* Don't use this directly, use BUG_WARN or BUG_WARN_MSG instead */ #define __BUG_WARN_MSG(cond, with_msg, ...) \ do { if (cond) { \ - ErrorF("BUG: triggered 'if (" #cond ")'\n"); \ - ErrorF("BUG: %s:%d in %s()\n", \ - __FILE__, __LINE__, __func__); \ - if (with_msg) ErrorF(__VA_ARGS__); \ + ErrorFSigSafe("BUG: triggered 'if (" #cond ")'\n"); \ + ErrorFSigSafe("BUG: %s:%u in %s()\n", \ + __FILE__, __LINE__, __func__); \ + if (with_msg) ErrorFSigSafe(__VA_ARGS__); \ xorg_backtrace(); \ } } while(0) @@ -381,4 +403,16 @@ extern _X_EXPORT unsigned long serverGeneration; #define BUG_WARN(cond) __BUG_WARN_MSG(cond, 0, NULL) +#define BUG_RETURN(cond) \ + do { if (cond) { __BUG_WARN_MSG(cond, 0, NULL); return; } } while(0) + +#define BUG_RETURN_MSG(cond, ...) \ + do { if (cond) { __BUG_WARN_MSG(cond, 1, __VA_ARGS__); return; } } while(0) + +#define BUG_RETURN_VAL(cond, val) \ + do { if (cond) { __BUG_WARN_MSG(cond, 0, NULL); return (val); } } while(0) + +#define BUG_RETURN_VAL_MSG(cond, val, ...) \ + do { if (cond) { __BUG_WARN_MSG(cond, 1, __VA_ARGS__); return (val); } } while(0) + #endif /* MISC_H */ diff --git a/xserver/include/opaque.h b/xserver/include/opaque.h index 9ca408ae1..b76ab6e6b 100644 --- a/xserver/include/opaque.h +++ b/xserver/include/opaque.h @@ -50,6 +50,7 @@ extern _X_EXPORT int ScreenSaverAllowExposures; extern _X_EXPORT int defaultScreenSaverBlanking; extern _X_EXPORT int defaultScreenSaverAllowExposures; extern _X_EXPORT char *display; +extern _X_EXPORT int displayfd; extern _X_EXPORT int defaultBackingStore; extern _X_EXPORT Bool disableBackingStore; diff --git a/xserver/include/os.h b/xserver/include/os.h index 93a43f4dc..88e726873 100644 --- a/xserver/include/os.h +++ b/xserver/include/os.h @@ -49,6 +49,7 @@ SOFTWARE. #include "misc.h" #include +#include #include #define SCREEN_SAVER_ON 0 @@ -87,7 +88,9 @@ extern void ddxBeforeReset(void); #endif #ifdef DDXOSVERRORF -extern _X_EXPORT void (*OsVendorVErrorFProc) (const char *, va_list args); +extern _X_EXPORT void (*OsVendorVErrorFProc) (const char *, + va_list args) +_X_ATTRIBUTE_PRINTF(1, 0); #endif extern _X_EXPORT int WaitForSomething(int * /*pClientsReady */ @@ -328,7 +331,8 @@ extern _X_EXPORT void OsCleanup(Bool); extern _X_EXPORT void -OsVendorFatalError(void); +OsVendorFatalError(const char *f, va_list args) +_X_ATTRIBUTE_PRINTF(1, 0); extern _X_EXPORT void OsVendorInit(void); @@ -339,6 +343,15 @@ OsBlockSignals(void); extern _X_EXPORT void OsReleaseSignals(void); +extern _X_EXPORT int +OsBlockSIGIO(void); + +extern _X_EXPORT void +OsReleaseSIGIO(void); + +extern void +OsResetSignals(void); + extern _X_EXPORT void OsAbort(void) _X_NORETURN; @@ -355,9 +368,13 @@ Fopen(const char *, const char *); extern _X_EXPORT int Fclose(pointer); #else -#define System(a) system(a) -#define Popen(a,b) popen(a,b) -#define Pclose(a) pclose(a) + +extern const char * +Win32TempDir(void); + +extern int +System(const char *cmdline); + #define Fopen(a,b) fopen(a,b) #define Fclose(a) fclose(a) #endif @@ -398,9 +415,6 @@ typedef struct sockaddr *sockaddrPtr; extern _X_EXPORT int InvalidHost(sockaddrPtr /*saddr */ , int /*len */ , ClientPtr client); -extern _X_EXPORT int -LocalClient(ClientPtr /* client */ ); - extern _X_EXPORT int LocalClientCred(ClientPtr, int *, int *); @@ -585,6 +599,7 @@ typedef enum { X_INFO, /* Informational message */ X_NONE, /* No prefix */ X_NOT_IMPLEMENTED, /* Not implemented */ + X_DEBUG, /* Debug message */ X_UNKNOWN = -1 /* unknown -- this must always be last */ } MessageType; @@ -609,6 +624,12 @@ _X_ATTRIBUTE_PRINTF(3, 4); extern _X_EXPORT void LogMessage(MessageType type, const char *format, ...) _X_ATTRIBUTE_PRINTF(2, 3); +extern _X_EXPORT void +LogMessageVerbSigSafe(MessageType type, int verb, const char *format, ...) +_X_ATTRIBUTE_PRINTF(3, 4); +extern _X_EXPORT void +LogVMessageVerbSigSafe(MessageType type, int verb, const char *format, va_list args) +_X_ATTRIBUTE_PRINTF(3, 0); extern _X_EXPORT void LogVHdrMessageVerb(MessageType type, int verb, @@ -654,6 +675,12 @@ extern _X_EXPORT void ErrorF(const char *f, ...) _X_ATTRIBUTE_PRINTF(1, 2); extern _X_EXPORT void +VErrorFSigSafe(const char *f, va_list args) +_X_ATTRIBUTE_PRINTF(1, 0); +extern _X_EXPORT void +ErrorFSigSafe(const char *f, ...) +_X_ATTRIBUTE_PRINTF(1, 2); +extern _X_EXPORT void LogPrintMarkers(void); extern _X_EXPORT void diff --git a/xserver/include/pixmap.h b/xserver/include/pixmap.h index 26d737c4d..921a94d1e 100644 --- a/xserver/include/pixmap.h +++ b/xserver/include/pixmap.h @@ -49,6 +49,7 @@ SOFTWARE. #include "misc.h" #include "screenint.h" +#include "regionstr.h" /* types for Drawable */ #define DRAWABLE_WINDOW 0 @@ -73,6 +74,8 @@ SOFTWARE. typedef struct _Drawable *DrawablePtr; typedef struct _Pixmap *PixmapPtr; +typedef struct _PixmapDirtyUpdate *PixmapDirtyUpdatePtr; + typedef union _PixUnion { PixmapPtr pixmap; unsigned long pixel; @@ -100,13 +103,29 @@ extern _X_EXPORT PixmapPtr GetScratchPixmapHeader(ScreenPtr /*pScreen */ , extern _X_EXPORT void FreeScratchPixmapHeader(PixmapPtr /*pPixmap */ ); -extern _X_EXPORT Bool CreateScratchPixmapsForScreen(int /*scrnum */ ); +extern _X_EXPORT Bool CreateScratchPixmapsForScreen(ScreenPtr /*pScreen */ ); -extern _X_EXPORT void FreeScratchPixmapsForScreen(int /*scrnum */ ); +extern _X_EXPORT void FreeScratchPixmapsForScreen(ScreenPtr /*pScreen */ ); extern _X_EXPORT PixmapPtr AllocatePixmap(ScreenPtr /*pScreen */ , int /*pixDataSize */ ); extern _X_EXPORT void FreePixmap(PixmapPtr /*pPixmap */ ); +extern _X_EXPORT PixmapPtr +PixmapShareToSlave(PixmapPtr pixmap, ScreenPtr slave); + +extern _X_EXPORT Bool +PixmapStartDirtyTracking(PixmapPtr src, + PixmapPtr slave_dst, + int x, int y); + +extern _X_EXPORT Bool +PixmapStopDirtyTracking(PixmapPtr src, PixmapPtr slave_dst); + +/* helper function, drivers can do this themselves if they can do it more + efficently */ +extern _X_EXPORT Bool +PixmapSyncDirtyHelper(PixmapDirtyUpdatePtr dirty, RegionPtr dirty_region); + #endif /* PIXMAP_H */ diff --git a/xserver/include/pixmapstr.h b/xserver/include/pixmapstr.h index 0800c62b2..2a1ef9b85 100644 --- a/xserver/include/pixmapstr.h +++ b/xserver/include/pixmapstr.h @@ -50,6 +50,7 @@ SOFTWARE. #include "screenint.h" #include "regionstr.h" #include "privates.h" +#include "damage.h" typedef struct _Drawable { unsigned char type; /* DRAWABLE_ */ @@ -80,6 +81,35 @@ typedef struct _Pixmap { short screen_y; #endif unsigned usage_hint; /* see CREATE_PIXMAP_USAGE_* */ + + PixmapPtr master_pixmap; /* pointer to master copy of pixmap for pixmap sharing */ } PixmapRec; +typedef struct _PixmapDirtyUpdate { + PixmapPtr src, slave_dst; + int x, y; + DamagePtr damage; + struct xorg_list ent; +} PixmapDirtyUpdateRec; + +static inline void +PixmapBox(BoxPtr box, PixmapPtr pixmap) +{ + box->x1 = 0; + box->x2 = pixmap->drawable.width; + + box->y1 = 0; + box->y2 = pixmap->drawable.height; +} + + +static inline void +PixmapRegionInit(RegionPtr region, PixmapPtr pixmap) +{ + BoxRec box; + + PixmapBox(&box, pixmap); + RegionInit(region, &box, 1); +} + #endif /* PIXMAPSTRUCT_H */ diff --git a/xserver/include/privates.h b/xserver/include/privates.h index c34b9512c..2c8864b8a 100644 --- a/xserver/include/privates.h +++ b/xserver/include/privates.h @@ -33,9 +33,9 @@ typedef enum { PRIVATE_SCREEN, PRIVATE_EXTENSION, PRIVATE_COLORMAP, + PRIVATE_DEVICE, /* These cannot have any objects before all relevant keys are registered */ - PRIVATE_DEVICE, PRIVATE_CLIENT, PRIVATE_PROPERTY, PRIVATE_SELECTION, @@ -66,6 +66,13 @@ typedef struct _DevPrivateKeyRec { struct _DevPrivateKeyRec *next; } DevPrivateKeyRec, *DevPrivateKey; +typedef struct _DevPrivateSetRec { + DevPrivateKey key; + unsigned offset; + int created; + int allocated; +} DevPrivateSetRec, *DevPrivateSetPtr; + typedef struct _DevScreenPrivateKeyRec { DevPrivateKeyRec screenKey; } DevScreenPrivateKeyRec, *DevScreenPrivateKey; @@ -218,6 +225,51 @@ dixLookupScreenPrivateAddr(PrivatePtr *privates, const DevScreenPrivateKey key, _dixGetScreenPrivateKey(key, pScreen)); } +/* + * These functions relate to allocations related to a specific screen; + * space will only be available for objects allocated for use on that + * screen. As such, only objects which are related directly to a specific + * screen are candidates for allocation this way, this includes + * windows, pixmaps, gcs, pictures and colormaps. This key is + * used just like any other key using dixGetPrivate and friends. + * + * This is distinctly different from the ScreenPrivateKeys above which + * allocate space in global objects like cursor bits for a specific + * screen, allowing multiple screen-related chunks of storage in a + * single global object. + */ + +#define HAVE_SCREEN_SPECIFIC_PRIVATE_KEYS 1 + +extern _X_EXPORT Bool +dixRegisterScreenSpecificPrivateKey(ScreenPtr pScreen, DevPrivateKey key, + DevPrivateType type, unsigned size); + +/* Clean up screen-specific privates before CloseScreen */ +extern void +dixFreeScreenSpecificPrivates(ScreenPtr pScreen); + +/* Initialize screen-specific privates in AddScreen */ +extern void +dixInitScreenSpecificPrivates(ScreenPtr pScreen); + +extern _X_EXPORT void * +_dixAllocateScreenObjectWithPrivates(ScreenPtr pScreen, + unsigned size, + unsigned clear, + unsigned offset, + DevPrivateType type); + +#define dixAllocateScreenObjectWithPrivates(s, t, type) _dixAllocateScreenObjectWithPrivates(s, sizeof(t), sizeof(t), offsetof(t, devPrivates), type) + +extern _X_EXPORT int +dixScreenSpecificPrivatesSize(ScreenPtr pScreen, DevPrivateType type); + +extern _X_EXPORT void +_dixInitScreenPrivates(ScreenPtr pScreen, PrivatePtr *privates, void *addr, DevPrivateType type); + +#define dixInitScreenPrivates(s, o, v, type) _dixInitScreenPrivates(s, &(o)->devPrivates, (v), type); + /* * Allocates private data separately from main object. * @@ -240,7 +292,7 @@ extern _X_EXPORT void * Initialize privates by zeroing them */ extern _X_EXPORT void - _dixInitPrivates(PrivatePtr *privates, void *addr, DevPrivateType type); +_dixInitPrivates(PrivatePtr *privates, void *addr, DevPrivateType type); #define dixInitPrivates(o, v, type) _dixInitPrivates(&(o)->devPrivates, (v), type); diff --git a/xserver/include/protocol-versions.h b/xserver/include/protocol-versions.h index 479ac2f77..5ceaeb012 100644 --- a/xserver/include/protocol-versions.h +++ b/xserver/include/protocol-versions.h @@ -65,7 +65,7 @@ /* RandR */ #define SERVER_RANDR_MAJOR_VERSION 1 -#define SERVER_RANDR_MINOR_VERSION 3 +#define SERVER_RANDR_MINOR_VERSION 4 /* Record */ #define SERVER_RECORD_MAJOR_VERSION 1 @@ -127,7 +127,7 @@ /* X Input */ #define SERVER_XI_MAJOR_VERSION 2 -#define SERVER_XI_MINOR_VERSION 2 +#define SERVER_XI_MINOR_VERSION 3 /* XKB */ #define SERVER_XKB_MAJOR_VERSION 1 @@ -135,7 +135,7 @@ /* Resource */ #define SERVER_XRES_MAJOR_VERSION 1 -#define SERVER_XRES_MINOR_VERSION 0 +#define SERVER_XRES_MINOR_VERSION 2 /* XvMC */ #define SERVER_XVMC_MAJOR_VERSION 1 diff --git a/xserver/include/ptrveloc.h b/xserver/include/ptrveloc.h index 8778646f5..3bd982a90 100644 --- a/xserver/include/ptrveloc.h +++ b/xserver/include/ptrveloc.h @@ -101,48 +101,43 @@ typedef struct _PredictableAccelSchemeRec { } PredictableAccelSchemeRec, *PredictableAccelSchemePtr; extern _X_EXPORT void - InitVelocityData(DeviceVelocityPtr vel); +InitVelocityData(DeviceVelocityPtr vel); extern _X_EXPORT void - InitTrackers(DeviceVelocityPtr vel, int ntracker); +InitTrackers(DeviceVelocityPtr vel, int ntracker); extern _X_EXPORT BOOL ProcessVelocityData2D(DeviceVelocityPtr vel, double dx, double dy, int time); extern _X_EXPORT double - BasicComputeAcceleration(DeviceIntPtr dev, DeviceVelocityPtr vel, double velocity, double threshold, double acc); extern _X_EXPORT void - FreeVelocityData(DeviceVelocityPtr vel); +FreeVelocityData(DeviceVelocityPtr vel); extern _X_EXPORT int - SetAccelerationProfile(DeviceVelocityPtr vel, int profile_num); +SetAccelerationProfile(DeviceVelocityPtr vel, int profile_num); extern _X_EXPORT DeviceVelocityPtr GetDevicePredictableAccelData(DeviceIntPtr dev); extern _X_EXPORT void - SetDeviceSpecificAccelerationProfile(DeviceVelocityPtr vel, PointerAccelerationProfileFunc profile); extern _X_INTERNAL void - AccelerationDefaultCleanup(DeviceIntPtr dev); +AccelerationDefaultCleanup(DeviceIntPtr dev); extern _X_INTERNAL Bool - InitPredictableAccelerationScheme(DeviceIntPtr dev, struct _ValuatorAccelerationRec *protoScheme); extern _X_INTERNAL void - acceleratePointerPredictable(DeviceIntPtr dev, ValuatorMask *val, CARD32 evtime); extern _X_INTERNAL void - acceleratePointerLightweight(DeviceIntPtr dev, ValuatorMask *val, CARD32 evtime); diff --git a/xserver/include/resource.h b/xserver/include/resource.h index 068057013..4a8dc3169 100644 --- a/xserver/include/resource.h +++ b/xserver/include/resource.h @@ -152,11 +152,42 @@ typedef Bool (*FindComplexResType) (pointer /*value */ , XID /*id */ , pointer /*cdata */ ); +/* Structure for estimating resource memory usage. Memory usage + * consists of space allocated for the resource itself and of + * references to other resources. Currently the most important use for + * this structure is to estimate pixmap usage of different resources + * more accurately. */ +typedef struct { + /* Size of resource itself. Zero if not implemented. */ + unsigned long resourceSize; + /* Size attributed to pixmap references from the resource. */ + unsigned long pixmapRefSize; + /* Number of references to this resource; typically 1 */ + unsigned long refCnt; +} ResourceSizeRec, *ResourceSizePtr; + +typedef void (*SizeType)(pointer /*value*/, + XID /*id*/, + ResourceSizePtr /*size*/); + extern _X_EXPORT RESTYPE CreateNewResourceType(DeleteType /*deleteFunc */ , const char * /*name */ ); -extern _X_EXPORT void SetResourceTypeErrorValue(RESTYPE /*type */ , - int /*errorValue */ ); +typedef void (*FindTypeSubResources)(pointer /* value */, + FindAllRes /* func */, + pointer /* cdata */); + +extern _X_EXPORT SizeType GetResourceTypeSizeFunc( + RESTYPE /*type*/); + +extern _X_EXPORT void SetResourceTypeFindSubResFunc( + RESTYPE /*type*/, FindTypeSubResources /*findFunc*/); + +extern _X_EXPORT void SetResourceTypeSizeFunc( + RESTYPE /*type*/, SizeType /*sizeFunc*/); + +extern _X_EXPORT void SetResourceTypeErrorValue( + RESTYPE /*type*/, int /*errorValue*/); extern _X_EXPORT RESTYPE CreateNewResourceClass(void); @@ -193,6 +224,15 @@ extern _X_EXPORT void FindAllClientResources(ClientPtr /*client */ , FindAllRes /*func */ , pointer /*cdata */ ); +/** @brief Iterate through all subresources of a resource. + + @note The XID argument provided to the FindAllRes function + may be 0 for subresources that don't have an XID */ +extern _X_EXPORT void FindSubResources(pointer /*resource*/, + RESTYPE /*type*/, + FindAllRes /*func*/, + pointer /*cdata*/); + extern _X_EXPORT void FreeClientNeverRetainResources(ClientPtr /*client */ ); extern _X_EXPORT void FreeClientResources(ClientPtr /*client */ ); @@ -231,4 +271,17 @@ extern _X_EXPORT unsigned int GetXIDList(ClientPtr /*client */ , extern _X_EXPORT RESTYPE lastResourceType; extern _X_EXPORT RESTYPE TypeMask; -#endif /* RESOURCE_H */ +/** @brief A hashing function to be used for hashing resource IDs + + @param id The resource ID to hash + @param numBits The number of bits in the resulting hash. Must be >=0. + + @note This function is really only for handling + INITHASHSIZE..MAXHASHSIZE bit hashes, but will handle any number + of bits by either masking numBits lower bits of the ID or by + providing at most MAXHASHSIZE hashes. +*/ +extern _X_EXPORT int HashResourceID(XID id, + int numBits); + +#endif /* RESOURCE_H */ diff --git a/xserver/include/screenint.h b/xserver/include/screenint.h index 881747182..e61cd33ed 100644 --- a/xserver/include/screenint.h +++ b/xserver/include/screenint.h @@ -55,7 +55,6 @@ typedef struct _Depth *DepthPtr; typedef struct _Screen *ScreenPtr; extern _X_EXPORT int AddScreen(Bool (* /*pfnInit */ )( - int /*index */ , ScreenPtr /*pScreen */ , int /*argc */ , @@ -63,6 +62,32 @@ extern _X_EXPORT int AddScreen(Bool (* /*pfnInit */ )( int /*argc */ , char ** /*argv */ ); + +extern _X_EXPORT int AddGPUScreen(Bool (*pfnInit) (ScreenPtr /*pScreen */ , + int /*argc */ , + char ** /*argv */ + ), + int argc, char **argv); + +extern _X_EXPORT void RemoveGPUScreen(ScreenPtr pScreen); + +extern _X_EXPORT void +AttachUnboundGPU(ScreenPtr pScreen, ScreenPtr newScreen); +extern _X_EXPORT void +DetachUnboundGPU(ScreenPtr unbound); + +extern _X_EXPORT void +AttachOutputGPU(ScreenPtr pScreen, ScreenPtr newScreen); + +extern _X_EXPORT void +DetachOutputGPU(ScreenPtr output); + +extern _X_EXPORT void +AttachOffloadGPU(ScreenPtr pScreen, ScreenPtr newScreen); + +extern _X_EXPORT void +DetachOffloadGPU(ScreenPtr slave); + typedef struct _ColormapRec *ColormapPtr; #endif /* SCREENINT_H */ diff --git a/xserver/include/scrnintstr.h b/xserver/include/scrnintstr.h index 0ae937777..df7407391 100644 --- a/xserver/include/scrnintstr.h +++ b/xserver/include/scrnintstr.h @@ -95,8 +95,7 @@ typedef struct _ScreenSaverStuff { * or as a local variable) can easily do so and retain full type checking. */ -typedef Bool (*CloseScreenProcPtr) (int /*index */ , - ScreenPtr /*pScreen */ ); +typedef Bool (*CloseScreenProcPtr) (ScreenPtr /*pScreen */ ); typedef void (*QueryBestSizeProcPtr) (int /*class */ , unsigned short * /*pwidth */ , @@ -180,6 +179,8 @@ typedef void (*ClipNotifyProcPtr) (WindowPtr /*pWindow */ , #define CREATE_PIXMAP_USAGE_BACKING_PIXMAP 2 /* pixmap will contain a glyph */ #define CREATE_PIXMAP_USAGE_GLYPH_PICTURE 3 +/* pixmap will be shared */ +#define CREATE_PIXMAP_USAGE_SHARED 4 typedef PixmapPtr (*CreatePixmapProcPtr) (ScreenPtr /*pScreen */ , int /*width */ , @@ -258,13 +259,11 @@ typedef void (*SendGraphicsExposeProcPtr) (ClientPtr /*client */ , int /*major */ , int /*minor */ ); -typedef void (*ScreenBlockHandlerProcPtr) (int /*screenNum */ , - pointer /*blockData */ , +typedef void (*ScreenBlockHandlerProcPtr) (ScreenPtr /*pScreen*/ , pointer /*pTimeout */ , pointer /*pReadmask */ ); -typedef void (*ScreenWakeupHandlerProcPtr) (int /*screenNum */ , - pointer /*wakeupData */ , +typedef void (*ScreenWakeupHandlerProcPtr) (ScreenPtr /*pScreen*/ , unsigned long /*result */ , pointer /*pReadMask */ ); @@ -342,6 +341,18 @@ typedef void (*DeviceCursorCleanupProcPtr) (DeviceIntPtr /* pDev */ , typedef void (*ConstrainCursorHarderProcPtr) (DeviceIntPtr, ScreenPtr, int, int *, int *); + +typedef Bool (*SharePixmapBackingProcPtr)(PixmapPtr, ScreenPtr, void **); + +typedef Bool (*SetSharedPixmapBackingProcPtr)(PixmapPtr, void *); + +typedef Bool (*StartPixmapTrackingProcPtr)(PixmapPtr, PixmapPtr, + int x, int y); + +typedef Bool (*StopPixmapTrackingProcPtr)(PixmapPtr, PixmapPtr); + +typedef Bool (*ReplaceScanoutPixmapProcPtr)(DrawablePtr, PixmapPtr, Bool); + typedef struct _Screen { int myNum; /* index of this instance in Screens[] */ ATOM id; @@ -370,6 +381,8 @@ typedef struct _Screen { WindowPtr root; ScreenSaverStuffRec screensaver; + DevPrivateSetRec screenSpecificPrivates[PRIVATE_LAST]; + /* Random screen procedures */ CloseScreenProcPtr CloseScreen; @@ -440,9 +453,6 @@ typedef struct _Screen { ScreenBlockHandlerProcPtr BlockHandler; ScreenWakeupHandlerProcPtr WakeupHandler; - pointer blockData; - pointer wakeupData; - /* anybody can get a piece of this array */ PrivateRec *devPrivates; @@ -481,6 +491,28 @@ typedef struct _Screen { * malicious users to steal framebuffer's content if that would be the * default */ Bool canDoBGNoneRoot; + + Bool isGPU; + + struct xorg_list unattached_list; + struct xorg_list unattached_head; + + ScreenPtr current_master; + + struct xorg_list output_slave_list; + struct xorg_list output_head; + + SharePixmapBackingProcPtr SharePixmapBacking; + SetSharedPixmapBackingProcPtr SetSharedPixmapBacking; + + StartPixmapTrackingProcPtr StartPixmapTracking; + StopPixmapTrackingProcPtr StopPixmapTracking; + + struct xorg_list pixmap_dirty_list; + struct xorg_list offload_slave_list; + struct xorg_list offload_head; + + ReplaceScanoutPixmapProcPtr ReplaceScanoutPixmap; } ScreenRec; static inline RegionPtr @@ -498,6 +530,8 @@ typedef struct _ScreenInfo { PixmapFormatRec formats[MAXFORMATS]; int numScreens; ScreenPtr screens[MAXSCREENS]; + int numGPUScreens; + ScreenPtr gpuscreens[MAXGPUSCREENS]; int x; /* origin */ int y; /* origin */ int width; /* total width of all screens together */ diff --git a/xserver/include/servermd.h b/xserver/include/servermd.h index e62bd4c2b..0a4806677 100644 --- a/xserver/include/servermd.h +++ b/xserver/include/servermd.h @@ -67,6 +67,7 @@ SOFTWARE. * GLYPHPADBYTES is used. */ + #ifdef __avr32__ #define IMAGE_BYTE_ORDER MSBFirst @@ -77,10 +78,10 @@ SOFTWARE. #if defined(vax) || defined(__vax__) -#define IMAGE_BYTE_ORDER LSBFirst /* Values for the VAX only */ -#define BITMAP_BIT_ORDER LSBFirst -#define GLYPHPADBYTES 4 /* to make fb work */ -#define GETLEFTBITS_ALIGNMENT 1 +#define IMAGE_BYTE_ORDER LSBFirst /* Values for the VAX only */ +#define BITMAP_BIT_ORDER LSBFirst +#define GLYPHPADBYTES 4 /* to make fb work */ +#define GETLEFTBITS_ALIGNMENT 1 #define FAST_UNALIGNED_READS #endif /* vax */ @@ -291,7 +292,7 @@ SOFTWARE. #endif /* linux/m68k */ -#if defined (OpenBSD) && defined (__mc68020__) +#if defined (__OpenBSD__) && defined (__mc68020__) #define IMAGE_BYTE_ORDER MSBFirst #define BITMAP_BIT_ORDER MSBFirst @@ -303,10 +304,10 @@ SOFTWARE. #ifdef sgi -#define IMAGE_BYTE_ORDER MSBFirst -#define BITMAP_BIT_ORDER MSBFirst -#define GLYPHPADBYTES 4 -#define GETLEFTBITS_ALIGNMENT 1 +#define IMAGE_BYTE_ORDER MSBFirst +#define BITMAP_BIT_ORDER MSBFirst +#define GLYPHPADBYTES 4 +#define GETLEFTBITS_ALIGNMENT 1 #define AVOID_MEMORY_READ #define FAST_CONSTANT_OFFSET_MODE #define LARGE_INSTRUCTION_CACHE diff --git a/xserver/include/window.h b/xserver/include/window.h index 64c56aeb3..b6d61c339 100644 --- a/xserver/include/window.h +++ b/xserver/include/window.h @@ -214,19 +214,15 @@ extern _X_EXPORT void ResizeChildrenWinSize(WindowPtr /*pWin */ , int /*dw */ , int /*dh */ ); -extern _X_EXPORT void ShapeExtensionInit(void); - extern _X_EXPORT void SendShapeNotify(WindowPtr /* pWin */ , - int /* which */ ); + int /* which */); extern _X_EXPORT RegionPtr CreateBoundingShape(WindowPtr /* pWin */ ); extern _X_EXPORT RegionPtr CreateClipShape(WindowPtr /* pWin */ ); -extern _X_EXPORT void DisableMapUnmapEvents(WindowPtr /* pWin */ ); -extern _X_EXPORT void EnableMapUnmapEvents(WindowPtr /* pWin */ ); - extern _X_EXPORT void SetRootClip(ScreenPtr pScreen, Bool enable); extern _X_EXPORT void PrintWindowTree(void); +extern _X_EXPORT VisualPtr WindowGetVisual(WindowPtr /*pWin*/); #endif /* WINDOW_H */ diff --git a/xserver/include/windowstr.h b/xserver/include/windowstr.h index 9caafba41..a1e608f09 100644 --- a/xserver/include/windowstr.h +++ b/xserver/include/windowstr.h @@ -86,8 +86,8 @@ typedef struct _WindowOpt { struct _OtherClients *otherClients; /* default: NULL */ struct _GrabRec *passiveGrabs; /* default: NULL */ PropertyPtr userProps; /* default: NULL */ - unsigned long backingBitPlanes; /* default: ~0L */ - unsigned long backingPixel; /* default: 0 */ + CARD32 backingBitPlanes; /* default: ~0L */ + CARD32 backingPixel; /* default: 0 */ RegionPtr boundingShape; /* default: NULL */ RegionPtr clipShape; /* default: NULL */ RegionPtr inputShape; /* default: NULL */ diff --git a/xserver/include/xkbsrv.h b/xserver/include/xkbsrv.h index 3b72885bd..45e2e8c47 100644 --- a/xserver/include/xkbsrv.h +++ b/xserver/include/xkbsrv.h @@ -171,6 +171,7 @@ typedef struct _XkbSrvInfo { KeyCode mouseKey; KeyCode inactiveKey; KeyCode slowKey; + KeyCode slowKeyEnableKey; KeyCode repeatKey; CARD8 krgTimerActive; CARD8 beepType; @@ -301,13 +302,15 @@ extern _X_EXPORT const char *XkbBinDirectory; extern _X_EXPORT CARD32 xkbDebugFlags; #define _XkbLibError(c,l,d) /* Epoch fail */ + +/* "a" is a "unique" numeric identifier that just defines which error + * code statement it is. _XkbErrCode2(4, foo) means "this is the 4th error + * statement in this function". lovely. + */ #define _XkbErrCode2(a,b) ((XID)((((unsigned int)(a))<<24)|((b)&0xffffff))) #define _XkbErrCode3(a,b,c) _XkbErrCode2(a,(((unsigned int)(b))<<16)|(c)) #define _XkbErrCode4(a,b,c,d) _XkbErrCode3(a,b,((((unsigned int)(c))<<8)|(d))) -extern _X_EXPORT int DeviceKeyPress, DeviceKeyRelease, DeviceMotionNotify; -extern _X_EXPORT int DeviceButtonPress, DeviceButtonRelease; - #define Status int extern _X_EXPORT void XkbUseMsg(void @@ -833,23 +836,6 @@ extern void XkbFakeDeviceButton(DeviceIntPtr /* dev */ , #define _XkbListGeometry 4 #define _XkbListNumComponents 5 -typedef struct _XkbSrvListInfo { - int szPool; - int nPool; - char *pool; - - int maxRtrn; - int nTotal; - - char *pattern[_XkbListNumComponents]; - int nFound[_XkbListNumComponents]; -} XkbSrvListInfoRec, *XkbSrvListInfoPtr; - -extern _X_EXPORT Status XkbDDXList(DeviceIntPtr /* dev */ , - XkbSrvListInfoPtr /* listing */ , - ClientPtr /* client */ - ); - extern _X_EXPORT unsigned int XkbDDXLoadKeymapByNames(DeviceIntPtr /* keybd */ , XkbComponentNamesPtr /* names */ , diff --git a/xserver/include/xorg-config.h.in b/xserver/include/xorg-config.h.in index 205f6c239..5dee82519 100644 --- a/xserver/include/xorg-config.h.in +++ b/xserver/include/xorg-config.h.in @@ -136,6 +136,9 @@ /* Have getresuid */ #undef HAVE_GETRESUID +/* Have X server platform bus support */ +#undef XSERVER_PLATFORM_BUS + /* Use X server privilege separation */ #undef X_PRIVSEP diff --git a/xserver/include/xorg-server.h.in b/xserver/include/xorg-server.h.in index f3cb87e19..7d35247b3 100644 --- a/xserver/include/xorg-server.h.in +++ b/xserver/include/xorg-server.h.in @@ -197,7 +197,7 @@ #undef WSCONS_SUPPORT /* Loadable XFree86 server awesomeness */ -#undef XFree86LOADER +#define XFree86LOADER /* Use libpciaccess */ #undef XSERVER_LIBPCIACCESS @@ -205,6 +205,9 @@ /* X Access Control Extension */ #undef XACE +/* Have X server platform bus support */ +#undef XSERVER_PLATFORM_BUS + /* Use X server privilege separation */ #undef X_PRIVSEP diff --git a/xserver/include/xserver-properties.h b/xserver/include/xserver-properties.h index 85f2ce5c4..bf48fabe5 100644 --- a/xserver/include/xserver-properties.h +++ b/xserver/include/xserver-properties.h @@ -118,6 +118,9 @@ #define AXIS_LABEL_PROP_ABS_MT_BLOB_ID "Abs MT Blob ID" #define AXIS_LABEL_PROP_ABS_MT_TRACKING_ID "Abs MT Tracking ID" #define AXIS_LABEL_PROP_ABS_MT_PRESSURE "Abs MT Pressure" +#define AXIS_LABEL_PROP_ABS_MT_DISTANCE "Abs MT Distance" +#define AXIS_LABEL_PROP_ABS_MT_TOOL_X "Abs MT Tool X" +#define AXIS_LABEL_PROP_ABS_MT_TOOL_Y "Abs MT Tool Y" #define AXIS_LABEL_PROP_ABS_MISC "Abs Misc" /* Button names */ diff --git a/xserver/include/xwin-config.h.in b/xserver/include/xwin-config.h.in index 8122f5543..c5119f268 100644 --- a/xserver/include/xwin-config.h.in +++ b/xserver/include/xwin-config.h.in @@ -31,3 +31,6 @@ /* Default log location */ #undef DEFAULT_LOGDIR + +/* Whether we should re-locate the root to where the executable lives */ +#undef RELOCATE_PROJECTROOT diff --git a/xserver/m4/xorg-tls.m4 b/xserver/m4/xorg-tls.m4 index 237fdcd9e..e04f1ff56 100644 --- a/xserver/m4/xorg-tls.m4 +++ b/xserver/m4/xorg-tls.m4 @@ -28,7 +28,7 @@ AC_DEFUN([XORG_TLS], [ ac_cv_tls=none keywords="__thread __declspec(thread)" for kw in $keywords ; do - AC_TRY_COMPILE([int $kw test;], [], ac_cv_tls=$kw) + AC_TRY_COMPILE([int $kw test;], [], ac_cv_tls=$kw ; break ;) done ]) AC_MSG_RESULT($ac_cv_tls) diff --git a/xserver/man/Makefile.in b/xserver/man/Makefile.in index dba4b0d60..7c76fba8c 100644 --- a/xserver/man/Makefile.in +++ b/xserver/man/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -183,13 +183,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -211,6 +207,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -235,6 +232,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -250,7 +248,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -365,6 +362,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -484,7 +482,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/manpages.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/manpages.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -510,9 +508,9 @@ $(top_srcdir)/manpages.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/man/Xserver.man b/xserver/man/Xserver.man index 0cd9b941c..b103551fa 100644 --- a/xserver/man/Xserver.man +++ b/xserver/man/Xserver.man @@ -127,6 +127,13 @@ Not obeyed by all servers. .B \-core causes the server to generate a core dump on fatal errors. .TP 8 +.B \-displayfd \fIfd\fP +specifies a file descriptor in the launching process. Rather than specify +a display number, the X server will attempt to listen on successively higher +display numbers, and upon finding a free one, will write the display number back +on this file descriptor as a newline-terminated string. The \-pn option is +ignored when using \-displayfd. +.TP 8 .B \-deferglyphs \fIwhichfonts\fP specifies the types of fonts for which the server should attempt to use deferred glyph loading. \fIwhichfonts\fP can be all (all fonts), diff --git a/xserver/mi/Makefile.am b/xserver/mi/Makefile.am index 96ceeaa8a..0cef7798f 100644 --- a/xserver/mi/Makefile.am +++ b/xserver/mi/Makefile.am @@ -1,7 +1,7 @@ noinst_LTLIBRARIES = libmi.la if XORG -sdk_HEADERS = micmap.h miline.h mipointer.h mi.h mibstore.h \ +sdk_HEADERS = micmap.h miline.h mipointer.h mi.h \ migc.h mipointrst.h mizerarc.h micoord.h mifillarc.h \ mispans.h miwideline.h mistruct.h mifpoly.h mioverlay.h endif @@ -12,7 +12,6 @@ libmi_la_SOURCES = \ mi.h \ miarc.c \ mibitblt.c \ - mibstore.h \ micmap.c \ micmap.h \ micoord.h \ diff --git a/xserver/mi/Makefile.in b/xserver/mi/Makefile.in index 02e252bce..abd29f2f0 100644 --- a/xserver/mi/Makefile.in +++ b/xserver/mi/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -129,8 +129,8 @@ am__can_run_installinfo = \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac -am__sdk_HEADERS_DIST = micmap.h miline.h mipointer.h mi.h mibstore.h \ - migc.h mipointrst.h mizerarc.h micoord.h mifillarc.h mispans.h \ +am__sdk_HEADERS_DIST = micmap.h miline.h mipointer.h mi.h migc.h \ + mipointrst.h mizerarc.h micoord.h mifillarc.h mispans.h \ miwideline.h mistruct.h mifpoly.h mioverlay.h am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ @@ -221,13 +221,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -249,6 +245,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -273,6 +270,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -288,7 +286,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -387,6 +384,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -487,7 +485,7 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libmi.la -@XORG_TRUE@sdk_HEADERS = micmap.h miline.h mipointer.h mi.h mibstore.h \ +@XORG_TRUE@sdk_HEADERS = micmap.h miline.h mipointer.h mi.h \ @XORG_TRUE@ migc.h mipointrst.h mizerarc.h micoord.h mifillarc.h \ @XORG_TRUE@ mispans.h miwideline.h mistruct.h mifpoly.h mioverlay.h @@ -496,7 +494,6 @@ libmi_la_SOURCES = \ mi.h \ miarc.c \ mibitblt.c \ - mibstore.h \ micmap.c \ micmap.h \ micoord.h \ @@ -551,7 +548,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -576,9 +573,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/mi/mibitblt.c b/xserver/mi/mibitblt.c index b9873c16d..b0d14ae55 100644 --- a/xserver/mi/mibitblt.c +++ b/xserver/mi/mibitblt.c @@ -614,7 +614,7 @@ miGetImage(DrawablePtr pDraw, int sx, int sy, int w, int h, if (format == ZPixmap) { if ((((1LL << depth) - 1) & planeMask) != (1LL << depth) - 1) { ChangeGCVal gcv; - xPoint pt; + xPoint xpt; pGC = GetScratchGC(depth, pDraw->pScreen); if (!pGC) @@ -629,9 +629,9 @@ miGetImage(DrawablePtr pDraw, int sx, int sy, int w, int h, * Clear the pixmap before doing anything else */ ValidateGC((DrawablePtr) pPixmap, pGC); - pt.x = pt.y = 0; + xpt.x = xpt.y = 0; width = w; - (*pGC->ops->FillSpans) ((DrawablePtr) pPixmap, pGC, 1, &pt, &width, + (*pGC->ops->FillSpans) ((DrawablePtr) pPixmap, pGC, 1, &xpt, &width, TRUE); /* alu is already GXCopy */ diff --git a/xserver/mi/mibstore.h b/xserver/mi/mibstore.h deleted file mode 100644 index f8ed4446d..000000000 --- a/xserver/mi/mibstore.h +++ /dev/null @@ -1,23 +0,0 @@ -/*- - * mibstore.h -- - * Header file for users of the MI backing-store scheme. - * - * Copyright (c) 1987 by the Regents of the University of California - * - * Permission to use, copy, modify, and distribute this - * software and its documentation for any purpose and without - * fee is hereby granted, provided that the above copyright - * notice appear in all copies. The University of California - * makes no representations about the suitability of this - * software for any purpose. It is provided "as is" without - * express or implied warranty. - */ - -#ifndef _MIBSTORE_H -#define _MIBSTORE_H - -#include "screenint.h" - -#define miInitializeBackingStore(x) do {} while (0) - -#endif /* _MIBSTORE_H */ diff --git a/xserver/mi/midispcur.c b/xserver/mi/midispcur.c index 24b9a700d..edca9696f 100644 --- a/xserver/mi/midispcur.c +++ b/xserver/mi/midispcur.c @@ -56,14 +56,12 @@ in this Software without prior written authorization from The Open Group. static DevPrivateKeyRec miDCScreenKeyRec; #define miDCScreenKey (&miDCScreenKeyRec) -static DevScreenPrivateKeyRec miDCCursorBitsKeyRec; -#define miDCCursorBitsKey (&miDCCursorBitsKeyRec) static DevScreenPrivateKeyRec miDCDeviceKeyRec; #define miDCDeviceKey (&miDCDeviceKeyRec) -static Bool miDCCloseScreen(int index, ScreenPtr pScreen); +static Bool miDCCloseScreen(ScreenPtr pScreen); /* per device private data */ typedef struct { @@ -86,18 +84,15 @@ typedef struct { */ typedef struct { CloseScreenProcPtr CloseScreen; -} miDCScreenRec, *miDCScreenPtr; - -#define miGetDCScreen(s) ((miDCScreenPtr)(dixLookupPrivate(&(s)->devPrivates, miDCScreenKey))) - -/* per-cursor per-screen private data */ -typedef struct { PixmapPtr sourceBits; /* source bits */ PixmapPtr maskBits; /* mask bits */ #ifdef ARGB_CURSOR PicturePtr pPicture; #endif -} miDCCursorRec, *miDCCursorPtr; + CursorPtr pCursor; +} miDCScreenRec, *miDCScreenPtr; + +#define miGetDCScreen(s) ((miDCScreenPtr)(dixLookupPrivate(&(s)->devPrivates, miDCScreenKey))) Bool miDCInitialize(ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs) @@ -105,13 +100,11 @@ miDCInitialize(ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs) miDCScreenPtr pScreenPriv; if (!dixRegisterPrivateKey(&miDCScreenKeyRec, PRIVATE_SCREEN, 0) || - !dixRegisterScreenPrivateKey(&miDCCursorBitsKeyRec, pScreen, - PRIVATE_CURSOR_BITS, 0) || !dixRegisterScreenPrivateKey(&miDCDeviceKeyRec, pScreen, PRIVATE_DEVICE, 0)) return FALSE; - pScreenPriv = malloc(sizeof(miDCScreenRec)); + pScreenPriv = calloc(1, sizeof(miDCScreenRec)); if (!pScreenPriv) return FALSE; @@ -127,57 +120,60 @@ miDCInitialize(ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs) return TRUE; } +static void +miDCSwitchScreenCursor(ScreenPtr pScreen, CursorPtr pCursor, PixmapPtr sourceBits, PixmapPtr maskBits, PicturePtr pPicture) +{ + miDCScreenPtr pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miDCScreenKey); + + if (pScreenPriv->sourceBits) + (*pScreen->DestroyPixmap)(pScreenPriv->sourceBits); + pScreenPriv->sourceBits = sourceBits; + + if (pScreenPriv->maskBits) + (*pScreen->DestroyPixmap)(pScreenPriv->maskBits); + pScreenPriv->maskBits = maskBits; + +#ifdef ARGB_CURSOR + if (pScreenPriv->pPicture) + FreePicture(pScreenPriv->pPicture, 0); + pScreenPriv->pPicture = pPicture; +#endif + + pScreenPriv->pCursor = pCursor; +} + static Bool -miDCCloseScreen(int index, ScreenPtr pScreen) +miDCCloseScreen(ScreenPtr pScreen) { miDCScreenPtr pScreenPriv; pScreenPriv = (miDCScreenPtr) dixLookupPrivate(&pScreen->devPrivates, miDCScreenKey); pScreen->CloseScreen = pScreenPriv->CloseScreen; + + miDCSwitchScreenCursor(pScreen, NULL, NULL, NULL, NULL); free((pointer) pScreenPriv); - return (*pScreen->CloseScreen) (index, pScreen); + return (*pScreen->CloseScreen) (pScreen); } Bool miDCRealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) { - if (pCursor->bits->refcnt <= 1) - dixSetScreenPrivate(&pCursor->bits->devPrivates, miDCCursorBitsKey, - pScreen, NULL); return TRUE; } #ifdef ARGB_CURSOR #define EnsurePicture(picture,draw,win) (picture || miDCMakePicture(&picture,draw,win)) -static VisualPtr -miDCGetWindowVisual(WindowPtr pWin) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - VisualID vid = wVisual(pWin); - int i; - - for (i = 0; i < pScreen->numVisuals; i++) - if (pScreen->visuals[i].vid == vid) - return &pScreen->visuals[i]; - return 0; -} - static PicturePtr miDCMakePicture(PicturePtr * ppPicture, DrawablePtr pDraw, WindowPtr pWin) { - ScreenPtr pScreen = pDraw->pScreen; - VisualPtr pVisual; PictFormatPtr pFormat; XID subwindow_mode = IncludeInferiors; PicturePtr pPicture; int error; - pVisual = miDCGetWindowVisual(pWin); - if (!pVisual) - return 0; - pFormat = PictureMatchVisual(pScreen, pDraw->depth, pVisual); + pFormat = PictureWindowFormat(pWin); if (!pFormat) return 0; pPicture = CreatePicture(0, pDraw, pFormat, @@ -188,42 +184,39 @@ miDCMakePicture(PicturePtr * ppPicture, DrawablePtr pDraw, WindowPtr pWin) } #endif -static miDCCursorPtr +static Bool miDCRealize(ScreenPtr pScreen, CursorPtr pCursor) { - miDCCursorPtr pPriv; + miDCScreenPtr pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miDCScreenKey); GCPtr pGC; ChangeGCVal gcvals; + PixmapPtr sourceBits, maskBits; + + if (pScreenPriv->pCursor == pCursor) + return TRUE; - pPriv = malloc(sizeof(miDCCursorRec)); - if (!pPriv) - return NULL; #ifdef ARGB_CURSOR + if (pCursor->bits->argb) { PixmapPtr pPixmap; PictFormatPtr pFormat; int error; + PicturePtr pPicture; pFormat = PictureMatchFormat(pScreen, 32, PICT_a8r8g8b8); - if (!pFormat) { - free((pointer) pPriv); - return NULL; - } + if (!pFormat) + return FALSE; - pPriv->sourceBits = 0; - pPriv->maskBits = 0; pPixmap = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, pCursor->bits->height, 32, CREATE_PIXMAP_USAGE_SCRATCH); - if (!pPixmap) { - free((pointer) pPriv); - return NULL; - } + if (!pPixmap) + return FALSE; + pGC = GetScratchGC(32, pScreen); if (!pGC) { (*pScreen->DestroyPixmap) (pPixmap); - free((pointer) pPriv); - return NULL; + return FALSE; } ValidateGC(&pPixmap->drawable, pGC); (*pGC->ops->PutImage) (&pPixmap->drawable, pGC, 32, @@ -231,105 +224,86 @@ miDCRealize(ScreenPtr pScreen, CursorPtr pCursor) pCursor->bits->height, 0, ZPixmap, (char *) pCursor->bits->argb); FreeScratchGC(pGC); - pPriv->pPicture = CreatePicture(0, &pPixmap->drawable, - pFormat, 0, 0, serverClient, &error); + pPicture = CreatePicture(0, &pPixmap->drawable, + pFormat, 0, 0, serverClient, &error); (*pScreen->DestroyPixmap) (pPixmap); - if (!pPriv->pPicture) { - free((pointer) pPriv); - return NULL; - } - dixSetScreenPrivate(&pCursor->bits->devPrivates, miDCCursorBitsKey, - pScreen, pPriv); - return pPriv; + if (!pPicture) + return FALSE; + + miDCSwitchScreenCursor(pScreen, pCursor, NULL, NULL, pPicture); + return TRUE; } - pPriv->pPicture = 0; #endif - pPriv->sourceBits = - (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, - pCursor->bits->height, 1, 0); - if (!pPriv->sourceBits) { - free((pointer) pPriv); - return NULL; + sourceBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, + pCursor->bits->height, 1, 0); + if (!sourceBits) + return FALSE; + + maskBits = (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, + pCursor->bits->height, 1, 0); + if (!maskBits) { + (*pScreen->DestroyPixmap) (sourceBits); + return FALSE; } - pPriv->maskBits = - (*pScreen->CreatePixmap) (pScreen, pCursor->bits->width, - pCursor->bits->height, 1, 0); - if (!pPriv->maskBits) { - (*pScreen->DestroyPixmap) (pPriv->sourceBits); - free((pointer) pPriv); - return NULL; - } - dixSetScreenPrivate(&pCursor->bits->devPrivates, miDCCursorBitsKey, pScreen, - pPriv); /* create the two sets of bits, clipping as appropriate */ pGC = GetScratchGC(1, pScreen); if (!pGC) { - (void) miDCUnrealizeCursor(pScreen, pCursor); - return NULL; + (*pScreen->DestroyPixmap) (sourceBits); + (*pScreen->DestroyPixmap) (maskBits); + return FALSE; } - ValidateGC((DrawablePtr) pPriv->sourceBits, pGC); - (*pGC->ops->PutImage) ((DrawablePtr) pPriv->sourceBits, pGC, 1, + ValidateGC((DrawablePtr) sourceBits, pGC); + (*pGC->ops->PutImage) ((DrawablePtr) sourceBits, pGC, 1, 0, 0, pCursor->bits->width, pCursor->bits->height, 0, XYPixmap, (char *) pCursor->bits->source); gcvals.val = GXand; ChangeGC(NullClient, pGC, GCFunction, &gcvals); - ValidateGC((DrawablePtr) pPriv->sourceBits, pGC); - (*pGC->ops->PutImage) ((DrawablePtr) pPriv->sourceBits, pGC, 1, + ValidateGC((DrawablePtr) sourceBits, pGC); + (*pGC->ops->PutImage) ((DrawablePtr) sourceBits, pGC, 1, 0, 0, pCursor->bits->width, pCursor->bits->height, 0, XYPixmap, (char *) pCursor->bits->mask); /* mask bits -- pCursor->mask & ~pCursor->source */ gcvals.val = GXcopy; ChangeGC(NullClient, pGC, GCFunction, &gcvals); - ValidateGC((DrawablePtr) pPriv->maskBits, pGC); - (*pGC->ops->PutImage) ((DrawablePtr) pPriv->maskBits, pGC, 1, + ValidateGC((DrawablePtr) maskBits, pGC); + (*pGC->ops->PutImage) ((DrawablePtr) maskBits, pGC, 1, 0, 0, pCursor->bits->width, pCursor->bits->height, 0, XYPixmap, (char *) pCursor->bits->mask); gcvals.val = GXandInverted; ChangeGC(NullClient, pGC, GCFunction, &gcvals); - ValidateGC((DrawablePtr) pPriv->maskBits, pGC); - (*pGC->ops->PutImage) ((DrawablePtr) pPriv->maskBits, pGC, 1, + ValidateGC((DrawablePtr) maskBits, pGC); + (*pGC->ops->PutImage) ((DrawablePtr) maskBits, pGC, 1, 0, 0, pCursor->bits->width, pCursor->bits->height, 0, XYPixmap, (char *) pCursor->bits->source); FreeScratchGC(pGC); - return pPriv; + + miDCSwitchScreenCursor(pScreen, pCursor, sourceBits, maskBits, NULL); + return TRUE; } Bool miDCUnrealizeCursor(ScreenPtr pScreen, CursorPtr pCursor) { - miDCCursorPtr pPriv; + miDCScreenPtr pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miDCScreenKey); - pPriv = (miDCCursorPtr) dixLookupScreenPrivate(&pCursor->bits->devPrivates, - miDCCursorBitsKey, pScreen); - if (pPriv && (pCursor->bits->refcnt <= 1)) { - if (pPriv->sourceBits) - (*pScreen->DestroyPixmap) (pPriv->sourceBits); - if (pPriv->maskBits) - (*pScreen->DestroyPixmap) (pPriv->maskBits); -#ifdef ARGB_CURSOR - if (pPriv->pPicture) - FreePicture(pPriv->pPicture, 0); -#endif - free((pointer) pPriv); - dixSetScreenPrivate(&pCursor->bits->devPrivates, miDCCursorBitsKey, - pScreen, NULL); - } + if (pCursor == pScreenPriv->pCursor) + miDCSwitchScreenCursor(pScreen, NULL, NULL, NULL, NULL); return TRUE; } static void miDCPutBits(DrawablePtr pDrawable, - miDCCursorPtr pPriv, GCPtr sourceGC, GCPtr maskGC, int x_org, int y_org, unsigned w, unsigned h, unsigned long source, unsigned long mask) { + miDCScreenPtr pScreenPriv = dixLookupPrivate(&pDrawable->pScreen->devPrivates, miDCScreenKey); ChangeGCVal gcval; int x, y; @@ -349,7 +323,7 @@ miDCPutBits(DrawablePtr pDrawable, y = y_org; } - (*sourceGC->ops->PushPixels) (sourceGC, pPriv->sourceBits, pDrawable, w, h, + (*sourceGC->ops->PushPixels) (sourceGC, pScreenPriv->sourceBits, pDrawable, w, h, x, y); if (maskGC->fgPixel != mask) { gcval.val = mask; @@ -367,7 +341,7 @@ miDCPutBits(DrawablePtr pDrawable, y = y_org; } - (*maskGC->ops->PushPixels) (maskGC, pPriv->maskBits, pDrawable, w, h, x, y); + (*maskGC->ops->PushPixels) (maskGC, pScreenPriv->maskBits, pDrawable, w, h, x, y); } static GCPtr @@ -389,27 +363,22 @@ Bool miDCPutUpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, int x, int y, unsigned long source, unsigned long mask) { - miDCCursorPtr pPriv; + miDCScreenPtr pScreenPriv = dixLookupPrivate(&pScreen->devPrivates, miDCScreenKey); miDCBufferPtr pBuffer; WindowPtr pWin; - pPriv = (miDCCursorPtr) dixLookupScreenPrivate(&pCursor->bits->devPrivates, - miDCCursorBitsKey, pScreen); - if (!pPriv) { - pPriv = miDCRealize(pScreen, pCursor); - if (!pPriv) - return FALSE; - } + if (!miDCRealize(pScreen, pCursor)) + return FALSE; pWin = pScreen->root; pBuffer = miGetDCDevice(pDev, pScreen); #ifdef ARGB_CURSOR - if (pPriv->pPicture) { + if (pScreenPriv->pPicture) { if (!EnsurePicture(pBuffer->pRootPicture, &pWin->drawable, pWin)) return FALSE; CompositePicture(PictOpOver, - pPriv->pPicture, + pScreenPriv->pPicture, NULL, pBuffer->pRootPicture, 0, 0, 0, 0, @@ -418,7 +387,7 @@ miDCPutUpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor, else #endif { - miDCPutBits((DrawablePtr) pWin, pPriv, + miDCPutBits((DrawablePtr) pWin, pBuffer->pSourceGC, pBuffer->pMaskGC, x, y, pCursor->bits->width, pCursor->bits->height, source, mask); diff --git a/xserver/mi/mieq.c b/xserver/mi/mieq.c index e117a8db7..d7d73deb6 100644 --- a/xserver/mi/mieq.c +++ b/xserver/mi/mieq.c @@ -276,23 +276,22 @@ mieqEnqueue(DeviceIntPtr pDev, InternalEvent *e) */ miEventQueue.dropped++; if (miEventQueue.dropped == 1) { - ErrorF - ("[mi] EQ overflowing. Additional events will be discarded until existing events are processed.\n"); + ErrorFSigSafe("[mi] EQ overflowing. Additional events will be " + "discarded until existing events are processed.\n"); xorg_backtrace(); - ErrorF - ("[mi] These backtraces from mieqEnqueue may point to a culprit higher up the stack.\n"); - ErrorF("[mi] mieq is *NOT* the cause. It is a victim.\n"); + ErrorFSigSafe("[mi] These backtraces from mieqEnqueue may point to " + "a culprit higher up the stack.\n"); + ErrorFSigSafe("[mi] mieq is *NOT* the cause. It is a victim.\n"); } else if (miEventQueue.dropped % QUEUE_DROP_BACKTRACE_FREQUENCY == 0 && miEventQueue.dropped / QUEUE_DROP_BACKTRACE_FREQUENCY <= QUEUE_DROP_BACKTRACE_MAX) { - ErrorF - ("[mi] EQ overflow continuing. %lu events have been dropped.\n", - miEventQueue.dropped); + ErrorFSigSafe("[mi] EQ overflow continuing. %u events have been " + "dropped.\n", miEventQueue.dropped); if (miEventQueue.dropped / QUEUE_DROP_BACKTRACE_FREQUENCY == QUEUE_DROP_BACKTRACE_MAX) { - ErrorF - ("[mi] No further overflow reports will be reported until the clog is cleared.\n"); + ErrorFSigSafe("[mi] No further overflow reports will be " + "reported until the clog is cleared.\n"); } xorg_backtrace(); } @@ -408,6 +407,10 @@ ChangeDeviceID(DeviceIntPtr dev, InternalEvent *event) case ET_RawTouchUpdate: event->raw_event.deviceid = dev->id; break; + case ET_BarrierHit: + case ET_BarrierLeave: + event->barrier_event.deviceid = dev->id; + break; default: ErrorF("[mi] Unknown event type (%d), cannot change id.\n", event->any.type); @@ -624,7 +627,11 @@ mieqProcessInputEvents(void) mieqProcessDeviceEvent(dev, &event, screen); /* Update the sprite now. Next event may be from different device. */ - if (event.any.type == ET_Motion && master) + if (master && + (event.any.type == ET_Motion || + ((event.any.type == ET_TouchBegin || + event.any.type == ET_TouchUpdate) && + event.device_event.flags & TOUCH_POINTER_EMULATED))) miPointerUpdateSprite(dev); #ifdef XQUARTZ diff --git a/xserver/mi/miexpose.c b/xserver/mi/miexpose.c index dbb29ca4a..8b7c93fb8 100644 --- a/xserver/mi/miexpose.c +++ b/xserver/mi/miexpose.c @@ -327,7 +327,7 @@ miSendGraphicsExpose(ClientPtr client, RegionPtr pRgn, XID drawable, numRects = RegionNumRects(pRgn); pBox = RegionRects(pRgn); - if (!(pEvent = malloc(numRects * sizeof(xEvent)))) + if (!(pEvent = calloc(numRects, sizeof(xEvent)))) return; pe = pEvent; @@ -349,13 +349,12 @@ miSendGraphicsExpose(ClientPtr client, RegionPtr pRgn, XID drawable, free(pEvent); } else { - xEvent event; - - memset(&event, 0, sizeof(xEvent)); + xEvent event = { + .u.noExposure.drawable = drawable, + .u.noExposure.majorEvent = major, + .u.noExposure.minorEvent = minor + }; event.u.u.type = NoExpose; - event.u.noExposure.drawable = drawable; - event.u.noExposure.majorEvent = major; - event.u.noExposure.minorEvent = minor; WriteEventsToClient(client, 1, &event); } } diff --git a/xserver/mi/miinitext.c b/xserver/mi/miinitext.c index 6ceae0537..81c663abe 100644 --- a/xserver/mi/miinitext.c +++ b/xserver/mi/miinitext.c @@ -44,21 +44,46 @@ SOFTWARE. ******************************************************************/ +/* + * Copyright (c) 2000 by The XFree86 Project, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of the copyright holder(s) + * and author(s) shall not be used in advertising or otherwise to promote + * the sale, use or other dealings in this Software without prior written + * authorization from the copyright holder(s) and author(s). + */ + #ifdef HAVE_DIX_CONFIG_H #include #endif #ifdef HAVE_XORG_CONFIG_H #include +#include "xf86Extensions.h" #endif #ifdef HAVE_DMX_CONFIG_H #include #undef XV #undef DBE -#undef XF86VIDMODE -#undef XFreeXDGA -#undef XF86DRI #undef SCREENSAVER #undef RANDR #undef XFIXES @@ -75,198 +100,18 @@ SOFTWARE. #ifdef HAVE_KDRIVE_CONFIG_H #include -/* there must be a better way... */ -#undef XFreeXDGA -#undef XF86DRI -#undef XF86VIDMODE #endif #ifdef HAVE_XGL_CONFIG_H #include -#undef XFreeXDGA -#undef XF86DRI -#undef XF86VIDMODE #endif #include "misc.h" #include "extension.h" +#include "extinit.h" #include "micmap.h" #include "globals.h" -extern Bool noTestExtensions; - -#ifdef COMPOSITE -extern Bool noCompositeExtension; -#endif -#ifdef DBE -extern Bool noDbeExtension; -#endif -#ifdef DPMSExtension -extern Bool noDPMSExtension; -#endif -#ifdef GLXEXT -extern Bool noGlxExtension; -#endif -#ifdef SCREENSAVER -extern Bool noScreenSaverExtension; -#endif -#ifdef MITSHM -extern Bool noMITShmExtension; -#endif -#ifdef RANDR -extern Bool noRRExtension; -#endif -extern Bool noRenderExtension; - -#ifdef XCSECURITY -extern Bool noSecurityExtension; -#endif -#ifdef RES -extern Bool noResExtension; -#endif -#ifdef XF86BIGFONT -extern Bool noXFree86BigfontExtension; -#endif -#ifdef XFreeXDGA -extern Bool noXFree86DGAExtension; -#endif -#ifdef XF86DRI -extern Bool noXFree86DRIExtension; -#endif -#ifdef XF86VIDMODE -extern Bool noXFree86VidModeExtension; -#endif -#ifdef XFIXES -extern Bool noXFixesExtension; -#endif -#ifdef PANORAMIX -extern Bool noPanoramiXExtension; -#endif -#ifdef INXQUARTZ -extern Bool noPseudoramiXExtension; -#endif -#ifdef XSELINUX -extern Bool noSELinuxExtension; -#endif -#ifdef XV -extern Bool noXvExtension; -#endif -extern Bool noGEExtension; - -#ifndef XFree86LOADER -#define INITARGS void -typedef void (*InitExtension) (INITARGS); -#else /* XFree86Loader */ -#include "loaderProcs.h" -#endif - -#ifdef MITSHM -#include -#endif -#ifdef XTEST -#include -#endif -#include -#ifdef XCSECURITY -#include "securitysrv.h" -#include -#endif -#ifdef XSELINUX -#include "xselinux.h" -#endif -#ifdef PANORAMIX -#include -#endif -#ifdef XF86BIGFONT -#include -#endif -#ifdef RES -#include -#endif - -/* FIXME: this whole block of externs should be from the appropriate headers */ -#ifdef MITSHM -extern void ShmExtensionInit(INITARGS); -#endif -#ifdef PANORAMIX -extern void PanoramiXExtensionInit(INITARGS); -#endif -#ifdef INXQUARTZ -extern void PseudoramiXExtensionInit(INITARGS); -#endif -extern void XInputExtensionInit(INITARGS); - -#ifdef XTEST -extern void XTestExtensionInit(INITARGS); -#endif -extern void BigReqExtensionInit(INITARGS); - -#ifdef SCREENSAVER -extern void ScreenSaverExtensionInit(INITARGS); -#endif -#ifdef XV -extern void XvExtensionInit(INITARGS); -extern void XvMCExtensionInit(INITARGS); -#endif -extern void SyncExtensionInit(INITARGS); -extern void XkbExtensionInit(INITARGS); -extern void XCMiscExtensionInit(INITARGS); - -#ifdef XRECORD -extern void RecordExtensionInit(INITARGS); -#endif -#ifdef DBE -extern void DbeExtensionInit(INITARGS); -#endif -#ifdef XCSECURITY -extern void SecurityExtensionInit(INITARGS); -#endif -#ifdef XSELINUX -extern void SELinuxExtensionInit(INITARGS); -#endif -#ifdef XF86BIGFONT -extern void XFree86BigfontExtensionInit(INITARGS); -#endif -#ifdef XF86VIDMODE -extern void XFree86VidModeExtensionInit(INITARGS); -#endif -#ifdef XFreeXDGA -extern void XFree86DGAExtensionInit(INITARGS); -#endif -#ifdef GLXEXT -typedef struct __GLXprovider __GLXprovider; -extern __GLXprovider __glXDRISWRastProvider; -extern void GlxPushProvider(__GLXprovider * impl); -extern void GlxExtensionInit(INITARGS); -#endif -#ifdef XF86DRI -extern void XFree86DRIExtensionInit(INITARGS); -#endif -#ifdef DPMSExtension -extern void DPMSExtensionInit(INITARGS); -#endif -extern void RenderExtensionInit(INITARGS); - -#ifdef RANDR -extern void RRExtensionInit(INITARGS); -#endif -#ifdef RES -extern void ResExtensionInit(INITARGS); -#endif -#ifdef DMXEXT -extern void DMXExtensionInit(INITARGS); -#endif -#ifdef XFIXES -extern void XFixesExtensionInit(INITARGS); -#endif -#ifdef DAMAGE -extern void DamageExtensionInit(INITARGS); -#endif -#ifdef COMPOSITE -extern void CompositeExtensionInit(INITARGS); -#endif -extern void GEExtensionInit(INITARGS); - /* The following is only a small first step towards run-time * configurable extensions. */ @@ -312,6 +157,7 @@ static ExtensionToggle ExtensionToggleList[] = { #ifdef XF86BIGFONT {"XFree86-Bigfont", &noXFree86BigfontExtension}, #endif +#ifdef XorgLoader #ifdef XFreeXDGA {"XFree86-DGA", &noXFree86DGAExtension}, #endif @@ -321,6 +167,7 @@ static ExtensionToggle ExtensionToggleList[] = { #ifdef XF86VIDMODE {"XFree86-VidModeExtension", &noXFree86VidModeExtension}, #endif +#endif #ifdef XFIXES {"XFIXES", &noXFixesExtension}, #endif @@ -336,15 +183,16 @@ static ExtensionToggle ExtensionToggleList[] = { #ifdef XV {"XVideo", &noXvExtension}, #endif - {NULL, NULL} }; Bool EnableDisableExtension(const char *name, Bool enable) { - ExtensionToggle *ext = &ExtensionToggleList[0]; + ExtensionToggle *ext; + int i; - for (ext = &ExtensionToggleList[0]; ext->name != NULL; ext++) { + for (i = 0; i < ARRAY_SIZE(ExtensionToggleList); i++) { + ext = &ExtensionToggleList[i]; if (strcmp(name, ext->name) == 0) { if (ext->disablePtr != NULL) { *ext->disablePtr = !enable; @@ -364,10 +212,12 @@ EnableDisableExtension(const char *name, Bool enable) void EnableDisableExtensionError(const char *name, Bool enable) { - ExtensionToggle *ext = &ExtensionToggleList[0]; + ExtensionToggle *ext; + int i; Bool found = FALSE; - for (ext = &ExtensionToggleList[0]; ext->name != NULL; ext++) { + for (i = 0; i < ARRAY_SIZE(ExtensionToggleList); i++) { + ext = &ExtensionToggleList[i]; if ((strcmp(name, ext->name) == 0) && (ext->disablePtr == NULL)) { ErrorF("[mi] Extension \"%s\" can not be disabled\n", name); found = TRUE; @@ -378,187 +228,107 @@ EnableDisableExtensionError(const char *name, Bool enable) ErrorF("[mi] Extension \"%s\" is not recognized\n", name); ErrorF("[mi] Only the following extensions can be run-time %s:\n", enable ? "enabled" : "disabled"); - for (ext = &ExtensionToggleList[0]; ext->name != NULL; ext++) { + for (i = 0; i < ARRAY_SIZE(ExtensionToggleList); i++) { + ext = &ExtensionToggleList[i]; if (ext->disablePtr != NULL) { ErrorF("[mi] %s\n", ext->name); } } } -#ifndef XFree86LOADER - - /*ARGSUSED*/ void -InitExtensions(int argc, char *argv[]) -{ - if (!noGEExtension) - GEExtensionInit(); - -#ifdef PANORAMIX - if (!noPanoramiXExtension) - PanoramiXExtensionInit(); -#endif -#ifdef INXQUARTZ - if (!noPseudoramiXExtension) - PseudoramiXExtensionInit(); -#endif - ShapeExtensionInit(); -#ifdef MITSHM - if (!noMITShmExtension) - ShmExtensionInit(); -#endif - XInputExtensionInit(); -#ifdef XTEST - if (!noTestExtensions) - XTestExtensionInit(); -#endif - BigReqExtensionInit(); -#if defined(SCREENSAVER) - if (!noScreenSaverExtension) - ScreenSaverExtensionInit(); -#endif -#ifdef XV - if (!noXvExtension) { - XvExtensionInit(); - XvMCExtensionInit(); - } -#endif - SyncExtensionInit(); - XkbExtensionInit(); - XCMiscExtensionInit(); -#ifdef XRECORD - if (!noTestExtensions) - RecordExtensionInit(); -#endif -#ifdef DBE - if (!noDbeExtension) - DbeExtensionInit(); -#endif -#ifdef XCSECURITY - if (!noSecurityExtension) - SecurityExtensionInit(); -#endif -#ifdef XSELINUX - if (!noSELinuxExtension) - SELinuxExtensionInit(); -#endif -#if defined(DPMSExtension) && !defined(NO_HW_ONLY_EXTS) - if (!noDPMSExtension) - DPMSExtensionInit(); -#endif -#ifdef XF86BIGFONT - if (!noXFree86BigfontExtension) - XFree86BigfontExtensionInit(); -#endif -#if !defined(NO_HW_ONLY_EXTS) -#if defined(XF86VIDMODE) - if (!noXFree86VidModeExtension) - XFree86VidModeExtensionInit(); -#endif -#if defined(XFreeXDGA) - if (!noXFree86DGAExtension) - XFree86DGAExtensionInit(); -#endif -#ifdef XF86DRI - if (!noXFree86DRIExtension) - XFree86DRIExtensionInit(); -#endif -#endif -#ifdef XFIXES - /* must be before Render to layer DisplayCursor correctly */ - if (!noXFixesExtension) - XFixesExtensionInit(); -#endif - if (!noRenderExtension) - RenderExtensionInit(); -#ifdef RANDR - if (!noRRExtension) - RRExtensionInit(); -#endif -#ifdef RES - if (!noResExtension) - ResExtensionInit(); -#endif -#ifdef DMXEXT - DMXExtensionInit(); /* server-specific extension, cannot be disabled */ -#endif -#ifdef COMPOSITE - if (!noCompositeExtension) - CompositeExtensionInit(); -#endif -#ifdef DAMAGE - if (!noDamageExtension) - DamageExtensionInit(); -#endif - -#ifdef GLXEXT - if (serverGeneration == 1) - GlxPushProvider(&__glXDRISWRastProvider); - if (!noGlxExtension) - GlxExtensionInit(); -#endif -} - -#else /* XFree86LOADER */ /* List of built-in (statically linked) extensions */ static ExtensionModule staticExtensions[] = { - {GEExtensionInit, "Generic Event Extension", &noGEExtension, NULL, NULL}, - {ShapeExtensionInit, "SHAPE", NULL, NULL, NULL}, + {GEExtensionInit, "Generic Event Extension", &noGEExtension}, + {ShapeExtensionInit, "SHAPE", NULL}, #ifdef MITSHM - {ShmExtensionInit, SHMNAME, &noMITShmExtension, NULL, NULL}, + {ShmExtensionInit, SHMNAME, &noMITShmExtension}, #endif - {XInputExtensionInit, "XInputExtension", NULL, NULL, NULL}, + {XInputExtensionInit, "XInputExtension", NULL}, #ifdef XTEST - {XTestExtensionInit, XTestExtensionName, &noTestExtensions, NULL, NULL}, + {XTestExtensionInit, XTestExtensionName, &noTestExtensions}, #endif - {BigReqExtensionInit, "BIG-REQUESTS", NULL, NULL, NULL}, - {SyncExtensionInit, "SYNC", NULL, NULL, NULL}, - {XkbExtensionInit, XkbName, NULL, NULL, NULL}, - {XCMiscExtensionInit, "XC-MISC", NULL, NULL, NULL}, + {BigReqExtensionInit, "BIG-REQUESTS", NULL}, + {SyncExtensionInit, "SYNC", NULL}, + {XkbExtensionInit, XkbName, NULL}, + {XCMiscExtensionInit, "XC-MISC", NULL}, #ifdef XCSECURITY - {SecurityExtensionInit, SECURITY_EXTENSION_NAME, &noSecurityExtension, NULL, - NULL}, + {SecurityExtensionInit, SECURITY_EXTENSION_NAME, &noSecurityExtension}, #endif #ifdef PANORAMIX - {PanoramiXExtensionInit, PANORAMIX_PROTOCOL_NAME, &noPanoramiXExtension, - NULL, NULL}, + {PanoramiXExtensionInit, PANORAMIX_PROTOCOL_NAME, &noPanoramiXExtension}, +#endif +#ifdef INXQUARTZ + /* PseudoramiXExtensionInit must be done before RRExtensionInit, or + * XQuartz will render windows offscreen. + */ + {PseudoramiXExtensionInit, "PseudoramiX", &noPseudoramiXExtension}, #endif #ifdef XFIXES /* must be before Render to layer DisplayCursor correctly */ - {XFixesExtensionInit, "XFIXES", &noXFixesExtension, NULL, NULL}, + {XFixesExtensionInit, "XFIXES", &noXFixesExtension}, #endif #ifdef XF86BIGFONT - {XFree86BigfontExtensionInit, XF86BIGFONTNAME, &noXFree86BigfontExtension, - NULL, NULL}, + {XFree86BigfontExtensionInit, XF86BIGFONTNAME, &noXFree86BigfontExtension}, #endif - {RenderExtensionInit, "RENDER", &noRenderExtension, NULL, NULL}, + {RenderExtensionInit, "RENDER", &noRenderExtension}, #ifdef RANDR - {RRExtensionInit, "RANDR", &noRRExtension, NULL, NULL}, + {RRExtensionInit, "RANDR", &noRRExtension}, #endif #ifdef COMPOSITE - {CompositeExtensionInit, "COMPOSITE", &noCompositeExtension, NULL}, + {CompositeExtensionInit, "COMPOSITE", &noCompositeExtension}, #endif #ifdef DAMAGE - {DamageExtensionInit, "DAMAGE", &noDamageExtension, NULL}, + {DamageExtensionInit, "DAMAGE", &noDamageExtension}, +#endif +#ifdef SCREENSAVER + {ScreenSaverExtensionInit, ScreenSaverName, &noScreenSaverExtension}, +#endif +#ifdef DBE + {DbeExtensionInit, "DOUBLE-BUFFER", &noDbeExtension}, +#endif +#ifdef XRECORD + {RecordExtensionInit, "RECORD", &noTestExtensions}, +#endif +#ifdef DPMSExtension + {DPMSExtensionInit, DPMSExtensionName, &noDPMSExtension}, +#endif +#ifdef RES + {ResExtensionInit, XRES_NAME, &noResExtension}, +#endif +#ifdef XV + {XvExtensionInit, XvName, &noXvExtension}, + {XvMCExtensionInit, XvMCName, &noXvExtension}, +#endif +#ifdef XSELINUX + {SELinuxExtensionInit, SELINUX_EXTENSION_NAME, &noSELinuxExtension}, #endif - {NULL, NULL, NULL, NULL, NULL} }; - /*ARGSUSED*/ void +static ExtensionModule *ExtensionModuleList = NULL; +static int numExtensionModules = 0; + +static void +AddStaticExtensions(void) +{ + static Bool listInitialised = FALSE; + int i; + + if (listInitialised) + return; + listInitialised = TRUE; + + /* Add built-in extensions to the list. */ + for (i = 0; i < ARRAY_SIZE(staticExtensions); i++) + LoadExtension(&staticExtensions[i], TRUE); +} + +void InitExtensions(int argc, char *argv[]) { int i; ExtensionModule *ext; - static Bool listInitialised = FALSE; - if (!listInitialised) { - /* Add built-in extensions to the list. */ - for (i = 0; staticExtensions[i].name; i++) - LoadExtension(&staticExtensions[i], TRUE); - - /* Sort the extensions according the init dependencies. */ - LoaderSortExtensions(); - listInitialised = TRUE; - } + AddStaticExtensions(); for (i = 0; ExtensionModuleList[i].name != NULL; i++) { ext = &ExtensionModuleList[i]; @@ -569,4 +339,51 @@ InitExtensions(int argc, char *argv[]) } } -#endif /* XFree86LOADER */ +static ExtensionModule * +NewExtensionModule(void) +{ + ExtensionModule *save = ExtensionModuleList; + int n; + + /* Make sure built-in extensions get added to the list before those + * in modules. */ + AddStaticExtensions(); + + /* Sanity check */ + if (!ExtensionModuleList) + numExtensionModules = 0; + + n = numExtensionModules + 1; + ExtensionModuleList = realloc(ExtensionModuleList, + (n + 1) * sizeof(ExtensionModule)); + if (ExtensionModuleList == NULL) { + ExtensionModuleList = save; + return NULL; + } + else { + numExtensionModules++; + ExtensionModuleList[numExtensionModules].name = NULL; + return ExtensionModuleList + (numExtensionModules - 1); + } +} + +void +LoadExtension(const ExtensionModule * e, Bool builtin) +{ + ExtensionModule *newext; + + if (e == NULL || e->name == NULL) + return; + + if (!(newext = NewExtensionModule())) + return; + + if (builtin) + ErrorF("Initializing built-in extension %s\n", e->name); + else + ErrorF("Loading extension %s\n", e->name); + + newext->name = e->name; + newext->initFunc = e->initFunc; + newext->disablePtr = e->disablePtr; +} diff --git a/xserver/mi/mioverlay.c b/xserver/mi/mioverlay.c index f72159e73..2bfd5e401 100644 --- a/xserver/mi/mioverlay.c +++ b/xserver/mi/mioverlay.c @@ -66,7 +66,7 @@ static Bool HasUnderlayChildren(WindowPtr); static void MarkUnderlayWindow(WindowPtr); static Bool CollectUnderlayChildrenRegions(WindowPtr, RegionPtr); -static Bool miOverlayCloseScreen(int, ScreenPtr); +static Bool miOverlayCloseScreen(ScreenPtr); static Bool miOverlayCreateWindow(WindowPtr); static Bool miOverlayDestroyWindow(WindowPtr); static Bool miOverlayUnrealizeWindow(WindowPtr); @@ -160,7 +160,7 @@ miInitOverlay(ScreenPtr pScreen, } static Bool -miOverlayCloseScreen(int i, ScreenPtr pScreen) +miOverlayCloseScreen(ScreenPtr pScreen) { miOverlayScreenPtr pScreenPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen); @@ -172,7 +172,7 @@ miOverlayCloseScreen(int i, ScreenPtr pScreen) free(pScreenPriv); - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } static Bool diff --git a/xserver/mi/mipointer.c b/xserver/mi/mipointer.c index de6698a37..b8503f450 100644 --- a/xserver/mi/mipointer.c +++ b/xserver/mi/mipointer.c @@ -91,14 +91,14 @@ static void miPointerCursorLimits(DeviceIntPtr pDev, ScreenPtr pScreen, BoxPtr pTopLeftBox); static Bool miPointerSetCursorPosition(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y, Bool generateEvent); -static Bool miPointerCloseScreen(int index, ScreenPtr pScreen); +static Bool miPointerCloseScreen(ScreenPtr pScreen); static void miPointerMove(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y); static Bool miPointerDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen); static void miPointerDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen); static void miPointerMoveNoEvent(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y); -static InternalEvent *events; /* for WarpPointer MotionNotifies */ +static InternalEvent *mipointermove_events; /* for WarpPointer MotionNotifies */ Bool miPointerInitialize(ScreenPtr pScreen, @@ -143,7 +143,7 @@ miPointerInitialize(ScreenPtr pScreen, pScreen->DeviceCursorInitialize = miPointerDeviceInitialize; pScreen->DeviceCursorCleanup = miPointerDeviceCleanup; - events = NULL; + mipointermove_events = NULL; return TRUE; } @@ -154,15 +154,15 @@ miPointerInitialize(ScreenPtr pScreen, * @param pScreen The actual screen pointer */ static Bool -miPointerCloseScreen(int index, ScreenPtr pScreen) +miPointerCloseScreen(ScreenPtr pScreen) { SetupScreen(pScreen); pScreen->CloseScreen = pScreenPriv->CloseScreen; free((pointer) pScreenPriv); - FreeEventList(events, GetMaximumEventsNum()); - events = NULL; - return (*pScreen->CloseScreen) (index, pScreen); + FreeEventList(mipointermove_events, GetMaximumEventsNum()); + mipointermove_events = NULL; + return (*pScreen->CloseScreen) (pScreen); } /* @@ -565,23 +565,21 @@ miPointerMoveNoEvent(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) */ ScreenPtr miPointerSetPosition(DeviceIntPtr pDev, int mode, double *screenx, - double *screeny) + double *screeny, + int *nevents, InternalEvent* events) { miPointerScreenPtr pScreenPriv; ScreenPtr pScreen; ScreenPtr newScreen; int x, y; Bool switch_screen = FALSE; + Bool should_constrain_barriers = FALSE; + int i; miPointerPtr pPointer; - if (!pDev || !pDev->coreEvents) - return NULL; - pPointer = MIPOINTER(pDev); pScreen = pPointer->pScreen; - if (!pScreen) - return NULL; /* called before ready */ x = trunc(*screenx); y = trunc(*screeny); @@ -593,6 +591,25 @@ miPointerSetPosition(DeviceIntPtr pDev, int mode, double *screenx, x -= pScreen->x; y -= pScreen->y; + should_constrain_barriers = (mode == Relative); + + if (should_constrain_barriers) { + /* coordinates after clamped to a barrier */ + int constrained_x, constrained_y; + int current_x, current_y; /* current position in per-screen coord */ + + current_x = MIPOINTER(pDev)->x - pScreen->y; + current_y = MIPOINTER(pDev)->y - pScreen->x; + + input_constrain_cursor(pDev, pScreen, + current_x, current_y, x, y, + &constrained_x, &constrained_y, + nevents, events); + + x = constrained_x; + y = constrained_y; + } + if (switch_screen) { pScreenPriv = GetScreenPrivate(pScreen); if (!pPointer->confined) { @@ -624,6 +641,18 @@ miPointerSetPosition(DeviceIntPtr pDev, int mode, double *screenx, if (pPointer->x != x || pPointer->y != y || pPointer->pScreen != pScreen) miPointerMoveNoEvent(pDev, pScreen, x, y); + /* check if we generated any barrier events and if so, update root x/y + * to the fully constrained coords */ + if (should_constrain_barriers) { + for (i = 0; i < *nevents; i++) { + if (events[i].any.type == ET_BarrierHit || + events[i].any.type == ET_BarrierLeave) { + events[i].barrier_event.root_x = x; + events[i].barrier_event.root_y = y; + } + } + } + /* Convert to desktop coordinates again */ x += pScreen->x; y += pScreen->y; @@ -681,17 +710,17 @@ miPointerMove(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) valuators[0] = x; valuators[1] = y; - if (!events) { - events = InitEventList(GetMaximumEventsNum()); + if (!mipointermove_events) { + mipointermove_events = InitEventList(GetMaximumEventsNum()); - if (!events) { + if (!mipointermove_events) { FatalError("Could not allocate event store.\n"); return; } } valuator_mask_set_range(&mask, 0, 2, valuators); - nevents = GetPointerEvents(events, pDev, MotionNotify, 0, + nevents = GetPointerEvents(mipointermove_events, pDev, MotionNotify, 0, POINTER_SCREEN | POINTER_ABSOLUTE | POINTER_NORAW, &mask); @@ -700,7 +729,7 @@ miPointerMove(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y) darwinEvents_lock(); #endif for (i = 0; i < nevents; i++) - mieqEnqueue(pDev, &events[i]); + mieqEnqueue(pDev, &mipointermove_events[i]); #ifdef XQUARTZ darwinEvents_unlock(); #endif diff --git a/xserver/mi/mipointer.h b/xserver/mi/mipointer.h index 1500e216a..f89dff31e 100644 --- a/xserver/mi/mipointer.h +++ b/xserver/mi/mipointer.h @@ -115,7 +115,8 @@ miPointerGetPosition(DeviceIntPtr pDev, int *x, int *y); /* Moves the cursor to the specified position. May clip the co-ordinates: * x and y are modified in-place. */ extern _X_EXPORT ScreenPtr -miPointerSetPosition(DeviceIntPtr pDev, int mode, double *x, double *y); +miPointerSetPosition(DeviceIntPtr pDev, int mode, double *x, double *y, + int *nevents, InternalEvent *events); extern _X_EXPORT void miPointerUpdateSprite(DeviceIntPtr pDev); diff --git a/xserver/mi/miscrinit.c b/xserver/mi/miscrinit.c index 2850c8d79..4698b532f 100644 --- a/xserver/mi/miscrinit.c +++ b/xserver/mi/miscrinit.c @@ -119,7 +119,7 @@ miModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth, } static Bool -miCloseScreen(int iScreen, ScreenPtr pScreen) +miCloseScreen(ScreenPtr pScreen) { return ((*pScreen->DestroyPixmap) ((PixmapPtr) pScreen->devPrivate)); } @@ -262,8 +262,6 @@ miScreenInit(ScreenPtr pScreen, pointer pbits, /* pointer to screen bits */ pScreen->SendGraphicsExpose = miSendGraphicsExpose; pScreen->BlockHandler = (ScreenBlockHandlerProcPtr) NoopDDA; pScreen->WakeupHandler = (ScreenWakeupHandlerProcPtr) NoopDDA; - pScreen->blockData = (pointer) 0; - pScreen->wakeupData = (pointer) 0; pScreen->MarkWindow = miMarkWindow; pScreen->MarkOverlappedWindows = miMarkOverlappedWindows; pScreen->MoveWindow = miMoveWindow; diff --git a/xserver/mi/mispans.c b/xserver/mi/mispans.c index 0f89880e2..11c8a43d0 100644 --- a/xserver/mi/mispans.c +++ b/xserver/mi/mispans.c @@ -453,8 +453,6 @@ miFillUniqueSpanGroup(DrawablePtr pDraw, GCPtr pGC, SpanGroup * spanGroup) (int *) realloc(newspans->widths, ysizes[index] * sizeof(int)); if (!newpoints || !newwidths) { - int i; - for (i = 0; i < ylength; i++) { free(yspans[i].points); free(yspans[i].widths); @@ -485,8 +483,6 @@ miFillUniqueSpanGroup(DrawablePtr pDraw, GCPtr pGC, SpanGroup * spanGroup) points = malloc(count * sizeof(DDXPointRec)); widths = malloc(count * sizeof(int)); if (!points || !widths) { - int i; - for (i = 0; i < ylength; i++) { free(yspans[i].points); free(yspans[i].widths); diff --git a/xserver/mi/misprite.c b/xserver/mi/misprite.c index c9fcabcab..97bbf8ef5 100644 --- a/xserver/mi/misprite.c +++ b/xserver/mi/misprite.c @@ -191,7 +191,7 @@ static DevPrivateKeyRec miSpriteDevPrivatesKeyRec; #define miSpriteDevPrivatesKey (&miSpriteDevPrivatesKeyRec) -static Bool miSpriteCloseScreen(int i, ScreenPtr pScreen); +static Bool miSpriteCloseScreen(ScreenPtr pScreen); static void miSpriteGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h, unsigned int format, unsigned long planemask, char *pdstLine); @@ -203,7 +203,7 @@ static void miSpriteSourceValidate(DrawablePtr pDrawable, int x, int y, unsigned int subWindowMode); static void miSpriteCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc); -static void miSpriteBlockHandler(int i, pointer blockData, +static void miSpriteBlockHandler(ScreenPtr pScreen, pointer pTimeout, pointer pReadMask); static void miSpriteInstallColormap(ColormapPtr pMap); static void miSpriteStoreColors(ColormapPtr pMap, int ndef, xColorItem * pdef); @@ -367,7 +367,7 @@ miSpriteInitialize(ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs) */ static Bool -miSpriteCloseScreen(int i, ScreenPtr pScreen) +miSpriteCloseScreen(ScreenPtr pScreen) { miSpriteScreenPtr pScreenPriv = GetSpriteScreen(pScreen); @@ -382,7 +382,7 @@ miSpriteCloseScreen(int i, ScreenPtr pScreen) free(pScreenPriv); - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } static void @@ -520,10 +520,9 @@ miSpriteCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc) } static void -miSpriteBlockHandler(int i, pointer blockData, pointer pTimeout, +miSpriteBlockHandler(ScreenPtr pScreen, pointer pTimeout, pointer pReadmask) { - ScreenPtr pScreen = screenInfo.screens[i]; miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen); DeviceIntPtr pDev; miCursorInfoPtr pCursorInfo; @@ -554,7 +553,7 @@ miSpriteBlockHandler(int i, pointer blockData, pointer pTimeout, SCREEN_PROLOGUE(pPriv, pScreen, BlockHandler); - (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask); + (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); if (WorkToDo) SCREEN_EPILOGUE(pPriv, pScreen, BlockHandler); diff --git a/xserver/miext/Makefile.am b/xserver/miext/Makefile.am index bbedac2b5..b84adc12b 100644 --- a/xserver/miext/Makefile.am +++ b/xserver/miext/Makefile.am @@ -1,11 +1,8 @@ SUBDIRS = sync damage shadow -if COMPOSITE -SUBDIRS += cw -endif if XQUARTZ SUBDIRS += rootless endif if XWIN_MULTIWINDOWEXTWM SUBDIRS += rootless endif -DIST_SUBDIRS = sync damage shadow cw rootless +DIST_SUBDIRS = sync damage shadow rootless diff --git a/xserver/miext/Makefile.in b/xserver/miext/Makefile.in index 1f4cc347b..bf26112c8 100644 --- a/xserver/miext/Makefile.in +++ b/xserver/miext/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -49,9 +49,8 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -@COMPOSITE_TRUE@am__append_1 = cw -@XQUARTZ_TRUE@am__append_2 = rootless -@XWIN_MULTIWINDOWEXTWM_TRUE@am__append_3 = rootless +@XQUARTZ_TRUE@am__append_1 = rootless +@XWIN_MULTIWINDOWEXTWM_TRUE@am__append_2 = rootless subdir = miext DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 @@ -189,13 +188,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -217,6 +212,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -241,6 +237,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -256,7 +253,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -355,6 +351,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -454,13 +451,12 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = sync damage shadow $(am__append_1) $(am__append_2) \ - $(am__append_3) -DIST_SUBDIRS = sync damage shadow cw rootless +SUBDIRS = sync damage shadow $(am__append_1) $(am__append_2) +DIST_SUBDIRS = sync damage shadow rootless all: all-recursive .SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -485,9 +481,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/miext/cw/Makefile.am b/xserver/miext/cw/Makefile.am deleted file mode 100644 index e056f4279..000000000 --- a/xserver/miext/cw/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -noinst_LTLIBRARIES = libcw.la - -AM_CFLAGS = $(DIX_CFLAGS) - -INCLUDES = -I$(top_srcdir)/hw/xfree86/os-support - -libcw_la_SOURCES = \ - cw.c \ - cw_ops.c \ - cw_render.c \ - cw.h diff --git a/xserver/miext/cw/Makefile.in b/xserver/miext/cw/Makefile.in deleted file mode 100644 index 290585669..000000000 --- a/xserver/miext/cw/Makefile.in +++ /dev/null @@ -1,763 +0,0 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. -# @configure_input@ - -# Copyright (C) 1994-2012 Free Software Foundation, Inc. - -# This Makefile.in is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -@SET_MAKE@ - -VPATH = @srcdir@ -am__make_dryrun = \ - { \ - am__dry=no; \ - case $$MAKEFLAGS in \ - *\\[\ \ ]*) \ - echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ - | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ - *) \ - for am__flg in $$MAKEFLAGS; do \ - case $$am__flg in \ - *=*|--*) ;; \ - *n*) am__dry=yes; break;; \ - esac; \ - done;; \ - esac; \ - test $$am__dry = yes; \ - } -pkgdatadir = $(datadir)/@PACKAGE@ -pkgincludedir = $(includedir)/@PACKAGE@ -pkglibdir = $(libdir)/@PACKAGE@ -pkglibexecdir = $(libexecdir)/@PACKAGE@ -am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd -install_sh_DATA = $(install_sh) -c -m 644 -install_sh_PROGRAM = $(install_sh) -c -install_sh_SCRIPT = $(install_sh) -c -INSTALL_HEADER = $(INSTALL_DATA) -transform = $(program_transform_name) -NORMAL_INSTALL = : -PRE_INSTALL = : -POST_INSTALL = : -NORMAL_UNINSTALL = : -PRE_UNINSTALL = : -POST_UNINSTALL = : -build_triplet = @build@ -host_triplet = @host@ -subdir = miext/cw -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ - $(top_srcdir)/depcomp -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/xorg-tls.m4 \ - $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/include/do-not-use-config.h \ - $(top_builddir)/include/xorg-server.h \ - $(top_builddir)/include/dix-config.h \ - $(top_builddir)/include/xorg-config.h \ - $(top_builddir)/include/xkb-config.h \ - $(top_builddir)/include/xwin-config.h \ - $(top_builddir)/include/kdrive-config.h \ - $(top_builddir)/include/version-config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = -LTLIBRARIES = $(noinst_LTLIBRARIES) -libcw_la_LIBADD = -am_libcw_la_OBJECTS = cw.lo cw_ops.lo cw_render.lo -libcw_la_OBJECTS = $(am_libcw_la_OBJECTS) -AM_V_lt = $(am__v_lt_@AM_V@) -am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) -am__v_lt_0 = --silent -am__v_lt_1 = -AM_V_P = $(am__v_P_@AM_V@) -am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) -am__v_P_0 = false -am__v_P_1 = : -AM_V_GEN = $(am__v_GEN_@AM_V@) -am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) -am__v_GEN_0 = @echo " GEN " $@; -am__v_GEN_1 = -AM_V_at = $(am__v_at_@AM_V@) -am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) -am__v_at_0 = @ -am__v_at_1 = -DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include -depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles -am__mv = mv -f -COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ - $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ - $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ - $(AM_CFLAGS) $(CFLAGS) -AM_V_CC = $(am__v_CC_@AM_V@) -am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) -am__v_CC_0 = @echo " CC " $@; -am__v_CC_1 = -CCLD = $(CC) -LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(AM_LDFLAGS) $(LDFLAGS) -o $@ -AM_V_CCLD = $(am__v_CCLD_@AM_V@) -am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) -am__v_CCLD_0 = @echo " CCLD " $@; -am__v_CCLD_1 = -SOURCES = $(libcw_la_SOURCES) -DIST_SOURCES = $(libcw_la_SOURCES) -am__can_run_installinfo = \ - case $$AM_UPDATE_INFO_DIR in \ - n|no|NO) false;; \ - *) (install-info --version) >/dev/null 2>&1;; \ - esac -ETAGS = etags -CTAGS = ctags -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -ACLOCAL = @ACLOCAL@ -ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ -ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ -AMTAR = @AMTAR@ -AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ -APPLE_APPLICATIONS_DIR = @APPLE_APPLICATIONS_DIR@ -APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ -APP_MAN_DIR = @APP_MAN_DIR@ -APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ -AR = @AR@ -AS = @AS@ -AUTOCONF = @AUTOCONF@ -AUTOHEADER = @AUTOHEADER@ -AUTOMAKE = @AUTOMAKE@ -AWK = @AWK@ -BASE_CFLAGS = @BASE_CFLAGS@ -BASE_FONT_PATH = @BASE_FONT_PATH@ -BUILD_DATE = @BUILD_DATE@ -BUILD_TIME = @BUILD_TIME@ -BUNDLE_ID_PREFIX = @BUNDLE_ID_PREFIX@ -CC = @CC@ -CCAS = @CCAS@ -CCASDEPMODE = @CCASDEPMODE@ -CCASFLAGS = @CCASFLAGS@ -CCDEPMODE = @CCDEPMODE@ -CFLAGS = @CFLAGS@ -CHANGELOG_CMD = @CHANGELOG_CMD@ -COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CWARNFLAGS = @CWARNFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_LIBS = @DBUS_LIBS@ -DEFAULT_LIBRARY_PATH = @DEFAULT_LIBRARY_PATH@ -DEFAULT_LOGDIR = @DEFAULT_LOGDIR@ -DEFAULT_LOGPREFIX = @DEFAULT_LOGPREFIX@ -DEFAULT_MODULE_PATH = @DEFAULT_MODULE_PATH@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DGA_CFLAGS = @DGA_CFLAGS@ -DGA_LIBS = @DGA_LIBS@ -DIX_CFLAGS = @DIX_CFLAGS@ -DIX_LIB = @DIX_LIB@ -DLLTOOL = @DLLTOOL@ -DLOPEN_LIBS = @DLOPEN_LIBS@ -DMXEXAMPLES_DEP_CFLAGS = @DMXEXAMPLES_DEP_CFLAGS@ -DMXEXAMPLES_DEP_LIBS = @DMXEXAMPLES_DEP_LIBS@ -DMXMODULES_CFLAGS = @DMXMODULES_CFLAGS@ -DMXMODULES_LIBS = @DMXMODULES_LIBS@ -DMXXIEXAMPLES_DEP_CFLAGS = @DMXXIEXAMPLES_DEP_CFLAGS@ -DMXXIEXAMPLES_DEP_LIBS = @DMXXIEXAMPLES_DEP_LIBS@ -DMXXMUEXAMPLES_DEP_CFLAGS = @DMXXMUEXAMPLES_DEP_CFLAGS@ -DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ -DOXYGEN = @DOXYGEN@ -DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ -DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ -DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ -DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ -DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ -DSYMUTIL = @DSYMUTIL@ -DTRACE = @DTRACE@ -DUMPBIN = @DUMPBIN@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -FGREP = @FGREP@ -FILE_MAN_DIR = @FILE_MAN_DIR@ -FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ -FONT100DPIDIR = @FONT100DPIDIR@ -FONT75DPIDIR = @FONT75DPIDIR@ -FONTMISCDIR = @FONTMISCDIR@ -FONTOTFDIR = @FONTOTFDIR@ -FONTROOTDIR = @FONTROOTDIR@ -FONTTTFDIR = @FONTTTFDIR@ -FONTTYPE1DIR = @FONTTYPE1DIR@ -FOP = @FOP@ -GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ -GLX_DEFINES = @GLX_DEFINES@ -GLX_TLS = @GLX_TLS@ -GL_CFLAGS = @GL_CFLAGS@ -GL_LIBS = @GL_LIBS@ -GREP = @GREP@ -HAL_CFLAGS = @HAL_CFLAGS@ -HAL_LIBS = @HAL_LIBS@ -INSTALL = @INSTALL@ -INSTALL_CMD = @INSTALL_CMD@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -KDRIVE_CFLAGS = @KDRIVE_CFLAGS@ -KDRIVE_INCS = @KDRIVE_INCS@ -KDRIVE_LIBS = @KDRIVE_LIBS@ -KDRIVE_LOCAL_LIBS = @KDRIVE_LOCAL_LIBS@ -KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ -KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ -KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ -KHRONOS_OPENGL_REGISTRY_LIBS = @KHRONOS_OPENGL_REGISTRY_LIBS@ -KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ -LD = @LD@ -LDFLAGS = @LDFLAGS@ -LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ -LEX = @LEX@ -LEXLIB = @LEXLIB@ -LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ -LIBDRM_CFLAGS = @LIBDRM_CFLAGS@ -LIBDRM_LIBS = @LIBDRM_LIBS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBSHA1_CFLAGS = @LIBSHA1_CFLAGS@ -LIBSHA1_LIBS = @LIBSHA1_LIBS@ -LIBTOOL = @LIBTOOL@ -LIB_MAN_DIR = @LIB_MAN_DIR@ -LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ -LIPO = @LIPO@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ -MAIN_LIB = @MAIN_LIB@ -MAKEINFO = @MAKEINFO@ -MANIFEST_TOOL = @MANIFEST_TOOL@ -MAN_SUBSTS = @MAN_SUBSTS@ -MISC_MAN_DIR = @MISC_MAN_DIR@ -MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ -MKDIR_P = @MKDIR_P@ -NM = @NM@ -NMEDIT = @NMEDIT@ -OBJC = @OBJC@ -OBJCCLD = @OBJCCLD@ -OBJCDEPMODE = @OBJCDEPMODE@ -OBJCFLAGS = @OBJCFLAGS@ -OBJCLINK = @OBJCLINK@ -OBJDUMP = @OBJDUMP@ -OBJEXT = @OBJEXT@ -OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ -OPENSSL_LIBS = @OPENSSL_LIBS@ -OS_LIB = @OS_LIB@ -OTOOL = @OTOOL@ -OTOOL64 = @OTOOL64@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_URL = @PACKAGE_URL@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ -PCIACCESS_LIBS = @PCIACCESS_LIBS@ -PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@ -PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ -PIXMAN_LIBS = @PIXMAN_LIBS@ -PKG_CONFIG = @PKG_CONFIG@ -PROJECTROOT = @PROJECTROOT@ -RANLIB = @RANLIB@ -RAWCPP = @RAWCPP@ -RAWCPPFLAGS = @RAWCPPFLAGS@ -RELEASE_DATE = @RELEASE_DATE@ -SDK_REQUIRED_MODULES = @SDK_REQUIRED_MODULES@ -SED = @SED@ -SELINUX_CFLAGS = @SELINUX_CFLAGS@ -SELINUX_LIBS = @SELINUX_LIBS@ -SERVER_MISC_CONFIG_PATH = @SERVER_MISC_CONFIG_PATH@ -SET_MAKE = @SET_MAKE@ -SHA1_CFLAGS = @SHA1_CFLAGS@ -SHA1_LIBS = @SHA1_LIBS@ -SHELL = @SHELL@ -SOLARIS_ASM_CFLAGS = @SOLARIS_ASM_CFLAGS@ -SOLARIS_INOUT_ARCH = @SOLARIS_INOUT_ARCH@ -STRICT_CFLAGS = @STRICT_CFLAGS@ -STRIP = @STRIP@ -STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ -SYSCONFDIR = @SYSCONFDIR@ -TSLIB_CFLAGS = @TSLIB_CFLAGS@ -TSLIB_LIBS = @TSLIB_LIBS@ -UDEV_CFLAGS = @UDEV_CFLAGS@ -UDEV_LIBS = @UDEV_LIBS@ -UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ -VENDOR_NAME_SHORT = @VENDOR_NAME_SHORT@ -VERSION = @VERSION@ -WINDOWSWM_CFLAGS = @WINDOWSWM_CFLAGS@ -WINDOWSWM_LIBS = @WINDOWSWM_LIBS@ -WINDRES = @WINDRES@ -X11EXAMPLES_DEP_CFLAGS = @X11EXAMPLES_DEP_CFLAGS@ -X11EXAMPLES_DEP_LIBS = @X11EXAMPLES_DEP_LIBS@ -XDMCP_CFLAGS = @XDMCP_CFLAGS@ -XDMCP_LIBS = @XDMCP_LIBS@ -XDMXCONFIG_DEP_CFLAGS = @XDMXCONFIG_DEP_CFLAGS@ -XDMXCONFIG_DEP_LIBS = @XDMXCONFIG_DEP_LIBS@ -XDMX_CFLAGS = @XDMX_CFLAGS@ -XDMX_LIBS = @XDMX_LIBS@ -XDMX_SYS_LIBS = @XDMX_SYS_LIBS@ -XEPHYR_CFLAGS = @XEPHYR_CFLAGS@ -XEPHYR_INCS = @XEPHYR_INCS@ -XEPHYR_LIBS = @XEPHYR_LIBS@ -XF86CONFIGDIR = @XF86CONFIGDIR@ -XF86CONFIGFILE = @XF86CONFIGFILE@ -XF86VIDMODE_CFLAGS = @XF86VIDMODE_CFLAGS@ -XF86VIDMODE_LIBS = @XF86VIDMODE_LIBS@ -XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@ -XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@ -XKB_COMPILED_DIR = @XKB_COMPILED_DIR@ -XKB_DFLT_LAYOUT = @XKB_DFLT_LAYOUT@ -XKB_DFLT_MODEL = @XKB_DFLT_MODEL@ -XKB_DFLT_OPTIONS = @XKB_DFLT_OPTIONS@ -XKB_DFLT_RULES = @XKB_DFLT_RULES@ -XKB_DFLT_VARIANT = @XKB_DFLT_VARIANT@ -XKM_OUTPUT_DIR = @XKM_OUTPUT_DIR@ -XLIB_CFLAGS = @XLIB_CFLAGS@ -XLIB_LIBS = @XLIB_LIBS@ -XMLTO = @XMLTO@ -XNESTMODULES_CFLAGS = @XNESTMODULES_CFLAGS@ -XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ -XNEST_LIBS = @XNEST_LIBS@ -XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ -XORG_CFLAGS = @XORG_CFLAGS@ -XORG_INCS = @XORG_INCS@ -XORG_LIBS = @XORG_LIBS@ -XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ -XORG_MAN_PAGE = @XORG_MAN_PAGE@ -XORG_MODULES_CFLAGS = @XORG_MODULES_CFLAGS@ -XORG_MODULES_LIBS = @XORG_MODULES_LIBS@ -XORG_OS_SUBDIR = @XORG_OS_SUBDIR@ -XORG_SGML_PATH = @XORG_SGML_PATH@ -XORG_SYS_LIBS = @XORG_SYS_LIBS@ -XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ -XPBPROXY_LIBS = @XPBPROXY_LIBS@ -XQUARTZ_LIBS = @XQUARTZ_LIBS@ -XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@ -XRESEXAMPLES_DEP_CFLAGS = @XRESEXAMPLES_DEP_CFLAGS@ -XRESEXAMPLES_DEP_LIBS = @XRESEXAMPLES_DEP_LIBS@ -XSERVERCFLAGS_CFLAGS = @XSERVERCFLAGS_CFLAGS@ -XSERVERCFLAGS_LIBS = @XSERVERCFLAGS_LIBS@ -XSERVERLIBS_CFLAGS = @XSERVERLIBS_CFLAGS@ -XSERVERLIBS_LIBS = @XSERVERLIBS_LIBS@ -XSERVER_LIBS = @XSERVER_LIBS@ -XSERVER_SYS_LIBS = @XSERVER_SYS_LIBS@ -XSLTPROC = @XSLTPROC@ -XSL_STYLESHEET = @XSL_STYLESHEET@ -XTSTEXAMPLES_DEP_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@ -XTSTEXAMPLES_DEP_LIBS = @XTSTEXAMPLES_DEP_LIBS@ -XVFB_LIBS = @XVFB_LIBS@ -XVFB_SYS_LIBS = @XVFB_SYS_LIBS@ -XWINMODULES_CFLAGS = @XWINMODULES_CFLAGS@ -XWINMODULES_LIBS = @XWINMODULES_LIBS@ -XWIN_LIBS = @XWIN_LIBS@ -XWIN_SERVER_NAME = @XWIN_SERVER_NAME@ -XWIN_SYS_LIBS = @XWIN_SYS_LIBS@ -YACC = @YACC@ -YFLAGS = @YFLAGS@ -__XCONFIGDIR__ = @__XCONFIGDIR__@ -__XCONFIGFILE__ = @__XCONFIGFILE__@ -abi_ansic = @abi_ansic@ -abi_extension = @abi_extension@ -abi_videodrv = @abi_videodrv@ -abi_xinput = @abi_xinput@ -abs_builddir = @abs_builddir@ -abs_srcdir = @abs_srcdir@ -abs_top_builddir = @abs_top_builddir@ -abs_top_srcdir = @abs_top_srcdir@ -ac_ct_AR = @ac_ct_AR@ -ac_ct_CC = @ac_ct_CC@ -ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ -am__include = @am__include@ -am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ -am__tar = @am__tar@ -am__untar = @am__untar@ -bindir = @bindir@ -build = @build@ -build_alias = @build_alias@ -build_cpu = @build_cpu@ -build_os = @build_os@ -build_vendor = @build_vendor@ -builddir = @builddir@ -datadir = @datadir@ -datarootdir = @datarootdir@ -docdir = @docdir@ -driverdir = @driverdir@ -dvidir = @dvidir@ -exec_prefix = @exec_prefix@ -extdir = @extdir@ -host = @host@ -host_alias = @host_alias@ -host_cpu = @host_cpu@ -host_os = @host_os@ -host_vendor = @host_vendor@ -htmldir = @htmldir@ -includedir = @includedir@ -infodir = @infodir@ -install_sh = @install_sh@ -libdir = @libdir@ -libexecdir = @libexecdir@ -localedir = @localedir@ -localstatedir = @localstatedir@ -logdir = @logdir@ -mandir = @mandir@ -mkdir_p = @mkdir_p@ -moduledir = @moduledir@ -oldincludedir = @oldincludedir@ -pdfdir = @pdfdir@ -prefix = @prefix@ -program_transform_name = @program_transform_name@ -psdir = @psdir@ -sbindir = @sbindir@ -sdkdir = @sdkdir@ -sharedstatedir = @sharedstatedir@ -srcdir = @srcdir@ -symbol_visibility = @symbol_visibility@ -sysconfdir = @sysconfdir@ -sysconfigdir = @sysconfigdir@ -target_alias = @target_alias@ -top_build_prefix = @top_build_prefix@ -top_builddir = @top_builddir@ -top_srcdir = @top_srcdir@ -noinst_LTLIBRARIES = libcw.la -AM_CFLAGS = $(DIX_CFLAGS) -INCLUDES = -I$(top_srcdir)/hw/xfree86/os-support -libcw_la_SOURCES = \ - cw.c \ - cw_ops.c \ - cw_render.c \ - cw.h - -all: all-am - -.SUFFIXES: -.SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) - @for dep in $?; do \ - case '$(am__configure_deps)' in \ - *$$dep*) \ - ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ - && { if test -f $@; then exit 0; else break; fi; }; \ - exit 1;; \ - esac; \ - done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign miext/cw/Makefile'; \ - $(am__cd) $(top_srcdir) && \ - $(AUTOMAKE) --foreign miext/cw/Makefile -.PRECIOUS: Makefile -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - @case '$?' in \ - *config.status*) \ - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ - *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ - esac; - -$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh - -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) - cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(am__aclocal_m4_deps): - -clean-noinstLTLIBRARIES: - -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) - @list='$(noinst_LTLIBRARIES)'; \ - locs=`for p in $$list; do echo $$p; done | \ - sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ - sort -u`; \ - test -z "$$locs" || { \ - echo rm -f $${locs}; \ - rm -f $${locs}; \ - } -libcw.la: $(libcw_la_OBJECTS) $(libcw_la_DEPENDENCIES) $(EXTRA_libcw_la_DEPENDENCIES) - $(AM_V_CCLD)$(LINK) $(libcw_la_OBJECTS) $(libcw_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cw.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cw_ops.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cw_render.Plo@am__quote@ - -.c.o: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< - -.c.obj: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` - -.c.lo: -@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - set x; \ - here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - shift; \ - if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ - test -n "$$unique" || unique=$$empty_fix; \ - if test $$# -gt 0; then \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - "$$@" $$unique; \ - else \ - $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ - $$unique; \ - fi; \ - fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - test -z "$(CTAGS_ARGS)$$unique" \ - || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ - $$unique - -GTAGS: - here=`$(am__cd) $(top_builddir) && pwd` \ - && $(am__cd) $(top_srcdir) \ - && gtags -i $(GTAGS_ARGS) "$$here" - -cscopelist: $(HEADERS) $(SOURCES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP)'; \ - case "$(srcdir)" in \ - [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ - *) sdir=$(subdir)/$(srcdir) ;; \ - esac; \ - for i in $$list; do \ - if test -f "$$i"; then \ - echo "$(subdir)/$$i"; \ - else \ - echo "$$sdir/$$i"; \ - fi; \ - done >> $(top_builddir)/cscope.files - -distclean-tags: - -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags - -distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ - list='$(DISTFILES)'; \ - dist_files=`for file in $$list; do echo $$file; done | \ - sed -e "s|^$$srcdirstrip/||;t" \ - -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ - case $$dist_files in \ - */*) $(MKDIR_P) `echo "$$dist_files" | \ - sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ - sort -u` ;; \ - esac; \ - for file in $$dist_files; do \ - if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ - dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ - if test -d "$(distdir)/$$file"; then \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ - cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ - find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ - fi; \ - cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ - else \ - test -f "$(distdir)/$$file" \ - || cp -p $$d/$$file "$(distdir)/$$file" \ - || exit 1; \ - fi; \ - done -check-am: all-am -check: check-am -all-am: Makefile $(LTLIBRARIES) -installdirs: -install: install-am -install-exec: install-exec-am -install-data: install-data-am -uninstall: uninstall-am - -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am - -installcheck: installcheck-am -install-strip: - if test -z '$(STRIP)'; then \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - install; \ - else \ - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ - fi -mostlyclean-generic: - -clean-generic: - -distclean-generic: - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -maintainer-clean-generic: - @echo "This command is intended for maintainers to use" - @echo "it deletes files that may require special tools to rebuild." -clean: clean-am - -clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \ - mostlyclean-am - -distclean: distclean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile distclean-generic \ - distclean-tags - -dvi: dvi-am - -dvi-am: - -html: html-am - -html-am: - -info: info-am - -info-am: - -install-data-am: - -install-dvi: install-dvi-am - -install-dvi-am: - -install-exec-am: - -install-html: install-html-am - -install-html-am: - -install-info: install-info-am - -install-info-am: - -install-man: - -install-pdf: install-pdf-am - -install-pdf-am: - -install-ps: install-ps-am - -install-ps-am: - -installcheck-am: - -maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-am - -mostlyclean-am: mostlyclean-compile mostlyclean-generic \ - mostlyclean-libtool - -pdf: pdf-am - -pdf-am: - -ps: ps-am - -ps-am: - -uninstall-am: - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstLTLIBRARIES cscopelist ctags \ - distclean distclean-compile distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-compile \ - mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - tags uninstall uninstall-am - - -# Tell versions [3.59,3.63) of GNU make to not export all variables. -# Otherwise a system limit (for SysV at least) may be exceeded. -.NOEXPORT: diff --git a/xserver/miext/cw/cw.c b/xserver/miext/cw/cw.c deleted file mode 100644 index 87ced2f6a..000000000 --- a/xserver/miext/cw/cw.c +++ /dev/null @@ -1,524 +0,0 @@ -/* - * Copyright © 2004 Eric Anholt - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Eric Anholt not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Eric Anholt makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * ERIC ANHOLT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL ERIC ANHOLT BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include - -#include "gcstruct.h" -#include "windowstr.h" -#include "cw.h" - -#define CW_DEBUG 1 - -#if CW_DEBUG -#define CW_ASSERT(x) do { \ - if (!(x)) { \ - ErrorF("composite wrapper: assertion failed at %s:%d\n", __FUNC__, \ - __LINE__); \ - } \ -} while (0) -#else -#define CW_ASSERT(x) do {} while (0) -#endif - -DevPrivateKeyRec cwGCKeyRec; -DevPrivateKeyRec cwScreenKeyRec; -DevPrivateKeyRec cwWindowKeyRec; -DevPrivateKeyRec cwPictureKeyRec; - -extern GCOps cwGCOps; - -static Bool - cwCloseScreen(int i, ScreenPtr pScreen); - -static void - cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable); -static void - cwChangeGC(GCPtr pGC, unsigned long mask); -static void - cwCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst); -static void - cwDestroyGC(GCPtr pGC); -static void - cwChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects); -static void - cwCopyClip(GCPtr pgcDst, GCPtr pgcSrc); -static void - cwDestroyClip(GCPtr pGC); - -GCFuncs cwGCFuncs = { - cwValidateGC, - cwChangeGC, - cwCopyGC, - cwDestroyGC, - cwChangeClip, - cwDestroyClip, - cwCopyClip, -}; - -/* Find the real drawable to draw to, and provide offsets that will translate - * window coordinates to backing pixmap coordinates. - */ -DrawablePtr -cwGetBackingDrawable(DrawablePtr pDrawable, int *x_off, int *y_off) -{ - PixmapPtr pPixmap; - - if (pDrawable->type == DRAWABLE_WINDOW && - (pPixmap = getCwPixmap((WindowPtr) pDrawable))) { - *x_off = pDrawable->x - pPixmap->screen_x; - *y_off = pDrawable->y - pPixmap->screen_y; - return &pPixmap->drawable; - } - else { - *x_off = *y_off = 0; - return pDrawable; - } -} - -#define FUNC_PROLOGUE(pGC, pPriv) do { \ - (pGC)->funcs = (pPriv)->wrapFuncs; \ - (pGC)->ops = (pPriv)->wrapOps; \ -} while (0) - -#define FUNC_EPILOGUE(pGC, pPriv) do { \ - (pPriv)->wrapFuncs = (pGC)->funcs; \ - (pPriv)->wrapOps = (pGC)->ops; \ - (pGC)->funcs = &cwGCFuncs; \ - (pGC)->ops = &cwGCOps; \ -} while (0) - -static Bool -cwCreateBackingGC(GCPtr pGC, DrawablePtr pDrawable) -{ - cwGCRec *pPriv = getCwGC(pGC); - int status, x_off, y_off; - XID noexpose = xFalse; - DrawablePtr pBackingDrawable; - - pBackingDrawable = cwGetBackingDrawable(pDrawable, &x_off, &y_off); - pPriv->pBackingGC = CreateGC(pBackingDrawable, GCGraphicsExposures, - &noexpose, &status, (XID) 0, serverClient); - if (status != Success) - return FALSE; - - pPriv->serialNumber = 0; - pPriv->stateChanges = GCAllBits; - - return TRUE; -} - -static void -cwDestroyBackingGC(GCPtr pGC) -{ - cwGCPtr pPriv; - - pPriv = (cwGCPtr) getCwGC(pGC); - - if (pPriv->pBackingGC) { - FreeGC(pPriv->pBackingGC, (XID) 0); - pPriv->pBackingGC = NULL; - } -} - -static void -cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable) -{ - GCPtr pBackingGC; - cwGCPtr pPriv; - DrawablePtr pBackingDrawable; - int x_off, y_off; - - pPriv = (cwGCPtr) getCwGC(pGC); - - FUNC_PROLOGUE(pGC, pPriv); - - /* - * Must call ValidateGC to ensure pGC->pCompositeClip is valid - */ - (*pGC->funcs->ValidateGC) (pGC, stateChanges, pDrawable); - - if (!cwDrawableIsRedirWindow(pDrawable)) { - cwDestroyBackingGC(pGC); - FUNC_EPILOGUE(pGC, pPriv); - return; - } - else { - if (!pPriv->pBackingGC && !cwCreateBackingGC(pGC, pDrawable)) { - FUNC_EPILOGUE(pGC, pPriv); - return; - } - } - - pBackingGC = pPriv->pBackingGC; - pBackingDrawable = cwGetBackingDrawable(pDrawable, &x_off, &y_off); - - pPriv->stateChanges |= stateChanges; - - /* - * Copy the composite clip into the backing GC if either - * the drawable clip list has changed or the client has changed - * the client clip data - */ - if (pDrawable->serialNumber != pPriv->serialNumber || - (pPriv->stateChanges & (GCClipXOrigin | GCClipYOrigin | GCClipMask))) { - ChangeGCVal vals[2]; - RegionPtr pCompositeClip; - - pCompositeClip = RegionCreate(NULL, 0); - RegionCopy(pCompositeClip, pGC->pCompositeClip); - - /* Either the drawable has changed, or the clip list in the drawable has - * changed. Copy the new clip list over and set the new translated - * offset for it. - */ - - (*pBackingGC->funcs->ChangeClip) (pBackingGC, CT_REGION, - (pointer) pCompositeClip, 0); - - vals[0].val = x_off - pDrawable->x; - vals[1].val = y_off - pDrawable->y; - ChangeGC(NullClient, pBackingGC, (GCClipXOrigin | GCClipYOrigin), vals); - - pPriv->serialNumber = pDrawable->serialNumber; - /* - * Mask off any client clip changes to make sure - * the clip list set above remains in effect - */ - pPriv->stateChanges &= ~(GCClipXOrigin | GCClipYOrigin | GCClipMask); - } - - if (pPriv->stateChanges) { - CopyGC(pGC, pBackingGC, pPriv->stateChanges); - pPriv->stateChanges = 0; - } - - if ((pGC->patOrg.x + x_off) != pBackingGC->patOrg.x || - (pGC->patOrg.y + y_off) != pBackingGC->patOrg.y) { - ChangeGCVal vals[2]; - - vals[0].val = pGC->patOrg.x + x_off; - vals[1].val = pGC->patOrg.y + y_off; - ChangeGC(NullClient, pBackingGC, - (GCTileStipXOrigin | GCTileStipYOrigin), vals); - } - - ValidateGC(pBackingDrawable, pBackingGC); - - FUNC_EPILOGUE(pGC, pPriv); -} - -static void -cwChangeGC(GCPtr pGC, unsigned long mask) -{ - cwGCPtr pPriv = (cwGCPtr) dixLookupPrivate(&pGC->devPrivates, cwGCKey); - - FUNC_PROLOGUE(pGC, pPriv); - - (*pGC->funcs->ChangeGC) (pGC, mask); - - FUNC_EPILOGUE(pGC, pPriv); -} - -static void -cwCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst) -{ - cwGCPtr pPriv = (cwGCPtr) dixLookupPrivate(&pGCDst->devPrivates, cwGCKey); - - FUNC_PROLOGUE(pGCDst, pPriv); - - (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst); - - FUNC_EPILOGUE(pGCDst, pPriv); -} - -static void -cwDestroyGC(GCPtr pGC) -{ - cwGCPtr pPriv = (cwGCPtr) dixLookupPrivate(&pGC->devPrivates, cwGCKey); - - FUNC_PROLOGUE(pGC, pPriv); - - cwDestroyBackingGC(pGC); - - (*pGC->funcs->DestroyGC) (pGC); - - /* leave it unwrapped */ -} - -static void -cwChangeClip(GCPtr pGC, int type, pointer pvalue, int nrects) -{ - cwGCPtr pPriv = (cwGCPtr) dixLookupPrivate(&pGC->devPrivates, cwGCKey); - - FUNC_PROLOGUE(pGC, pPriv); - - (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects); - - FUNC_EPILOGUE(pGC, pPriv); -} - -static void -cwCopyClip(GCPtr pgcDst, GCPtr pgcSrc) -{ - cwGCPtr pPriv = (cwGCPtr) dixLookupPrivate(&pgcDst->devPrivates, cwGCKey); - - FUNC_PROLOGUE(pgcDst, pPriv); - - (*pgcDst->funcs->CopyClip) (pgcDst, pgcSrc); - - FUNC_EPILOGUE(pgcDst, pPriv); -} - -static void -cwDestroyClip(GCPtr pGC) -{ - cwGCPtr pPriv = (cwGCPtr) dixLookupPrivate(&pGC->devPrivates, cwGCKey); - - FUNC_PROLOGUE(pGC, pPriv); - - (*pGC->funcs->DestroyClip) (pGC); - - FUNC_EPILOGUE(pGC, pPriv); -} - -/* - * Screen wrappers. - */ - -#define SCREEN_PROLOGUE(pScreen, field) \ - ((pScreen)->field = getCwScreen(pScreen)->field) - -#define SCREEN_EPILOGUE(pScreen, field, wrapper) do { \ - getCwScreen(pScreen)->field = (pScreen)->field; \ - (pScreen)->field = (wrapper); \ -} while (0) - -static Bool -cwCreateGC(GCPtr pGC) -{ - cwGCPtr pPriv = getCwGC(pGC); - ScreenPtr pScreen = pGC->pScreen; - Bool ret; - - SCREEN_PROLOGUE(pScreen, CreateGC); - - if ((ret = (*pScreen->CreateGC) (pGC))) - FUNC_EPILOGUE(pGC, pPriv); - - SCREEN_EPILOGUE(pScreen, CreateGC, cwCreateGC); - - return ret; -} - -static void -cwGetImage(DrawablePtr pSrc, int x, int y, int w, int h, unsigned int format, - unsigned long planemask, char *pdstLine) -{ - ScreenPtr pScreen = pSrc->pScreen; - DrawablePtr pBackingDrawable; - int src_off_x, src_off_y; - - SCREEN_PROLOGUE(pScreen, GetImage); - - pBackingDrawable = cwGetBackingDrawable(pSrc, &src_off_x, &src_off_y); - - CW_OFFSET_XY_SRC(x, y); - - (*pScreen->GetImage) (pBackingDrawable, x, y, w, h, format, planemask, - pdstLine); - - SCREEN_EPILOGUE(pScreen, GetImage, cwGetImage); -} - -static void -cwGetSpans(DrawablePtr pSrc, int wMax, DDXPointPtr ppt, int *pwidth, - int nspans, char *pdstStart) -{ - ScreenPtr pScreen = pSrc->pScreen; - DrawablePtr pBackingDrawable; - int i; - int src_off_x, src_off_y; - - SCREEN_PROLOGUE(pScreen, GetSpans); - - pBackingDrawable = cwGetBackingDrawable(pSrc, &src_off_x, &src_off_y); - - for (i = 0; i < nspans; i++) - CW_OFFSET_XY_SRC(ppt[i].x, ppt[i].y); - - (*pScreen->GetSpans) (pBackingDrawable, wMax, ppt, pwidth, nspans, - pdstStart); - - SCREEN_EPILOGUE(pScreen, GetSpans, cwGetSpans); -} - -static void -cwCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc) -{ - ScreenPtr pScreen = pWin->drawable.pScreen; - - SCREEN_PROLOGUE(pScreen, CopyWindow); - - if (!cwDrawableIsRedirWindow((DrawablePtr) pWin)) { - (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc); - } - else { - GCPtr pGC; - BoxPtr pExtents; - int x_off, y_off; - int dx, dy; - PixmapPtr pBackingPixmap; - RegionPtr pClip; - int src_x, src_y, dst_x, dst_y, w, h; - - dx = ptOldOrg.x - pWin->drawable.x; - dy = ptOldOrg.y - pWin->drawable.y; - - pExtents = RegionExtents(prgnSrc); - - pBackingPixmap = (PixmapPtr) cwGetBackingDrawable((DrawablePtr) pWin, - &x_off, &y_off); - - src_x = pExtents->x1 - pBackingPixmap->screen_x; - src_y = pExtents->y1 - pBackingPixmap->screen_y; - w = pExtents->x2 - pExtents->x1; - h = pExtents->y2 - pExtents->y1; - dst_x = src_x - dx; - dst_y = src_y - dy; - - /* Translate region (as required by API) */ - RegionTranslate(prgnSrc, -dx, -dy); - - pGC = GetScratchGC(pBackingPixmap->drawable.depth, pScreen); - /* - * Copy region to GC as clip, aligning as dest clip - */ - pClip = RegionCreate(NULL, 0); - RegionIntersect(pClip, &pWin->borderClip, prgnSrc); - RegionTranslate(pClip, - -pBackingPixmap->screen_x, -pBackingPixmap->screen_y); - - (*pGC->funcs->ChangeClip) (pGC, CT_REGION, pClip, 0); - - ValidateGC(&pBackingPixmap->drawable, pGC); - - (*pGC->ops->CopyArea) (&pBackingPixmap->drawable, - &pBackingPixmap->drawable, pGC, - src_x, src_y, w, h, dst_x, dst_y); - - (*pGC->funcs->DestroyClip) (pGC); - - FreeScratchGC(pGC); - } - - SCREEN_EPILOGUE(pScreen, CopyWindow, cwCopyWindow); -} - -static PixmapPtr -cwGetWindowPixmap(WindowPtr pWin) -{ - PixmapPtr pPixmap = getCwPixmap(pWin); - - if (!pPixmap) { - ScreenPtr pScreen = pWin->drawable.pScreen; - - SCREEN_PROLOGUE(pScreen, GetWindowPixmap); - if (pScreen->GetWindowPixmap) - pPixmap = (*pScreen->GetWindowPixmap) (pWin); - SCREEN_EPILOGUE(pScreen, GetWindowPixmap, cwGetWindowPixmap); - } - return pPixmap; -} - -static void -cwSetWindowPixmap(WindowPtr pWindow, PixmapPtr pPixmap) -{ - ScreenPtr pScreen = pWindow->drawable.pScreen; - - if (pPixmap == (*pScreen->GetScreenPixmap) (pScreen)) - pPixmap = NULL; - setCwPixmap(pWindow, pPixmap); -} - -/* Screen initialization/teardown */ -void -miInitializeCompositeWrapper(ScreenPtr pScreen) -{ - cwScreenPtr pScreenPriv; - Bool has_render = GetPictureScreenIfSet(pScreen) != NULL; - - if (!dixRegisterPrivateKey(&cwScreenKeyRec, PRIVATE_SCREEN, 0)) - return; - - if (!dixRegisterPrivateKey(&cwGCKeyRec, PRIVATE_GC, sizeof(cwGCRec))) - return; - - if (!dixRegisterPrivateKey(&cwWindowKeyRec, PRIVATE_WINDOW, 0)) - return; - - if (!dixRegisterPrivateKey(&cwPictureKeyRec, PRIVATE_PICTURE, 0)) - return; - - pScreenPriv = malloc(sizeof(cwScreenRec)); - if (!pScreenPriv) - return; - - dixSetPrivate(&pScreen->devPrivates, cwScreenKey, pScreenPriv); - - SCREEN_EPILOGUE(pScreen, CloseScreen, cwCloseScreen); - SCREEN_EPILOGUE(pScreen, GetImage, cwGetImage); - SCREEN_EPILOGUE(pScreen, GetSpans, cwGetSpans); - SCREEN_EPILOGUE(pScreen, CreateGC, cwCreateGC); - SCREEN_EPILOGUE(pScreen, CopyWindow, cwCopyWindow); - - SCREEN_EPILOGUE(pScreen, SetWindowPixmap, cwSetWindowPixmap); - SCREEN_EPILOGUE(pScreen, GetWindowPixmap, cwGetWindowPixmap); - - if (has_render) - cwInitializeRender(pScreen); -} - -static Bool -cwCloseScreen(int i, ScreenPtr pScreen) -{ - cwScreenPtr pScreenPriv; - PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); - - pScreenPriv = (cwScreenPtr) dixLookupPrivate(&pScreen->devPrivates, - cwScreenKey); - pScreen->CloseScreen = pScreenPriv->CloseScreen; - pScreen->GetImage = pScreenPriv->GetImage; - pScreen->GetSpans = pScreenPriv->GetSpans; - pScreen->CreateGC = pScreenPriv->CreateGC; - pScreen->CopyWindow = pScreenPriv->CopyWindow; - - if (ps) - cwFiniRender(pScreen); - - free((pointer) pScreenPriv); - - return (*pScreen->CloseScreen) (i, pScreen); -} diff --git a/xserver/miext/cw/cw.h b/xserver/miext/cw/cw.h deleted file mode 100644 index 9f880f7f5..000000000 --- a/xserver/miext/cw/cw.h +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright © 2004 Eric Anholt - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Eric Anholt not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Eric Anholt makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * ERIC ANHOLT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL ERIC ANHOLT BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include "gcstruct.h" -#include "picturestr.h" -#include "privates.h" - -/* - * One of these structures is allocated per GC that gets used with a window with - * backing pixmap. - */ - -typedef struct { - GCPtr pBackingGC; /* Copy of the GC but with graphicsExposures - * set FALSE and the clientClip set to - * clip output to the valid regions of the - * backing pixmap. */ - unsigned long serialNumber; /* clientClip computed time */ - unsigned long stateChanges; /* changes in parent gc since last copy */ - GCOps *wrapOps; /* wrapped ops */ - GCFuncs *wrapFuncs; /* wrapped funcs */ -} cwGCRec, *cwGCPtr; - -extern _X_EXPORT DevPrivateKeyRec cwGCKeyRec; - -#define cwGCKey (&cwGCKeyRec) - -#define getCwGC(pGC) ((cwGCPtr)dixLookupPrivate(&(pGC)->devPrivates, cwGCKey)) -#define setCwGC(pGC,p) dixSetPrivate(&(pGC)->devPrivates, cwGCKey, p) - -/* - * One of these structures is allocated per Picture that gets used with a - * window with a backing pixmap - */ - -typedef struct { - PicturePtr pBackingPicture; - unsigned long serialNumber; - unsigned long stateChanges; -} cwPictureRec, *cwPicturePtr; - -extern _X_EXPORT DevPrivateKeyRec cwPictureKeyRec; - -#define cwPictureKey (&cwPictureKeyRec) - -#define getCwPicture(pPicture) (pPicture->pDrawable ? \ - (cwPicturePtr)dixLookupPrivate(&(pPicture)->devPrivates, cwPictureKey) : 0) -#define setCwPicture(pPicture,p) dixSetPrivate(&(pPicture)->devPrivates, cwPictureKey, p) - -extern _X_EXPORT DevPrivateKeyRec cwWindowKeyRec; - -#define cwWindowKey (&cwWindowKeyRec) - -#define cwWindowPrivate(pWin) dixLookupPrivate(&(pWin)->devPrivates, cwWindowKey) -#define getCwPixmap(pWindow) ((PixmapPtr) cwWindowPrivate(pWindow)) -#define setCwPixmap(pWindow,pPixmap) \ - dixSetPrivate(&(pWindow)->devPrivates, cwWindowKey, pPixmap) - -#define cwDrawableIsRedirWindow(pDraw) \ - ((pDraw)->type == DRAWABLE_WINDOW && \ - getCwPixmap((WindowPtr) (pDraw)) != NULL) - -typedef struct { - /* - * screen func wrappers - */ - CloseScreenProcPtr CloseScreen; - GetImageProcPtr GetImage; - GetSpansProcPtr GetSpans; - CreateGCProcPtr CreateGC; - - CopyWindowProcPtr CopyWindow; - - GetWindowPixmapProcPtr GetWindowPixmap; - SetWindowPixmapProcPtr SetWindowPixmap; - - DestroyPictureProcPtr DestroyPicture; - ChangePictureClipProcPtr ChangePictureClip; - DestroyPictureClipProcPtr DestroyPictureClip; - - ChangePictureProcPtr ChangePicture; - ValidatePictureProcPtr ValidatePicture; - - CompositeProcPtr Composite; - CompositeRectsProcPtr CompositeRects; - - TrapezoidsProcPtr Trapezoids; - TrianglesProcPtr Triangles; - - RasterizeTrapezoidProcPtr RasterizeTrapezoid; -} cwScreenRec, *cwScreenPtr; - -extern _X_EXPORT DevPrivateKeyRec cwScreenKeyRec; - -#define cwScreenKey (&cwScreenKeyRec) - -#define getCwScreen(pScreen) ((cwScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, cwScreenKey)) -#define setCwScreen(pScreen,p) dixSetPrivate(&(pScreen)->devPrivates, cwScreenKey, p) - -#define CW_OFFSET_XYPOINTS(ppt, npt) do { \ - DDXPointPtr _ppt = (DDXPointPtr)(ppt); \ - int _i; \ - for (_i = 0; _i < npt; _i++) { \ - _ppt[_i].x += dst_off_x; \ - _ppt[_i].y += dst_off_y; \ - } \ -} while (0) - -#define CW_OFFSET_RECTS(prect, nrect) do { \ - int _i; \ - for (_i = 0; _i < nrect; _i++) { \ - (prect)[_i].x += dst_off_x; \ - (prect)[_i].y += dst_off_y; \ - } \ -} while (0) - -#define CW_OFFSET_ARCS(parc, narc) do { \ - int _i; \ - for (_i = 0; _i < narc; _i++) { \ - (parc)[_i].x += dst_off_x; \ - (parc)[_i].y += dst_off_y; \ - } \ -} while (0) - -#define CW_OFFSET_XY_DST(x, y) do { \ - (x) = (x) + dst_off_x; \ - (y) = (y) + dst_off_y; \ -} while (0) - -#define CW_OFFSET_XY_SRC(x, y) do { \ - (x) = (x) + src_off_x; \ - (y) = (y) + src_off_y; \ -} while (0) - -/* cw.c */ -extern _X_EXPORT DrawablePtr - cwGetBackingDrawable(DrawablePtr pDrawable, int *x_off, int *y_off); - -/* cw_render.c */ - -extern _X_EXPORT void - cwInitializeRender(ScreenPtr pScreen); - -extern _X_EXPORT void - cwFiniRender(ScreenPtr pScreen); - -/* cw.c */ - -extern _X_EXPORT void - miInitializeCompositeWrapper(ScreenPtr pScreen); diff --git a/xserver/miext/cw/cw_ops.c b/xserver/miext/cw/cw_ops.c deleted file mode 100644 index ccc558074..000000000 --- a/xserver/miext/cw/cw_ops.c +++ /dev/null @@ -1,477 +0,0 @@ -/* - * Copyright © 2004 Eric Anholt - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Eric Anholt not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Eric Anholt makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * ERIC ANHOLT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL ERIC ANHOLT BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include - -#include "gcstruct.h" -#include "pixmapstr.h" -#include "cw.h" -#include "mi.h" - -#define SETUP_BACKING_DST(_pDst, _pGC) \ - cwGCPtr pGCPrivate = getCwGC (_pGC); \ - int dst_off_x, dst_off_y; \ - DrawablePtr pBackingDst = cwGetBackingDrawable(pDst, &dst_off_x, \ - &dst_off_y); \ - GCPtr pBackingGC = pGCPrivate->pBackingGC ? pGCPrivate->pBackingGC : _pGC - -#define SETUP_BACKING_SRC(pSrc, pGC) \ - int src_off_x, src_off_y; \ - DrawablePtr pBackingSrc = cwGetBackingDrawable(pSrc, &src_off_x, \ - &src_off_y) - -#define PROLOGUE(pGC) do { \ - if (pBackingGC->serialNumber != pBackingDst->serialNumber) { \ - ValidateGC(pBackingDst, pBackingGC); \ - } \ - pGC->funcs = pGCPrivate->wrapFuncs;\ - pGC->ops = pGCPrivate->wrapOps;\ -} while (0) - -#define EPILOGUE(pGC) do { \ - pGCPrivate->wrapFuncs = (pGC)->funcs; \ - pGCPrivate->wrapOps = (pGC)->ops; \ - (pGC)->funcs = &cwGCFuncs; \ - (pGC)->ops = &cwGCOps; \ -} while (0) - -extern GCFuncs cwGCFuncs; - -/* - * GC ops -- wrap each GC operation with our own function - */ - -static void cwFillSpans(DrawablePtr pDst, GCPtr pGC, int nInit, - DDXPointPtr pptInit, int *pwidthInit, int fSorted); -static void cwSetSpans(DrawablePtr pDst, GCPtr pGC, char *psrc, - DDXPointPtr ppt, int *pwidth, int nspans, int fSorted); -static void cwPutImage(DrawablePtr pDst, GCPtr pGC, int depth, - int x, int y, int w, int h, int leftPad, int format, - char *pBits); -static RegionPtr cwCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, - int srcx, int srcy, int w, int h, - int dstx, int dsty); -static RegionPtr cwCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, - int srcx, int srcy, int w, int h, - int dstx, int dsty, unsigned long plane); -static void cwPolyPoint(DrawablePtr pDst, GCPtr pGC, int mode, int npt, - xPoint * pptInit); -static void cwPolylines(DrawablePtr pDst, GCPtr pGC, int mode, int npt, - DDXPointPtr pptInit); -static void cwPolySegment(DrawablePtr pDst, GCPtr pGC, int nseg, - xSegment * pSegs); -static void cwPolyRectangle(DrawablePtr pDst, GCPtr pGC, - int nrects, xRectangle *pRects); -static void cwPolyArc(DrawablePtr pDst, GCPtr pGC, int narcs, xArc * parcs); -static void cwFillPolygon(DrawablePtr pDst, GCPtr pGC, int shape, int mode, - int count, DDXPointPtr pPts); -static void cwPolyFillRect(DrawablePtr pDst, GCPtr pGC, - int nrectFill, xRectangle *prectInit); -static void cwPolyFillArc(DrawablePtr pDst, GCPtr pGC, int narcs, xArc * parcs); -static int cwPolyText8(DrawablePtr pDrawable, GCPtr pGC, int x, int y, - int count, char *chars); -static int cwPolyText16(DrawablePtr pDst, GCPtr pGC, int x, int y, - int count, unsigned short *chars); -static void cwImageText8(DrawablePtr pDst, GCPtr pGC, int x, int y, - int count, char *chars); -static void cwImageText16(DrawablePtr pDst, GCPtr pGC, int x, int y, - int count, unsigned short *chars); -static void cwImageGlyphBlt(DrawablePtr pDst, GCPtr pGC, int x, int y, - unsigned int nglyph, CharInfoPtr * ppci, - pointer pglyphBase); -static void cwPolyGlyphBlt(DrawablePtr pDst, GCPtr pGC, int x, int y, - unsigned int nglyph, CharInfoPtr * ppci, - pointer pglyphBase); -static void cwPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst, - int w, int h, int x, int y); - -GCOps cwGCOps = { - cwFillSpans, - cwSetSpans, - cwPutImage, - cwCopyArea, - cwCopyPlane, - cwPolyPoint, - cwPolylines, - cwPolySegment, - cwPolyRectangle, - cwPolyArc, - cwFillPolygon, - cwPolyFillRect, - cwPolyFillArc, - cwPolyText8, - cwPolyText16, - cwImageText8, - cwImageText16, - cwImageGlyphBlt, - cwPolyGlyphBlt, - cwPushPixels -}; - -static void -cwFillSpans(DrawablePtr pDst, GCPtr pGC, int nspans, DDXPointPtr ppt, - int *pwidth, int fSorted) -{ - SETUP_BACKING_DST(pDst, pGC); - - PROLOGUE(pGC); - - CW_OFFSET_XYPOINTS(ppt, nspans); - - (*pBackingGC->ops->FillSpans) (pBackingDst, pBackingGC, nspans, ppt, - pwidth, fSorted); - - EPILOGUE(pGC); -} - -static void -cwSetSpans(DrawablePtr pDst, GCPtr pGC, char *psrc, DDXPointPtr ppt, - int *pwidth, int nspans, int fSorted) -{ - SETUP_BACKING_DST(pDst, pGC); - - PROLOGUE(pGC); - - CW_OFFSET_XYPOINTS(ppt, nspans); - - (*pBackingGC->ops->SetSpans) (pBackingDst, pBackingGC, psrc, ppt, pwidth, - nspans, fSorted); - - EPILOGUE(pGC); -} - -static void -cwPutImage(DrawablePtr pDst, GCPtr pGC, int depth, int x, int y, int w, int h, - int leftPad, int format, char *pBits) -{ - SETUP_BACKING_DST(pDst, pGC); - - PROLOGUE(pGC); - - CW_OFFSET_XY_DST(x, y); - - (*pBackingGC->ops->PutImage) (pBackingDst, pBackingGC, depth, x, y, w, h, - leftPad, format, pBits); - - EPILOGUE(pGC); -} - -static RegionPtr -cwCopyArea(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, int srcx, int srcy, - int w, int h, int dstx, int dsty) -{ - int odstx, odsty; - int osrcx, osrcy; - - SETUP_BACKING_DST(pDst, pGC); - SETUP_BACKING_SRC(pSrc, pGC); - - PROLOGUE(pGC); - - odstx = dstx; - odsty = dsty; - osrcx = srcx; - osrcy = srcy; - CW_OFFSET_XY_DST(dstx, dsty); - CW_OFFSET_XY_SRC(srcx, srcy); - - (*pBackingGC->ops->CopyArea) (pBackingSrc, pBackingDst, - pBackingGC, srcx, srcy, w, h, dstx, dsty); - - EPILOGUE(pGC); - - return miHandleExposures(pSrc, pDst, pGC, - osrcx, osrcy, w, h, odstx, odsty, 0); -} - -static RegionPtr -cwCopyPlane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, int srcx, int srcy, - int w, int h, int dstx, int dsty, unsigned long plane) -{ - int odstx, odsty; - int osrcx, osrcy; - - SETUP_BACKING_DST(pDst, pGC); - SETUP_BACKING_SRC(pSrc, pGC); - - PROLOGUE(pGC); - - odstx = dstx; - odsty = dsty; - osrcx = srcx; - osrcy = srcy; - CW_OFFSET_XY_DST(dstx, dsty); - CW_OFFSET_XY_SRC(srcx, srcy); - - (*pBackingGC->ops->CopyPlane) (pBackingSrc, pBackingDst, - pBackingGC, srcx, srcy, w, h, - dstx, dsty, plane); - - EPILOGUE(pGC); - - return miHandleExposures(pSrc, pDst, pGC, - osrcx, osrcy, w, h, odstx, odsty, plane); -} - -static void -cwPolyPoint(DrawablePtr pDst, GCPtr pGC, int mode, int npt, xPoint * ppt) -{ - SETUP_BACKING_DST(pDst, pGC); - - PROLOGUE(pGC); - - if (mode == CoordModeOrigin) - CW_OFFSET_XYPOINTS(ppt, npt); - else - CW_OFFSET_XYPOINTS(ppt, 1); - - (*pBackingGC->ops->PolyPoint) (pBackingDst, pBackingGC, mode, npt, ppt); - - EPILOGUE(pGC); -} - -static void -cwPolylines(DrawablePtr pDst, GCPtr pGC, int mode, int npt, DDXPointPtr ppt) -{ - SETUP_BACKING_DST(pDst, pGC); - - PROLOGUE(pGC); - - if (mode == CoordModeOrigin) - CW_OFFSET_XYPOINTS(ppt, npt); - else - CW_OFFSET_XYPOINTS(ppt, 1); - - (*pBackingGC->ops->Polylines) (pBackingDst, pBackingGC, mode, npt, ppt); - - EPILOGUE(pGC); -} - -static void -cwPolySegment(DrawablePtr pDst, GCPtr pGC, int nseg, xSegment * pSegs) -{ - SETUP_BACKING_DST(pDst, pGC); - - PROLOGUE(pGC); - - CW_OFFSET_XYPOINTS(pSegs, nseg * 2); - - (*pBackingGC->ops->PolySegment) (pBackingDst, pBackingGC, nseg, pSegs); - - EPILOGUE(pGC); -} - -static void -cwPolyRectangle(DrawablePtr pDst, GCPtr pGC, int nrects, xRectangle *pRects) -{ - SETUP_BACKING_DST(pDst, pGC); - - PROLOGUE(pGC); - - CW_OFFSET_RECTS(pRects, nrects); - - (*pBackingGC->ops->PolyRectangle) (pBackingDst, pBackingGC, nrects, pRects); - - EPILOGUE(pGC); -} - -static void -cwPolyArc(DrawablePtr pDst, GCPtr pGC, int narcs, xArc * pArcs) -{ - SETUP_BACKING_DST(pDst, pGC); - - PROLOGUE(pGC); - - CW_OFFSET_RECTS(pArcs, narcs); - - (*pBackingGC->ops->PolyArc) (pBackingDst, pBackingGC, narcs, pArcs); - - EPILOGUE(pGC); -} - -static void -cwFillPolygon(DrawablePtr pDst, GCPtr pGC, int shape, int mode, int npt, - DDXPointPtr ppt) -{ - SETUP_BACKING_DST(pDst, pGC); - - PROLOGUE(pGC); - - if (mode == CoordModeOrigin) - CW_OFFSET_XYPOINTS(ppt, npt); - else - CW_OFFSET_XYPOINTS(ppt, 1); - - (*pBackingGC->ops->FillPolygon) (pBackingDst, pBackingGC, shape, mode, npt, - ppt); - - EPILOGUE(pGC); -} - -static void -cwPolyFillRect(DrawablePtr pDst, GCPtr pGC, int nrects, xRectangle *pRects) -{ - SETUP_BACKING_DST(pDst, pGC); - - PROLOGUE(pGC); - - CW_OFFSET_RECTS(pRects, nrects); - - (*pBackingGC->ops->PolyFillRect) (pBackingDst, pBackingGC, nrects, pRects); - - EPILOGUE(pGC); -} - -static void -cwPolyFillArc(DrawablePtr pDst, GCPtr pGC, int narcs, xArc * parcs) -{ - SETUP_BACKING_DST(pDst, pGC); - - PROLOGUE(pGC); - - CW_OFFSET_RECTS(parcs, narcs); - - (*pBackingGC->ops->PolyFillArc) (pBackingDst, pBackingGC, narcs, parcs); - - EPILOGUE(pGC); -} - -static int -cwPolyText8(DrawablePtr pDst, GCPtr pGC, int x, int y, int count, char *chars) -{ - int result; - - SETUP_BACKING_DST(pDst, pGC); - - PROLOGUE(pGC); - - CW_OFFSET_XY_DST(x, y); - - result = (*pBackingGC->ops->PolyText8) (pBackingDst, pBackingGC, x, y, - count, chars); - - EPILOGUE(pGC); - - return result; -} - -static int -cwPolyText16(DrawablePtr pDst, GCPtr pGC, int x, int y, int count, - unsigned short *chars) -{ - int result; - - SETUP_BACKING_DST(pDst, pGC); - - PROLOGUE(pGC); - - CW_OFFSET_XY_DST(x, y); - - result = (*pBackingGC->ops->PolyText16) (pBackingDst, pBackingGC, x, y, - count, chars); - - EPILOGUE(pGC); - return result; -} - -static void -cwImageText8(DrawablePtr pDst, GCPtr pGC, int x, int y, int count, char *chars) -{ - SETUP_BACKING_DST(pDst, pGC); - - PROLOGUE(pGC); - - CW_OFFSET_XY_DST(x, y); - - (*pBackingGC->ops->ImageText8) (pBackingDst, pBackingGC, x, y, count, - chars); - - EPILOGUE(pGC); -} - -static void -cwImageText16(DrawablePtr pDst, GCPtr pGC, int x, int y, int count, - unsigned short *chars) -{ - SETUP_BACKING_DST(pDst, pGC); - - PROLOGUE(pGC); - - CW_OFFSET_XY_DST(x, y); - - (*pBackingGC->ops->ImageText16) (pBackingDst, pBackingGC, x, y, count, - chars); - - EPILOGUE(pGC); -} - -static void -cwImageGlyphBlt(DrawablePtr pDst, GCPtr pGC, int x, int y, unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase) -{ - SETUP_BACKING_DST(pDst, pGC); - - PROLOGUE(pGC); - - CW_OFFSET_XY_DST(x, y); - - (*pBackingGC->ops->ImageGlyphBlt) (pBackingDst, pBackingGC, x, y, nglyph, - ppci, pglyphBase); - - EPILOGUE(pGC); -} - -static void -cwPolyGlyphBlt(DrawablePtr pDst, GCPtr pGC, int x, int y, unsigned int nglyph, - CharInfoPtr * ppci, pointer pglyphBase) -{ - SETUP_BACKING_DST(pDst, pGC); - - PROLOGUE(pGC); - - CW_OFFSET_XY_DST(x, y); - - (*pBackingGC->ops->PolyGlyphBlt) (pBackingDst, pBackingGC, x, y, nglyph, - ppci, pglyphBase); - - EPILOGUE(pGC); -} - -static void -cwPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDst, int w, int h, - int x, int y) -{ - SETUP_BACKING_DST(pDst, pGC); - - PROLOGUE(pGC); - - CW_OFFSET_XY_DST(x, y); - - (*pBackingGC->ops->PushPixels) (pBackingGC, pBitMap, pBackingDst, w, h, - x, y); - - EPILOGUE(pGC); -} diff --git a/xserver/miext/cw/cw_render.c b/xserver/miext/cw/cw_render.c deleted file mode 100644 index 059d686fb..000000000 --- a/xserver/miext/cw/cw_render.c +++ /dev/null @@ -1,383 +0,0 @@ -/* - * Copyright © 2004 Eric Anholt - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Eric Anholt not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Eric Anholt makes no - * representations about the suitability of this software for any purpose. It - * is provided "as is" without express or implied warranty. - * - * ERIC ANHOLT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL ERIC ANHOLT BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - */ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include - -#include "gcstruct.h" -#include "windowstr.h" -#include "cw.h" - -#define cwPsDecl(pScreen) \ - PictureScreenPtr ps = GetPictureScreen (pScreen); \ - cwScreenPtr pCwScreen = getCwScreen (pScreen) - -#define cwPicturePrivate \ - cwPicturePtr pPicturePrivate = getCwPicture(pPicture) - -#define cwSrcPictureDecl \ - int src_picture_x_off, src_picture_y_off; \ - PicturePtr pBackingSrcPicture = cwGetBackingPicture(pSrcPicture, \ - &src_picture_x_off,\ - &src_picture_y_off) - -#define cwDstPictureDecl \ - int dst_picture_x_off, dst_picture_y_off; \ - PicturePtr pBackingDstPicture = cwGetBackingPicture(pDstPicture, \ - &dst_picture_x_off,\ - &dst_picture_y_off) - -#define cwMskPictureDecl \ - int msk_picture_x_off = 0, msk_picture_y_off = 0; \ - PicturePtr pBackingMskPicture = (!pMskPicture ? 0 : \ - cwGetBackingPicture(pMskPicture, \ - &msk_picture_x_off,\ - &msk_picture_y_off)) - -#define cwPsUnwrap(elt) { \ - ps->elt = pCwScreen->elt; \ -} - -#define cwPsWrap(elt,func) { \ - pCwScreen->elt = ps->elt; \ - ps->elt = func; \ -} - -static cwPicturePtr -cwCreatePicturePrivate(PicturePtr pPicture) -{ - WindowPtr pWindow = (WindowPtr) pPicture->pDrawable; - PixmapPtr pPixmap = getCwPixmap(pWindow); - int error; - cwPicturePtr pPicturePrivate; - - pPicturePrivate = malloc(sizeof(cwPictureRec)); - if (!pPicturePrivate) - return NULL; - - pPicturePrivate->pBackingPicture = CreatePicture(0, &pPixmap->drawable, - pPicture->pFormat, - 0, 0, serverClient, - &error); - if (!pPicturePrivate->pBackingPicture) { - free(pPicturePrivate); - return NULL; - } - - /* - * Ensure that this serial number does not match the window's - */ - pPicturePrivate->serialNumber = pPixmap->drawable.serialNumber; - pPicturePrivate->stateChanges = (1 << (CPLastBit + 1)) - 1; - - setCwPicture(pPicture, pPicturePrivate); - - return pPicturePrivate; -} - -static void -cwDestroyPicturePrivate(PicturePtr pPicture) -{ - cwPicturePrivate; - - if (pPicturePrivate) { - if (pPicturePrivate->pBackingPicture) - FreePicture(pPicturePrivate->pBackingPicture, 0); - free(pPicturePrivate); - setCwPicture(pPicture, NULL); - } -} - -static PicturePtr -cwGetBackingPicture(PicturePtr pPicture, int *x_off, int *y_off) -{ - cwPicturePrivate; - - if (pPicturePrivate) { - DrawablePtr pDrawable = pPicture->pDrawable; - WindowPtr pWindow = (WindowPtr) pDrawable; - PixmapPtr pPixmap = getCwPixmap(pWindow); - - *x_off = pDrawable->x - pPixmap->screen_x; - *y_off = pDrawable->y - pPixmap->screen_y; - - return pPicturePrivate->pBackingPicture; - } - else { - *x_off = *y_off = 0; - return pPicture; - } -} - -static void -cwDestroyPicture(PicturePtr pPicture) -{ - ScreenPtr pScreen = pPicture->pDrawable->pScreen; - - cwPsDecl(pScreen); - - cwPsUnwrap(DestroyPicture); - cwDestroyPicturePrivate(pPicture); - (*ps->DestroyPicture) (pPicture); - cwPsWrap(DestroyPicture, cwDestroyPicture); -} - -static void -cwChangePicture(PicturePtr pPicture, Mask mask) -{ - ScreenPtr pScreen = pPicture->pDrawable->pScreen; - - cwPsDecl(pScreen); - cwPicturePtr pPicturePrivate = getCwPicture(pPicture); - - cwPsUnwrap(ChangePicture); - (*ps->ChangePicture) (pPicture, mask); - if (pPicturePrivate) - pPicturePrivate->stateChanges |= mask; - cwPsWrap(ChangePicture, cwChangePicture); -} - -static void -cwValidatePicture(PicturePtr pPicture, Mask mask) -{ - DrawablePtr pDrawable = pPicture->pDrawable; - ScreenPtr pScreen = pDrawable->pScreen; - - cwPsDecl(pScreen); - cwPicturePrivate; - - cwPsUnwrap(ValidatePicture); - - /* - * Must call ValidatePicture to ensure pPicture->pCompositeClip is valid - */ - (*ps->ValidatePicture) (pPicture, mask); - - if (!cwDrawableIsRedirWindow(pDrawable)) { - if (pPicturePrivate) - cwDestroyPicturePrivate(pPicture); - } - else { - PicturePtr pBackingPicture; - DrawablePtr pBackingDrawable; - int x_off, y_off; - - pBackingDrawable = cwGetBackingDrawable(pDrawable, &x_off, &y_off); - - if (pPicturePrivate && - pPicturePrivate->pBackingPicture->pDrawable != pBackingDrawable) { - cwDestroyPicturePrivate(pPicture); - pPicturePrivate = 0; - } - - if (!pPicturePrivate) { - pPicturePrivate = cwCreatePicturePrivate(pPicture); - if (!pPicturePrivate) { - cwPsWrap(ValidatePicture, cwValidatePicture); - return; - } - } - - pBackingPicture = pPicturePrivate->pBackingPicture; - - /* - * Always copy transform and filters because there's no - * indication of when they've changed - */ - SetPictureTransform(pBackingPicture, pPicture->transform); - - if (pBackingPicture->filter != pPicture->filter || - pPicture->filter_nparams > 0) { - char *filter = PictureGetFilterName(pPicture->filter); - - SetPictureFilter(pBackingPicture, - filter, strlen(filter), - pPicture->filter_params, pPicture->filter_nparams); - } - - pPicturePrivate->stateChanges |= mask; - - if (pPicturePrivate->serialNumber != pDrawable->serialNumber || - (pPicturePrivate-> - stateChanges & (CPClipXOrigin | CPClipYOrigin | CPClipMask))) { - SetPictureClipRegion(pBackingPicture, x_off - pDrawable->x, - y_off - pDrawable->y, - pPicture->pCompositeClip); - - pPicturePrivate->serialNumber = pDrawable->serialNumber; - pPicturePrivate->stateChanges &= - ~(CPClipXOrigin | CPClipYOrigin | CPClipMask); - } - - CopyPicture(pPicture, pPicturePrivate->stateChanges, pBackingPicture); - - ValidatePicture(pBackingPicture); - } - cwPsWrap(ValidatePicture, cwValidatePicture); -} - -static void -cwComposite(CARD8 op, - PicturePtr pSrcPicture, - PicturePtr pMskPicture, - PicturePtr pDstPicture, - INT16 xSrc, - INT16 ySrc, - INT16 xMsk, - INT16 yMsk, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height) -{ - ScreenPtr pScreen = pDstPicture->pDrawable->pScreen; - - cwPsDecl(pScreen); - cwSrcPictureDecl; - cwMskPictureDecl; - cwDstPictureDecl; - - cwPsUnwrap(Composite); - (*ps->Composite) (op, pBackingSrcPicture, pBackingMskPicture, - pBackingDstPicture, xSrc + src_picture_x_off, - ySrc + src_picture_y_off, xMsk + msk_picture_x_off, - yMsk + msk_picture_y_off, xDst + dst_picture_x_off, - yDst + dst_picture_y_off, width, height); - cwPsWrap(Composite, cwComposite); -} - -static void -cwCompositeRects(CARD8 op, - PicturePtr pDstPicture, - xRenderColor * color, int nRect, xRectangle *rects) -{ - ScreenPtr pScreen = pDstPicture->pDrawable->pScreen; - - cwPsDecl(pScreen); - cwDstPictureDecl; - int i; - - cwPsUnwrap(CompositeRects); - for (i = 0; i < nRect; i++) { - rects[i].x += dst_picture_x_off; - rects[i].y += dst_picture_y_off; - } - (*ps->CompositeRects) (op, pBackingDstPicture, color, nRect, rects); - cwPsWrap(CompositeRects, cwCompositeRects); -} - -static void -cwTrapezoids(CARD8 op, - PicturePtr pSrcPicture, - PicturePtr pDstPicture, - PictFormatPtr maskFormat, - INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid * traps) -{ - ScreenPtr pScreen = pDstPicture->pDrawable->pScreen; - - cwPsDecl(pScreen); - cwSrcPictureDecl; - cwDstPictureDecl; - int i; - - cwPsUnwrap(Trapezoids); - if (dst_picture_x_off || dst_picture_y_off) { - for (i = 0; i < ntrap; i++) { - traps[i].top += dst_picture_y_off << 16; - traps[i].bottom += dst_picture_y_off << 16; - traps[i].left.p1.x += dst_picture_x_off << 16; - traps[i].left.p1.y += dst_picture_y_off << 16; - traps[i].left.p2.x += dst_picture_x_off << 16; - traps[i].left.p2.y += dst_picture_y_off << 16; - traps[i].right.p1.x += dst_picture_x_off << 16; - traps[i].right.p1.y += dst_picture_y_off << 16; - traps[i].right.p2.x += dst_picture_x_off << 16; - traps[i].right.p2.y += dst_picture_y_off << 16; - } - } - (*ps->Trapezoids) (op, pBackingSrcPicture, pBackingDstPicture, maskFormat, - xSrc + src_picture_x_off, ySrc + src_picture_y_off, - ntrap, traps); - cwPsWrap(Trapezoids, cwTrapezoids); -} - -static void -cwTriangles(CARD8 op, - PicturePtr pSrcPicture, - PicturePtr pDstPicture, - PictFormatPtr maskFormat, - INT16 xSrc, INT16 ySrc, int ntri, xTriangle * tris) -{ - ScreenPtr pScreen = pDstPicture->pDrawable->pScreen; - - cwPsDecl(pScreen); - cwSrcPictureDecl; - cwDstPictureDecl; - int i; - - cwPsUnwrap(Triangles); - if (dst_picture_x_off || dst_picture_y_off) { - for (i = 0; i < ntri; i++) { - tris[i].p1.x += dst_picture_x_off << 16; - tris[i].p1.y += dst_picture_y_off << 16; - tris[i].p2.x += dst_picture_x_off << 16; - tris[i].p2.y += dst_picture_y_off << 16; - tris[i].p3.x += dst_picture_x_off << 16; - tris[i].p3.y += dst_picture_y_off << 16; - } - } - (*ps->Triangles) (op, pBackingSrcPicture, pBackingDstPicture, maskFormat, - xSrc + src_picture_x_off, ySrc + src_picture_y_off, - ntri, tris); - cwPsWrap(Triangles, cwTriangles); -} - -void -cwInitializeRender(ScreenPtr pScreen) -{ - cwPsDecl(pScreen); - - cwPsWrap(DestroyPicture, cwDestroyPicture); - cwPsWrap(ChangePicture, cwChangePicture); - cwPsWrap(ValidatePicture, cwValidatePicture); - cwPsWrap(Composite, cwComposite); - cwPsWrap(CompositeRects, cwCompositeRects); - cwPsWrap(Trapezoids, cwTrapezoids); - cwPsWrap(Triangles, cwTriangles); - /* There is no need to wrap AddTraps as far as we can tell. AddTraps can - * only be done on alpha-only pictures, and we won't be getting - * alpha-only window pictures, so there's no need to translate. - */ -} - -void -cwFiniRender(ScreenPtr pScreen) -{ - cwPsDecl(pScreen); - - cwPsUnwrap(DestroyPicture); - cwPsUnwrap(ChangePicture); - cwPsUnwrap(ValidatePicture); - cwPsUnwrap(Composite); - cwPsUnwrap(CompositeRects); - cwPsUnwrap(Trapezoids); - cwPsUnwrap(Triangles); -} diff --git a/xserver/miext/damage/Makefile.in b/xserver/miext/damage/Makefile.in index df6beed62..9d0e168f0 100644 --- a/xserver/miext/damage/Makefile.in +++ b/xserver/miext/damage/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -212,13 +212,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -240,6 +236,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -264,6 +261,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -279,7 +277,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -378,6 +375,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -490,7 +488,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -515,9 +513,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/miext/damage/damage.c b/xserver/miext/damage/damage.c index 72ed65997..a98c20ec0 100644 --- a/xserver/miext/damage/damage.c +++ b/xserver/miext/damage/damage.c @@ -38,9 +38,6 @@ #include "gcstruct.h" #include "damage.h" #include "damagestr.h" -#ifdef COMPOSITE -#include "cw.h" -#endif #define wrap(priv, real, mem, func) {\ priv->mem = real->mem; \ @@ -439,9 +436,13 @@ damageCreateGC(GCPtr pGC) static void damageValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) { + drawableDamage(pDrawable); DAMAGE_GC_FUNC_PROLOGUE(pGC); (*pGC->funcs->ValidateGC) (pGC, changes, pDrawable); - pGCPriv->ops = pGC->ops; /* just so it's not NULL */ + if (pDamage) + pGCPriv->ops = pGC->ops; /* so it's not NULL, so FUNC_EPILOGUE does work */ + else + pGCPriv->ops = NULL; DAMAGE_GC_FUNC_EPILOGUE(pGC); } @@ -1646,7 +1647,7 @@ damageDestroyWindow(WindowPtr pWindow) } static Bool -damageCloseScreen(int i, ScreenPtr pScreen) +damageCloseScreen(ScreenPtr pScreen) { damageScrPriv(pScreen); @@ -1655,7 +1656,7 @@ damageCloseScreen(int i, ScreenPtr pScreen) unwrap(pScrPriv, pScreen, CopyWindow); unwrap(pScrPriv, pScreen, CloseScreen); free(pScrPriv); - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } /** @@ -1666,14 +1667,38 @@ miDamageCreate(DamagePtr pDamage) { } +/* + * We only wrap into the GC when there's a registered listener. For windows, + * damage includes damage to children. So if there's a GC validated against + * a subwindow and we then register a damage on the parent, we need to bump + * the serial numbers of the children to re-trigger validation. + * + * Since we can't know if a GC has been validated against one of the affected + * children, just bump them all to be safe. + */ +static int +damageRegisterVisit(WindowPtr pWin, void *data) +{ + pWin->drawable.serialNumber = NEXT_SERIAL_NUMBER; + return WT_WALKCHILDREN; +} + void miDamageRegister(DrawablePtr pDrawable, DamagePtr pDamage) { + if (pDrawable->type == DRAWABLE_WINDOW) + TraverseTree((WindowPtr)pDrawable, damageRegisterVisit, NULL); + else + pDrawable->serialNumber = NEXT_SERIAL_NUMBER; } void miDamageUnregister(DrawablePtr pDrawable, DamagePtr pDamage) { + if (pDrawable->type == DRAWABLE_WINDOW) + TraverseTree((WindowPtr)pDrawable, damageRegisterVisit, NULL); + else + pDrawable->serialNumber = NEXT_SERIAL_NUMBER; } void diff --git a/xserver/miext/rootless/Makefile.in b/xserver/miext/rootless/Makefile.in index be1f91aed..790a47084 100644 --- a/xserver/miext/rootless/Makefile.in +++ b/xserver/miext/rootless/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -182,13 +182,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -210,6 +206,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -234,6 +231,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -249,7 +247,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -348,6 +345,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -467,7 +465,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -492,9 +490,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/miext/rootless/rootlessScreen.c b/xserver/miext/rootless/rootlessScreen.c index ecc72ea92..a1af3e7ac 100644 --- a/xserver/miext/rootless/rootlessScreen.c +++ b/xserver/miext/rootless/rootlessScreen.c @@ -138,7 +138,7 @@ RootlessCreateScreenResources(ScreenPtr pScreen) } static Bool -RootlessCloseScreen(int i, ScreenPtr pScreen) +RootlessCloseScreen(ScreenPtr pScreen) { RootlessScreenRec *s; @@ -154,7 +154,7 @@ RootlessCloseScreen(int i, ScreenPtr pScreen) } free(s); - return pScreen->CloseScreen(i, pScreen); + return pScreen->CloseScreen(pScreen); } static void diff --git a/xserver/miext/shadow/Makefile.in b/xserver/miext/shadow/Makefile.in index 91a491b0a..662e4f230 100644 --- a/xserver/miext/shadow/Makefile.in +++ b/xserver/miext/shadow/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -217,13 +217,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -245,6 +241,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -269,6 +266,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -284,7 +282,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -383,6 +380,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -514,7 +512,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -539,9 +537,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/miext/shadow/shadow.c b/xserver/miext/shadow/shadow.c index d2ba68497..2d869e54b 100644 --- a/xserver/miext/shadow/shadow.c +++ b/xserver/miext/shadow/shadow.c @@ -96,7 +96,7 @@ shadowGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h, #define BACKWARDS_COMPATIBILITY static Bool -shadowCloseScreen(int i, ScreenPtr pScreen) +shadowCloseScreen(ScreenPtr pScreen) { shadowBuf(pScreen); @@ -110,7 +110,7 @@ shadowCloseScreen(int i, ScreenPtr pScreen) if (pBuf->pPixmap) pScreen->DestroyPixmap(pBuf->pPixmap); free(pBuf); - return pScreen->CloseScreen(i, pScreen); + return pScreen->CloseScreen(pScreen); } #ifdef BACKWARDS_COMPATIBILITY diff --git a/xserver/miext/shadow/shrotpackYX.h b/xserver/miext/shadow/shrotpackYX.h index 57fcf22fa..f3df6c549 100644 --- a/xserver/miext/shadow/shrotpackYX.h +++ b/xserver/miext/shadow/shrotpackYX.h @@ -53,9 +53,6 @@ #define PREFETCH #endif -void - FUNC(ScreenPtr pScreen, shadowBufPtr pBuf); - void FUNC(ScreenPtr pScreen, shadowBufPtr pBuf) { diff --git a/xserver/miext/sync/Makefile.in b/xserver/miext/sync/Makefile.in index f13c3e5ab..5253674f0 100644 --- a/xserver/miext/sync/Makefile.in +++ b/xserver/miext/sync/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -212,13 +212,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -240,6 +236,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -264,6 +261,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -279,7 +277,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -378,6 +375,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -490,7 +488,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -515,9 +513,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/miext/sync/misync.c b/xserver/miext/sync/misync.c index b1e2a36f7..d24921a18 100644 --- a/xserver/miext/sync/misync.c +++ b/xserver/miext/sync/misync.c @@ -163,13 +163,13 @@ miSyncGetScreenFuncs(ScreenPtr pScreen) } static Bool -SyncCloseScreen(int i, ScreenPtr pScreen) +SyncCloseScreen(ScreenPtr pScreen) { SyncScreenPrivPtr pScreenPriv = SYNC_SCREEN_PRIV(pScreen); pScreen->CloseScreen = pScreenPriv->CloseScreen; - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } Bool diff --git a/xserver/os/Makefile.in b/xserver/os/Makefile.in index 572083293..a4abaaa3f 100644 --- a/xserver/os/Makefile.in +++ b/xserver/os/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -207,13 +207,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -235,6 +231,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -259,6 +256,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -274,7 +272,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -373,6 +370,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -489,7 +487,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -514,9 +512,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/os/WaitFor.c b/xserver/os/WaitFor.c index 59f3af649..393890f19 100644 --- a/xserver/os/WaitFor.c +++ b/xserver/os/WaitFor.c @@ -561,7 +561,7 @@ NextDPMSTimeout(INT32 timeout) static CARD32 ScreenSaverTimeoutExpire(OsTimerPtr timer, CARD32 now, pointer arg) { - INT32 timeout = now - lastDeviceEventTime.milliseconds; + INT32 timeout = now - lastDeviceEventTime[XIAllDevices].milliseconds; CARD32 nextTimeout = 0; #ifdef DPMSExtension diff --git a/xserver/os/access.c b/xserver/os/access.c index 550f2ed8c..88a44d9e5 100644 --- a/xserver/os/access.c +++ b/xserver/os/access.c @@ -471,7 +471,7 @@ in6_fillscopeid(struct sockaddr_in6 *sin6) #if defined(__KAME__) if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr)) { sin6->sin6_scope_id = - ntohs(*(u_int16_t *) & sin6->sin6_addr.s6_addr[2]); + ntohs(*(u_int16_t *) &sin6->sin6_addr.s6_addr[2]); sin6->sin6_addr.s6_addr[2] = sin6->sin6_addr.s6_addr[3] = 0; } #endif @@ -1007,14 +1007,6 @@ ComputeLocalClient(ClientPtr client) return FALSE; } -Bool -LocalClient(ClientPtr client) -{ - if (!client->osPrivate) - return FALSE; - return ((OsCommPtr) client->osPrivate)->local_client; -} - /* * Return the uid and gid of a connected local client * @@ -1176,7 +1168,7 @@ AuthorizedClient(ClientPtr client) if (rc != Success) return rc; - return LocalClient(client) ? Success : BadAccess; + return client->local ? Success : BadAccess; } /* Add a host to the access control list. This is the external interface diff --git a/xserver/os/backtrace.c b/xserver/os/backtrace.c index 81348f417..daac60cf6 100644 --- a/xserver/os/backtrace.c +++ b/xserver/os/backtrace.c @@ -45,29 +45,37 @@ xorg_backtrace(void) int size, i; Dl_info info; - ErrorF("\n"); - ErrorF("Backtrace:\n"); + ErrorFSigSafe("\n"); + ErrorFSigSafe("Backtrace:\n"); size = backtrace(array, 64); for (i = 0; i < size; i++) { int rc = dladdr(array[i], &info); if (rc == 0) { - ErrorF("%d: ?? [%p]\n", i, array[i]); + ErrorFSigSafe("%u: ?? [%p]\n", i, array[i]); continue; } mod = (info.dli_fname && *info.dli_fname) ? info.dli_fname : "(vdso)"; if (info.dli_saddr) - ErrorF("%d: %s (%s+0x%lx) [%p]\n", i, mod, - info.dli_sname, - (long unsigned int) ((char *) array[i] - - (char *) info.dli_saddr), array[i]); + ErrorFSigSafe( + "%u: %s (%s+0x%x) [%p]\n", + i, + mod, + info.dli_sname, + (unsigned int)((char *) array[i] - + (char *) info.dli_saddr), + array[i]); else - ErrorF("%d: %s (%p+0x%lx) [%p]\n", i, mod, - info.dli_fbase, - (long unsigned int) ((char *) array[i] - - (char *) info.dli_fbase), array[i]); + ErrorFSigSafe( + "%u: %s (%p+0x%x) [%p]\n", + i, + mod, + info.dli_fbase, + (unsigned int)((char *) array[i] - + (char *) info.dli_fbase), + array[i]); } - ErrorF("\n"); + ErrorFSigSafe("\n"); } #else /* not glibc or glibc < 2.1 */ @@ -105,7 +113,7 @@ xorg_backtrace_frame(uintptr_t pc, int signo, void *arg) strcpy(signame, "unknown"); } - ErrorF("** Signal %d (%s)\n", signo, signame); + ErrorFSigSafe("** Signal %u (%s)\n", signo, signame); } snprintf(header, sizeof(header), "%d: 0x%lx", depth, pc); @@ -123,7 +131,8 @@ xorg_backtrace_frame(uintptr_t pc, int signo, void *arg) symname = "
"; offset = pc - (uintptr_t) dlinfo.dli_fbase; } - ErrorF("%s: %s:%s+0x%lx\n", header, dlinfo.dli_fname, symname, offset); + ErrorFSigSafe("%s: %s:%s+0x%x\n", header, dlinfo.dli_fname, symname, + offset); } else { @@ -131,7 +140,7 @@ xorg_backtrace_frame(uintptr_t pc, int signo, void *arg) * probably poke elfloader here, but haven't written that code yet, * so we just print the pc. */ - ErrorF("%s\n", header); + ErrorFSigSafe("%s\n", header); } return 0; @@ -183,7 +192,7 @@ xorg_backtrace_pstack(void) if (bytesread > 0) { btline[bytesread] = 0; - ErrorF("%s", btline); + ErrorFSigSafe("%s", btline); } else if ((bytesread < 0) || ((errno != EINTR) && (errno != EAGAIN))) done = 1; @@ -203,8 +212,8 @@ void xorg_backtrace(void) { - ErrorF("\n"); - ErrorF("Backtrace:\n"); + ErrorFSigSafe("\n"); + ErrorFSigSafe("Backtrace:\n"); #ifdef HAVE_PSTACK /* First try fork/exec of pstack - otherwise fall back to walkcontext @@ -221,9 +230,9 @@ xorg_backtrace(void) walkcontext(&u, xorg_backtrace_frame, &depth); else #endif - ErrorF("Failed to get backtrace info: %s\n", strerror(errno)); + ErrorFSigSafe("Failed to get backtrace info: %s\n", strerror(errno)); } - ErrorF("\n"); + ErrorFSigSafe("\n"); } #else diff --git a/xserver/os/connection.c b/xserver/os/connection.c index f5a94a750..9d95686c7 100644 --- a/xserver/os/connection.c +++ b/xserver/os/connection.c @@ -142,6 +142,7 @@ Bool AnyClientsWriteBlocked; /* true if some client blocked on write */ static Bool RunFromSmartParent; /* send SIGUSR1 to parent process */ Bool RunFromSigStopParent; /* send SIGSTOP to our own process; Upstart (or equivalent) will send SIGCONT back. */ +static char dynamic_display[7]; /* display name */ Bool PartialNetwork; /* continue even if unable to bind all addrs */ static Pid_t ParentProcess; @@ -353,20 +354,37 @@ void NotifyParentProcess(void) { #if !defined(WIN32) + if (dynamic_display[0]) { + write(displayfd, dynamic_display, strlen(dynamic_display)); + write(displayfd, "\n", 1); + close(displayfd); + } if (RunFromSmartParent) { - if (ParentProcess > 1) { + if (ParentProcess > 1) { #ifdef X_PRIVSEP priv_signal_parent(); #else kill (ParentProcess, SIGUSR1); #endif - } + } } if (RunFromSigStopParent) raise(SIGSTOP); #endif } +static Bool +TryCreateSocket(int num, int *partial) +{ + char port[20]; + + snprintf(port, sizeof(port), "%d", num); + + return (_XSERVTransMakeAllCOTSServerListeners(port, partial, + &ListenTransCount, + &ListenTransConns) >= 0); +} + /***************** * CreateWellKnownSockets * At initialization, create the sockets to listen on for new clients. @@ -377,7 +395,6 @@ CreateWellKnownSockets(void) { int i; int partial; - char port[20]; FD_ZERO(&AllSockets); FD_ZERO(&AllClients); @@ -393,29 +410,41 @@ CreateWellKnownSockets(void) FD_ZERO(&WellKnownConnections); - snprintf(port, sizeof(port), "%d", atoi(display)); - - if ((_XSERVTransMakeAllCOTSServerListeners(port, &partial, - &ListenTransCount, - &ListenTransConns) >= 0) && - (ListenTransCount >= 1)) { - if (!PartialNetwork && partial) { - FatalError("Failed to establish all listening sockets"); - } - else { - ListenTransFds = malloc(ListenTransCount * sizeof(int)); - - for (i = 0; i < ListenTransCount; i++) { - int fd = _XSERVTransGetConnectionNumber(ListenTransConns[i]); - - ListenTransFds[i] = fd; - FD_SET(fd, &WellKnownConnections); - - if (!_XSERVTransIsLocal(ListenTransConns[i])) { - DefineSelf(fd); - } + /* display is initialized to "0" by main(). It is then set to the display + * number if specified on the command line, or to NULL when the -displayfd + * option is used. */ + if (display) { + if (TryCreateSocket(atoi(display), &partial) && + ListenTransCount >= 1) + if (!PartialNetwork && partial) + FatalError ("Failed to establish all listening sockets"); + } + else { /* -displayfd */ + Bool found = 0; + for (i = 0; i < 65535 - X_TCP_PORT; i++) { + if (TryCreateSocket(i, &partial) && !partial) { + found = 1; + break; } + else + CloseWellKnownConnections(); } + if (!found) + FatalError("Failed to find a socket to listen on"); + snprintf(dynamic_display, sizeof(dynamic_display), "%d", i); + display = dynamic_display; + } + + ListenTransFds = malloc(ListenTransCount * sizeof (int)); + + for (i = 0; i < ListenTransCount; i++) { + int fd = _XSERVTransGetConnectionNumber(ListenTransConns[i]); + + ListenTransFds[i] = fd; + FD_SET(fd, &WellKnownConnections); + + if (!_XSERVTransIsLocal(ListenTransConns[i])) + DefineSelf (fd); } if (!XFD_ANYSET(&WellKnownConnections)) @@ -742,7 +771,7 @@ AllocNewConnection(XtransConnInfo trans_conn, int fd, CARD32 conn_time) free(oc); return NullClient; } - oc->local_client = ComputeLocalClient(client); + client->local = ComputeLocalClient(client); #if !defined(WIN32) ConnectionTranslation[fd] = client->index; #else @@ -870,9 +899,9 @@ ErrorConnMax(XtransConnInfo trans_conn) { int fd = _XSERVTransGetConnectionNumber(trans_conn); xConnSetupPrefix csp; - char pad[3]; + char pad[3] = { 0, 0, 0 }; struct iovec iov[3]; - char byteOrder = 0; + char order = 0; int whichbyte = 1; struct timeval waittime; fd_set mask; @@ -885,15 +914,15 @@ ErrorConnMax(XtransConnInfo trans_conn) FD_SET(fd, &mask); (void) Select(fd + 1, &mask, NULL, NULL, &waittime); /* try to read the byte-order of the connection */ - (void) _XSERVTransRead(trans_conn, &byteOrder, 1); - if ((byteOrder == 'l') || (byteOrder == 'B')) { + (void) _XSERVTransRead(trans_conn, &order, 1); + if (order == 'l' || order == 'B' || order == 'r' || order == 'R') { csp.success = xFalse; csp.lengthReason = sizeof(NOROOM) - 1; csp.length = (sizeof(NOROOM) + 2) >> 2; csp.majorVersion = X_PROTOCOL; csp.minorVersion = X_PROTOCOL_REVISION; - if (((*(char *) &whichbyte) && (byteOrder == 'B')) || - (!(*(char *) &whichbyte) && (byteOrder == 'l'))) { + if (((*(char *) &whichbyte) && (order == 'B' || order == 'R')) || + (!(*(char *) &whichbyte) && (order == 'l' || order == 'r'))) { swaps(&csp.majorVersion); swaps(&csp.minorVersion); swaps(&csp.length); @@ -1016,8 +1045,8 @@ CloseDownConnection(ClientPtr client) if (FlushCallback) CallCallbacks(&FlushCallback, NULL); - if (oc->output && oc->output->count) - FlushClient(client, oc, (char *) NULL, 0); + if (oc->output) + FlushClient(client, oc, (char *) NULL, 0); #ifdef XDMCP XdmcpCloseDisplay(oc->fd); #endif diff --git a/xserver/os/io.c b/xserver/os/io.c index b67a5f324..2f091c417 100644 --- a/xserver/os/io.c +++ b/xserver/os/io.c @@ -82,6 +82,23 @@ SOFTWARE. CallbackListPtr ReplyCallback; CallbackListPtr FlushCallback; +typedef struct _connectionInput { + struct _connectionInput *next; + char *buffer; /* contains current client input */ + char *bufptr; /* pointer to current start of data */ + int bufcnt; /* count of bytes in buffer */ + int lenLastReq; + int size; + unsigned int ignoreBytes; /* bytes to ignore before the next request */ +} ConnectionInput; + +typedef struct _connectionOutput { + struct _connectionOutput *next; + unsigned char *buf; + int size; + int count; +} ConnectionOutput; + static ConnectionInputPtr AllocateInputBuffer(void); static ConnectionOutputPtr AllocateOutputBuffer(void); @@ -578,8 +595,6 @@ ResetCurrentRequest(ClientPtr client) } } -static const int padlength[4] = { 0, 3, 2, 1 }; - /******************** * FlushAllOutput() * Flush all clients with output. However, if some client still @@ -757,7 +772,7 @@ WriteToClient(ClientPtr who, int count, const void *__buf) oc->output = oco; } - padBytes = padlength[count & 3]; + padBytes = padding_for_int32(count); if (ReplyCallback) { ReplyInfoRec replyinfo; @@ -815,7 +830,11 @@ WriteToClient(ClientPtr who, int count, const void *__buf) NewOutputPending = TRUE; FD_SET(oc->fd, &OutputPending); memmove((char *) oco->buf + oco->count, buf, count); - oco->count += count + padBytes; + oco->count += count; + if (padBytes) { + memset(oco->buf + oco->count, '\0', padBytes); + oco->count += padBytes; + } return count; } @@ -844,10 +863,13 @@ FlushClient(ClientPtr who, OsCommPtr oc, const void *__extraBuf, int extraCount) long todo; if (!oco) - return 0; + return 0; written = 0; - padsize = padlength[extraCount & 3]; + padsize = padding_for_int32(extraCount); notWritten = oco->count + extraCount + padsize; + if (!notWritten) + return 0; + todo = notWritten; while (notWritten) { long before = written; /* amount of whole thing written */ diff --git a/xserver/os/log.c b/xserver/os/log.c index 0e4957295..95bd8cca9 100644 --- a/xserver/os/log.c +++ b/xserver/os/log.c @@ -108,6 +108,7 @@ void (*OsVendorVErrorFProc) (const char *, va_list args) = NULL; #endif static FILE *logFile = NULL; +static int logFileFd = -1; static Bool logFlush = FALSE; static Bool logSync = FALSE; static int logVerbosity = DEFAULT_LOG_VERBOSITY; @@ -164,10 +165,21 @@ asm(".desc ___crashreporter_info__, 0x10"); #ifndef X_NOT_IMPLEMENTED_STRING #define X_NOT_IMPLEMENTED_STRING "(NI)" #endif +#ifndef X_DEBUG_STRING +#define X_DEBUG_STRING "(DB)" +#endif #ifndef X_NONE_STRING #define X_NONE_STRING "" #endif +static size_t +strlen_sigsafe(const char *s) +{ + size_t len; + for (len = 0; s[len]; len++); + return len; +} + /* * LogInit is called to start logging to a file. It is also called (with * NULL arguments) when logging to a file is not wanted. It must always be @@ -208,6 +220,8 @@ LogInit(const char *fname, const char *backup) FatalError("Cannot open log file \"%s\"\n", logFileName); setvbuf(logFile, NULL, _IONBF, 0); + logFileFd = fileno(logFile); + /* Flush saved log information. */ if (saveBuffer && bufferSize > 0) { fwrite(saveBuffer, bufferPos, 1, logFile); @@ -240,6 +254,7 @@ LogClose(enum ExitCode error) (error == EXIT_NO_ERROR) ? "successfully" : "with error", error); fclose(logFile); logFile = NULL; + logFileFd = -1; } } @@ -264,16 +279,125 @@ LogSetParameter(LogParameter param, int value) } } -/* This function does the actual log message writes. */ +static int +pnprintf(char *string, size_t size, const char *f, va_list args) +{ + int f_idx = 0; + int s_idx = 0; + int f_len = strlen_sigsafe(f); + char *string_arg; + char number[21]; + int p_len; + int i; + uint64_t ui; + int64_t si; + + for (; f_idx < f_len && s_idx < size - 1; f_idx++) { + if (f[f_idx] != '%') { + string[s_idx++] = f[f_idx]; + continue; + } + + f_idx++; + + /* silently swallow length modifiers */ + while (f_idx < f_len && ((f[f_idx] >= '0' && f[f_idx] <= '9') || f[f_idx] == '.')) + f_idx++; + + if (f_idx >= f_len) + break; + + switch (f[f_idx]) { + case 's': + string_arg = va_arg(args, char*); + p_len = strlen_sigsafe(string_arg); + + for (i = 0; i < p_len && s_idx < size - 1; i++) + string[s_idx++] = string_arg[i]; + break; + + case 'u': + ui = va_arg(args, unsigned); + FormatUInt64(ui, number); + p_len = strlen_sigsafe(number); + + for (i = 0; i < p_len && s_idx < size - 1; i++) + string[s_idx++] = number[i]; + break; + case 'i': + case 'd': + si = va_arg(args, int); + FormatInt64(si, number); + p_len = strlen_sigsafe(number); + + for (i = 0; i < p_len && s_idx < size - 1; i++) + string[s_idx++] = number[i]; + break; + + case 'p': + string[s_idx++] = '0'; + if (s_idx < size - 1) + string[s_idx++] = 'x'; + ui = (uintptr_t)va_arg(args, void*); + FormatUInt64Hex(ui, number); + p_len = strlen_sigsafe(number); + + for (i = 0; i < p_len && s_idx < size - 1; i++) + string[s_idx++] = number[i]; + break; + + case 'x': + ui = va_arg(args, unsigned); + FormatUInt64Hex(ui, number); + p_len = strlen_sigsafe(number); + + for (i = 0; i < p_len && s_idx < size - 1; i++) + string[s_idx++] = number[i]; + break; + case 'f': + { + double d = va_arg(args, double); + FormatDouble(d, number); + p_len = strlen_sigsafe(number); + + for (i = 0; i < p_len && s_idx < size - 1; i++) + string[s_idx++] = number[i]; + } + break; + default: + va_arg(args, char*); + string[s_idx++] = '%'; + if (s_idx < size - 1) + string[s_idx++] = f[f_idx]; + break; + } + } + + string[s_idx] = '\0'; + + return s_idx; +} + +/* This function does the actual log message writes. It must be signal safe. + * When attempting to call non-signal-safe functions, guard them with a check + * of the inSignalContext global variable. */ static void LogSWrite(int verb, const char *buf, size_t len, Bool end_line) { static Bool newline = TRUE; if (verb < 0 || logVerbosity >= verb) - fwrite(buf, len, 1, stderr); + write(2, buf, len); + if (verb < 0 || logFileVerbosity >= verb) { - if (logFile) { + if (inSignalContext && logFileFd >= 0) { + write(logFileFd, buf, len); +#ifndef WIN32 + if (logFlush && logSync) + fsync(logFileFd); +#endif + } + else if (!inSignalContext && logFile) { if (newline) fprintf(logFile, "[%10.3f] ", GetTimeInMillis() / 1000.0); newline = end_line; @@ -286,7 +410,7 @@ LogSWrite(int verb, const char *buf, size_t len, Bool end_line) #endif } } - else if (needBuffer) { + else if (!inSignalContext && needBuffer) { if (len > bufferUnused) { bufferSize += 1024; bufferUnused += 1024; @@ -351,6 +475,8 @@ LogMessageTypeVerbString(MessageType type, int verb) return X_UNKNOWN_STRING; case X_NONE: return X_NONE_STRING; + case X_DEBUG: + return X_DEBUG_STRING; default: return X_UNKNOWN_STRING; } @@ -359,12 +485,27 @@ LogMessageTypeVerbString(MessageType type, int verb) void LogVMessageVerb(MessageType type, int verb, const char *format, va_list args) { + static unsigned int warned; const char *type_str; char buf[1024]; const size_t size = sizeof(buf); Bool newline; size_t len = 0; + if (inSignalContext) { + if (warned < 3) { + BUG_WARN_MSG(inSignalContext, + "Warning: attempting to log data in a signal unsafe " + "manner while in signal context.\nPlease update to check " + "inSignalContext and/or use LogMessageVerbSigSafe() or " + "ErrorFSigSafe().\nThe offending log format message is:\n" + "%s\n", format); + warned++; + if (warned == 3) + LogMessageVerbSigSafe(X_WARNING, -1, "Warned %u times about sigsafe logging. Will be quiet now.\n", warned); + } + } + type_str = LogMessageTypeVerbString(type, verb); if (!type_str) return; @@ -406,16 +547,69 @@ LogMessage(MessageType type, const char *format, ...) va_end(ap); } +/* Log a message using only signal safe functions. */ +void +LogMessageVerbSigSafe(MessageType type, int verb, const char *format, ...) +{ + va_list ap; + va_start(ap, format); + LogVMessageVerbSigSafe(type, verb, format, ap); + va_end(ap); +} + +void +LogVMessageVerbSigSafe(MessageType type, int verb, const char *format, va_list args) +{ + const char *type_str; + char buf[1024]; + int len; + Bool newline; + + type_str = LogMessageTypeVerbString(type, verb); + if (!type_str) + return; + + /* if type_str is not "", prepend it and ' ', to message */ + if (type_str[0] != '\0') { + LogSWrite(verb, type_str, strlen_sigsafe(type_str), FALSE); + LogSWrite(verb, " ", 1, FALSE); + } + + len = pnprintf(buf, sizeof(buf), format, args); + + /* Force '\n' at end of truncated line */ + if (sizeof(buf) - len == 1) + buf[len - 1] = '\n'; + + newline = (buf[len - 1] == '\n'); + LogSWrite(verb, buf, len, newline); +} + void LogVHdrMessageVerb(MessageType type, int verb, const char *msg_format, va_list msg_args, const char *hdr_format, va_list hdr_args) { + static unsigned int warned; const char *type_str; char buf[1024]; const size_t size = sizeof(buf); Bool newline; size_t len = 0; + if (inSignalContext) { + if (warned < 3) { + BUG_WARN_MSG(inSignalContext, + "Warning: attempting to log data in a signal unsafe " + "manner while in signal context.\nPlease update to check " + "inSignalContext and/or use LogMessageVerbSigSafe().\nThe " + "offending header and log message formats are:\n%s %s\n", + hdr_format, msg_format); + warned++; + if (warned == 3) + LogMessageVerbSigSafe(X_WARNING, -1, "Warned %u times about sigsafe logging. Will be quiet now.\n", warned); + } + } + type_str = LogMessageTypeVerbString(type, verb); if (!type_str) return; @@ -472,7 +666,7 @@ AbortServer(void) #endif CloseWellKnownConnections(); OsCleanup(TRUE); - CloseDownDevices(); + AbortDevices(); AbortDDX(EXIT_ERR_ABORT); fflush(stderr); if (CoreDump) @@ -583,6 +777,7 @@ void FatalError(const char *f, ...) { va_list args; + va_list args2; static Bool beenhere = FALSE; if (beenhere) @@ -591,21 +786,26 @@ FatalError(const char *f, ...) ErrorF("\nFatal server error:\n"); va_start(args, f); + + /* Make a copy for OsVendorFatalError */ + va_copy(args2, args); + #ifdef __APPLE__ { - va_list args2; + va_list apple_args; - va_copy(args2, args); - (void) vsnprintf(__crashreporter_info_buff__, - sizeof(__crashreporter_info_buff__), f, args2); - va_end(args2); + va_copy(apple_args, args); + (void)vsnprintf(__crashreporter_info_buff__, + sizeof(__crashreporter_info_buff__), f, apple_args); + va_end(apple_args); } #endif VErrorF(f, args); va_end(args); ErrorF("\n"); if (!beenhere) - OsVendorFatalError(); + OsVendorFatalError(f, args2); + va_end(args2); if (!beenhere) { beenhere = TRUE; AbortServer(); @@ -637,6 +837,22 @@ ErrorF(const char *f, ...) va_end(args); } +void +VErrorFSigSafe(const char *f, va_list args) +{ + LogVMessageVerbSigSafe(X_ERROR, -1, f, args); +} + +void +ErrorFSigSafe(const char *f, ...) +{ + va_list args; + + va_start(args, f); + VErrorFSigSafe(f, args); + va_end(args); +} + void LogPrintMarkers(void) { diff --git a/xserver/os/osdep.h b/xserver/os/osdep.h index 2e5a22907..5e979dfc3 100644 --- a/xserver/os/osdep.h +++ b/xserver/os/osdep.h @@ -107,22 +107,8 @@ typedef Bool (*AddAuthorFunc) (unsigned name_length, const char *name, unsigned data_length, char *data); #endif -typedef struct _connectionInput { - struct _connectionInput *next; - char *buffer; /* contains current client input */ - char *bufptr; /* pointer to current start of data */ - int bufcnt; /* count of bytes in buffer */ - int lenLastReq; - int size; - unsigned int ignoreBytes; /* bytes to ignore before the next request */ -} ConnectionInput, *ConnectionInputPtr; - -typedef struct _connectionOutput { - struct _connectionOutput *next; - int size; - unsigned char *buf; - int count; -} ConnectionOutput, *ConnectionOutputPtr; +typedef struct _connectionInput *ConnectionInputPtr; +typedef struct _connectionOutput *ConnectionOutputPtr; struct _osComm; @@ -162,7 +148,6 @@ typedef struct _osComm { XID auth_id; /* authorization id */ CARD32 conn_time; /* timestamp if not established, else 0 */ struct _XtransConnInfo *trans_conn; /* transport connection object */ - Bool local_client; } OsCommRec, *OsCommPtr; extern int FlushClient(ClientPtr /*who */ , diff --git a/xserver/os/osinit.c b/xserver/os/osinit.c index 143e872e7..f085671f3 100644 --- a/xserver/os/osinit.c +++ b/xserver/os/osinit.c @@ -102,6 +102,7 @@ OsRegisterSigWrapper(OsSigWrapperPtr newSigWrapper) * OsSigHandler -- * Catch unexpected signals and exit or continue cleanly. */ +#if !defined(WIN32) || defined(__CYGWIN__) static void #ifdef SA_SIGINFO OsSigHandler(int signo, siginfo_t * sip, void *unused) @@ -113,7 +114,7 @@ OsSigHandler(int signo) const char *dlerr = dlerror(); if (dlerr) { - LogMessage(X_ERROR, "Dynamic loader error: %s\n", dlerr); + LogMessageVerbSigSafe(X_ERROR, 1, "Dynamic loader error: %s\n", dlerr); } #endif /* RTLD_DI_SETSIGNAL */ @@ -129,8 +130,8 @@ OsSigHandler(int signo) #ifdef SA_SIGINFO if (sip->si_code == SI_USER) { - ErrorF("Recieved signal %d sent by process %ld, uid %ld\n", - signo, (long) sip->si_pid, (long) sip->si_uid); + ErrorFSigSafe("Received signal %u sent by process %u, uid %u\n", signo, + sip->si_pid, sip->si_uid); } else { switch (signo) { @@ -138,7 +139,7 @@ OsSigHandler(int signo) case SIGBUS: case SIGILL: case SIGFPE: - ErrorF("%s at address %p\n", strsignal(signo), sip->si_addr); + ErrorFSigSafe("%s at address %p\n", strsignal(signo), sip->si_addr); } } #endif @@ -146,6 +147,7 @@ OsSigHandler(int signo) FatalError("Caught signal %d (%s). Server aborting\n", signo, strsignal(signo)); } +#endif /* !WIN32 || __CYGWIN__ */ void OsInit(void) @@ -155,6 +157,7 @@ OsInit(void) char fname[PATH_MAX]; if (!been_here) { +#if !defined(WIN32) || defined(__CYGWIN__) struct sigaction act, oact; int i; @@ -181,6 +184,8 @@ OsInit(void) siglist[i], strerror(errno)); } } +#endif /* !WIN32 || __CYGWIN__ */ + #ifdef HAVE_BACKTRACE /* * initialize the backtracer, since the ctor calls dlopen(), which @@ -207,29 +212,29 @@ OsInit(void) fclose(stdin); fclose(stdout); #endif - /* - * If a write of zero bytes to stderr returns non-zero, i.e. -1, - * then writing to stderr failed, and we'll write somewhere else - * instead. (Apparently this never happens in the Real World.) - */ - if (write(2, fname, 0) == -1) { - FILE *err; - - if (strlen(display) + strlen(ADMPATH) + 1 < sizeof fname) - snprintf(fname, sizeof(fname), ADMPATH, display); - else - strlcpy(fname, devnull, sizeof(fname)); - /* - * uses stdio to avoid os dependencies here, - * a real os would use - * open (fname, O_WRONLY|O_APPEND|O_CREAT, 0666) - */ - if (!(err = fopen(fname, "a+"))) - err = fopen(devnull, "w"); - if (err && (fileno(err) != 2)) { - dup2(fileno(err), 2); - fclose(err); - } + /* + * If a write of zero bytes to stderr returns non-zero, i.e. -1, + * then writing to stderr failed, and we'll write somewhere else + * instead. (Apparently this never happens in the Real World.) + */ + if (write (2, fname, 0) == -1) { + FILE *err; + + if (strlen (display) + strlen (ADMPATH) + 1 < sizeof fname) + snprintf (fname, sizeof(fname), ADMPATH, display); + else + strlcpy (fname, devnull, sizeof(fname)); + /* + * uses stdio to avoid os dependencies here, + * a real os would use + * open (fname, O_WRONLY|O_APPEND|O_CREAT, 0666) + */ + if (!(err = fopen (fname, "a+"))) + err = fopen (devnull, "w"); + if (err && (fileno(err) != 2)) { + dup2 (fileno (err), 2); + fclose (err); + } #if defined(SYSV) || defined(SVR4) || defined(WIN32) || defined(__CYGWIN__) { static char buf[BUFSIZ]; @@ -241,8 +246,10 @@ OsInit(void) #endif } +#if !defined(WIN32) || defined(__CYGWIN__) if (getpgrp() == 0) setpgid(0, 0); +#endif #ifdef RLIMIT_DATA if (limitDataSpace >= 0) { @@ -288,6 +295,7 @@ OsInit(void) } TimerInit(); OsVendorInit(); + OsResetSignals(); /* * No log file by default. OsVendorInit() should call LogInit() with the * log file name if logging to a file is desired. diff --git a/xserver/os/strndup.c b/xserver/os/strndup.c index b604b9bac..e0eddf13d 100644 --- a/xserver/os/strndup.c +++ b/xserver/os/strndup.c @@ -27,6 +27,10 @@ * SUCH DAMAGE. */ +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + #include #include #include diff --git a/xserver/os/utils.c b/xserver/os/utils.c index 47a34b914..617431f14 100644 --- a/xserver/os/utils.c +++ b/xserver/os/utils.c @@ -71,6 +71,7 @@ __stdcall unsigned long GetTickCount(void); #if !defined(WIN32) || !defined(__MINGW32__) #include #include +# define SMART_SCHEDULE_POSSIBLE #endif #include "misc.h" #include @@ -138,7 +139,6 @@ Bool noDPMSExtension = FALSE; #endif #ifdef GLXEXT Bool noGlxExtension = FALSE; -Bool noGlxVisualInit = FALSE; #endif #ifdef SCREENSAVER Bool noScreenSaverExtension = FALSE; @@ -204,6 +204,8 @@ int auditTrailLevel = 1; char *SeatId = NULL; +sig_atomic_t inSignalContext = FALSE; + #if defined(SVR4) || defined(__linux__) || defined(CSRG_BASED) #define HAS_SAVED_IDS_AND_SETEUID #endif @@ -211,6 +213,9 @@ char *SeatId = NULL; OsSigHandlerPtr OsSignal(int sig, OsSigHandlerPtr handler) { +#if defined(WIN32) && !defined(__CYGWIN__) + return signal(sig, handler); +#else struct sigaction act, oact; sigemptyset(&act.sa_mask); @@ -221,6 +226,7 @@ OsSignal(int sig, OsSigHandlerPtr handler) if (sigaction(sig, &act, &oact)) perror("sigaction"); return oact.sa_handler; +#endif } /* @@ -234,6 +240,19 @@ OsSignal(int sig, OsSigHandlerPtr handler) #define LOCK_PREFIX "/.X" #define LOCK_SUFFIX "-lock" +#if !defined(WIN32) || defined(__CYGWIN__) +#define LOCK_SERVER +#endif + +#ifndef LOCK_SERVER +void +LockServer(void) +{} + +void +UnlockServer(void) +{} +#else /* LOCK_SERVER */ static Bool StillLocking = FALSE; static char LockFile[PATH_MAX]; static Bool nolock = FALSE; @@ -264,10 +283,8 @@ LockServer(void) len += strlen(tmppath) + strlen(port) + strlen(LOCK_SUFFIX) + 1; if (len > sizeof(LockFile)) FatalError("Display name `%s' is too long\n", port); - (void) snprintf(tmp, sizeof(tmp), - "%s" LOCK_TMP_PREFIX "%s" LOCK_SUFFIX, tmppath, port); - (void) snprintf(LockFile, sizeof(LockFile), - "%s" LOCK_PREFIX "%s" LOCK_SUFFIX, tmppath, port); + (void) sprintf(tmp, "%s" LOCK_TMP_PREFIX "%s" LOCK_SUFFIX, tmppath, port); + (void) sprintf(LockFile, "%s" LOCK_PREFIX "%s" LOCK_SUFFIX, tmppath, port); /* * Create a temporary file containing our PID. Attempt three times @@ -387,12 +404,13 @@ UnlockServer(void) (void) unlink(LockFile); } } +#endif /* LOCK_SERVER */ #ifdef X_PRIVSEP int ChownLock(uid_t uid, gid_t gid) { - return chown(LockFile, uid, gid); + return chown(LockFile, uid, gid); } #endif @@ -516,7 +534,9 @@ UseMsg(void) #ifdef RLIMIT_STACK ErrorF("-ls int limit stack space to N Kb\n"); #endif +#ifdef LOCK_SERVER ErrorF("-nolock disable the locking mechanism\n"); +#endif ErrorF("-nolisten string don't listen on protocol\n"); ErrorF("-noreset don't reset after last client exists\n"); ErrorF("-background [none] create root window with no background\n"); @@ -530,8 +550,7 @@ UseMsg(void) #ifndef __OpenBSD__ ErrorF("-retro start with classic stipple and cursor\n"); #else - ErrorF("-retard start with black background " - "and no cursor\n"); + ErrorF("-retard start with black background and no cursor\n"); #endif ErrorF("-s # screen-saver timeout (minutes)\n"); ErrorF("-seat string seat to run on\n"); @@ -678,6 +697,17 @@ ProcessCommandLine(int argc, char *argv[]) else UseMsg(); } + else if (strcmp(argv[i], "-displayfd") == 0) { + if (++i < argc) { + displayfd = atoi(argv[i]); + display = NULL; +#ifdef LOCK_SERVER + nolock = TRUE; +#endif + } + else + UseMsg(); + } #ifdef DPMSExtension else if (strcmp(argv[i], "dpms") == 0) /* ignored for compatibility */ ; @@ -753,6 +783,7 @@ ProcessCommandLine(int argc, char *argv[]) UseMsg(); } #endif +#ifdef LOCK_SERVER else if (strcmp(argv[i], "-nolock") == 0) { #if !defined(WIN32) && !defined(__CYGWIN__) if (getuid() != 0) @@ -762,11 +793,12 @@ ProcessCommandLine(int argc, char *argv[]) #endif nolock = TRUE; } +#endif else if (strcmp(argv[i], "-nolisten") == 0) { if (++i < argc) { if (_XSERVTransNoListen(argv[i])) - FatalError("Failed to disable listen for %s transport", - argv[i]); + ErrorF("Failed to disable listen for %s transport", + argv[i]); } else UseMsg(); @@ -796,11 +828,11 @@ ProcessCommandLine(int argc, char *argv[]) else if (strcmp(argv[i], "-r") == 0) defaultKeyboardControl.autoRepeat = FALSE; #ifndef __OpenBSD__ - else if (strcmp(argv[i], "-retro") == 0) + else if ( strcmp( argv[i], "-retro") == 0) party_like_its_1989 = TRUE; #else - else if ( strcmp( argv[i], "-retard") == 0) - party_like_its_1989 = FALSE; + else if ( strcmp( argv[i], "-retard") == 0) + party_like_its_1989 = FALSE; #endif else if (strcmp(argv[i], "-s") == 0) { if (++i < argc) @@ -888,6 +920,7 @@ ProcessCommandLine(int argc, char *argv[]) i = skip - 1; } #endif +#ifdef SMART_SCHEDULE_POSSIBLE else if (strcmp(argv[i], "-dumbSched") == 0) { SmartScheduleDisable = TRUE; } @@ -906,6 +939,7 @@ ProcessCommandLine(int argc, char *argv[]) else UseMsg(); } +#endif else if (strcmp(argv[i], "-render") == 0) { if (++i < argc) { int policy = PictureParseCmapPolicy(argv[i]); @@ -1117,6 +1151,7 @@ XNFstrdup(const char *s) void SmartScheduleStopTimer(void) { +#ifdef SMART_SCHEDULE_POSSIBLE struct itimerval timer; if (SmartScheduleDisable) @@ -1126,11 +1161,13 @@ SmartScheduleStopTimer(void) timer.it_value.tv_sec = 0; timer.it_value.tv_usec = 0; (void) setitimer(ITIMER_REAL, &timer, 0); +#endif } void SmartScheduleStartTimer(void) { +#ifdef SMART_SCHEDULE_POSSIBLE struct itimerval timer; if (SmartScheduleDisable) @@ -1140,6 +1177,7 @@ SmartScheduleStartTimer(void) timer.it_value.tv_sec = 0; timer.it_value.tv_usec = SmartScheduleInterval * 1000; setitimer(ITIMER_REAL, &timer, 0); +#endif } static void @@ -1151,6 +1189,7 @@ SmartScheduleTimer(int sig) void SmartScheduleInit(void) { +#ifdef SMART_SCHEDULE_POSSIBLE struct sigaction act; if (SmartScheduleDisable) @@ -1166,6 +1205,7 @@ SmartScheduleInit(void) perror("sigaction for smart scheduler"); SmartScheduleDisable = TRUE; } +#endif } #ifdef SIG_BLOCK @@ -1180,14 +1220,14 @@ OsBlockSignals(void) if (BlockedSignalCount++ == 0) { sigset_t set; +#ifdef SIGIO + OsBlockSIGIO(); +#endif sigemptyset(&set); sigaddset(&set, SIGALRM); sigaddset(&set, SIGVTALRM); #ifdef SIGWINCH sigaddset(&set, SIGWINCH); -#endif -#ifdef SIGIO - sigaddset(&set, SIGIO); #endif sigaddset(&set, SIGTSTP); sigaddset(&set, SIGTTIN); @@ -1198,16 +1238,74 @@ OsBlockSignals(void) #endif } +#ifdef SIG_BLOCK +static sig_atomic_t sigio_blocked; +static sigset_t PreviousSigIOMask; +#endif + +/** + * returns zero if this call caused SIGIO to be blocked now, non-zero if it + * was already blocked by a previous call to this function. + */ +int +OsBlockSIGIO(void) +{ +#ifdef SIGIO +#ifdef SIG_BLOCK + if (sigio_blocked++ == 0) { + sigset_t set; + int ret; + + sigemptyset(&set); + sigaddset(&set, SIGIO); + sigprocmask(SIG_BLOCK, &set, &PreviousSigIOMask); + ret = sigismember(&PreviousSigIOMask, SIGIO); + return ret; + } +#endif +#endif + return 1; +} + +void +OsReleaseSIGIO(void) +{ +#ifdef SIGIO +#ifdef SIG_BLOCK + if (--sigio_blocked == 0) { + sigprocmask(SIG_SETMASK, &PreviousSigIOMask, 0); + } else if (sigio_blocked < 0) { + BUG_WARN(sigio_blocked < 0); + sigio_blocked = 0; + } +#endif +#endif +} + void OsReleaseSignals(void) { #ifdef SIG_BLOCK if (--BlockedSignalCount == 0) { sigprocmask(SIG_SETMASK, &PreviousSignalMask, 0); + OsReleaseSIGIO(); } #endif } +void +OsResetSignals(void) +{ +#ifdef SIG_BLOCK + while (BlockedSignalCount > 0) + OsReleaseSignals(); +#ifdef SIGIO + while (sigio_blocked > 0) + OsReleaseSIGIO(); +#endif +#endif +} + /* * Pending signals may interfere with core dumping. Provide a * mechanism to block signals when aborting. @@ -1514,6 +1612,79 @@ Fclose(pointer iop) #endif /* !WIN32 */ +#ifdef WIN32 + +#include + +const char * +Win32TempDir() +{ + static char buffer[PATH_MAX]; + + if (GetTempPath(sizeof(buffer), buffer)) { + int len; + + buffer[sizeof(buffer) - 1] = 0; + len = strlen(buffer); + if (len > 0) + if (buffer[len - 1] == '\\') + buffer[len - 1] = 0; + return buffer; + } + if (getenv("TEMP") != NULL) + return getenv("TEMP"); + else if (getenv("TMP") != NULL) + return getenv("TMP"); + else + return "/tmp"; +} + +int +System(const char *cmdline) +{ + STARTUPINFO si; + PROCESS_INFORMATION pi; + DWORD dwExitCode; + char *cmd = strdup(cmdline); + + ZeroMemory(&si, sizeof(si)); + si.cb = sizeof(si); + ZeroMemory(&pi, sizeof(pi)); + + if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) { + LPVOID buffer; + + if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + GetLastError(), + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + (LPTSTR) &buffer, 0, NULL)) { + ErrorF("[xkb] Starting '%s' failed!\n", cmdline); + } + else { + ErrorF("[xkb] Starting '%s' failed: %s", cmdline, (char *) buffer); + LocalFree(buffer); + } + + free(cmd); + return -1; + } + /* Wait until child process exits. */ + WaitForSingleObject(pi.hProcess, INFINITE); + + GetExitCodeProcess(pi.hProcess, &dwExitCode); + + /* Close process and thread handles. */ + CloseHandle(pi.hProcess); + CloseHandle(pi.hThread); + free(cmd); + + return dwExitCode; +} +#endif + /* * CheckUserParameters: check for long command line arguments and long * environment variables. By default, these checks are only done when @@ -1806,3 +1977,93 @@ xstrtokenize(const char *str, const char *separators) free(list); return NULL; } + +/* Format a signed number into a string in a signal safe manner. The string + * should be at least 21 characters in order to handle all int64_t values. + */ +void +FormatInt64(int64_t num, char *string) +{ + if (num < 0) { + string[0] = '-'; + num *= -1; + string++; + } + FormatUInt64(num, string); +} + +/* Format a number into a string in a signal safe manner. The string should be + * at least 21 characters in order to handle all uint64_t values. */ +void +FormatUInt64(uint64_t num, char *string) +{ + uint64_t divisor; + int len; + int i; + + for (len = 1, divisor = 10; + len < 20 && num / divisor; + len++, divisor *= 10); + + for (i = len, divisor = 1; i > 0; i--, divisor *= 10) + string[i - 1] = '0' + ((num / divisor) % 10); + + string[len] = '\0'; +} + +/** + * Format a double number as %.2f. + */ +void +FormatDouble(double dbl, char *string) +{ + int slen = 0; + uint64_t frac; + + frac = (dbl > 0 ? dbl : -dbl) * 100.0 + 0.5; + frac %= 100; + + /* write decimal part to string */ + if (dbl < 0 && dbl > -1) + string[slen++] = '-'; + FormatInt64((int64_t)dbl, &string[slen]); + + while(string[slen] != '\0') + slen++; + + /* append fractional part, but only if we have enough characters. We + * expect string to be 21 chars (incl trailing \0) */ + if (slen <= 17) { + string[slen++] = '.'; + if (frac < 10) + string[slen++] = '0'; + + FormatUInt64(frac, &string[slen]); + } +} + + +/* Format a number into a hexadecimal string in a signal safe manner. The string + * should be at least 17 characters in order to handle all uint64_t values. */ +void +FormatUInt64Hex(uint64_t num, char *string) +{ + uint64_t divisor; + int len; + int i; + + for (len = 1, divisor = 0x10; + len < 16 && num / divisor; + len++, divisor *= 0x10); + + for (i = len, divisor = 1; i > 0; i--, divisor *= 0x10) { + int val = (num / divisor) % 0x10; + + if (val < 10) + string[i - 1] = '0' + val; + else + string[i - 1] = 'a' + val - 10; + } + + string[len] = '\0'; +} diff --git a/xserver/os/xdmcp.c b/xserver/os/xdmcp.c index 8d0fbb5a9..0538ac53e 100644 --- a/xserver/os/xdmcp.c +++ b/xserver/os/xdmcp.c @@ -751,7 +751,7 @@ receive_packet(int socketfd) XdmcpHeader header; /* read message off socket */ - if (!XdmcpFill(socketfd, &buffer, (XdmcpNetaddr) & from, &fromlen)) + if (!XdmcpFill(socketfd, &buffer, (XdmcpNetaddr) &from, &fromlen)) return; /* reset retransmission backoff */ @@ -1059,7 +1059,7 @@ send_query_msg(void) for (i = 0; i < NumBroadcastAddresses; i++) XdmcpFlush(xdmcpSocket, &buffer, - (XdmcpNetaddr) & BroadcastAddresses[i], + (XdmcpNetaddr) &BroadcastAddresses[i], sizeof(struct sockaddr_in)); } #if defined(IPv6) && defined(AF_INET6) @@ -1098,7 +1098,7 @@ send_query_msg(void) if (SOCKADDR_FAMILY(ManagerAddress) == AF_INET6) socketfd = xdmcpSocket6; #endif - XdmcpFlush(socketfd, &buffer, (XdmcpNetaddr) & ManagerAddress, + XdmcpFlush(socketfd, &buffer, (XdmcpNetaddr) &ManagerAddress, ManagerAddressLen); } } @@ -1223,7 +1223,7 @@ send_request_msg(void) socketfd = xdmcpSocket6; #endif if (XdmcpFlush(socketfd, &buffer, - (XdmcpNetaddr) & req_sockaddr, req_socklen)) + (XdmcpNetaddr) &req_sockaddr, req_socklen)) state = XDM_AWAIT_REQUEST_RESPONSE; } @@ -1316,7 +1316,7 @@ send_manage_msg(void) if (SOCKADDR_FAMILY(req_sockaddr) == AF_INET6) socketfd = xdmcpSocket6; #endif - XdmcpFlush(socketfd, &buffer, (XdmcpNetaddr) & req_sockaddr, req_socklen); + XdmcpFlush(socketfd, &buffer, (XdmcpNetaddr) &req_sockaddr, req_socklen); } static void @@ -1373,7 +1373,7 @@ send_keepalive_msg(void) if (SOCKADDR_FAMILY(req_sockaddr) == AF_INET6) socketfd = xdmcpSocket6; #endif - XdmcpFlush(socketfd, &buffer, (XdmcpNetaddr) & req_sockaddr, req_socklen); + XdmcpFlush(socketfd, &buffer, (XdmcpNetaddr) &req_sockaddr, req_socklen); } static void @@ -1391,7 +1391,7 @@ recv_alive_msg(unsigned length) if (SessionRunning && AliveSessionID == SessionID) { /* backoff dormancy period */ state = XDM_RUN_SESSION; - if ((GetTimeInMillis() - lastDeviceEventTime.milliseconds) > + if ((GetTimeInMillis() - lastDeviceEventTime[XIAllDevices].milliseconds) > keepaliveDormancy * 1000) { keepaliveDormancy <<= 1; if (keepaliveDormancy > XDM_MAX_DORMANCY) diff --git a/xserver/os/xsha1.c b/xserver/os/xsha1.c index dccce74b6..24c0aa284 100644 --- a/xserver/os/xsha1.c +++ b/xserver/os/xsha1.c @@ -74,6 +74,78 @@ x_sha1_final(void *ctx, unsigned char result[20]) return 1; } +#elif defined(HAVE_SHA1_IN_CRYPTOAPI) /* Use CryptoAPI for SHA1 */ + +#define WIN32_LEAN_AND_MEAN +#include +#include + +static HCRYPTPROV hProv; + +void * +x_sha1_init(void) +{ + HCRYPTHASH *ctx = malloc(sizeof(*ctx)); + + if (!ctx) + return NULL; + CryptAcquireContext(&hProv, NULL, MS_DEF_PROV, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT); + CryptCreateHash(hProv, CALG_SHA1, 0, 0, ctx); + return ctx; +} + +int +x_sha1_update(void *ctx, void *data, int size) +{ + HCRYPTHASH *hHash = ctx; + + CryptHashData(*hHash, data, size, 0); + return 1; +} + +int +x_sha1_final(void *ctx, unsigned char result[20]) +{ + HCRYPTHASH *hHash = ctx; + DWORD len = 20; + + CryptGetHashParam(*hHash, HP_HASHVAL, result, &len, 0); + CryptDestroyHash(*hHash); + CryptReleaseContext(hProv, 0); + free(ctx); + return 1; +} + +#elif defined(HAVE_SHA1_IN_LIBNETTLE) /* Use libnettle for SHA1 */ + +#include + +void * +x_sha1_init(void) +{ + struct sha1_ctx *ctx = malloc(sizeof(*ctx)); + + if (!ctx) + return NULL; + sha1_init(ctx); + return ctx; +} + +int +x_sha1_update(void *ctx, void *data, int size) +{ + sha1_update(ctx, size, data); + return 1; +} + +int +x_sha1_final(void *ctx, unsigned char result[20]) +{ + sha1_digest(ctx, 20, result); + free(ctx); + return 1; +} + #elif defined(HAVE_SHA1_IN_LIBGCRYPT) /* Use libgcrypt for SHA1 */ #include diff --git a/xserver/randr/Makefile.am b/xserver/randr/Makefile.am index de338b972..ccaff3f02 100644 --- a/xserver/randr/Makefile.am +++ b/xserver/randr/Makefile.am @@ -18,6 +18,8 @@ librandr_la_SOURCES = \ rroutput.c \ rrpointer.c \ rrproperty.c \ + rrprovider.c \ + rrproviderproperty.c \ rrscreen.c \ rrsdispatch.c \ rrtransform.h \ diff --git a/xserver/randr/Makefile.in b/xserver/randr/Makefile.in index cf3a52d13..1078b5842 100644 --- a/xserver/randr/Makefile.in +++ b/xserver/randr/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -78,13 +78,14 @@ LTLIBRARIES = $(noinst_LTLIBRARIES) librandr_la_LIBADD = am__librandr_la_SOURCES_DIST = randr.c randrstr.h rrcrtc.c \ rrdispatch.c rrinfo.c rrmode.c rroutput.c rrpointer.c \ - rrproperty.c rrscreen.c rrsdispatch.c rrtransform.h \ - rrtransform.c rrxinerama.c + rrproperty.c rrprovider.c rrproviderproperty.c rrscreen.c \ + rrsdispatch.c rrtransform.h rrtransform.c rrxinerama.c am__objects_1 = rrxinerama.lo @XINERAMA_TRUE@am__objects_2 = $(am__objects_1) am_librandr_la_OBJECTS = randr.lo rrcrtc.lo rrdispatch.lo rrinfo.lo \ - rrmode.lo rroutput.lo rrpointer.lo rrproperty.lo rrscreen.lo \ - rrsdispatch.lo rrtransform.lo $(am__objects_2) + rrmode.lo rroutput.lo rrpointer.lo rrproperty.lo rrprovider.lo \ + rrproviderproperty.lo rrscreen.lo rrsdispatch.lo \ + rrtransform.lo $(am__objects_2) librandr_la_OBJECTS = $(am_librandr_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -221,13 +222,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -249,6 +246,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -273,6 +271,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -288,7 +287,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -387,6 +385,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -492,13 +491,13 @@ XINERAMA_SRCS = rrxinerama.c @XORG_TRUE@sdk_HEADERS = randrstr.h rrtransform.h librandr_la_SOURCES = randr.c randrstr.h rrcrtc.c rrdispatch.c \ rrinfo.c rrmode.c rroutput.c rrpointer.c rrproperty.c \ - rrscreen.c rrsdispatch.c rrtransform.h rrtransform.c \ - $(am__append_1) + rrprovider.c rrproviderproperty.c rrscreen.c rrsdispatch.c \ + rrtransform.h rrtransform.c $(am__append_1) all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -523,9 +522,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): @@ -556,6 +555,8 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rroutput.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rrpointer.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rrproperty.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rrprovider.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rrproviderproperty.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rrscreen.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rrsdispatch.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rrtransform.Plo@am__quote@ diff --git a/xserver/randr/randr.c b/xserver/randr/randr.c index 5c1f70cb3..f0decfc6c 100644 --- a/xserver/randr/randr.c +++ b/xserver/randr/randr.c @@ -30,6 +30,7 @@ #endif #include "randrstr.h" +#include "extinit.h" /* From render.h */ #ifndef SubPixelUnknown @@ -83,7 +84,7 @@ RRClientCallback(CallbackListPtr *list, pointer closure, pointer data) } static Bool -RRCloseScreen(int i, ScreenPtr pScreen) +RRCloseScreen(ScreenPtr pScreen) { rrScrPriv(pScreen); int j; @@ -94,11 +95,14 @@ RRCloseScreen(int i, ScreenPtr pScreen) for (j = pScrPriv->numOutputs - 1; j >= 0; j--) RROutputDestroy(pScrPriv->outputs[j]); + if (pScrPriv->provider) + RRProviderDestroy(pScrPriv->provider); + free(pScrPriv->crtcs); free(pScrPriv->outputs); free(pScrPriv); RRNScreens -= 1; /* ok, one fewer screen with RandR running */ - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } static void @@ -175,6 +179,47 @@ SRROutputPropertyNotifyEvent(xRROutputPropertyNotifyEvent * from, /* pad4 */ } +static void +SRRProviderChangeNotifyEvent(xRRProviderChangeNotifyEvent * from, + xRRProviderChangeNotifyEvent * to) +{ + to->type = from->type; + to->subCode = from->subCode; + cpswaps(from->sequenceNumber, to->sequenceNumber); + cpswapl(from->timestamp, to->timestamp); + cpswapl(from->window, to->window); + cpswapl(from->provider, to->provider); +} + +static void +SRRProviderPropertyNotifyEvent(xRRProviderPropertyNotifyEvent * from, + xRRProviderPropertyNotifyEvent * to) +{ + to->type = from->type; + to->subCode = from->subCode; + cpswaps(from->sequenceNumber, to->sequenceNumber); + cpswapl(from->window, to->window); + cpswapl(from->provider, to->provider); + cpswapl(from->atom, to->atom); + cpswapl(from->timestamp, to->timestamp); + to->state = from->state; + /* pad1 */ + /* pad2 */ + /* pad3 */ + /* pad4 */ +} + +static void +SRRResourceChangeNotifyEvent(xRRResourceChangeNotifyEvent * from, + xRRResourceChangeNotifyEvent * to) +{ + to->type = from->type; + to->subCode = from->subCode; + cpswaps(from->sequenceNumber, to->sequenceNumber); + cpswapl(from->timestamp, to->timestamp); + cpswapl(from->window, to->window); +} + static void SRRNotifyEvent(xEvent *from, xEvent *to) { @@ -191,6 +236,17 @@ SRRNotifyEvent(xEvent *from, xEvent *to) SRROutputPropertyNotifyEvent((xRROutputPropertyNotifyEvent *) from, (xRROutputPropertyNotifyEvent *) to); break; + case RRNotify_ProviderChange: + SRRProviderChangeNotifyEvent((xRRProviderChangeNotifyEvent *) from, + (xRRProviderChangeNotifyEvent *) to); + break; + case RRNotify_ProviderProperty: + SRRProviderPropertyNotifyEvent((xRRProviderPropertyNotifyEvent *) from, + (xRRProviderPropertyNotifyEvent *) to); + break; + case RRNotify_ResourceChange: + SRRResourceChangeNotifyEvent((xRRResourceChangeNotifyEvent *) from, + (xRRResourceChangeNotifyEvent *) to); default: break; } @@ -208,6 +264,8 @@ RRInit(void) return FALSE; if (!RROutputInit()) return FALSE; + if (!RRProviderInit()) + return FALSE; RRGeneration = serverGeneration; } if (!dixRegisterPrivateKey(&rrPrivKeyRec, PRIVATE_SCREEN, 0)) @@ -269,7 +327,7 @@ RRScreenInit(ScreenPtr pScreen) wrap(pScrPriv, pScreen, CloseScreen, RRCloseScreen); pScreen->ConstrainCursorHarder = RRConstrainCursorHarder; - + pScreen->ReplaceScanoutPixmap = RRReplaceScanoutPixmap; pScrPriv->numOutputs = 0; pScrPriv->outputs = NULL; pScrPriv->numCrtcs = 0; @@ -356,7 +414,7 @@ RRExtensionInit(void) RRModeInitErrorValue(); RRCrtcInitErrorValue(); RROutputInitErrorValue(); - + RRProviderInitErrorValue(); #ifdef PANORAMIX RRXineramaExtensionInit(); #endif @@ -412,25 +470,37 @@ TellChanged(WindowPtr pWin, pointer value) void RRTellChanged(ScreenPtr pScreen) { + ScreenPtr master; rrScrPriv(pScreen); + rrScrPrivPtr mastersp; int i; + if (pScreen->isGPU) { + master = pScreen->current_master; + mastersp = rrGetScrPriv(master); + } + else { + master = pScreen; + mastersp = pScrPriv; + } + if (pScrPriv->changed) { UpdateCurrentTimeIf(); - if (pScrPriv->configChanged) { - pScrPriv->lastConfigTime = currentTime; - pScrPriv->configChanged = FALSE; + if (mastersp->configChanged) { + mastersp->lastConfigTime = currentTime; + mastersp->configChanged = FALSE; } pScrPriv->changed = FALSE; - WalkTree(pScreen, TellChanged, (pointer) pScreen); + mastersp->changed = FALSE; + WalkTree(master, TellChanged, (pointer) master); for (i = 0; i < pScrPriv->numOutputs; i++) pScrPriv->outputs[i]->changed = FALSE; for (i = 0; i < pScrPriv->numCrtcs; i++) pScrPriv->crtcs[i]->changed = FALSE; - if (pScrPriv->layoutChanged) { + if (mastersp->layoutChanged) { pScrPriv->layoutChanged = FALSE; - RRPointerScreenConfigured(pScreen); - RRSendConfigNotify(pScreen); + RRPointerScreenConfigured(master); + RRSendConfigNotify(master); } } } @@ -446,6 +516,9 @@ RRFirstOutput(ScreenPtr pScreen) RROutputPtr output; int i, j; + if (!pScrPriv) + return NULL; + if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc) return pScrPriv->primaryOutput; diff --git a/xserver/randr/randrstr.h b/xserver/randr/randrstr.h index 273885de7..25174798f 100644 --- a/xserver/randr/randrstr.h +++ b/xserver/randr/randrstr.h @@ -57,11 +57,12 @@ #define RANDR_13_INTERFACE 1 /* requires RANDR_12_INTERFACE */ #define RANDR_GET_CRTC_INTERFACE 1 -#define RANDR_INTERFACE_VERSION 0x0103 +#define RANDR_INTERFACE_VERSION 0x0104 typedef XID RRMode; typedef XID RROutput; typedef XID RRCrtc; +typedef XID RRProvider; extern _X_EXPORT int RREventBase, RRErrorBase; @@ -78,6 +79,7 @@ typedef struct _rrPropertyValue RRPropertyValueRec, *RRPropertyValuePtr; typedef struct _rrProperty RRPropertyRec, *RRPropertyPtr; typedef struct _rrCrtc RRCrtcRec, *RRCrtcPtr; typedef struct _rrOutput RROutputRec, *RROutputPtr; +typedef struct _rrProvider RRProviderRec, *RRProviderPtr; struct _rrMode { int refcnt; @@ -125,6 +127,8 @@ struct _rrCrtc { PictTransform transform; struct pict_f_transform f_transform; struct pict_f_transform f_inverse; + + PixmapPtr scanout_pixmap; }; struct _rrOutput { @@ -152,6 +156,18 @@ struct _rrOutput { void *devPrivate; }; +struct _rrProvider { + RRProvider id; + ScreenPtr pScreen; + uint32_t capabilities; + char *name; + int nameLength; + RRPropertyPtr properties; + Bool pendingProperties; + struct _rrProvider *offload_sink; + struct _rrProvider *output_source; +}; + #if RANDR_12_INTERFACE typedef Bool (*RRScreenSetSizeProcPtr) (ScreenPtr pScreen, CARD16 width, @@ -197,8 +213,27 @@ typedef Bool (*RRSetPanningProcPtr) (ScreenPtr pScrn, #endif /* RANDR_13_INTERFACE */ +typedef Bool (*RRProviderGetPropertyProcPtr) (ScreenPtr pScreen, + RRProviderPtr provider, Atom property); +typedef Bool (*RRProviderSetPropertyProcPtr) (ScreenPtr pScreen, + RRProviderPtr provider, + Atom property, + RRPropertyValuePtr value); + typedef Bool (*RRGetInfoProcPtr) (ScreenPtr pScreen, Rotation * rotations); -typedef Bool (*RRCloseScreenProcPtr) (int i, ScreenPtr pscreen); +typedef Bool (*RRCloseScreenProcPtr) (ScreenPtr pscreen); + +typedef Bool (*RRProviderSetOutputSourceProcPtr)(ScreenPtr pScreen, + RRProviderPtr provider, + RRProviderPtr output_source); + +typedef Bool (*RRProviderSetOffloadSinkProcPtr)(ScreenPtr pScreen, + RRProviderPtr provider, + RRProviderPtr offload_sink); + + +typedef void (*RRProviderDestroyProcPtr)(ScreenPtr pScreen, + RRProviderPtr provider); /* These are for 1.0 compatibility */ @@ -223,6 +258,8 @@ typedef Bool (*RRSetConfigProcPtr) (ScreenPtr pScreen, #endif +typedef Bool (*RRCrtcSetScanoutPixmapProcPtr)(RRCrtcPtr crtc, PixmapPtr pixmap); + typedef struct _rrScrPriv { /* * 'public' part of the structure; DDXen fill this in @@ -246,7 +283,13 @@ typedef struct _rrScrPriv { RRGetPanningProcPtr rrGetPanning; RRSetPanningProcPtr rrSetPanning; #endif + /* TODO #if RANDR_15_INTERFACE */ + RRCrtcSetScanoutPixmapProcPtr rrCrtcSetScanoutPixmap; + RRProviderSetOutputSourceProcPtr rrProviderSetOutputSource; + RRProviderSetOffloadSinkProcPtr rrProviderSetOffloadSink; + RRProviderGetPropertyProcPtr rrProviderGetProperty; + RRProviderSetPropertyProcPtr rrProviderSetProperty; /* * Private part of the structure; not considered part of the ABI */ @@ -288,6 +331,11 @@ typedef struct _rrScrPriv { int size; #endif Bool discontiguous; + + RRProviderPtr provider; + + RRProviderDestroyProcPtr rrProviderDestroy; + } rrScrPrivRec, *rrScrPrivPtr; extern _X_EXPORT DevPrivateKeyRec rrPrivKeyRec; @@ -331,7 +379,7 @@ extern _X_EXPORT RESTYPE RRClientType, RREventType; /* resource types for ev extern _X_EXPORT DevPrivateKeyRec RRClientPrivateKeyRec; #define RRClientPrivateKey (&RRClientPrivateKeyRec) -extern _X_EXPORT RESTYPE RRCrtcType, RRModeType, RROutputType; +extern _X_EXPORT RESTYPE RRCrtcType, RRModeType, RROutputType, RRProviderType; #define VERIFY_RR_OUTPUT(id, ptr, a)\ {\ @@ -363,13 +411,19 @@ extern _X_EXPORT RESTYPE RRCrtcType, RRModeType, RROutputType; }\ } +#define VERIFY_RR_PROVIDER(id, ptr, a)\ + {\ + int rc = dixLookupResourceByType((pointer *)&(ptr), id,\ + RRProviderType, client, a);\ + if (rc != Success) {\ + client->errorValue = id;\ + return rc;\ + }\ + } + #define GetRRClient(pClient) ((RRClientPtr)dixLookupPrivate(&(pClient)->devPrivates, RRClientPrivateKey)) #define rrClientPriv(pClient) RRClientPtr pRRClient = GetRRClient(pClient) -/* Initialize the extension */ -extern _X_EXPORT void - RRExtensionInit(void); - #ifdef RANDR_12_INTERFACE /* * Set the range of sizes for the screen @@ -574,25 +628,6 @@ extern _X_EXPORT Bool extern _X_EXPORT void RRCrtcGetScanoutSize(RRCrtcPtr crtc, int *width, int *height); -/* - * Compute the complete transformation matrix including - * client-specified transform, rotation/reflection values and the crtc - * offset. - * - * Return TRUE if the resulting transform is not a simple translation. - */ -extern _X_EXPORT Bool - -RRTransformCompute(int x, - int y, - int width, - int height, - Rotation rotation, - RRTransformPtr rr_transform, - PictTransformPtr transform, - struct pict_f_transform *f_transform, - struct pict_f_transform *f_inverse); - /* * Return crtc transform */ @@ -634,6 +669,15 @@ extern _X_EXPORT Bool extern _X_EXPORT void RRCrtcInitErrorValue(void); +/* + * Detach and free a scanout pixmap + */ +extern _X_EXPORT void + RRCrtcDetachScanoutPixmap(RRCrtcPtr crtc); + +extern _X_EXPORT Bool + RRReplaceScanoutPixmap(DrawablePtr pDrawable, PixmapPtr pPixmap, Bool enable); + /* * Crtc dispatch */ @@ -843,6 +887,82 @@ extern _X_EXPORT int extern _X_EXPORT int ProcRRDeleteOutputProperty(ClientPtr client); +/* rrprovider.c */ +extern _X_EXPORT void +RRProviderInitErrorValue(void); + +extern _X_EXPORT int +ProcRRGetProviders(ClientPtr client); + +extern _X_EXPORT int +ProcRRGetProviderInfo(ClientPtr client); + +extern _X_EXPORT int +ProcRRSetProviderOutputSource(ClientPtr client); + +extern _X_EXPORT int +ProcRRSetProviderOffloadSink(ClientPtr client); + +extern _X_EXPORT Bool +RRProviderInit(void); + +extern _X_EXPORT RRProviderPtr +RRProviderCreate(ScreenPtr pScreen, const char *name, + int nameLength); + +extern _X_EXPORT void +RRProviderDestroy (RRProviderPtr provider); + +extern _X_EXPORT void +RRProviderSetCapabilities(RRProviderPtr provider, uint32_t capabilities); + +extern _X_EXPORT Bool +RRProviderLookup(XID id, RRProviderPtr *provider_p); + +/* rrproviderproperty.c */ + +extern _X_EXPORT void + RRDeleteAllProviderProperties(RRProviderPtr provider); + +extern _X_EXPORT RRPropertyValuePtr + RRGetProviderProperty(RRProviderPtr provider, Atom property, Bool pending); + +extern _X_EXPORT RRPropertyPtr + RRQueryProviderProperty(RRProviderPtr provider, Atom property); + +extern _X_EXPORT void + RRDeleteProviderProperty(RRProviderPtr provider, Atom property); + +extern _X_EXPORT int +RRChangeProviderProperty(RRProviderPtr provider, Atom property, Atom type, + int format, int mode, unsigned long len, + pointer value, Bool sendevent, Bool pending); + +extern _X_EXPORT int + RRConfigureProviderProperty(RRProviderPtr provider, Atom property, + Bool pending, Bool range, Bool immutable, + int num_values, INT32 *values); + +extern _X_EXPORT Bool + RRPostProviderPendingProperties(RRProviderPtr provider); + +extern _X_EXPORT int + ProcRRGetProviderProperty(ClientPtr client); + +extern _X_EXPORT int + ProcRRListProviderProperties(ClientPtr client); + +extern _X_EXPORT int + ProcRRQueryProviderProperty(ClientPtr client); + +extern _X_EXPORT int +ProcRRConfigureProviderProperty(ClientPtr client); + +extern _X_EXPORT int +ProcRRChangeProviderProperty(ClientPtr client); + +extern _X_EXPORT int + ProcRRDeleteProviderProperty(ClientPtr client); /* rrxinerama.c */ #ifdef XINERAMA extern _X_EXPORT void diff --git a/xserver/randr/rrcrtc.c b/xserver/randr/rrcrtc.c index 36caa5822..6e2eca5ad 100644 --- a/xserver/randr/rrcrtc.c +++ b/xserver/randr/rrcrtc.c @@ -236,29 +236,21 @@ RRDeliverCrtcEvent(ClientPtr client, WindowPtr pWin, RRCrtcPtr crtc) ScreenPtr pScreen = pWin->drawable.pScreen; rrScrPriv(pScreen); - xRRCrtcChangeNotifyEvent ce; RRModePtr mode = crtc->mode; - ce.type = RRNotify + RREventBase; - ce.subCode = RRNotify_CrtcChange; - ce.timestamp = pScrPriv->lastSetTime.milliseconds; - ce.window = pWin->drawable.id; - ce.crtc = crtc->id; - ce.rotation = crtc->rotation; - if (mode) { - ce.mode = mode->mode.id; - ce.x = crtc->x; - ce.y = crtc->y; - ce.width = mode->mode.width; - ce.height = mode->mode.height; - } - else { - ce.mode = None; - ce.x = 0; - ce.y = 0; - ce.width = 0; - ce.height = 0; - } + xRRCrtcChangeNotifyEvent ce = { + .type = RRNotify + RREventBase, + .subCode = RRNotify_CrtcChange, + .timestamp = pScrPriv->lastSetTime.milliseconds, + .window = pWin->drawable.id, + .crtc = crtc->id, + .mode = mode ? mode->mode.id : None, + .rotation = crtc->rotation, + .x = mode ? crtc->x : 0, + .y = mode ? crtc->y : 0, + .width = mode ? mode->mode.width : 0, + .height = mode ? mode->mode.height : 0 + }; WriteEventsToClient(client, 1, (xEvent *) &ce); } @@ -367,6 +359,159 @@ RRComputeContiguity(ScreenPtr pScreen) pScrPriv->discontiguous = discontiguous; } +void +RRCrtcDetachScanoutPixmap(RRCrtcPtr crtc) +{ + ScreenPtr master = crtc->pScreen->current_master; + int ret; + PixmapPtr mscreenpix; + rrScrPriv(crtc->pScreen); + + mscreenpix = master->GetScreenPixmap(master); + + ret = pScrPriv->rrCrtcSetScanoutPixmap(crtc, NULL); + if (crtc->scanout_pixmap) { + master->StopPixmapTracking(mscreenpix, crtc->scanout_pixmap); + /* + * Unref the pixmap twice: once for the original reference, and once + * for the reference implicitly added by PixmapShareToSlave. + */ + master->DestroyPixmap(crtc->scanout_pixmap->master_pixmap); + master->DestroyPixmap(crtc->scanout_pixmap->master_pixmap); + crtc->pScreen->DestroyPixmap(crtc->scanout_pixmap); + } + crtc->scanout_pixmap = NULL; + RRCrtcChanged(crtc, TRUE); +} + +static Bool +rrCreateSharedPixmap(RRCrtcPtr crtc, int width, int height, + int x, int y) +{ + PixmapPtr mpix, spix; + ScreenPtr master = crtc->pScreen->current_master; + Bool ret; + int depth; + PixmapPtr mscreenpix; + PixmapPtr protopix = crtc->pScreen->current_master->GetScreenPixmap(crtc->pScreen->current_master); + rrScrPriv(crtc->pScreen); + + /* create a pixmap on the master screen, + then get a shared handle for it + create a shared pixmap on the slave screen using the handle + set the master screen to do dirty updates to the shared pixmap + from the screen pixmap. + set slave screen to scanout shared linear pixmap + */ + + mscreenpix = master->GetScreenPixmap(master); + depth = protopix->drawable.depth; + + if (crtc->scanout_pixmap) + RRCrtcDetachScanoutPixmap(crtc); + + if (width == 0 && height == 0) { + return TRUE; + } + + mpix = master->CreatePixmap(master, width, height, depth, + CREATE_PIXMAP_USAGE_SHARED); + if (!mpix) + return FALSE; + + spix = PixmapShareToSlave(mpix, crtc->pScreen); + if (spix == NULL) { + master->DestroyPixmap(mpix); + return FALSE; + } + + ret = pScrPriv->rrCrtcSetScanoutPixmap(crtc, spix); + if (ret == FALSE) { + ErrorF("failed to set shadow slave pixmap\n"); + return FALSE; + } + + crtc->scanout_pixmap = spix; + + master->StartPixmapTracking(mscreenpix, spix, x, y); + return TRUE; +} + +static Bool +rrCheckPixmapBounding(ScreenPtr pScreen, + RRCrtcPtr rr_crtc, int x, int y, int w, int h) +{ + RegionRec root_pixmap_region, total_region, new_crtc_region; + int i, c; + BoxRec newbox; + BoxPtr newsize; + ScreenPtr slave; + int new_width, new_height; + PixmapPtr screen_pixmap = pScreen->GetScreenPixmap(pScreen); + rrScrPriv(pScreen); + + PixmapRegionInit(&root_pixmap_region, screen_pixmap); + RegionInit(&total_region, NULL, 0); + + /* have to iterate all the crtcs of the attached gpu masters + and all their output slaves */ + for (c = 0; c < pScrPriv->numCrtcs; c++) { + if (pScrPriv->crtcs[c] == rr_crtc) { + newbox.x1 = x; + newbox.x2 = x + w; + newbox.y1 = y; + newbox.y2 = y + h; + } else { + if (!pScrPriv->crtcs[c]->mode) + continue; + newbox.x1 = pScrPriv->crtcs[c]->x; + newbox.x2 = pScrPriv->crtcs[c]->x + pScrPriv->crtcs[c]->mode->mode.width; + newbox.y1 = pScrPriv->crtcs[c]->y; + newbox.y2 = pScrPriv->crtcs[c]->y + pScrPriv->crtcs[c]->mode->mode.height; + } + RegionInit(&new_crtc_region, &newbox, 1); + RegionUnion(&total_region, &total_region, &new_crtc_region); + } + + xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) { + rrScrPriv(slave); + for (c = 0; c < pScrPriv->numCrtcs; c++) + if (pScrPriv->crtcs[c] == rr_crtc) { + newbox.x1 = x; + newbox.x2 = x + w; + newbox.y1 = y; + newbox.y2 = y + h; + } + else { + if (!pScrPriv->crtcs[c]->mode) + continue; + newbox.x1 = pScrPriv->crtcs[c]->x; + newbox.x2 = pScrPriv->crtcs[c]->x + pScrPriv->crtcs[c]->mode->mode.width; + newbox.y1 = pScrPriv->crtcs[c]->y; + newbox.y2 = pScrPriv->crtcs[c]->y + pScrPriv->crtcs[c]->mode->mode.height; + } + RegionInit(&new_crtc_region, &newbox, 1); + RegionUnion(&total_region, &total_region, &new_crtc_region); + } + + newsize = RegionExtents(&total_region); + new_width = newsize->x2 - newsize->x1; + new_height = newsize->y2 - newsize->y1; + + if (new_width == screen_pixmap->drawable.width && + new_height == screen_pixmap->drawable.height) { + ErrorF("adjust shatters %d %d\n", newsize->x1, newsize->x2); + } else { + int ret; + rrScrPriv(pScreen); + ret = pScrPriv->rrScreenSetSize(pScreen, + new_width, new_height, 0, 0); + } + + /* set shatters TODO */ + return TRUE; +} + /* * Request that the Crtc be reconfigured */ @@ -394,6 +539,26 @@ RRCrtcSet(RRCrtcPtr crtc, ret = TRUE; } else { + if (pScreen->isGPU) { + ScreenPtr master = pScreen->current_master; + int width = 0, height = 0; + + if (mode) { + width = mode->mode.width; + height = mode->mode.height; + } + ErrorF("have a master to look out for\n"); + ret = rrCheckPixmapBounding(master, crtc, + x, y, width, height); + if (!ret) + return FALSE; + + if (pScreen->current_master) { + ret = rrCreateSharedPixmap(crtc, width, height, x, y); + ErrorF("need to create shared pixmap %d", ret); + + } + } #if RANDR_12_INTERFACE if (pScrPriv->rrCrtcSet) { ret = (*pScrPriv->rrCrtcSet) (pScreen, crtc, mode, x, y, @@ -508,6 +673,9 @@ RRCrtcDestroyResource(pointer value, XID pid) } } } + + if (crtc->scanout_pixmap) + RRCrtcDetachScanoutPixmap(crtc); free(crtc->gammaRed); if (crtc->mode) RRModeDestroy(crtc->mode); @@ -729,11 +897,13 @@ ProcRRGetCrtcInfo(ClientPtr client) mode = crtc->mode; - rep.type = X_Reply; - rep.status = RRSetConfigSuccess; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.timestamp = pScrPriv->lastSetTime.milliseconds; + rep = (xRRGetCrtcInfoReply) { + .type = X_Reply, + .status = RRSetConfigSuccess, + .sequenceNumber = client->sequence, + .length = 0, + .timestamp = pScrPriv->lastSetTime.milliseconds + }; if (pScrPriv->rrGetPanning && pScrPriv->rrGetPanning(pScreen, crtc, &panned_area, NULL, NULL) && (panned_area.x2 > panned_area.x1) && (panned_area.y2 > panned_area.y1)) @@ -804,9 +974,9 @@ ProcRRGetCrtcInfo(ClientPtr client) swaps(&rep.nOutput); swaps(&rep.nPossibleOutput); } - WriteToClient(client, sizeof(xRRGetCrtcInfoReply), (char *) &rep); + WriteToClient(client, sizeof(xRRGetCrtcInfoReply), &rep); if (extraLen) { - WriteToClient(client, extraLen, (char *) extra); + WriteToClient(client, extraLen, extra); free(extra); } @@ -825,10 +995,10 @@ ProcRRSetCrtcConfig(ClientPtr client) int numOutputs; RROutputPtr *outputs = NULL; RROutput *outputIds; - TimeStamp configTime; TimeStamp time; Rotation rotation; - int rc, i, j; + int ret, i, j; + CARD8 status; REQUEST_AT_LEAST_SIZE(xRRSetCrtcConfigReq); numOutputs = (stuff->length - bytes_to_int32(SIZEOF(xRRSetCrtcConfigReq))); @@ -855,11 +1025,11 @@ ProcRRSetCrtcConfig(ClientPtr client) outputIds = (RROutput *) (stuff + 1); for (i = 0; i < numOutputs; i++) { - rc = dixLookupResourceByType((pointer *) (outputs + i), outputIds[i], + ret = dixLookupResourceByType((pointer *) (outputs + i), outputIds[i], RROutputType, client, DixSetAttrAccess); - if (rc != Success) { + if (ret != Success) { free(outputs); - return rc; + return ret; } /* validate crtc for this output */ for (j = 0; j < outputs[i]->numCrtcs; j++) @@ -904,11 +1074,10 @@ ProcRRSetCrtcConfig(ClientPtr client) pScrPriv = rrGetScrPriv(pScreen); time = ClientTimeToServerTime(stuff->timestamp); - configTime = ClientTimeToServerTime(stuff->configTimestamp); if (!pScrPriv) { time = currentTime; - rep.status = RRSetConfigFailed; + status = RRSetConfigFailed; goto sendReply; } @@ -956,6 +1125,16 @@ ProcRRSetCrtcConfig(ClientPtr client) int source_height; PictTransform transform; struct pixman_f_transform f_transform, f_inverse; + int width, height; + + if (pScreen->isGPU) { + width = pScreen->current_master->width; + height = pScreen->current_master->height; + } + else { + width = pScreen->width; + height = pScreen->height; + } RRTransformCompute(stuff->x, stuff->y, mode->mode.width, mode->mode.height, @@ -965,13 +1144,13 @@ ProcRRSetCrtcConfig(ClientPtr client) RRModeGetScanoutSize(mode, &transform, &source_width, &source_height); - if (stuff->x + source_width > pScreen->width) { + if (stuff->x + source_width > width) { client->errorValue = stuff->x; free(outputs); return BadValue; } - if (stuff->y + source_height > pScreen->height) { + if (stuff->y + source_height > height) { client->errorValue = stuff->y; free(outputs); return BadValue; @@ -982,27 +1161,29 @@ ProcRRSetCrtcConfig(ClientPtr client) if (!RRCrtcSet(crtc, mode, stuff->x, stuff->y, rotation, numOutputs, outputs)) { - rep.status = RRSetConfigFailed; + status = RRSetConfigFailed; goto sendReply; } - rep.status = RRSetConfigSuccess; + status = RRSetConfigSuccess; pScrPriv->lastSetTime = time; sendReply: free(outputs); - rep.type = X_Reply; - /* rep.status has already been filled in */ - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.newTimestamp = pScrPriv->lastSetTime.milliseconds; + rep = (xRRSetCrtcConfigReply) { + .type = X_Reply, + .status = status, + .sequenceNumber = client->sequence, + .length = 0, + .newTimestamp = pScrPriv->lastSetTime.milliseconds + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.newTimestamp); } - WriteToClient(client, sizeof(xRRSetCrtcConfigReply), (char *) &rep); + WriteToClient(client, sizeof(xRRSetCrtcConfigReply), &rep); return Success; } @@ -1031,12 +1212,13 @@ ProcRRGetPanning(ClientPtr client) if (!pScrPriv) return RRErrorBase + BadRRCrtc; - memset(&rep, 0, sizeof(rep)); - rep.type = X_Reply; - rep.status = RRSetConfigSuccess; - rep.sequenceNumber = client->sequence; - rep.length = 1; - rep.timestamp = pScrPriv->lastSetTime.milliseconds; + rep = (xRRGetPanningReply) { + .type = X_Reply, + .status = RRSetConfigSuccess, + .sequenceNumber = client->sequence, + .length = 1, + .timestamp = pScrPriv->lastSetTime.milliseconds + }; if (pScrPriv->rrGetPanning && pScrPriv->rrGetPanning(pScreen, crtc, &total, &tracking, border)) { @@ -1071,7 +1253,7 @@ ProcRRGetPanning(ClientPtr client) swaps(&rep.border_right); swaps(&rep.border_bottom); } - WriteToClient(client, sizeof(xRRGetPanningReply), (char *) &rep); + WriteToClient(client, sizeof(xRRGetPanningReply), &rep); return Success; } @@ -1087,6 +1269,7 @@ ProcRRSetPanning(ClientPtr client) BoxRec total; BoxRec tracking; INT16 border[4]; + CARD8 status; REQUEST_SIZE_MATCH(xRRSetPanningReq); VERIFY_RR_CRTC(stuff->crtc, crtc, DixReadAccess); @@ -1099,7 +1282,7 @@ ProcRRSetPanning(ClientPtr client) if (!pScrPriv) { time = currentTime; - rep.status = RRSetConfigFailed; + status = RRSetConfigFailed; goto sendReply; } @@ -1126,20 +1309,23 @@ ProcRRSetPanning(ClientPtr client) pScrPriv->lastSetTime = time; - rep.status = RRSetConfigSuccess; + status = RRSetConfigSuccess; sendReply: - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.newTimestamp = pScrPriv->lastSetTime.milliseconds; + rep = (xRRSetPanningReply) { + .type = X_Reply, + .status = status, + .sequenceNumber = client->sequence, + .length = 0, + .newTimestamp = pScrPriv->lastSetTime.milliseconds + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.newTimestamp); } - WriteToClient(client, sizeof(xRRSetPanningReply), (char *) &rep); + WriteToClient(client, sizeof(xRRSetPanningReply), &rep); return Success; } @@ -1157,16 +1343,18 @@ ProcRRGetCrtcGammaSize(ClientPtr client) if (!RRCrtcGammaGet(crtc)) return RRErrorBase + BadRRCrtc; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.length = 0; - reply.size = crtc->gammaSize; + reply = (xRRGetCrtcGammaSizeReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .size = crtc->gammaSize + }; if (client->swapped) { swaps(&reply.sequenceNumber); swapl(&reply.length); swaps(&reply.size); } - WriteToClient(client, sizeof(xRRGetCrtcGammaSizeReply), (char *) &reply); + WriteToClient(client, sizeof(xRRGetCrtcGammaSizeReply), &reply); return Success; } @@ -1194,16 +1382,18 @@ ProcRRGetCrtcGamma(ClientPtr client) return BadAlloc; } - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; - reply.length = bytes_to_int32(len); - reply.size = crtc->gammaSize; + reply = (xRRGetCrtcGammaReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(len), + .size = crtc->gammaSize + }; if (client->swapped) { swaps(&reply.sequenceNumber); swapl(&reply.length); swaps(&reply.size); } - WriteToClient(client, sizeof(xRRGetCrtcGammaReply), (char *) &reply); + WriteToClient(client, sizeof(xRRGetCrtcGammaReply), &reply); if (crtc->gammaSize) { memcpy(extra, crtc->gammaRed, len); client->pSwapReplyFunc = (ReplySwapPtr) CopySwap16Write; @@ -1344,7 +1534,7 @@ ProcRRGetCrtcTransform(ClientPtr client) nextra = (transform_filter_length(pending) + transform_filter_length(current)); - reply = malloc(sizeof(xRRGetCrtcTransformReply) + nextra); + reply = calloc(1, sizeof(xRRGetCrtcTransformReply) + nextra); if (!reply) return BadAlloc; @@ -1369,24 +1559,15 @@ ProcRRGetCrtcTransform(ClientPtr client) swaps(&reply->sequenceNumber); swapl(&reply->length); } - WriteToClient(client, sizeof(xRRGetCrtcTransformReply) + nextra, - (char *) reply); + WriteToClient(client, sizeof(xRRGetCrtcTransformReply) + nextra, reply); free(reply); return Success; } -void -RRConstrainCursorHarder(DeviceIntPtr pDev, ScreenPtr pScreen, int mode, int *x, - int *y) +static Bool check_all_screen_crtcs(ScreenPtr pScreen, int *x, int *y) { rrScrPriv(pScreen); int i; - - /* intentional dead space -> let it float */ - if (pScrPriv->discontiguous) - return; - - /* if we're moving inside a crtc, we're fine */ for (i = 0; i < pScrPriv->numCrtcs; i++) { RRCrtcPtr crtc = pScrPriv->crtcs[i]; @@ -1398,8 +1579,15 @@ RRConstrainCursorHarder(DeviceIntPtr pDev, ScreenPtr pScreen, int mode, int *x, crtc_bounds(crtc, &left, &right, &top, &bottom); if ((*x >= left) && (*x < right) && (*y >= top) && (*y < bottom)) - return; + return TRUE; } + return FALSE; +} + +static Bool constrain_all_screen_crtcs(DeviceIntPtr pDev, ScreenPtr pScreen, int *x, int *y) +{ + rrScrPriv(pScreen); + int i; /* if we're trying to escape, clamp to the CRTC we're coming from */ for (i = 0; i < pScrPriv->numCrtcs; i++) { @@ -1423,7 +1611,101 @@ RRConstrainCursorHarder(DeviceIntPtr pDev, ScreenPtr pScreen, int mode, int *x, if (*y >= bottom) *y = bottom - 1; - return; + return TRUE; } } + return FALSE; +} + +void +RRConstrainCursorHarder(DeviceIntPtr pDev, ScreenPtr pScreen, int mode, int *x, + int *y) +{ + rrScrPriv(pScreen); + Bool ret; + ScreenPtr slave; + + /* intentional dead space -> let it float */ + if (pScrPriv->discontiguous) + return; + + /* if we're moving inside a crtc, we're fine */ + ret = check_all_screen_crtcs(pScreen, x, y); + if (ret == TRUE) + return; + + xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) { + ret = check_all_screen_crtcs(slave, x, y); + if (ret == TRUE) + return; + } + + /* if we're trying to escape, clamp to the CRTC we're coming from */ + ret = constrain_all_screen_crtcs(pDev, pScreen, x, y); + if (ret == TRUE) + return; + + xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) { + ret = constrain_all_screen_crtcs(pDev, slave, x, y); + if (ret == TRUE) + return; + } +} + +Bool +RRReplaceScanoutPixmap(DrawablePtr pDrawable, PixmapPtr pPixmap, Bool enable) +{ + rrScrPriv(pDrawable->pScreen); + int i; + Bool size_fits = FALSE; + Bool changed = FALSE; + Bool ret = TRUE; + + for (i = 0; i < pScrPriv->numCrtcs; i++) { + RRCrtcPtr crtc = pScrPriv->crtcs[i]; + + if (!crtc->mode && enable) + continue; + + changed = FALSE; + if (crtc->mode && crtc->x == pDrawable->x && + crtc->y == pDrawable->y && + crtc->mode->mode.width == pDrawable->width && + crtc->mode->mode.height == pDrawable->height) + size_fits = TRUE; + + /* is the pixmap already set? */ + if (crtc->scanout_pixmap == pPixmap) { + /* if its a disable then don't care about size */ + if (enable == FALSE) { + /* set scanout to NULL */ + crtc->scanout_pixmap = NULL; + changed = TRUE; + } else { + /* if the size fits then we are already setup */ + if (size_fits) + return TRUE; + /* if the size no longer fits then drop off */ + crtc->scanout_pixmap = NULL; + changed = TRUE; + ret = FALSE; + } + } else { + if (!size_fits) + return FALSE; + if (enable) { + crtc->scanout_pixmap = pPixmap; + pScrPriv->rrCrtcSetScanoutPixmap(crtc, pPixmap); + changed = TRUE; + } + } + + if (changed && pScrPriv->rrCrtcSet) { + pScrPriv->rrCrtcSetScanoutPixmap(crtc, crtc->scanout_pixmap); + + (*pScrPriv->rrCrtcSet) (pDrawable->pScreen, crtc, crtc->mode, crtc->x, crtc->y, + crtc->rotation, crtc->numOutputs, crtc->outputs); + } + } + return ret; } diff --git a/xserver/randr/rrdispatch.c b/xserver/randr/rrdispatch.c index 85cf03738..7fbc9f01c 100644 --- a/xserver/randr/rrdispatch.c +++ b/xserver/randr/rrdispatch.c @@ -35,16 +35,17 @@ RRClientKnowsRates(ClientPtr pClient) static int ProcRRQueryVersion(ClientPtr client) { - xRRQueryVersionReply rep = { 0 }; + xRRQueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; REQUEST(xRRQueryVersionReq); rrClientPriv(client); REQUEST_SIZE_MATCH(xRRQueryVersionReq); pRRClient->major_version = stuff->majorVersion; pRRClient->minor_version = stuff->minorVersion; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; if (version_compare(stuff->majorVersion, stuff->minorVersion, SERVER_RANDR_MAJOR_VERSION, @@ -63,7 +64,7 @@ ProcRRQueryVersion(ClientPtr client) swapl(&rep.majorVersion); swapl(&rep.minorVersion); } - WriteToClient(client, sizeof(xRRQueryVersionReply), (char *) &rep); + WriteToClient(client, sizeof(xRRQueryVersionReply), &rep); return Success; } @@ -90,7 +91,8 @@ ProcRRSelectInput(ClientPtr client) if (stuff->enable & (RRScreenChangeNotifyMask | RRCrtcChangeNotifyMask | RROutputChangeNotifyMask | - RROutputPropertyNotifyMask)) { + RROutputPropertyNotifyMask | + RRProviderPropertyNotifyMask)) { ScreenPtr pScreen = pWin->drawable.pScreen; rrScrPriv(pScreen); @@ -241,4 +243,15 @@ int (*ProcRandrVector[RRNumberRequests]) (ClientPtr) = { ProcRRSetPanning, /* 29 */ ProcRRSetOutputPrimary, /* 30 */ ProcRRGetOutputPrimary, /* 31 */ +/* V1.4 additions */ + ProcRRGetProviders, /* 32 */ + ProcRRGetProviderInfo, /* 33 */ + ProcRRSetProviderOffloadSink, /* 34 */ + ProcRRSetProviderOutputSource, /* 35 */ + ProcRRListProviderProperties, /* 36 */ + ProcRRQueryProviderProperty, /* 37 */ + ProcRRConfigureProviderProperty, /* 38 */ + ProcRRChangeProviderProperty, /* 39 */ + ProcRRDeleteProviderProperty, /* 40 */ + ProcRRGetProviderProperty, /* 41 */ }; diff --git a/xserver/randr/rrinfo.c b/xserver/randr/rrinfo.c index 114ec3471..1408d6f64 100644 --- a/xserver/randr/rrinfo.c +++ b/xserver/randr/rrinfo.c @@ -82,6 +82,7 @@ RRScanOldConfig(ScreenPtr pScreen, Rotation rotations) int i; CARD16 minWidth = MAXSHORT, minHeight = MAXSHORT; CARD16 maxWidth = 0, maxHeight = 0; + CARD16 width, height; /* * First time through, create a crtc and output and hook @@ -141,11 +142,11 @@ RRScanOldConfig(ScreenPtr pScreen, Rotation rotations) /* find size bounds */ for (i = 0; i < output->numModes + output->numUserModes; i++) { - RRModePtr mode = (i < output->numModes ? + mode = (i < output->numModes ? output->modes[i] : output->userModes[i - output->numModes]); - CARD16 width = mode->mode.width; - CARD16 height = mode->mode.height; + width = mode->mode.width; + height = mode->mode.height; if (width < minWidth) minWidth = width; diff --git a/xserver/randr/rrmode.c b/xserver/randr/rrmode.c index b637c06b9..f5d3f9e54 100644 --- a/xserver/randr/rrmode.c +++ b/xserver/randr/rrmode.c @@ -89,8 +89,10 @@ RRModeCreate(xRRModeInfo * modeInfo, const char *name, ScreenPtr userScreen) } mode->mode.id = FakeClientID(0); - if (!AddResource(mode->mode.id, RRModeType, (pointer) mode)) + if (!AddResource(mode->mode.id, RRModeType, (pointer) mode)) { + free(newModes); return NULL; + } modes = newModes; modes[num_modes++] = mode; @@ -173,7 +175,7 @@ RRModesForScreen(ScreenPtr pScreen, int *num_ret) */ for (o = 0; o < pScrPriv->numOutputs; o++) { RROutputPtr output = pScrPriv->outputs[o]; - int m, n; + int n; for (m = 0; m < output->numModes + output->numUserModes; m++) { RRModePtr mode = (m < output->numModes ? @@ -282,10 +284,9 @@ int ProcRRCreateMode(ClientPtr client) { REQUEST(xRRCreateModeReq); - xRRCreateModeReply rep = { 0 }; + xRRCreateModeReply rep; WindowPtr pWin; ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; xRRModeInfo *modeInfo; long units_after; char *name; @@ -298,7 +299,6 @@ ProcRRCreateMode(ClientPtr client) return rc; pScreen = pWin->drawable.pScreen; - pScrPriv = rrGetScrPriv(pScreen); modeInfo = &stuff->modeInfo; name = (char *) (stuff + 1); @@ -312,17 +312,18 @@ ProcRRCreateMode(ClientPtr client) if (!mode) return error; - rep.type = X_Reply; - rep.pad0 = 0; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.mode = mode->mode.id; + rep = (xRRCreateModeReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .mode = mode->mode.id + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.mode); } - WriteToClient(client, sizeof(xRRCreateModeReply), (char *) &rep); + WriteToClient(client, sizeof(xRRCreateModeReply), &rep); /* Drop out reference to this mode */ RRModeDestroy(mode); return Success; diff --git a/xserver/randr/rroutput.c b/xserver/randr/rroutput.c index 0890c55b5..88781ba0f 100644 --- a/xserver/randr/rroutput.c +++ b/xserver/randr/rroutput.c @@ -305,28 +305,22 @@ RRDeliverOutputEvent(ClientPtr client, WindowPtr pWin, RROutputPtr output) ScreenPtr pScreen = pWin->drawable.pScreen; rrScrPriv(pScreen); - xRROutputChangeNotifyEvent oe; RRCrtcPtr crtc = output->crtc; - RRModePtr mode = crtc ? crtc->mode : 0; + RRModePtr mode = crtc ? crtc->mode : NULL; - oe.type = RRNotify + RREventBase; - oe.subCode = RRNotify_OutputChange; - oe.timestamp = pScrPriv->lastSetTime.milliseconds; - oe.configTimestamp = pScrPriv->lastConfigTime.milliseconds; - oe.window = pWin->drawable.id; - oe.output = output->id; - if (crtc) { - oe.crtc = crtc->id; - oe.mode = mode ? mode->mode.id : None; - oe.rotation = crtc->rotation; - } - else { - oe.crtc = None; - oe.mode = None; - oe.rotation = RR_Rotate_0; - } - oe.connection = output->connection; - oe.subpixelOrder = output->subpixelOrder; + xRROutputChangeNotifyEvent oe = { + .type = RRNotify + RREventBase, + .subCode = RRNotify_OutputChange, + .timestamp = pScrPriv->lastSetTime.milliseconds, + .configTimestamp = pScrPriv->lastConfigTime.milliseconds, + .window = pWin->drawable.id, + .output = output->id, + .crtc = crtc ? crtc->id : None, + .mode = mode ? mode->mode.id : None, + .rotation = crtc ? crtc->rotation : RR_Rotate_0, + .connection = output->connection, + .subpixelOrder = output->subpixelOrder + }; WriteEventsToClient(client, 1, (xEvent *) &oe); } @@ -425,21 +419,23 @@ ProcRRGetOutputInfo(ClientPtr client) pScreen = output->pScreen; pScrPriv = rrGetScrPriv(pScreen); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = bytes_to_int32(OutputInfoExtra); - rep.timestamp = pScrPriv->lastSetTime.milliseconds; - rep.crtc = output->crtc ? output->crtc->id : None; - rep.mmWidth = output->mmWidth; - rep.mmHeight = output->mmHeight; - rep.connection = output->connection; - rep.subpixelOrder = output->subpixelOrder; - rep.nCrtcs = output->numCrtcs; - rep.nModes = output->numModes + output->numUserModes; - rep.nPreferred = output->numPreferred; - rep.nClones = output->numClones; - rep.nameLength = output->nameLength; - + rep = (xRRGetOutputInfoReply) { + .type = X_Reply, + .status = RRSetConfigSuccess, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(OutputInfoExtra), + .timestamp = pScrPriv->lastSetTime.milliseconds, + .crtc = output->crtc ? output->crtc->id : None, + .mmWidth = output->mmWidth, + .mmHeight = output->mmHeight, + .connection = output->connection, + .subpixelOrder = output->subpixelOrder, + .nCrtcs = output->numCrtcs, + .nModes = output->numModes + output->numUserModes, + .nPreferred = output->numPreferred, + .nClones = output->numClones, + .nameLength = output->nameLength + }; extraLen = ((output->numCrtcs + output->numModes + output->numUserModes + output->numClones + bytes_to_int32(rep.nameLength)) << 2); @@ -489,9 +485,9 @@ ProcRRGetOutputInfo(ClientPtr client) swaps(&rep.nClones); swaps(&rep.nameLength); } - WriteToClient(client, sizeof(xRRGetOutputInfoReply), (char *) &rep); + WriteToClient(client, sizeof(xRRGetOutputInfoReply), &rep); if (extraLen) { - WriteToClient(client, extraLen, (char *) extra); + WriteToClient(client, extraLen, extra); free(extra); } @@ -528,13 +524,13 @@ ProcRRSetOutputPrimary(ClientPtr client) RROutputPtr output = NULL; WindowPtr pWin; rrScrPrivPtr pScrPriv; - int rc; + int ret; REQUEST_SIZE_MATCH(xRRSetOutputPrimaryReq); - rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); - if (rc != Success) - return rc; + ret = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); + if (ret != Success) + return ret; if (stuff->output) { VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess); @@ -546,7 +542,8 @@ ProcRRSetOutputPrimary(ClientPtr client) } pScrPriv = rrGetScrPriv(pWin->drawable.pScreen); - RRSetPrimaryOutput(pWin->drawable.pScreen, pScrPriv, output); + if (pScrPriv) + RRSetPrimaryOutput(pWin->drawable.pScreen, pScrPriv, output); return Success; } @@ -571,10 +568,11 @@ ProcRRGetOutputPrimary(ClientPtr client) if (pScrPriv) primary = pScrPriv->primaryOutput; - memset(&rep, 0, sizeof(rep)); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.output = primary ? primary->id : None; + rep = (xRRGetOutputPrimaryReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .output = primary ? primary->id : None + }; if (client->swapped) { swaps(&rep.sequenceNumber); diff --git a/xserver/randr/rrproperty.c b/xserver/randr/rrproperty.c index 75948fccb..67b546728 100644 --- a/xserver/randr/rrproperty.c +++ b/xserver/randr/rrproperty.c @@ -65,14 +65,14 @@ RRDestroyOutputProperty(RRPropertyPtr prop) static void RRDeleteProperty(RROutputRec * output, RRPropertyRec * prop) { - xRROutputPropertyNotifyEvent event; - - event.type = RREventBase + RRNotify; - event.subCode = RRNotify_OutputProperty; - event.output = output->id; - event.state = PropertyDelete; - event.atom = prop->propertyName; - event.timestamp = currentTime.milliseconds; + xRROutputPropertyNotifyEvent event = { + .type = RREventBase + RRNotify, + .subCode = RRNotify_OutputProperty, + .output = output->id, + .state = PropertyDelete, + .atom = prop->propertyName, + .timestamp = currentTime.milliseconds + }; RRDeliverPropertyEvent(output->pScreen, (xEvent *) &event); @@ -138,7 +138,6 @@ RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type, pointer value, Bool sendevent, Bool pending) { RRPropertyPtr prop; - xRROutputPropertyNotifyEvent event; rrScrPrivPtr pScrPriv = rrGetScrPriv(output->pScreen); int size_in_bytes; int total_size; @@ -218,6 +217,8 @@ RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type, !pScrPriv->rrOutputSetProperty(output->pScreen, output, prop->propertyName, &new_value)) { free(new_value.data); + if (add) + RRDestroyOutputProperty(prop); return BadValue; } free(prop_value->data); @@ -237,12 +238,14 @@ RRChangeOutputProperty(RROutputPtr output, Atom property, Atom type, output->pendingProperties = TRUE; if (sendevent) { - event.type = RREventBase + RRNotify; - event.subCode = RRNotify_OutputProperty; - event.output = output->id; - event.state = PropertyNewValue; - event.atom = prop->propertyName; - event.timestamp = currentTime.milliseconds; + xRROutputPropertyNotifyEvent event = { + .type = RREventBase + RRNotify, + .subCode = RRNotify_OutputProperty, + .output = output->id, + .state = PropertyNewValue, + .atom = prop->propertyName, + .timestamp = currentTime.milliseconds + }; RRDeliverPropertyEvent(output->pScreen, (xEvent *) &event); } return Success; @@ -341,12 +344,18 @@ RRConfigureOutputProperty(RROutputPtr output, Atom property, /* * ranges must have even number of values */ - if (range && (num_values & 1)) + if (range && (num_values & 1)) { + if (add) + RRDestroyOutputProperty(prop); return BadMatch; + } new_values = malloc(num_values * sizeof(INT32)); - if (!new_values && num_values) + if (!new_values && num_values) { + if (add) + RRDestroyOutputProperty(prop); return BadAlloc; + } if (num_values) memcpy(new_values, values, num_values * sizeof(INT32)); @@ -378,7 +387,7 @@ int ProcRRListOutputProperties(ClientPtr client) { REQUEST(xRRListOutputPropertiesReq); - Atom *pAtoms = NULL, *temppAtoms; + Atom *pAtoms = NULL; xRRListOutputPropertiesReply rep; int numProps = 0; RROutputPtr output; @@ -394,21 +403,25 @@ ProcRRListOutputProperties(ClientPtr client) if (!(pAtoms = (Atom *) malloc(numProps * sizeof(Atom)))) return BadAlloc; - rep.type = X_Reply; - rep.length = bytes_to_int32(numProps * sizeof(Atom)); - rep.sequenceNumber = client->sequence; - rep.nAtoms = numProps; + rep = (xRRListOutputPropertiesReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(numProps * sizeof(Atom)), + .nAtoms = numProps + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swaps(&rep.nAtoms); } - temppAtoms = pAtoms; - for (prop = output->properties; prop; prop = prop->next) - *temppAtoms++ = prop->propertyName; + WriteToClient(client, sizeof(xRRListOutputPropertiesReply), &rep); - WriteToClient(client, sizeof(xRRListOutputPropertiesReply), (char *) &rep); if (numProps) { + /* Copy property name atoms to reply buffer */ + Atom *temppAtoms = pAtoms; + for (prop = output->properties; prop; prop = prop->next) + *temppAtoms++ = prop->propertyName; + client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms); free(pAtoms); @@ -438,17 +451,21 @@ ProcRRQueryOutputProperty(ClientPtr client) if (!extra) return BadAlloc; } - rep.type = X_Reply; - rep.length = prop->num_valid; - rep.sequenceNumber = client->sequence; - rep.pending = prop->is_pending; - rep.range = prop->range; - rep.immutable = prop->immutable; + + rep = (xRRQueryOutputPropertyReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = prop->num_valid, + .pending = prop->is_pending, + .range = prop->range, + .immutable = prop->immutable + }; + if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); } - WriteToClient(client, sizeof(xRRQueryOutputPropertyReply), (char *) &rep); + WriteToClient(client, sizeof(xRRQueryOutputPropertyReply), &rep); if (prop->num_valid) { memcpy(extra, prop->valid_values, prop->num_valid * sizeof(INT32)); client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; @@ -594,8 +611,10 @@ ProcRRGetOutputProperty(ClientPtr client) if (prop->propertyName == stuff->property) break; - reply.type = X_Reply; - reply.sequenceNumber = client->sequence; + reply = (xRRGetOutputPropertyReply) { + .type = X_Reply, + .sequenceNumber = client->sequence + }; if (!prop) { reply.nItems = 0; reply.length = 0; @@ -672,14 +691,14 @@ ProcRRGetOutputProperty(ClientPtr client) reply.propertyType = prop_value->type; if (stuff->delete && (reply.bytesAfter == 0)) { - xRROutputPropertyNotifyEvent event; - - event.type = RREventBase + RRNotify; - event.subCode = RRNotify_OutputProperty; - event.output = output->id; - event.state = PropertyDelete; - event.atom = prop->propertyName; - event.timestamp = currentTime.milliseconds; + xRROutputPropertyNotifyEvent event = { + .type = RREventBase + RRNotify, + .subCode = RRNotify_OutputProperty, + .output = output->id, + .state = PropertyDelete, + .atom = prop->propertyName, + .timestamp = currentTime.milliseconds + }; RRDeliverPropertyEvent(output->pScreen, (xEvent *) &event); } diff --git a/xserver/randr/rrprovider.c b/xserver/randr/rrprovider.c new file mode 100644 index 000000000..b321e6227 --- /dev/null +++ b/xserver/randr/rrprovider.c @@ -0,0 +1,418 @@ +/* + * Copyright © 2012 Red Hat Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + * + * Authors: Dave Airlie + */ + +#include "randrstr.h" +#include "swaprep.h" + +RESTYPE RRProviderType; + +/* + * Initialize provider type error value + */ +void +RRProviderInitErrorValue(void) +{ + SetResourceTypeErrorValue(RRProviderType, RRErrorBase + BadRRProvider); +} + +#define ADD_PROVIDER(_pScreen) do { \ + pScrPriv = rrGetScrPriv((_pScreen)); \ + if (pScrPriv->provider) { \ + providers[count_providers] = pScrPriv->provider->id; \ + if (client->swapped) \ + swapl(&providers[count_providers]); \ + count_providers++; \ + } \ + } while(0) + +int +ProcRRGetProviders (ClientPtr client) +{ + REQUEST(xRRGetProvidersReq); + xRRGetProvidersReply rep; + WindowPtr pWin; + ScreenPtr pScreen; + rrScrPrivPtr pScrPriv; + int rc; + CARD8 *extra; + unsigned int extraLen; + RRProvider *providers; + int total_providers = 0, count_providers = 0; + ScreenPtr iter; + + REQUEST_SIZE_MATCH(xRRGetProvidersReq); + rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); + if (rc != Success) + return rc; + + pScreen = pWin->drawable.pScreen; + + pScrPriv = rrGetScrPriv(pScreen); + + if (pScrPriv->provider) + total_providers++; + xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) { + pScrPriv = rrGetScrPriv(iter); + total_providers += pScrPriv->provider ? 1 : 0; + } + xorg_list_for_each_entry(iter, &pScreen->offload_slave_list, offload_head) { + pScrPriv = rrGetScrPriv(iter); + total_providers += pScrPriv->provider ? 1 : 0; + } + xorg_list_for_each_entry(iter, &pScreen->unattached_list, unattached_head) { + pScrPriv = rrGetScrPriv(iter); + total_providers += pScrPriv->provider ? 1 : 0; + } + + pScrPriv = rrGetScrPriv(pScreen); + + if (!pScrPriv) + { + rep = (xRRGetProvidersReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .timestamp = currentTime.milliseconds, + .nProviders = 0 + }; + extra = NULL; + extraLen = 0; + } else { + rep = (xRRGetProvidersReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .timestamp = pScrPriv->lastSetTime.milliseconds, + .nProviders = total_providers, + .length = total_providers + }; + extraLen = rep.length << 2; + if (extraLen) { + extra = malloc(extraLen); + if (!extra) + return BadAlloc; + } else + extra = NULL; + + providers = (RRProvider *)extra; + ADD_PROVIDER(pScreen); + xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) { + ADD_PROVIDER(iter); + } + xorg_list_for_each_entry(iter, &pScreen->offload_slave_list, offload_head) { + ADD_PROVIDER(iter); + } + xorg_list_for_each_entry(iter, &pScreen->unattached_list, unattached_head) { + ADD_PROVIDER(iter); + } + } + + if (client->swapped) { + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.timestamp); + swaps(&rep.nProviders); + } + WriteToClient(client, sizeof(xRRGetProvidersReply), (char *)&rep); + if (extraLen) + { + WriteToClient (client, extraLen, (char *) extra); + free(extra); + } + return Success; +} + +int +ProcRRGetProviderInfo (ClientPtr client) +{ + REQUEST(xRRGetProviderInfoReq); + xRRGetProviderInfoReply rep; + rrScrPrivPtr pScrPriv, pScrProvPriv; + RRProviderPtr provider; + ScreenPtr pScreen; + CARD8 *extra; + unsigned int extraLen = 0; + RRCrtc *crtcs; + RROutput *outputs; + int i; + char *name; + ScreenPtr provscreen; + RRProvider *providers; + uint32_t *prov_cap; + + REQUEST_SIZE_MATCH(xRRGetProviderInfoReq); + VERIFY_RR_PROVIDER(stuff->provider, provider, DixReadAccess); + + pScreen = provider->pScreen; + pScrPriv = rrGetScrPriv(pScreen); + + rep = (xRRGetProviderInfoReply) { + .type = X_Reply, + .status = RRSetConfigSuccess, + .sequenceNumber = client->sequence, + .length = 0, + .capabilities = provider->capabilities, + .nameLength = provider->nameLength, + .timestamp = pScrPriv->lastSetTime.milliseconds, + .nCrtcs = pScrPriv->numCrtcs, + .nOutputs = pScrPriv->numOutputs, + .nAssociatedProviders = 0 + }; + + /* count associated providers */ + if (provider->offload_sink) + rep.nAssociatedProviders++; + if (provider->output_source) + rep.nAssociatedProviders++; + xorg_list_for_each_entry(provscreen, &pScreen->output_slave_list, output_head) + rep.nAssociatedProviders++; + xorg_list_for_each_entry(provscreen, &pScreen->offload_slave_list, offload_head) + rep.nAssociatedProviders++; + + rep.length = (pScrPriv->numCrtcs + pScrPriv->numOutputs + + (rep.nAssociatedProviders * 2) + bytes_to_int32(rep.nameLength)); + + extraLen = rep.length << 2; + if (extraLen) { + extra = malloc(extraLen); + if (!extra) + return BadAlloc; + } + else + extra = NULL; + + crtcs = (RRCrtc *)extra; + outputs = (RROutput *)(crtcs + rep.nCrtcs); + providers = (RRProvider *)(outputs + rep.nOutputs); + prov_cap = (unsigned int *)(providers + rep.nAssociatedProviders); + name = (char *)(prov_cap + rep.nAssociatedProviders); + + for (i = 0; i < pScrPriv->numCrtcs; i++) { + crtcs[i] = pScrPriv->crtcs[i]->id; + if (client->swapped) + swapl(&crtcs[i]); + } + + for (i = 0; i < pScrPriv->numOutputs; i++) { + outputs[i] = pScrPriv->outputs[i]->id; + if (client->swapped) + swapl(&outputs[i]); + } + + i = 0; + if (provider->offload_sink) { + providers[i] = provider->offload_sink->id; + if (client->swapped) + swapl(&providers[i]); + prov_cap[i] = RR_Capability_SinkOffload; + if (client->swapped) + swapl(&prov_cap[i]); + i++; + } + if (provider->output_source) { + providers[i] = provider->output_source->id; + if (client->swapped) + swapl(&providers[i]); + prov_cap[i] = RR_Capability_SourceOutput; + swapl(&prov_cap[i]); + i++; + } + xorg_list_for_each_entry(provscreen, &pScreen->output_slave_list, output_head) { + pScrProvPriv = rrGetScrPriv(provscreen); + providers[i] = pScrProvPriv->provider->id; + if (client->swapped) + swapl(&providers[i]); + prov_cap[i] = RR_Capability_SinkOutput; + if (client->swapped) + swapl(&prov_cap[i]); + i++; + } + xorg_list_for_each_entry(provscreen, &pScreen->offload_slave_list, offload_head) { + pScrProvPriv = rrGetScrPriv(provscreen); + providers[i] = pScrProvPriv->provider->id; + if (client->swapped) + swapl(&providers[i]); + prov_cap[i] = RR_Capability_SourceOffload; + if (client->swapped) + swapl(&prov_cap[i]); + i++; + } + + + memcpy(name, provider->name, rep.nameLength); + if (client->swapped) { + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.capabilities); + swaps(&rep.nCrtcs); + swaps(&rep.nOutputs); + swaps(&rep.nameLength); + } + WriteToClient(client, sizeof(xRRGetProviderInfoReply), (char *)&rep); + if (extraLen) + { + WriteToClient (client, extraLen, (char *) extra); + free(extra); + } + return Success; +} + +int +ProcRRSetProviderOutputSource(ClientPtr client) +{ + REQUEST(xRRSetProviderOutputSourceReq); + rrScrPrivPtr pScrPriv; + RRProviderPtr provider, source_provider = NULL; + ScreenPtr pScreen; + + REQUEST_AT_LEAST_SIZE(xRRSetProviderOutputSourceReq); + + VERIFY_RR_PROVIDER(stuff->provider, provider, DixReadAccess); + + if (!(provider->capabilities & RR_Capability_SinkOutput)) + return BadValue; + + if (stuff->source_provider) { + VERIFY_RR_PROVIDER(stuff->source_provider, source_provider, DixReadAccess); + + if (!(source_provider->capabilities & RR_Capability_SourceOutput)) + return BadValue; + } + + pScreen = provider->pScreen; + pScrPriv = rrGetScrPriv(pScreen); + + pScrPriv->rrProviderSetOutputSource(pScreen, provider, source_provider); + + RRTellChanged (pScreen); + + return Success; +} + +int +ProcRRSetProviderOffloadSink(ClientPtr client) +{ + REQUEST(xRRSetProviderOffloadSinkReq); + rrScrPrivPtr pScrPriv; + RRProviderPtr provider, sink_provider = NULL; + ScreenPtr pScreen; + + REQUEST_AT_LEAST_SIZE(xRRSetProviderOffloadSinkReq); + + VERIFY_RR_PROVIDER(stuff->provider, provider, DixReadAccess); + if (!(provider->capabilities & RR_Capability_SourceOffload)) + return BadValue; + + if (stuff->sink_provider) { + VERIFY_RR_PROVIDER(stuff->sink_provider, sink_provider, DixReadAccess); + if (!(sink_provider->capabilities & RR_Capability_SinkOffload)) + return BadValue; + } + pScreen = provider->pScreen; + pScrPriv = rrGetScrPriv(pScreen); + + pScrPriv->rrProviderSetOffloadSink(pScreen, provider, sink_provider); + + RRTellChanged (pScreen); + + return Success; +} + +RRProviderPtr +RRProviderCreate(ScreenPtr pScreen, const char *name, + int nameLength) +{ + RRProviderPtr provider; + rrScrPrivPtr pScrPriv; + + pScrPriv = rrGetScrPriv(pScreen); + + provider = calloc(1, sizeof(RRProviderRec) + nameLength + 1); + if (!provider) + return NULL; + + provider->id = FakeClientID(0); + provider->pScreen = pScreen; + provider->name = (char *) (provider + 1); + provider->nameLength = nameLength; + memcpy(provider->name, name, nameLength); + provider->name[nameLength] = '\0'; + + if (!AddResource (provider->id, RRProviderType, (pointer) provider)) + return NULL; + pScrPriv->provider = provider; + return provider; +} + +/* + * Destroy a provider at shutdown + */ +void +RRProviderDestroy (RRProviderPtr provider) +{ + FreeResource (provider->id, 0); +} + +void +RRProviderSetCapabilities(RRProviderPtr provider, uint32_t capabilities) +{ + provider->capabilities = capabilities; +} + +static int +RRProviderDestroyResource (pointer value, XID pid) +{ + RRProviderPtr provider = (RRProviderPtr)value; + ScreenPtr pScreen = provider->pScreen; + + if (pScreen) + { + rrScrPriv(pScreen); + + if (pScrPriv->rrProviderDestroy) + (*pScrPriv->rrProviderDestroy)(pScreen, provider); + pScrPriv->provider = NULL; + } + free(provider); + return 1; +} + +Bool +RRProviderInit(void) +{ + RRProviderType = CreateNewResourceType(RRProviderDestroyResource, "Provider"); + if (!RRProviderType) + return FALSE; + + return TRUE; +} + +extern _X_EXPORT Bool +RRProviderLookup(XID id, RRProviderPtr *provider_p) +{ + int rc = dixLookupResourceByType((void **)provider_p, id, + RRProviderType, NullClient, DixReadAccess); + if (rc == Success) + return TRUE; + return FALSE; +} diff --git a/xserver/randr/rrproviderproperty.c b/xserver/randr/rrproviderproperty.c new file mode 100644 index 000000000..ab601da9a --- /dev/null +++ b/xserver/randr/rrproviderproperty.c @@ -0,0 +1,730 @@ +/* + * Copyright © 2006 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that copyright + * notice and this permission notice appear in supporting documentation, and + * that the name of the copyright holders not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission. The copyright holders make no representations + * about the suitability of this software for any purpose. It is provided "as + * is" without express or implied warranty. + * + * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + * OF THIS SOFTWARE. + */ + +#include "randrstr.h" +#include "propertyst.h" +#include "swaprep.h" + +static int +DeliverPropertyEvent(WindowPtr pWin, void *value) +{ + xRRProviderPropertyNotifyEvent *event = value; + RREventPtr *pHead, pRREvent; + + dixLookupResourceByType((pointer *) &pHead, pWin->drawable.id, + RREventType, serverClient, DixReadAccess); + if (!pHead) + return WT_WALKCHILDREN; + + for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) { + if (!(pRREvent->mask & RRProviderPropertyNotifyMask)) + continue; + + event->window = pRREvent->window->drawable.id; + WriteEventsToClient(pRREvent->client, 1, (xEvent *) event); + } + + return WT_WALKCHILDREN; +} + +static void +RRDeliverPropertyEvent(ScreenPtr pScreen, xEvent *event) +{ + if (!(dispatchException & (DE_RESET | DE_TERMINATE))) + WalkTree(pScreen, DeliverPropertyEvent, event); +} + +static void +RRDestroyProviderProperty(RRPropertyPtr prop) +{ + free(prop->valid_values); + free(prop->current.data); + free(prop->pending.data); + free(prop); +} + +static void +RRDeleteProperty(RRProviderRec * provider, RRPropertyRec * prop) +{ + xRRProviderPropertyNotifyEvent event = { + .type = RREventBase + RRNotify, + .subCode = RRNotify_ProviderProperty, + .provider = provider->id, + .state = PropertyDelete, + .atom = prop->propertyName, + .timestamp = currentTime.milliseconds + }; + + RRDeliverPropertyEvent(provider->pScreen, (xEvent *) &event); + + RRDestroyProviderProperty(prop); +} + +void +RRDeleteAllProviderProperties(RRProviderPtr provider) +{ + RRPropertyPtr prop, next; + + for (prop = provider->properties; prop; prop = next) { + next = prop->next; + RRDeleteProperty(provider, prop); + } +} + +static void +RRInitProviderPropertyValue(RRPropertyValuePtr property_value) +{ + property_value->type = None; + property_value->format = 0; + property_value->size = 0; + property_value->data = NULL; +} + +static RRPropertyPtr +RRCreateProviderProperty(Atom property) +{ + RRPropertyPtr prop; + + prop = (RRPropertyPtr) malloc(sizeof(RRPropertyRec)); + if (!prop) + return NULL; + prop->next = NULL; + prop->propertyName = property; + prop->is_pending = FALSE; + prop->range = FALSE; + prop->immutable = FALSE; + prop->num_valid = 0; + prop->valid_values = NULL; + RRInitProviderPropertyValue(&prop->current); + RRInitProviderPropertyValue(&prop->pending); + return prop; +} + +void +RRDeleteProviderProperty(RRProviderPtr provider, Atom property) +{ + RRPropertyRec *prop, **prev; + + for (prev = &provider->properties; (prop = *prev); prev = &(prop->next)) + if (prop->propertyName == property) { + *prev = prop->next; + RRDeleteProperty(provider, prop); + return; + } +} + +int +RRChangeProviderProperty(RRProviderPtr provider, Atom property, Atom type, + int format, int mode, unsigned long len, + pointer value, Bool sendevent, Bool pending) +{ + RRPropertyPtr prop; + rrScrPrivPtr pScrPriv = rrGetScrPriv(provider->pScreen); + int size_in_bytes; + int total_size; + unsigned long total_len; + RRPropertyValuePtr prop_value; + RRPropertyValueRec new_value; + Bool add = FALSE; + + size_in_bytes = format >> 3; + + /* first see if property already exists */ + prop = RRQueryProviderProperty(provider, property); + if (!prop) { /* just add to list */ + prop = RRCreateProviderProperty(property); + if (!prop) + return BadAlloc; + add = TRUE; + mode = PropModeReplace; + } + if (pending && prop->is_pending) + prop_value = &prop->pending; + else + prop_value = &prop->current; + + /* To append or prepend to a property the request format and type + must match those of the already defined property. The + existing format and type are irrelevant when using the mode + "PropModeReplace" since they will be written over. */ + + if ((format != prop_value->format) && (mode != PropModeReplace)) + return BadMatch; + if ((prop_value->type != type) && (mode != PropModeReplace)) + return BadMatch; + new_value = *prop_value; + if (mode == PropModeReplace) + total_len = len; + else + total_len = prop_value->size + len; + + if (mode == PropModeReplace || len > 0) { + pointer new_data = NULL, old_data = NULL; + + total_size = total_len * size_in_bytes; + new_value.data = (pointer) malloc(total_size); + if (!new_value.data && total_size) { + if (add) + RRDestroyProviderProperty(prop); + return BadAlloc; + } + new_value.size = len; + new_value.type = type; + new_value.format = format; + + switch (mode) { + case PropModeReplace: + new_data = new_value.data; + old_data = NULL; + break; + case PropModeAppend: + new_data = (pointer) (((char *) new_value.data) + + (prop_value->size * size_in_bytes)); + old_data = new_value.data; + break; + case PropModePrepend: + new_data = new_value.data; + old_data = (pointer) (((char *) new_value.data) + + (prop_value->size * size_in_bytes)); + break; + } + if (new_data) + memcpy((char *) new_data, (char *) value, len * size_in_bytes); + if (old_data) + memcpy((char *) old_data, (char *) prop_value->data, + prop_value->size * size_in_bytes); + + if (pending && pScrPriv->rrProviderSetProperty && + !pScrPriv->rrProviderSetProperty(provider->pScreen, provider, + prop->propertyName, &new_value)) { + if (add) + RRDestroyProviderProperty(prop); + free(new_value.data); + return BadValue; + } + free(prop_value->data); + *prop_value = new_value; + } + + else if (len == 0) { + /* do nothing */ + } + + if (add) { + prop->next = provider->properties; + provider->properties = prop; + } + + if (pending && prop->is_pending) + provider->pendingProperties = TRUE; + + if (sendevent) { + xRRProviderPropertyNotifyEvent event = { + .type = RREventBase + RRNotify, + .subCode = RRNotify_ProviderProperty, + .provider = provider->id, + .state = PropertyNewValue, + .atom = prop->propertyName, + .timestamp = currentTime.milliseconds + }; + RRDeliverPropertyEvent(provider->pScreen, (xEvent *) &event); + } + return Success; +} + +Bool +RRPostProviderPendingProperties(RRProviderPtr provider) +{ + RRPropertyValuePtr pending_value; + RRPropertyValuePtr current_value; + RRPropertyPtr property; + Bool ret = TRUE; + + if (!provider->pendingProperties) + return TRUE; + + provider->pendingProperties = FALSE; + for (property = provider->properties; property; property = property->next) { + /* Skip non-pending properties */ + if (!property->is_pending) + continue; + + pending_value = &property->pending; + current_value = &property->current; + + /* + * If the pending and current values are equal, don't mark it + * as changed (which would deliver an event) + */ + if (pending_value->type == current_value->type && + pending_value->format == current_value->format && + pending_value->size == current_value->size && + !memcmp(pending_value->data, current_value->data, + pending_value->size * (pending_value->format / 8))) + continue; + + if (RRChangeProviderProperty(provider, property->propertyName, + pending_value->type, pending_value->format, + PropModeReplace, pending_value->size, + pending_value->data, TRUE, FALSE) != Success) + ret = FALSE; + } + return ret; +} + +RRPropertyPtr +RRQueryProviderProperty(RRProviderPtr provider, Atom property) +{ + RRPropertyPtr prop; + + for (prop = provider->properties; prop; prop = prop->next) + if (prop->propertyName == property) + return prop; + return NULL; +} + +RRPropertyValuePtr +RRGetProviderProperty(RRProviderPtr provider, Atom property, Bool pending) +{ + RRPropertyPtr prop = RRQueryProviderProperty(provider, property); + rrScrPrivPtr pScrPriv = rrGetScrPriv(provider->pScreen); + + if (!prop) + return NULL; + if (pending && prop->is_pending) + return &prop->pending; + else { +#if RANDR_13_INTERFACE + /* If we can, try to update the property value first */ + if (pScrPriv->rrProviderGetProperty) + pScrPriv->rrProviderGetProperty(provider->pScreen, provider, + prop->propertyName); +#endif + return &prop->current; + } +} + +int +RRConfigureProviderProperty(RRProviderPtr provider, Atom property, + Bool pending, Bool range, Bool immutable, + int num_values, INT32 *values) +{ + RRPropertyPtr prop = RRQueryProviderProperty(provider, property); + Bool add = FALSE; + INT32 *new_values; + + if (!prop) { + prop = RRCreateProviderProperty(property); + if (!prop) + return BadAlloc; + add = TRUE; + } + else if (prop->immutable && !immutable) + return BadAccess; + + /* + * ranges must have even number of values + */ + if (range && (num_values & 1)) { + if (add) + RRDestroyProviderProperty(prop); + return BadMatch; + } + + new_values = malloc(num_values * sizeof(INT32)); + if (!new_values && num_values) { + if (add) + RRDestroyProviderProperty(prop); + return BadAlloc; + } + if (num_values) + memcpy(new_values, values, num_values * sizeof(INT32)); + + /* + * Property moving from pending to non-pending + * loses any pending values + */ + if (prop->is_pending && !pending) { + free(prop->pending.data); + RRInitProviderPropertyValue(&prop->pending); + } + + prop->is_pending = pending; + prop->range = range; + prop->immutable = immutable; + prop->num_valid = num_values; + free(prop->valid_values); + prop->valid_values = new_values; + + if (add) { + prop->next = provider->properties; + provider->properties = prop; + } + + return Success; +} + +int +ProcRRListProviderProperties(ClientPtr client) +{ + REQUEST(xRRListProviderPropertiesReq); + Atom *pAtoms = NULL, *temppAtoms; + xRRListProviderPropertiesReply rep; + int numProps = 0; + RRProviderPtr provider; + RRPropertyPtr prop; + + REQUEST_SIZE_MATCH(xRRListProviderPropertiesReq); + + VERIFY_RR_PROVIDER(stuff->provider, provider, DixReadAccess); + + for (prop = provider->properties; prop; prop = prop->next) + numProps++; + if (numProps) + if (!(pAtoms = (Atom *) malloc(numProps * sizeof(Atom)))) + return BadAlloc; + + rep = (xRRListProviderPropertiesReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(numProps * sizeof(Atom)), + .nAtoms = numProps + }; + if (client->swapped) { + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swaps(&rep.nAtoms); + } + temppAtoms = pAtoms; + for (prop = provider->properties; prop; prop = prop->next) + *temppAtoms++ = prop->propertyName; + + WriteToClient(client, sizeof(xRRListProviderPropertiesReply), (char *) &rep); + if (numProps) { + client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; + WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms); + free(pAtoms); + } + return Success; +} + +int +ProcRRQueryProviderProperty(ClientPtr client) +{ + REQUEST(xRRQueryProviderPropertyReq); + xRRQueryProviderPropertyReply rep; + RRProviderPtr provider; + RRPropertyPtr prop; + char *extra = NULL; + + REQUEST_SIZE_MATCH(xRRQueryProviderPropertyReq); + + VERIFY_RR_PROVIDER(stuff->provider, provider, DixReadAccess); + + prop = RRQueryProviderProperty(provider, stuff->property); + if (!prop) + return BadName; + + if (prop->num_valid) { + extra = malloc(prop->num_valid * sizeof(INT32)); + if (!extra) + return BadAlloc; + } + rep = (xRRQueryProviderPropertyReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = prop->num_valid, + .pending = prop->is_pending, + .range = prop->range, + .immutable = prop->immutable + }; + if (client->swapped) { + swaps(&rep.sequenceNumber); + swapl(&rep.length); + } + WriteToClient(client, sizeof(xRRQueryProviderPropertyReply), (char *) &rep); + if (prop->num_valid) { + memcpy(extra, prop->valid_values, prop->num_valid * sizeof(INT32)); + client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; + WriteSwappedDataToClient(client, prop->num_valid * sizeof(INT32), + extra); + free(extra); + } + return Success; +} + +int +ProcRRConfigureProviderProperty(ClientPtr client) +{ + REQUEST(xRRConfigureProviderPropertyReq); + RRProviderPtr provider; + int num_valid; + + REQUEST_AT_LEAST_SIZE(xRRConfigureProviderPropertyReq); + + VERIFY_RR_PROVIDER(stuff->provider, provider, DixReadAccess); + + num_valid = + stuff->length - bytes_to_int32(sizeof(xRRConfigureProviderPropertyReq)); + return RRConfigureProviderProperty(provider, stuff->property, stuff->pending, + stuff->range, FALSE, num_valid, + (INT32 *) (stuff + 1)); +} + +int +ProcRRChangeProviderProperty(ClientPtr client) +{ + REQUEST(xRRChangeProviderPropertyReq); + RRProviderPtr provider; + char format, mode; + unsigned long len; + int sizeInBytes; + int totalSize; + int err; + + REQUEST_AT_LEAST_SIZE(xRRChangeProviderPropertyReq); + UpdateCurrentTime(); + format = stuff->format; + mode = stuff->mode; + if ((mode != PropModeReplace) && (mode != PropModeAppend) && + (mode != PropModePrepend)) { + client->errorValue = mode; + return BadValue; + } + if ((format != 8) && (format != 16) && (format != 32)) { + client->errorValue = format; + return BadValue; + } + len = stuff->nUnits; + if (len > bytes_to_int32((0xffffffff - sizeof(xChangePropertyReq)))) + return BadLength; + sizeInBytes = format >> 3; + totalSize = len * sizeInBytes; + REQUEST_FIXED_SIZE(xRRChangeProviderPropertyReq, totalSize); + + VERIFY_RR_PROVIDER(stuff->provider, provider, DixReadAccess); + + if (!ValidAtom(stuff->property)) { + client->errorValue = stuff->property; + return BadAtom; + } + if (!ValidAtom(stuff->type)) { + client->errorValue = stuff->type; + return BadAtom; + } + + err = RRChangeProviderProperty(provider, stuff->property, + stuff->type, (int) format, + (int) mode, len, (pointer) &stuff[1], TRUE, + TRUE); + if (err != Success) + return err; + else + return Success; +} + +int +ProcRRDeleteProviderProperty(ClientPtr client) +{ + REQUEST(xRRDeleteProviderPropertyReq); + RRProviderPtr provider; + RRPropertyPtr prop; + + REQUEST_SIZE_MATCH(xRRDeleteProviderPropertyReq); + UpdateCurrentTime(); + VERIFY_RR_PROVIDER(stuff->provider, provider, DixReadAccess); + + if (!ValidAtom(stuff->property)) { + client->errorValue = stuff->property; + return BadAtom; + } + + prop = RRQueryProviderProperty(provider, stuff->property); + if (!prop) { + client->errorValue = stuff->property; + return BadName; + } + + if (prop->immutable) { + client->errorValue = stuff->property; + return BadAccess; + } + + RRDeleteProviderProperty(provider, stuff->property); + return Success; +} + +int +ProcRRGetProviderProperty(ClientPtr client) +{ + REQUEST(xRRGetProviderPropertyReq); + RRPropertyPtr prop, *prev; + RRPropertyValuePtr prop_value; + unsigned long n, len, ind; + RRProviderPtr provider; + xRRGetProviderPropertyReply reply = { + .type = X_Reply, + .sequenceNumber = client->sequence + }; + char *extra = NULL; + + REQUEST_SIZE_MATCH(xRRGetProviderPropertyReq); + if (stuff->delete) + UpdateCurrentTime(); + VERIFY_RR_PROVIDER(stuff->provider, provider, + stuff->delete ? DixWriteAccess : DixReadAccess); + + if (!ValidAtom(stuff->property)) { + client->errorValue = stuff->property; + return BadAtom; + } + if ((stuff->delete != xTrue) && (stuff->delete != xFalse)) { + client->errorValue = stuff->delete; + return BadValue; + } + if ((stuff->type != AnyPropertyType) && !ValidAtom(stuff->type)) { + client->errorValue = stuff->type; + return BadAtom; + } + + for (prev = &provider->properties; (prop = *prev); prev = &prop->next) + if (prop->propertyName == stuff->property) + break; + + if (!prop) { + reply.nItems = 0; + reply.length = 0; + reply.bytesAfter = 0; + reply.propertyType = None; + reply.format = 0; + if (client->swapped) { + swaps(&reply.sequenceNumber); + swapl(&reply.length); + swapl(&reply.propertyType); + swapl(&reply.bytesAfter); + swapl(&reply.nItems); + } + WriteToClient(client, sizeof(xRRGetProviderPropertyReply), &reply); + return Success; + } + + if (prop->immutable && stuff->delete) + return BadAccess; + + prop_value = RRGetProviderProperty(provider, stuff->property, stuff->pending); + if (!prop_value) + return BadAtom; + + /* If the request type and actual type don't match. Return the + property information, but not the data. */ + + if (((stuff->type != prop_value->type) && (stuff->type != AnyPropertyType)) + ) { + reply.bytesAfter = prop_value->size; + reply.format = prop_value->format; + reply.length = 0; + reply.nItems = 0; + reply.propertyType = prop_value->type; + if (client->swapped) { + swaps(&reply.sequenceNumber); + swapl(&reply.length); + swapl(&reply.propertyType); + swapl(&reply.bytesAfter); + swapl(&reply.nItems); + } + WriteToClient(client, sizeof(xRRGetProviderPropertyReply), &reply); + return Success; + } + +/* + * Return type, format, value to client + */ + n = (prop_value->format / 8) * prop_value->size; /* size (bytes) of prop */ + ind = stuff->longOffset << 2; + + /* If longOffset is invalid such that it causes "len" to + be negative, it's a value error. */ + + if (n < ind) { + client->errorValue = stuff->longOffset; + return BadValue; + } + + len = min(n - ind, 4 * stuff->longLength); + + if (len) { + extra = malloc(len); + if (!extra) + return BadAlloc; + } + reply.bytesAfter = n - (ind + len); + reply.format = prop_value->format; + reply.length = bytes_to_int32(len); + if (prop_value->format) + reply.nItems = len / (prop_value->format / 8); + else + reply.nItems = 0; + reply.propertyType = prop_value->type; + + if (stuff->delete && (reply.bytesAfter == 0)) { + xRRProviderPropertyNotifyEvent event = { + .type = RREventBase + RRNotify, + .subCode = RRNotify_ProviderProperty, + .provider = provider->id, + .state = PropertyDelete, + .atom = prop->propertyName, + .timestamp = currentTime.milliseconds + }; + RRDeliverPropertyEvent(provider->pScreen, (xEvent *) &event); + } + + if (client->swapped) { + swaps(&reply.sequenceNumber); + swapl(&reply.length); + swapl(&reply.propertyType); + swapl(&reply.bytesAfter); + swapl(&reply.nItems); + } + WriteToClient(client, sizeof(xGenericReply), &reply); + if (len) { + memcpy(extra, (char *) prop_value->data + ind, len); + switch (reply.format) { + case 32: + client->pSwapReplyFunc = (ReplySwapPtr) CopySwap32Write; + break; + case 16: + client->pSwapReplyFunc = (ReplySwapPtr) CopySwap16Write; + break; + default: + client->pSwapReplyFunc = (ReplySwapPtr) WriteToClient; + break; + } + WriteSwappedDataToClient(client, len, extra); + free(extra); + } + + if (stuff->delete && (reply.bytesAfter == 0)) { /* delete the Property */ + *prev = prop->next; + RRDestroyProviderProperty(prop); + } + return Success; +} diff --git a/xserver/randr/rrscreen.c b/xserver/randr/rrscreen.c index f570afaf4..39340ccee 100644 --- a/xserver/randr/rrscreen.c +++ b/xserver/randr/rrscreen.c @@ -22,8 +22,6 @@ #include "randrstr.h" -static const int padlength[4] = { 0, 3, 2, 1 }; - static CARD16 RR10CurrentSizeID(ScreenPtr pScreen); @@ -46,8 +44,7 @@ RREditConnectionInfo(ScreenPtr pScreen) connSetup = (xConnSetup *) ConnectionInfo; vendor = (char *) connSetup + sizeof(xConnSetup); formats = (xPixmapFormat *) ((char *) vendor + - connSetup->nbytesVendor + - padlength[connSetup->nbytesVendor & 3]); + pad_to_int32(connSetup->nbytesVendor)); root = (xWindowRoot *) ((char *) formats + sizeof(xPixmapFormat) * screenInfo.numPixmapFormats); @@ -71,20 +68,20 @@ void RRSendConfigNotify(ScreenPtr pScreen) { WindowPtr pWin = pScreen->root; - xEvent event; - - event.u.u.type = ConfigureNotify; - event.u.configureNotify.window = pWin->drawable.id; - event.u.configureNotify.aboveSibling = None; - event.u.configureNotify.x = 0; - event.u.configureNotify.y = 0; + xEvent event = { + .u.configureNotify.window = pWin->drawable.id, + .u.configureNotify.aboveSibling = None, + .u.configureNotify.x = 0, + .u.configureNotify.y = 0, /* XXX xinerama stuff ? */ - event.u.configureNotify.width = pWin->drawable.width; - event.u.configureNotify.height = pWin->drawable.height; - event.u.configureNotify.borderWidth = wBorderWidth(pWin); - event.u.configureNotify.override = pWin->overrideRedirect; + .u.configureNotify.width = pWin->drawable.width, + .u.configureNotify.height = pWin->drawable.height, + .u.configureNotify.borderWidth = wBorderWidth(pWin), + .u.configureNotify.override = pWin->overrideRedirect + }; + event.u.u.type = ConfigureNotify; DeliverEvents(pWin, &event, 1, NullWindow); } @@ -92,19 +89,20 @@ void RRDeliverScreenEvent(ClientPtr client, WindowPtr pWin, ScreenPtr pScreen) { rrScrPriv(pScreen); - xRRScreenChangeNotifyEvent se; RRCrtcPtr crtc = pScrPriv->numCrtcs ? pScrPriv->crtcs[0] : NULL; WindowPtr pRoot = pScreen->root; - se.type = RRScreenChangeNotify + RREventBase; - se.rotation = (CARD8) (crtc ? crtc->rotation : RR_Rotate_0); - se.timestamp = pScrPriv->lastSetTime.milliseconds; - se.configTimestamp = pScrPriv->lastConfigTime.milliseconds; - se.root = pRoot->drawable.id; - se.window = pWin->drawable.id; - se.subpixelOrder = PictureGetSubpixelOrder(pScreen); + xRRScreenChangeNotifyEvent se = { + .type = RRScreenChangeNotify + RREventBase, + .rotation = (CARD8) (crtc ? crtc->rotation : RR_Rotate_0), + .timestamp = pScrPriv->lastSetTime.milliseconds, + .configTimestamp = pScrPriv->lastConfigTime.milliseconds, + .root = pRoot->drawable.id, + .window = pWin->drawable.id, + .subpixelOrder = PictureGetSubpixelOrder(pScreen), - se.sizeID = RR10CurrentSizeID(pScreen); + .sizeID = RR10CurrentSizeID(pScreen) + }; if (se.rotation & (RR_Rotate_90 | RR_Rotate_270)) { se.widthInPixels = pScreen->height; @@ -195,7 +193,7 @@ ProcRRGetScreenSizeRange(ClientPtr client) rrScrPrivPtr pScrPriv; int rc; - REQUEST_SIZE_MATCH(xRRGetScreenInfoReq); + REQUEST_SIZE_MATCH(xRRGetScreenSizeRangeReq); rc = dixLookupWindow(&pWin, stuff->window, client, DixGetAttrAccess); if (rc != Success) return rc; @@ -203,10 +201,12 @@ ProcRRGetScreenSizeRange(ClientPtr client) pScreen = pWin->drawable.pScreen; pScrPriv = rrGetScrPriv(pScreen); - rep.type = X_Reply; - rep.pad = 0; - rep.sequenceNumber = client->sequence; - rep.length = 0; + rep = (xRRGetScreenSizeRangeReply) { + .type = X_Reply, + .pad = 0, + .sequenceNumber = client->sequence, + .length = 0 + }; if (pScrPriv) { if (!RRGetInfo(pScreen, FALSE)) @@ -228,7 +228,7 @@ ProcRRGetScreenSizeRange(ClientPtr client) swaps(&rep.maxWidth); swaps(&rep.maxHeight); } - WriteToClient(client, sizeof(xRRGetScreenSizeRangeReply), (char *) &rep); + WriteToClient(client, sizeof(xRRGetScreenSizeRangeReply), &rep); return Success; } @@ -248,6 +248,9 @@ ProcRRSetScreenSize(ClientPtr client) pScreen = pWin->drawable.pScreen; pScrPriv = rrGetScrPriv(pScreen); + if (!pScrPriv) + return BadMatch; + if (stuff->width < pScrPriv->minWidth || pScrPriv->maxWidth < stuff->width) { client->errorValue = stuff->width; return BadValue; @@ -289,6 +292,173 @@ ProcRRSetScreenSize(ClientPtr client) return Success; } + +#define update_totals(gpuscreen, pScrPriv) do { \ + total_crtcs += pScrPriv->numCrtcs; \ + total_outputs += pScrPriv->numOutputs; \ + modes = RRModesForScreen(gpuscreen, &num_modes); \ + if (!modes) \ + return BadAlloc; \ + for (j = 0; j < num_modes; j++) \ + total_name_len += modes[j]->mode.nameLength; \ + total_modes += num_modes; \ + free(modes); \ +} while(0) + +static inline void swap_modeinfos(xRRModeInfo *modeinfos, int i) +{ + swapl(&modeinfos[i].id); + swaps(&modeinfos[i].width); + swaps(&modeinfos[i].height); + swapl(&modeinfos[i].dotClock); + swaps(&modeinfos[i].hSyncStart); + swaps(&modeinfos[i].hSyncEnd); + swaps(&modeinfos[i].hTotal); + swaps(&modeinfos[i].hSkew); + swaps(&modeinfos[i].vSyncStart); + swaps(&modeinfos[i].vSyncEnd); + swaps(&modeinfos[i].vTotal); + swaps(&modeinfos[i].nameLength); + swapl(&modeinfos[i].modeFlags); +} + +#define update_arrays(gpuscreen, pScrPriv) do { \ + for (j = 0; j < pScrPriv->numCrtcs; j++) { \ + crtcs[crtc_count] = pScrPriv->crtcs[j]->id; \ + if (client->swapped) \ + swapl(&crtcs[crtc_count]); \ + crtc_count++; \ + } \ + for (j = 0; j < pScrPriv->numOutputs; j++) { \ + outputs[output_count] = pScrPriv->outputs[j]->id; \ + if (client->swapped) \ + swapl(&outputs[output_count]); \ + output_count++; \ + } \ + { \ + RRModePtr mode; \ + modes = RRModesForScreen(gpuscreen, &num_modes); \ + for (j = 0; j < num_modes; j++) { \ + mode = modes[j]; \ + modeinfos[mode_count] = mode->mode; \ + if (client->swapped) { \ + swap_modeinfos(modeinfos, mode_count); \ + } \ + memcpy(names, mode->name, mode->mode.nameLength); \ + names += mode->mode.nameLength; \ + mode_count++; \ + } \ + free(modes); \ + } \ + } while (0) + +static int +rrGetMultiScreenResources(ClientPtr client, Bool query, ScreenPtr pScreen) +{ + int j; + int total_crtcs, total_outputs, total_modes, total_name_len; + int crtc_count, output_count, mode_count; + ScreenPtr iter; + rrScrPrivPtr pScrPriv; + int num_modes; + RRModePtr *modes; + xRRGetScreenResourcesReply rep; + unsigned long extraLen; + CARD8 *extra; + RRCrtc *crtcs; + RROutput *outputs; + xRRModeInfo *modeinfos; + CARD8 *names; + + /* we need to iterate all the GPU masters and all their output slaves */ + total_crtcs = 0; + total_outputs = 0; + total_modes = 0; + total_name_len = 0; + + pScrPriv = rrGetScrPriv(pScreen); + + if (query && pScrPriv) + if (!RRGetInfo(pScreen, query)) + return BadAlloc; + + update_totals(pScreen, pScrPriv); + + xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) { + pScrPriv = rrGetScrPriv(iter); + + if (query) + if (!RRGetInfo(iter, query)) + return BadAlloc; + update_totals(iter, pScrPriv); + } + + ErrorF("reporting %d %d %d %d\n", total_crtcs, total_outputs, total_modes, total_name_len); + + pScrPriv = rrGetScrPriv(pScreen); + rep = (xRRGetScreenResourcesReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .timestamp = pScrPriv->lastSetTime.milliseconds, + .configTimestamp = pScrPriv->lastConfigTime.milliseconds, + .nCrtcs = total_crtcs, + .nOutputs = total_outputs, + .nModes = total_modes, + .nbytesNames = total_name_len + }; + + rep.length = (total_crtcs + total_outputs + total_modes * bytes_to_int32(SIZEOF(xRRModeInfo)) + + bytes_to_int32(rep.nbytesNames)); + + extraLen = rep.length << 2; + if (extraLen) { + extra = malloc(extraLen); + if (!extra) { + return BadAlloc; + } + } + else + extra = NULL; + + crtcs = (RRCrtc *)extra; + outputs = (RROutput *)(crtcs + total_crtcs); + modeinfos = (xRRModeInfo *)(outputs + total_outputs); + names = (CARD8 *)(modeinfos + total_modes); + + /* TODO primary */ + crtc_count = 0; + output_count = 0; + mode_count = 0; + + pScrPriv = rrGetScrPriv(pScreen); + update_arrays(pScreen, pScrPriv); + + xorg_list_for_each_entry(iter, &pScreen->output_slave_list, output_head) { + pScrPriv = rrGetScrPriv(iter); + + update_arrays(iter, pScrPriv); + } + + assert(bytes_to_int32((char *) names - (char *) extra) == rep.length); + if (client->swapped) { + swaps(&rep.sequenceNumber); + swapl(&rep.length); + swapl(&rep.timestamp); + swapl(&rep.configTimestamp); + swaps(&rep.nCrtcs); + swaps(&rep.nOutputs); + swaps(&rep.nModes); + swaps(&rep.nbytesNames); + } + WriteToClient(client, sizeof(xRRGetScreenResourcesReply), &rep); + if (extraLen) { + WriteToClient(client, extraLen, extra); + free(extra); + } + return Success; +} + static int rrGetScreenResources(ClientPtr client, Bool query) { @@ -312,22 +482,26 @@ rrGetScreenResources(ClientPtr client, Bool query) pScreen = pWin->drawable.pScreen; pScrPriv = rrGetScrPriv(pScreen); - rep.pad = 0; if (query && pScrPriv) if (!RRGetInfo(pScreen, query)) return BadAlloc; + if (!xorg_list_is_empty(&pScreen->output_slave_list)) + return rrGetMultiScreenResources(client, query, pScreen); + if (!pScrPriv) { - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.timestamp = currentTime.milliseconds; - rep.configTimestamp = currentTime.milliseconds; - rep.nCrtcs = 0; - rep.nOutputs = 0; - rep.nModes = 0; - rep.nbytesNames = 0; + rep = (xRRGetScreenResourcesReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .timestamp = currentTime.milliseconds, + .configTimestamp = currentTime.milliseconds, + .nCrtcs = 0, + .nOutputs = 0, + .nModes = 0, + .nbytesNames = 0 + }; extra = NULL; extraLen = 0; } @@ -339,15 +513,18 @@ rrGetScreenResources(ClientPtr client, Bool query) if (!modes) return BadAlloc; - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.timestamp = pScrPriv->lastSetTime.milliseconds; - rep.configTimestamp = pScrPriv->lastConfigTime.milliseconds; - rep.nCrtcs = pScrPriv->numCrtcs; - rep.nOutputs = pScrPriv->numOutputs; - rep.nModes = num_modes; - rep.nbytesNames = 0; + rep = (xRRGetScreenResourcesReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .timestamp = pScrPriv->lastSetTime.milliseconds, + .configTimestamp = pScrPriv->lastConfigTime.milliseconds, + .nCrtcs = pScrPriv->numCrtcs, + .nOutputs = pScrPriv->numOutputs, + .nModes = num_modes, + .nbytesNames = 0 + }; + for (i = 0; i < num_modes; i++) rep.nbytesNames += modes[i]->mode.nameLength; @@ -572,7 +749,6 @@ ProcRRGetScreenInfo(ClientPtr client) pScreen = pWin->drawable.pScreen; pScrPriv = rrGetScrPriv(pScreen); - rep.pad = 0; if (pScrPriv) if (!RRGetInfo(pScreen, TRUE)) @@ -581,18 +757,20 @@ ProcRRGetScreenInfo(ClientPtr client) output = RRFirstOutput(pScreen); if (!pScrPriv || !output) { - rep.type = X_Reply; - rep.setOfRotations = RR_Rotate_0; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.root = pWin->drawable.pScreen->root->drawable.id; - rep.timestamp = currentTime.milliseconds; - rep.configTimestamp = currentTime.milliseconds; - rep.nSizes = 0; - rep.sizeID = 0; - rep.rotation = RR_Rotate_0; - rep.rate = 0; - rep.nrateEnts = 0; + rep = (xRRGetScreenInfoReply) { + .type = X_Reply, + .setOfRotations = RR_Rotate_0, + .sequenceNumber = client->sequence, + .length = 0, + .root = pWin->drawable.pScreen->root->drawable.id, + .timestamp = currentTime.milliseconds, + .configTimestamp = currentTime.milliseconds, + .nSizes = 0, + .sizeID = 0, + .rotation = RR_Rotate_0, + .rate = 0, + .nrateEnts = 0 + }; extra = 0; extraLen = 0; } @@ -609,18 +787,20 @@ ProcRRGetScreenInfo(ClientPtr client) if (!pData) return BadAlloc; - rep.type = X_Reply; - rep.setOfRotations = output->crtc->rotations; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.root = pWin->drawable.pScreen->root->drawable.id; - rep.timestamp = pScrPriv->lastSetTime.milliseconds; - rep.configTimestamp = pScrPriv->lastConfigTime.milliseconds; - rep.rotation = output->crtc->rotation; - rep.nSizes = pData->nsize; - rep.nrateEnts = pData->nrefresh + pData->nsize; - rep.sizeID = pData->size; - rep.rate = pData->refresh; + rep = (xRRGetScreenInfoReply) { + .type = X_Reply, + .setOfRotations = output->crtc->rotations, + .sequenceNumber = client->sequence, + .length = 0, + .root = pWin->drawable.pScreen->root->drawable.id, + .timestamp = pScrPriv->lastSetTime.milliseconds, + .configTimestamp = pScrPriv->lastConfigTime.milliseconds, + .rotation = output->crtc->rotation, + .nSizes = pData->nsize, + .nrateEnts = pData->nrefresh + pData->nsize, + .sizeID = pData->size, + .rate = pData->refresh + }; extraLen = rep.nSizes * sizeof(xScreenSizes); if (has_rate) @@ -682,15 +862,16 @@ ProcRRGetScreenInfo(ClientPtr client) swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.timestamp); + swapl(&rep.configTimestamp); swaps(&rep.rotation); swaps(&rep.nSizes); swaps(&rep.sizeID); swaps(&rep.rate); swaps(&rep.nrateEnts); } - WriteToClient(client, sizeof(xRRGetScreenInfoReply), (char *) &rep); + WriteToClient(client, sizeof(xRRGetScreenInfoReply), &rep); if (extraLen) { - WriteToClient(client, extraLen, (char *) extra); + WriteToClient(client, extraLen, extra); free(extra); } return Success; @@ -710,6 +891,7 @@ ProcRRSetScreenConfig(ClientPtr client) Rotation rotation; int rate; Bool has_rate; + CARD8 status; RROutputPtr output; RRCrtcPtr crtc; RRModePtr mode; @@ -740,7 +922,7 @@ ProcRRSetScreenConfig(ClientPtr client) if (!pScrPriv) { time = currentTime; - rep.status = RRSetConfigFailed; + status = RRSetConfigFailed; goto sendReply; } if (!RRGetInfo(pScreen, FALSE)) @@ -749,7 +931,7 @@ ProcRRSetScreenConfig(ClientPtr client) output = RRFirstOutput(pScreen); if (!output) { time = currentTime; - rep.status = RRSetConfigFailed; + status = RRSetConfigFailed; goto sendReply; } @@ -765,7 +947,7 @@ ProcRRSetScreenConfig(ClientPtr client) * stop working after several hours have passed (freedesktop bug #6502). */ if (stuff->configTimestamp != pScrPriv->lastConfigTime.milliseconds) { - rep.status = RRSetConfigInvalidConfigTime; + status = RRSetConfigInvalidConfigTime; goto sendReply; } @@ -844,7 +1026,7 @@ ProcRRSetScreenConfig(ClientPtr client) * the last set-time */ if (CompareTimeStamps(time, pScrPriv->lastSetTime) < 0) { - rep.status = RRSetConfigInvalidTime; + status = RRSetConfigInvalidTime; goto sendReply; } @@ -876,24 +1058,24 @@ ProcRRSetScreenConfig(ClientPtr client) for (c = 0; c < pScrPriv->numCrtcs; c++) { if (!RRCrtcSet(pScrPriv->crtcs[c], NULL, 0, 0, RR_Rotate_0, 0, NULL)) { - rep.status = RRSetConfigFailed; + status = RRSetConfigFailed; /* XXX recover from failure */ goto sendReply; } } if (!RRScreenSizeSet(pScreen, width, height, pScreen->mmWidth, pScreen->mmHeight)) { - rep.status = RRSetConfigFailed; + status = RRSetConfigFailed; /* XXX recover from failure */ goto sendReply; } } if (!RRCrtcSet(crtc, mode, 0, 0, stuff->rotation, 1, &output)) - rep.status = RRSetConfigFailed; + status = RRSetConfigFailed; else { pScrPriv->lastSetTime = time; - rep.status = RRSetConfigSuccess; + status = RRSetConfigSuccess; } /* @@ -904,14 +1086,17 @@ ProcRRSetScreenConfig(ClientPtr client) free(pData); - rep.type = X_Reply; - /* rep.status has already been filled in */ - rep.length = 0; - rep.sequenceNumber = client->sequence; + rep = (xRRSetScreenConfigReply) { + .type = X_Reply, + .status = status, + .sequenceNumber = client->sequence, + .length = 0, - rep.newTimestamp = pScrPriv->lastSetTime.milliseconds; - rep.newConfigTimestamp = pScrPriv->lastConfigTime.milliseconds; - rep.root = pDraw->pScreen->root->drawable.id; + .newTimestamp = pScrPriv->lastSetTime.milliseconds, + .newConfigTimestamp = pScrPriv->lastConfigTime.milliseconds, + .root = pDraw->pScreen->root->drawable.id, + /* .subpixelOrder = ?? */ + }; if (client->swapped) { swaps(&rep.sequenceNumber); @@ -920,7 +1105,7 @@ ProcRRSetScreenConfig(ClientPtr client) swapl(&rep.newConfigTimestamp); swapl(&rep.root); } - WriteToClient(client, sizeof(xRRSetScreenConfigReply), (char *) &rep); + WriteToClient(client, sizeof(xRRSetScreenConfigReply), &rep); return Success; } diff --git a/xserver/randr/rrtransform.h b/xserver/randr/rrtransform.h index efce7e0d7..2269b4cb7 100644 --- a/xserver/randr/rrtransform.h +++ b/xserver/randr/rrtransform.h @@ -57,6 +57,13 @@ RRTransformSetFilter(RRTransformPtr dst, extern _X_EXPORT Bool RRTransformCopy(RRTransformPtr dst, RRTransformPtr src); +/* + * Compute the complete transformation matrix including + * client-specified transform, rotation/reflection values and the crtc + * offset. + * + * Return TRUE if the resulting transform is not a simple translation. + */ extern _X_EXPORT Bool RRTransformCompute(int x, diff --git a/xserver/randr/rrxinerama.c b/xserver/randr/rrxinerama.c index aa8a61eee..76d728c70 100644 --- a/xserver/randr/rrxinerama.c +++ b/xserver/randr/rrxinerama.c @@ -89,21 +89,22 @@ static int SProcRRXineramaDispatch(ClientPtr client); int ProcRRXineramaQueryVersion(ClientPtr client) { - xPanoramiXQueryVersionReply rep; + xPanoramiXQueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .majorVersion = SERVER_RRXINERAMA_MAJOR_VERSION, + .minorVersion = SERVER_RRXINERAMA_MINOR_VERSION + }; REQUEST_SIZE_MATCH(xPanoramiXQueryVersionReq); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = SERVER_RRXINERAMA_MAJOR_VERSION; - rep.minorVersion = SERVER_RRXINERAMA_MINOR_VERSION; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swaps(&rep.majorVersion); swaps(&rep.minorVersion); } - WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), (char *) &rep); + WriteToClient(client, sizeof(xPanoramiXQueryVersionReply), &rep); return Success; } @@ -130,17 +131,19 @@ ProcRRXineramaGetState(ClientPtr client) active = TRUE; } - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.state = active; - rep.window = stuff->window; + rep = (xPanoramiXGetStateReply) { + .type = X_Reply, + .state = active, + .sequenceNumber = client->sequence, + .length = 0, + .window = stuff->window + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.window); } - WriteToClient(client, sizeof(xPanoramiXGetStateReply), (char *) &rep); + WriteToClient(client, sizeof(xPanoramiXGetStateReply), &rep); return Success; } @@ -154,6 +157,7 @@ static int RRXineramaScreenCount(ScreenPtr pScreen) { int i, n; + ScreenPtr slave; n = 0; if (rrGetScrPriv(pScreen)) { @@ -162,6 +166,15 @@ RRXineramaScreenCount(ScreenPtr pScreen) if (RRXineramaCrtcActive(pScrPriv->crtcs[i])) n++; } + + xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) { + rrScrPrivPtr pSlavePriv; + pSlavePriv = rrGetScrPriv(slave); + for (i = 0; i < pSlavePriv->numCrtcs; i++) + if (RRXineramaCrtcActive(pSlavePriv->crtcs[i])) + n++; + } + return n; } @@ -184,17 +197,19 @@ ProcRRXineramaGetScreenCount(ClientPtr client) if (rc != Success) return rc; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.ScreenCount = RRXineramaScreenCount(pWin->drawable.pScreen); - rep.window = stuff->window; + rep = (xPanoramiXGetScreenCountReply) { + .type = X_Reply, + .ScreenCount = RRXineramaScreenCount(pWin->drawable.pScreen), + .sequenceNumber = client->sequence, + .length = 0, + .window = stuff->window + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.window); } - WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), (char *) &rep); + WriteToClient(client, sizeof(xPanoramiXGetScreenCountReply), &rep); return Success; } @@ -215,13 +230,15 @@ ProcRRXineramaGetScreenSize(ClientPtr client) pScreen = pWin->drawable.pScreen; pRoot = pScreen->root; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.width = pRoot->drawable.width; - rep.height = pRoot->drawable.height; - rep.window = stuff->window; - rep.screen = stuff->screen; + rep = (xPanoramiXGetScreenSizeReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .width = pRoot->drawable.width, + .height = pRoot->drawable.height, + .window = stuff->window, + .screen = stuff->screen + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); @@ -230,7 +247,7 @@ ProcRRXineramaGetScreenSize(ClientPtr client) swapl(&rep.window); swapl(&rep.screen); } - WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), (char *) &rep); + WriteToClient(client, sizeof(xPanoramiXGetScreenSizeReply), &rep); return Success; } @@ -241,17 +258,18 @@ ProcRRXineramaIsActive(ClientPtr client) REQUEST_SIZE_MATCH(xXineramaIsActiveReq); - memset(&rep, 0, sizeof(xXineramaIsActiveReply)); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.state = RRXineramaScreenActive(screenInfo.screens[RR_XINERAMA_SCREEN]); + rep = (xXineramaIsActiveReply) { + .type = X_Reply, + .length = 0, + .sequenceNumber = client->sequence, + .state = RRXineramaScreenActive(screenInfo.screens[RR_XINERAMA_SCREEN]) + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.state); } - WriteToClient(client, sizeof(xXineramaIsActiveReply), (char *) &rep); + WriteToClient(client, sizeof(xXineramaIsActiveReply), &rep); return Success; } @@ -299,26 +317,32 @@ ProcRRXineramaQueryScreens(ClientPtr client) { xXineramaQueryScreensReply rep; ScreenPtr pScreen = screenInfo.screens[RR_XINERAMA_SCREEN]; + int n = 0; + int i; REQUEST_SIZE_MATCH(xXineramaQueryScreensReq); - if (RRXineramaScreenActive(pScreen)) + if (RRXineramaScreenActive(pScreen)) { RRGetInfo(pScreen, FALSE); + n = RRXineramaScreenCount(pScreen); + } - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.number = RRXineramaScreenCount(pScreen); - rep.length = bytes_to_int32(rep.number * sz_XineramaScreenInfo); + rep = (xXineramaQueryScreensReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(n * sz_XineramaScreenInfo), + .number = n + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.number); } - WriteToClient(client, sizeof(xXineramaQueryScreensReply), (char *) &rep); + WriteToClient(client, sizeof(xXineramaQueryScreensReply), &rep); - if (rep.number) { + if (n) { + ScreenPtr slave; rrScrPriv(pScreen); - int i; int has_primary = 0; if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc) { @@ -334,6 +358,13 @@ ProcRRXineramaQueryScreens(ClientPtr client) } RRXineramaWriteCrtc(client, pScrPriv->crtcs[i]); } + + xorg_list_for_each_entry(slave, &pScreen->output_slave_list, output_head) { + rrScrPrivPtr pSlavePriv; + pSlavePriv = rrGetScrPriv(slave); + for (i = 0; i < pSlavePriv->numCrtcs; i++) + RRXineramaWriteCrtc(client, pSlavePriv->crtcs[i]); + } } return Success; diff --git a/xserver/record/Makefile.in b/xserver/record/Makefile.in index e270ef247..ce77eec60 100644 --- a/xserver/record/Makefile.in +++ b/xserver/record/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -181,13 +181,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -209,6 +205,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -233,6 +230,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -248,7 +246,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -347,6 +344,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -454,7 +452,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -479,9 +477,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/record/record.c b/xserver/record/record.c index 8a38118cd..f3a26a732 100644 --- a/xserver/record/record.c +++ b/xserver/record/record.c @@ -38,6 +38,7 @@ and Jim Haggerty of Metheus. #include "dixstruct.h" #include "extnsionst.h" +#include "extinit.h" #include #include "set.h" #include "swaprep.h" @@ -139,8 +140,6 @@ static int RecordDeleteContext(pointer /*value */ , XID /*id */ ); -void RecordExtensionInit(void); - /***************************************************************************/ /* client private stuff */ @@ -241,12 +240,12 @@ RecordFlushReplyBuffer(RecordContextPtr pContext, ++pContext->inFlush; if (pContext->numBufBytes) WriteToClient(pContext->pRecordingClient, pContext->numBufBytes, - (char *) pContext->replyBuffer); + pContext->replyBuffer); pContext->numBufBytes = 0; if (len1) - WriteToClient(pContext->pRecordingClient, len1, (char *) data1); + WriteToClient(pContext->pRecordingClient, len1, data1); if (len2) - WriteToClient(pContext->pRecordingClient, len2, (char *) data2); + WriteToClient(pContext->pRecordingClient, len2, data2); --pContext->inFlush; } /* RecordFlushReplyBuffer */ @@ -1816,21 +1815,21 @@ static int ProcRecordQueryVersion(ClientPtr client) { /* REQUEST(xRecordQueryVersionReq); */ - xRecordQueryVersionReply rep; + xRecordQueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .majorVersion = SERVER_RECORD_MAJOR_VERSION, + .minorVersion = SERVER_RECORD_MINOR_VERSION + }; REQUEST_SIZE_MATCH(xRecordQueryVersionReq); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.majorVersion = SERVER_RECORD_MAJOR_VERSION; - rep.minorVersion = SERVER_RECORD_MINOR_VERSION; if (client->swapped) { swaps(&rep.sequenceNumber); swaps(&rep.majorVersion); swaps(&rep.minorVersion); } - (void) WriteToClient(client, sizeof(xRecordQueryVersionReply), - (char *) &rep); + WriteToClient(client, sizeof(xRecordQueryVersionReply), &rep); return Success; } /* ProcRecordQueryVersion */ @@ -2136,6 +2135,7 @@ ProcRecordGetContext(ClientPtr client) GetContextRangeInfoPtr pri; int i; int err; + CARD32 nClients, length; REQUEST_SIZE_MATCH(xRecordGetContextReq); VERIFY_CONTEXT(pContext, stuff->context, client); @@ -2219,28 +2219,32 @@ ProcRecordGetContext(ClientPtr client) /* calculate number of clients and reply length */ - rep.nClients = 0; - rep.length = 0; + nClients = 0; + length = 0; for (pRCAP = pContext->pListOfRCAP, pri = pRangeInfo; pRCAP; pRCAP = pRCAP->pNextRCAP, pri++) { - rep.nClients += pRCAP->numClients; - rep.length += pRCAP->numClients * + nClients += pRCAP->numClients; + length += pRCAP->numClients * (bytes_to_int32(sizeof(xRecordClientInfo)) + pri->nRanges * bytes_to_int32(sizeof(xRecordRange))); } /* write the reply header */ - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.enabled = pContext->pRecordingClient != NULL; - rep.elementHeader = pContext->elemHeaders; + rep = (xRecordGetContextReply) { + .type = X_Reply, + .enabled = pContext->pRecordingClient != NULL, + .sequenceNumber = client->sequence, + .length = length, + .elementHeader = pContext->elemHeaders, + .nClients = nClients + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); swapl(&rep.nClients); } - (void) WriteToClient(client, sizeof(xRecordGetContextReply), (char *) &rep); + WriteToClient(client, sizeof(xRecordGetContextReply), &rep); /* write all the CLIENT_INFOs */ @@ -2257,9 +2261,9 @@ ProcRecordGetContext(ClientPtr client) rci.clientResource = pRCAP->pClientIDs[i]; if (client->swapped) swapl(&rci.clientResource); - WriteToClient(client, sizeof(xRecordClientInfo), (char *) &rci); + WriteToClient(client, sizeof(xRecordClientInfo), &rci); WriteToClient(client, sizeof(xRecordRange) * pri->nRanges, - (char *) pri->pRanges); + pri->pRanges); } } err = Success; diff --git a/xserver/render/Makefile.in b/xserver/render/Makefile.in index c1473b8a7..47394169a 100644 --- a/xserver/render/Makefile.in +++ b/xserver/render/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -214,13 +214,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -242,6 +238,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -266,6 +263,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -281,7 +279,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -380,6 +377,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -499,7 +497,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -524,9 +522,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/render/animcur.c b/xserver/render/animcur.c index 485c068fe..9cbba83fa 100644 --- a/xserver/render/animcur.c +++ b/xserver/render/animcur.c @@ -89,7 +89,7 @@ static DevPrivateKeyRec AnimCurScreenPrivateKeyRec; #define Unwrap(as,s,elt) ((s)->elt = (as)->elt) static Bool -AnimCurCloseScreen(int index, ScreenPtr pScreen) +AnimCurCloseScreen(ScreenPtr pScreen) { AnimCurScreenPtr as = GetAnimCurScreen(pScreen); Bool ret; @@ -103,7 +103,7 @@ AnimCurCloseScreen(int index, ScreenPtr pScreen) Unwrap(as, pScreen, UnrealizeCursor); Unwrap(as, pScreen, RecolorCursor); SetAnimCurScreen(pScreen, 0); - ret = (*pScreen->CloseScreen) (index, pScreen); + ret = (*pScreen->CloseScreen) (pScreen); free(as); return ret; } @@ -135,16 +135,16 @@ AnimCurCursorLimits(DeviceIntPtr pDev, */ static void -AnimCurScreenBlockHandler(int screenNum, - pointer blockData, +AnimCurScreenBlockHandler(ScreenPtr pScreen, pointer pTimeout, pointer pReadmask) { - ScreenPtr pScreen = screenInfo.screens[screenNum]; AnimCurScreenPtr as = GetAnimCurScreen(pScreen); DeviceIntPtr dev; Bool activeDevice = FALSE; CARD32 now = 0, soonest = ~0; /* earliest time to wakeup again */ + Unwrap(as, pScreen, BlockHandler); + for (dev = inputInfo.devices; dev; dev = dev->next) { if (IsPointerDevice(dev) && pScreen == dev->spriteInfo->anim.pScreen) { if (!activeDevice) { @@ -182,8 +182,7 @@ AnimCurScreenBlockHandler(int screenNum, if (activeDevice) AdjustWaitForDelay(pTimeout, soonest - now); - Unwrap(as, pScreen, BlockHandler); - (*pScreen->BlockHandler) (screenNum, blockData, pTimeout, pReadmask); + (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); if (activeDevice) Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler); else diff --git a/xserver/render/filter.c b/xserver/render/filter.c index 8c401ee5d..019ea7f94 100644 --- a/xserver/render/filter.c +++ b/xserver/render/filter.c @@ -273,7 +273,10 @@ PictureResetFilters(ScreenPtr pScreen) free(ps->filters); free(ps->filterAliases); - PictureFreeFilterIds(); + + /* Free the filters when the last screen is closed */ + if (pScreen->myNum == 0) + PictureFreeFilterIds(); } int diff --git a/xserver/render/glyph.c b/xserver/render/glyph.c index a143e9eb5..e1dc66291 100644 --- a/xserver/render/glyph.c +++ b/xserver/render/glyph.c @@ -80,8 +80,6 @@ static GlyphHashSetRec glyphHashSets[] = { #define NGLYPHHASHSETS (sizeof(glyphHashSets)/sizeof(glyphHashSets[0])) -static const CARD8 glyphDepths[GlyphFormatNum] = { 1, 4, 8, 16, 32 }; - static GlyphHashRec globalGlyphs[GlyphFormatNum]; void @@ -90,7 +88,6 @@ GlyphUninit(ScreenPtr pScreen) PictureScreenPtr ps = GetPictureScreen(pScreen); GlyphPtr glyph; int fdepth, i; - int scrno = pScreen->myNum; for (fdepth = 0; fdepth < GlyphFormatNum; fdepth++) { if (!globalGlyphs[fdepth].hashSet) @@ -99,9 +96,9 @@ GlyphUninit(ScreenPtr pScreen) for (i = 0; i < globalGlyphs[fdepth].hashSet->size; i++) { glyph = globalGlyphs[fdepth].table[i].glyph; if (glyph && glyph != DeletedGlyph) { - if (GlyphPicture(glyph)[scrno]) { - FreePicture((pointer) GlyphPicture(glyph)[scrno], 0); - GlyphPicture(glyph)[scrno] = NULL; + if (GetGlyphPicture(glyph, pScreen)) { + FreePicture((pointer) GetGlyphPicture(glyph, pScreen), 0); + SetGlyphPicture(glyph, pScreen, NULL); } (*ps->UnrealizeGlyph) (pScreen, glyph); } @@ -239,8 +236,8 @@ FreeGlyphPicture(GlyphPtr glyph) for (i = 0; i < screenInfo.numScreens; i++) { ScreenPtr pScreen = screenInfo.screens[i]; - if (GlyphPicture(glyph)[i]) - FreePicture((pointer) GlyphPicture(glyph)[i], 0); + if (GetGlyphPicture(glyph, pScreen)) + FreePicture((pointer) GetGlyphPicture(glyph, pScreen), 0); ps = GetPictureScreenIfSet(pScreen); if (ps) @@ -363,11 +360,12 @@ AllocateGlyph(xGlyphInfo * gi, int fdepth) dixInitPrivates(glyph, (char *) glyph + head_size, PRIVATE_GLYPH); for (i = 0; i < screenInfo.numScreens; i++) { - GlyphPicture(glyph)[i] = NULL; - ps = GetPictureScreenIfSet(screenInfo.screens[i]); + ScreenPtr pScreen = screenInfo.screens[i]; + SetGlyphPicture(glyph, pScreen, NULL); + ps = GetPictureScreenIfSet(pScreen); if (ps) { - if (!(*ps->RealizeGlyph) (screenInfo.screens[i], glyph)) + if (!(*ps->RealizeGlyph) (pScreen, glyph)) goto bail; } } @@ -638,7 +636,7 @@ miGlyphs(CARD8 op, n = list->len; while (n--) { glyph = *glyphs++; - pPicture = GlyphPicture(glyph)[pScreen->myNum]; + pPicture = GetGlyphPicture(glyph, pScreen); if (pPicture) { if (maskFormat) { @@ -684,3 +682,15 @@ miGlyphs(CARD8 op, (*pScreen->DestroyPixmap) (pMaskPixmap); } } + +PicturePtr GetGlyphPicture(GlyphPtr glyph, ScreenPtr pScreen) +{ + if (pScreen->isGPU) + return NULL; + return GlyphPicture(glyph)[pScreen->myNum]; +} + +void SetGlyphPicture(GlyphPtr glyph, ScreenPtr pScreen, PicturePtr picture) +{ + GlyphPicture(glyph)[pScreen->myNum] = picture; +} diff --git a/xserver/render/glyphstr.h b/xserver/render/glyphstr.h index cbc4751f0..7d178be01 100644 --- a/xserver/render/glyphstr.h +++ b/xserver/render/glyphstr.h @@ -133,4 +133,10 @@ extern _X_EXPORT GlyphSetPtr AllocateGlyphSet(int fdepth, PictFormatPtr format); extern _X_EXPORT int FreeGlyphSet(pointer value, XID gid); +#define GLYPH_HAS_GLYPH_PICTURE_ACCESSOR 1 /* used for api compat */ +extern _X_EXPORT PicturePtr + GetGlyphPicture(GlyphPtr glyph, ScreenPtr pScreen); +extern _X_EXPORT void + SetGlyphPicture(GlyphPtr glyph, ScreenPtr pScreen, PicturePtr picture); + #endif /* _GLYPHSTR_H_ */ diff --git a/xserver/render/picture.c b/xserver/render/picture.c index 2fd13fc37..2908b7629 100644 --- a/xserver/render/picture.c +++ b/xserver/render/picture.c @@ -50,6 +50,14 @@ RESTYPE PictFormatType; RESTYPE GlyphSetType; int PictureCmapPolicy = PictureCmapPolicyDefault; +PictFormatPtr +PictureWindowFormat(WindowPtr pWindow) +{ + ScreenPtr pScreen = pWindow->drawable.pScreen; + return PictureMatchVisual(pScreen, pWindow->drawable.depth, + WindowGetVisual(pWindow)); +} + Bool PictureDestroyWindow(WindowPtr pWindow) { @@ -72,14 +80,14 @@ PictureDestroyWindow(WindowPtr pWindow) } Bool -PictureCloseScreen(int index, ScreenPtr pScreen) +PictureCloseScreen(ScreenPtr pScreen) { PictureScreenPtr ps = GetPictureScreen(pScreen); Bool ret; int n; pScreen->CloseScreen = ps->CloseScreen; - ret = (*pScreen->CloseScreen) (index, pScreen); + ret = (*pScreen->CloseScreen) (pScreen); PictureResetFilters(pScreen); for (n = 0; n < ps->nformats; n++) if (ps->formats[n].type == PictTypeIndexed) @@ -591,6 +599,29 @@ PictureParseCmapPolicy(const char *name) return PictureCmapPolicyInvalid; } +/** @see GetDefaultBytes */ +static void +GetPictureBytes(pointer value, XID id, ResourceSizePtr size) +{ + PicturePtr picture = value; + + /* Currently only pixmap bytes are reported to clients. */ + size->resourceSize = 0; + + size->refCnt = picture->refcnt; + + /* Calculate pixmap reference sizes. */ + size->pixmapRefSize = 0; + if (picture->pDrawable && (picture->pDrawable->type == DRAWABLE_PIXMAP)) + { + SizeType pixmapSizeFunc = GetResourceTypeSizeFunc(RT_PIXMAP); + ResourceSizeRec pixmapSize = { 0, 0, 0 }; + PixmapPtr pixmap = (PixmapPtr)picture->pDrawable; + pixmapSizeFunc(pixmap, pixmap->drawable.id, &pixmapSize); + size->pixmapRefSize += pixmapSize.pixmapRefSize; + } +} + Bool PictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats) { @@ -602,6 +633,7 @@ PictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats) PictureType = CreateNewResourceType(FreePicture, "PICTURE"); if (!PictureType) return FALSE; + SetResourceTypeSizeFunc(PictureType, GetPictureBytes); PictFormatType = CreateNewResourceType(FreePictFormat, "PICTFORMAT"); if (!PictFormatType) return FALSE; @@ -731,7 +763,8 @@ CreatePicture(Picture pid, PicturePtr pPicture; PictureScreenPtr ps = GetPictureScreen(pDrawable->pScreen); - pPicture = dixAllocateObjectWithPrivates(PictureRec, PRIVATE_PICTURE); + pPicture = dixAllocateScreenObjectWithPrivates(pDrawable->pScreen, + PictureRec, PRIVATE_PICTURE); if (!pPicture) { *error = BadAlloc; return 0; @@ -821,7 +854,7 @@ createSourcePicture(void) { PicturePtr pPicture; - pPicture = dixAllocateObjectWithPrivates(PictureRec, PRIVATE_PICTURE); + pPicture = dixAllocateScreenObjectWithPrivates(NULL, PictureRec, PRIVATE_PICTURE); pPicture->pDrawable = 0; pPicture->pFormat = 0; pPicture->pNext = 0; diff --git a/xserver/render/picturestr.h b/xserver/render/picturestr.h index cd4ec498c..5644f28cf 100644 --- a/xserver/render/picturestr.h +++ b/xserver/render/picturestr.h @@ -363,10 +363,10 @@ extern _X_EXPORT RESTYPE GlyphSetType; #define SetPictureWindow(w,p) dixSetPrivate(&(w)->devPrivates, PictureWindowPrivateKey, p) #define VERIFY_PICTURE(pPicture, pid, client, mode) {\ - int rc = dixLookupResourceByType((pointer)&(pPicture), pid,\ - PictureType, client, mode);\ - if (rc != Success)\ - return rc;\ + int tmprc = dixLookupResourceByType((pointer)&(pPicture), pid,\ + PictureType, client, mode);\ + if (tmprc != Success)\ + return tmprc;\ } #define VERIFY_ALPHA(pPicture, pid, client, mode) {\ @@ -377,11 +377,14 @@ extern _X_EXPORT RESTYPE GlyphSetType; } \ } \ +extern _X_EXPORT PictFormatPtr + PictureWindowFormat(WindowPtr pWindow); + extern _X_EXPORT Bool PictureDestroyWindow(WindowPtr pWindow); extern _X_EXPORT Bool - PictureCloseScreen(int Index, ScreenPtr pScreen); + PictureCloseScreen(ScreenPtr pScreen); extern _X_EXPORT void PictureStoreColors(ColormapPtr pColormap, int ndef, xColorItem * pdef); @@ -544,8 +547,6 @@ CompositeTriFan(CARD8 op, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int npoints, xPointFixed * points); -extern _X_EXPORT void RenderExtensionInit(void); - Bool AnimCurInit(ScreenPtr pScreen); diff --git a/xserver/render/render.c b/xserver/render/render.c index 344ca75e2..51f75ae7e 100644 --- a/xserver/render/render.c +++ b/xserver/render/render.c @@ -37,6 +37,7 @@ #include "pixmapstr.h" #include "colormapst.h" #include "extnsionst.h" +#include "extinit.h" #include "servermd.h" #include #include @@ -267,7 +268,11 @@ static int ProcRenderQueryVersion(ClientPtr client) { RenderClientPtr pRenderClient = GetRenderClient(client); - xRenderQueryVersionReply rep; + xRenderQueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; REQUEST(xRenderQueryVersionReq); @@ -275,10 +280,6 @@ ProcRenderQueryVersion(ClientPtr client) pRenderClient->minor_version = stuff->minorVersion; REQUEST_SIZE_MATCH(xRenderQueryVersionReq); - memset(&rep, 0, sizeof(xRenderQueryVersionReply)); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; if ((stuff->majorVersion * 1000 + stuff->minorVersion) < (SERVER_RENDER_MAJOR_VERSION * 1000 + SERVER_RENDER_MINOR_VERSION)) { @@ -296,7 +297,7 @@ ProcRenderQueryVersion(ClientPtr client) swapl(&rep.majorVersion); swapl(&rep.minorVersion); } - WriteToClient(client, sizeof(xRenderQueryVersionReply), (char *) &rep); + WriteToClient(client, sizeof(xRenderQueryVersionReply), &rep); return Success; } @@ -500,7 +501,7 @@ ProcRenderQueryPictFormats(ClientPtr client) swapl(&reply->numVisuals); swapl(&reply->numSubpixel); } - WriteToClient(client, rlength, (char *) reply); + WriteToClient(client, rlength, reply); free(reply); return Success; } @@ -531,7 +532,7 @@ ProcRenderQueryPictIndexValues(ClientPtr client) num = pFormat->index.nvalues; rlength = (sizeof(xRenderQueryPictIndexValuesReply) + num * sizeof(xIndexValue)); - reply = (xRenderQueryPictIndexValuesReply *) malloc(rlength); + reply = (xRenderQueryPictIndexValuesReply *) calloc(1, rlength); if (!reply) return BadAlloc; @@ -557,7 +558,7 @@ ProcRenderQueryPictIndexValues(ClientPtr client) swapl(&reply->numIndexValues); } - WriteToClient(client, rlength, (char *) reply); + WriteToClient(client, rlength, reply); free(reply); return Success; } @@ -1136,11 +1137,11 @@ ProcRenderAddGlyphs(ClientPtr client) goto bail; } - GlyphPicture(glyph)[screen] = pDst = - CreatePicture(0, &pDstPix->drawable, + pDst = CreatePicture(0, &pDstPix->drawable, glyphSet->format, CPComponentAlpha, &component_alpha, serverClient, &error); + SetGlyphPicture(glyph, pScreen, pDst); /* The picture takes a reference to the pixmap, so we drop ours. */ @@ -1688,7 +1689,7 @@ ProcRenderQueryFilters(ClientPtr client) } len = ((nnames + 1) >> 1) + bytes_to_int32(nbytesName); total_bytes = sizeof(xRenderQueryFiltersReply) + (len << 2); - reply = (xRenderQueryFiltersReply *) malloc(total_bytes); + reply = (xRenderQueryFiltersReply *) calloc(1, total_bytes); if (!reply) return BadAlloc; aliases = (INT16 *) (reply + 1); @@ -1748,7 +1749,7 @@ ProcRenderQueryFilters(ClientPtr client) swapl(&reply->numAliases); swapl(&reply->numFilters); } - WriteToClient(client, total_bytes, (char *) reply); + WriteToClient(client, total_bytes, reply); free(reply); return Success; diff --git a/xserver/test/Makefile.am b/xserver/test/Makefile.am index 32be00d1b..34f53fc1e 100644 --- a/xserver/test/Makefile.am +++ b/xserver/test/Makefile.am @@ -5,7 +5,7 @@ if XORG # Tests that require at least some DDX functions in order to fully link # For now, requires xf86 ddx, could be adjusted to use another SUBDIRS += xi2 -noinst_PROGRAMS += xkb input xtest misc fixes xfree86 +noinst_PROGRAMS += xkb input xtest misc fixes xfree86 hashtabletest os signal-logging endif check_LTLIBRARIES = libxservertest.la @@ -18,15 +18,14 @@ if XORG INCLUDES += -I$(top_srcdir)/hw/xfree86/parser \ -I$(top_srcdir)/hw/xfree86/ddc \ -I$(top_srcdir)/hw/xfree86/i2c -I$(top_srcdir)/hw/xfree86/modes \ - -I$(top_srcdir)/hw/xfree86/ramdac + -I$(top_srcdir)/hw/xfree86/ramdac -I$(top_srcdir)/hw/xfree86/dri \ + -I$(top_srcdir)/hw/xfree86/dri2 endif -TEST_LDADD=libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) +TEST_LDADD=libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS) -if XORG if SPECIAL_DTRACE_OBJECTS TEST_LDADD += $(OS_LIB) $(DIX_LIB) endif -endif xkb_LDADD=$(TEST_LDADD) input_LDADD=$(TEST_LDADD) @@ -36,9 +35,13 @@ misc_LDADD=$(TEST_LDADD) fixes_LDADD=$(TEST_LDADD) xfree86_LDADD=$(TEST_LDADD) touch_LDADD=$(TEST_LDADD) +signal_logging_LDADD=$(TEST_LDADD) +hashtabletest_LDADD=$(TEST_LDADD) $(top_srcdir)/Xext/hashtable.c +os_LDADD=$(TEST_LDADD) libxservertest_la_LIBADD = $(XSERVER_LIBS) if XORG + nodist_libxservertest_la_SOURCES = $(top_builddir)/hw/xfree86/sdksyms.c libxservertest_la_LIBADD += \ $(top_builddir)/hw/xfree86/loader/libloader.la \ @@ -53,6 +56,14 @@ libxservertest_la_LIBADD += \ $(top_builddir)/hw/xfree86/dixmods/libxorgxkb.la \ @XORG_LIBS@ +if DRI +libxservertest_la_LIBADD += $(top_builddir)/hw/xfree86/dri/libdri.la +endif + +if DRI2 +libxservertest_la_LIBADD += $(top_builddir)/hw/xfree86/dri2/libdri2.la +endif + else nodist_libxservertest_la_SOURCES = \ ddxstubs.c \ diff --git a/xserver/test/Makefile.in b/xserver/test/Makefile.in index 53d00cb5d..33b164449 100644 --- a/xserver/test/Makefile.in +++ b/xserver/test/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -56,13 +56,14 @@ host_triplet = @host@ # Tests that require at least some DDX functions in order to fully link # For now, requires xf86 ddx, could be adjusted to use another @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_1 = xi2 -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_2 = xkb input xtest misc fixes xfree86 +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_2 = xkb input xtest misc fixes xfree86 hashtabletest os signal-logging @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_3 = -I$(top_srcdir)/hw/xfree86/parser \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ -I$(top_srcdir)/hw/xfree86/ddc \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ -I$(top_srcdir)/hw/xfree86/i2c -I$(top_srcdir)/hw/xfree86/modes \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ -I$(top_srcdir)/hw/xfree86/ramdac +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ -I$(top_srcdir)/hw/xfree86/ramdac -I$(top_srcdir)/hw/xfree86/dri \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ -I$(top_srcdir)/hw/xfree86/dri2 -@ENABLE_UNIT_TESTS_TRUE@@SPECIAL_DTRACE_OBJECTS_TRUE@@XORG_TRUE@am__append_4 = $(OS_LIB) $(DIX_LIB) +@ENABLE_UNIT_TESTS_TRUE@@SPECIAL_DTRACE_OBJECTS_TRUE@am__append_4 = $(OS_LIB) $(DIX_LIB) @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_5 = \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/loader/libloader.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/os-support/libxorgos.la \ @@ -76,7 +77,9 @@ host_triplet = @host@ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ $(top_builddir)/hw/xfree86/dixmods/libxorgxkb.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ @XORG_LIBS@ -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@am__append_6 = \ +@DRI_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_6 = $(top_builddir)/hw/xfree86/dri/libdri.la +@DRI2_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@am__append_7 = $(top_builddir)/hw/xfree86/dri2/libdri2.la +@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@am__append_8 = \ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/damageext/libdamageext.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/fb/libfb.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/fb/libwfb.la \ @@ -90,23 +93,23 @@ host_triplet = @host@ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/xkb/libxkb.la \ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/xkb/libxkbstubs.la -@COMPOSITE_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@am__append_7 = \ +@COMPOSITE_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@am__append_9 = \ @COMPOSITE_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/composite/libcomposite.la -@DBE_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@am__append_8 = \ +@DBE_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@am__append_10 = \ @DBE_TRUE@@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_builddir)/dbe/libdbe.la -@ENABLE_UNIT_TESTS_TRUE@@GLX_TRUE@@XORG_FALSE@am__append_9 = \ +@ENABLE_UNIT_TESTS_TRUE@@GLX_TRUE@@XORG_FALSE@am__append_11 = \ @ENABLE_UNIT_TESTS_TRUE@@GLX_TRUE@@XORG_FALSE@ $(top_builddir)/glx/libglx.la -@ENABLE_UNIT_TESTS_TRUE@@RECORD_TRUE@@XORG_FALSE@am__append_10 = \ +@ENABLE_UNIT_TESTS_TRUE@@RECORD_TRUE@@XORG_FALSE@am__append_12 = \ @ENABLE_UNIT_TESTS_TRUE@@RECORD_TRUE@@XORG_FALSE@ $(top_builddir)/record/librecord.la -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@@XQUARTZ_TRUE@am__append_11 = \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@@XQUARTZ_TRUE@am__append_13 = \ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@@XQUARTZ_TRUE@ $(top_builddir)/miext/rootless/librootless.la -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@@XQUARTZ_TRUE@am__append_12 = -lXplugin -@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@@XWIN_MULTIWINDOWEXTWM_TRUE@am__append_13 = \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@@XQUARTZ_TRUE@am__append_14 = -lXplugin +@ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@@XWIN_MULTIWINDOWEXTWM_TRUE@am__append_15 = \ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@@XWIN_MULTIWINDOWEXTWM_TRUE@ $(top_builddir)/miext/rootless/librootless.la subdir = test @@ -158,18 +161,27 @@ am__v_lt_1 = @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ xtest$(EXEEXT) \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ misc$(EXEEXT) \ @ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ fixes$(EXEEXT) \ -@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ xfree86$(EXEEXT) +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ xfree86$(EXEEXT) \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ hashtabletest$(EXEEXT) \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ os$(EXEEXT) \ +@ENABLE_UNIT_TESTS_TRUE@@XORG_TRUE@ signal-logging$(EXEEXT) PROGRAMS = $(noinst_PROGRAMS) fixes_SOURCES = fixes.c fixes_OBJECTS = fixes.$(OBJEXT) -@ENABLE_UNIT_TESTS_TRUE@@SPECIAL_DTRACE_OBJECTS_TRUE@@XORG_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) \ -@ENABLE_UNIT_TESTS_TRUE@@SPECIAL_DTRACE_OBJECTS_TRUE@@XORG_TRUE@ $(am__DEPENDENCIES_1) +@ENABLE_UNIT_TESTS_TRUE@@SPECIAL_DTRACE_OBJECTS_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) \ +@ENABLE_UNIT_TESTS_TRUE@@SPECIAL_DTRACE_OBJECTS_TRUE@ $(am__DEPENDENCIES_1) @ENABLE_UNIT_TESTS_TRUE@am__DEPENDENCIES_4 = libxservertest.la \ @ENABLE_UNIT_TESTS_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_UNIT_TESTS_TRUE@ $(am__DEPENDENCIES_1) \ +@ENABLE_UNIT_TESTS_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_UNIT_TESTS_TRUE@ $(am__DEPENDENCIES_3) \ @ENABLE_UNIT_TESTS_TRUE@ $(am__DEPENDENCIES_1) @ENABLE_UNIT_TESTS_TRUE@fixes_DEPENDENCIES = $(am__DEPENDENCIES_4) +hashtabletest_SOURCES = hashtabletest.c +hashtabletest_OBJECTS = hashtabletest.$(OBJEXT) +@ENABLE_UNIT_TESTS_TRUE@hashtabletest_DEPENDENCIES = \ +@ENABLE_UNIT_TESTS_TRUE@ $(am__DEPENDENCIES_4) \ +@ENABLE_UNIT_TESTS_TRUE@ $(top_srcdir)/Xext/hashtable.c input_SOURCES = input.c input_OBJECTS = input.$(OBJEXT) @ENABLE_UNIT_TESTS_TRUE@input_DEPENDENCIES = $(am__DEPENDENCIES_4) @@ -179,6 +191,13 @@ list_OBJECTS = list.$(OBJEXT) misc_SOURCES = misc.c misc_OBJECTS = misc.$(OBJEXT) @ENABLE_UNIT_TESTS_TRUE@misc_DEPENDENCIES = $(am__DEPENDENCIES_4) +os_SOURCES = os.c +os_OBJECTS = os.$(OBJEXT) +@ENABLE_UNIT_TESTS_TRUE@os_DEPENDENCIES = $(am__DEPENDENCIES_4) +signal_logging_SOURCES = signal-logging.c +signal_logging_OBJECTS = signal-logging.$(OBJEXT) +@ENABLE_UNIT_TESTS_TRUE@signal_logging_DEPENDENCIES = \ +@ENABLE_UNIT_TESTS_TRUE@ $(am__DEPENDENCIES_4) string_SOURCES = string.c string_OBJECTS = string.$(OBJEXT) string_LDADD = $(LDADD) @@ -228,10 +247,11 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(nodist_libxservertest_la_SOURCES) fixes.c input.c list.c \ - misc.c string.c touch.c xfree86.c xkb.c xtest.c -DIST_SOURCES = fixes.c input.c list.c misc.c string.c touch.c \ +SOURCES = $(nodist_libxservertest_la_SOURCES) fixes.c hashtabletest.c \ + input.c list.c misc.c os.c signal-logging.c string.c touch.c \ xfree86.c xkb.c xtest.c +DIST_SOURCES = fixes.c hashtabletest.c input.c list.c misc.c os.c \ + signal-logging.c string.c touch.c xfree86.c xkb.c xtest.c RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ @@ -339,13 +359,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -367,6 +383,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -391,6 +408,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -406,7 +424,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -505,6 +522,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -614,7 +632,8 @@ top_srcdir = @top_srcdir@ @ENABLE_UNIT_TESTS_TRUE@ $(am__append_3) @ENABLE_UNIT_TESTS_TRUE@TEST_LDADD = libxservertest.la \ @ENABLE_UNIT_TESTS_TRUE@ $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) \ -@ENABLE_UNIT_TESTS_TRUE@ $(am__append_4) $(am__append_12) +@ENABLE_UNIT_TESTS_TRUE@ $(GLX_SYS_LIBS) $(am__append_4) \ +@ENABLE_UNIT_TESTS_TRUE@ $(am__append_14) @ENABLE_UNIT_TESTS_TRUE@xkb_LDADD = $(TEST_LDADD) @ENABLE_UNIT_TESTS_TRUE@input_LDADD = $(TEST_LDADD) @ENABLE_UNIT_TESTS_TRUE@xtest_LDADD = $(TEST_LDADD) @@ -623,11 +642,15 @@ top_srcdir = @top_srcdir@ @ENABLE_UNIT_TESTS_TRUE@fixes_LDADD = $(TEST_LDADD) @ENABLE_UNIT_TESTS_TRUE@xfree86_LDADD = $(TEST_LDADD) @ENABLE_UNIT_TESTS_TRUE@touch_LDADD = $(TEST_LDADD) +@ENABLE_UNIT_TESTS_TRUE@signal_logging_LDADD = $(TEST_LDADD) +@ENABLE_UNIT_TESTS_TRUE@hashtabletest_LDADD = $(TEST_LDADD) $(top_srcdir)/Xext/hashtable.c +@ENABLE_UNIT_TESTS_TRUE@os_LDADD = $(TEST_LDADD) @ENABLE_UNIT_TESTS_TRUE@libxservertest_la_LIBADD = $(XSERVER_LIBS) \ @ENABLE_UNIT_TESTS_TRUE@ $(am__append_5) $(am__append_6) \ @ENABLE_UNIT_TESTS_TRUE@ $(am__append_7) $(am__append_8) \ @ENABLE_UNIT_TESTS_TRUE@ $(am__append_9) $(am__append_10) \ -@ENABLE_UNIT_TESTS_TRUE@ $(am__append_11) $(am__append_13) +@ENABLE_UNIT_TESTS_TRUE@ $(am__append_11) $(am__append_12) \ +@ENABLE_UNIT_TESTS_TRUE@ $(am__append_13) $(am__append_15) @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@nodist_libxservertest_la_SOURCES = \ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ ddxstubs.c \ @ENABLE_UNIT_TESTS_TRUE@@XORG_FALSE@ $(top_srcdir)/mi/miinitext.c \ @@ -641,7 +664,7 @@ all: all-recursive .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -666,9 +689,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): @@ -696,6 +719,9 @@ clean-noinstPROGRAMS: fixes$(EXEEXT): $(fixes_OBJECTS) $(fixes_DEPENDENCIES) $(EXTRA_fixes_DEPENDENCIES) @rm -f fixes$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fixes_OBJECTS) $(fixes_LDADD) $(LIBS) +hashtabletest$(EXEEXT): $(hashtabletest_OBJECTS) $(hashtabletest_DEPENDENCIES) $(EXTRA_hashtabletest_DEPENDENCIES) + @rm -f hashtabletest$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(hashtabletest_OBJECTS) $(hashtabletest_LDADD) $(LIBS) input$(EXEEXT): $(input_OBJECTS) $(input_DEPENDENCIES) $(EXTRA_input_DEPENDENCIES) @rm -f input$(EXEEXT) $(AM_V_CCLD)$(LINK) $(input_OBJECTS) $(input_LDADD) $(LIBS) @@ -705,6 +731,12 @@ list$(EXEEXT): $(list_OBJECTS) $(list_DEPENDENCIES) $(EXTRA_list_DEPENDENCIES) misc$(EXEEXT): $(misc_OBJECTS) $(misc_DEPENDENCIES) $(EXTRA_misc_DEPENDENCIES) @rm -f misc$(EXEEXT) $(AM_V_CCLD)$(LINK) $(misc_OBJECTS) $(misc_LDADD) $(LIBS) +os$(EXEEXT): $(os_OBJECTS) $(os_DEPENDENCIES) $(EXTRA_os_DEPENDENCIES) + @rm -f os$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(os_OBJECTS) $(os_LDADD) $(LIBS) +signal-logging$(EXEEXT): $(signal_logging_OBJECTS) $(signal_logging_DEPENDENCIES) $(EXTRA_signal_logging_DEPENDENCIES) + @rm -f signal-logging$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(signal_logging_OBJECTS) $(signal_logging_LDADD) $(LIBS) string$(EXEEXT): $(string_OBJECTS) $(string_DEPENDENCIES) $(EXTRA_string_DEPENDENCIES) @rm -f string$(EXEEXT) $(AM_V_CCLD)$(LINK) $(string_OBJECTS) $(string_LDADD) $(LIBS) @@ -730,11 +762,14 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ddxstubs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dpmsstubs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fixes.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hashtabletest.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/input.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miinitext.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/misc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/os.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sdksyms.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal-logging.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/string.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stubs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/touch.Po@am__quote@ diff --git a/xserver/test/ddxstubs.c b/xserver/test/ddxstubs.c index a214b9637..3647dc556 100644 --- a/xserver/test/ddxstubs.c +++ b/xserver/test/ddxstubs.c @@ -50,7 +50,7 @@ OsVendorInit(void) } void -OsVendorFatalError(void) +OsVendorFatalError(const char *f, va_list args) { } diff --git a/xserver/test/fixes.c b/xserver/test/fixes.c index 7807c73ce..4ac6750e4 100644 --- a/xserver/test/fixes.c +++ b/xserver/test/fixes.c @@ -265,6 +265,32 @@ fixes_pointer_barriers_test(void) x2 = x + 100; assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); + /* ray vert barrier */ + barrier.x1 = x; + barrier.x2 = x; + barrier.y1 = -1; + barrier.y2 = y + 100; + + /* ray barrier simple case */ + y1 = y; + y2 = y; + x1 = x + 50; + x2 = x - 50; + assert(barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); + + /* endpoint outside y range; should be blocked */ + y1 = y - 1000; + y2 = y - 1000; + x1 = x + 50; + x2 = x - 50; + assert(barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); + + /* endpoint outside y range */ + y1 = y + 150; + y2 = y + 150; + x1 = x + 50; + x2 = x - 50; + assert(!barrier_is_blocking(&barrier, x1, y1, x2, y2, &distance)); } static void diff --git a/xserver/test/hashtabletest.c b/xserver/test/hashtabletest.c new file mode 100644 index 000000000..64c7091fc --- /dev/null +++ b/xserver/test/hashtabletest.c @@ -0,0 +1,162 @@ +#include +#include +#include +#include "hashtable.h" +#include "resource.h" + +static void +print_xid(void* ptr, void* v) +{ + XID *x = v; + printf("%ld", *x); +} + +static void +print_int(void* ptr, void* v) +{ + int *x = v; + printf("%d", *x); +} + +static int +test1(void) +{ + HashTable h; + XID id; + int c; + int ok = 1; + const int numKeys = 420; + + printf("test1\n"); + h = ht_create(sizeof(XID), sizeof(int), ht_resourceid_hash, ht_resourceid_compare, NULL); + + for (c = 0; c < numKeys; ++c) { + int *dest; + id = c; + dest = ht_add(h, &id); + if (dest) { + *dest = 2 * c; + } + } + + printf("Distribution after insertion\n"); + ht_dump_distribution(h); + ht_dump_contents(h, print_xid, print_int, NULL); + + for (c = 0; c < numKeys; ++c) { + XID id = c; + int* v = ht_find(h, &id); + if (v) { + if (*v == 2 * c) { + // ok + } else { + printf("Key %d doesn't have expected value %d but has %d instead\n", + c, 2 * c, *v); + ok = 0; + } + } else { + ok = 0; + printf("Cannot find key %d\n", c); + } + } + + if (ok) { + printf("%d keys inserted and found\n", c); + + for (c = 0; c < numKeys; ++c) { + XID id = c; + ht_remove(h, &id); + } + + printf("Distribution after deletion\n"); + ht_dump_distribution(h); + } + + ht_destroy(h); + + return ok; +} + +static int +test2(void) +{ + HashTable h; + XID id; + int c; + int ok = 1; + const int numKeys = 420; + + printf("test2\n"); + h = ht_create(sizeof(XID), 0, ht_resourceid_hash, ht_resourceid_compare, NULL); + + for (c = 0; c < numKeys; ++c) { + id = c; + ht_add(h, &id); + } + + for (c = 0; c < numKeys; ++c) { + XID id = c; + if (!ht_find(h, &id)) { + ok = 0; + printf("Cannot find key %d\n", c); + } + } + + { + XID id = c + 1; + if (ht_find(h, &id)) { + ok = 0; + printf("Could find a key that shouldn't be there\n"); + } + } + + ht_destroy(h); + + if (ok) { + printf("Test with empty keys OK\n"); + } else { + printf("Test with empty keys FAILED\n"); + } + + return ok; +} + +static int +test3(void) +{ + int ok = 1; + HtGenericHashSetupRec hashSetup = { + .keySize = 4 + }; + HashTable h; + printf("test3\n"); + h = ht_create(4, 0, ht_generic_hash, ht_generic_compare, &hashSetup); + + if (!ht_add(h, "helo") || + !ht_add(h, "wrld")) { + printf("Could not insert keys\n"); + } + + if (!ht_find(h, "helo") || + !ht_find(h, "wrld")) { + ok = 0; + printf("Could not find inserted keys\n"); + } + + printf("Hash distribution with two strings\n"); + ht_dump_distribution(h); + + ht_destroy(h); + + return ok; +} + +int +main(void) +{ + int ok = test1(); + ok = ok && test2(); + ok = ok && test3(); + + return ok ? 0 : 1; +} diff --git a/xserver/test/input.c b/xserver/test/input.c index 90ab9aea3..be988a4a3 100644 --- a/xserver/test/input.c +++ b/xserver/test/input.c @@ -406,7 +406,7 @@ _dix_test_xi_convert(DeviceEvent *ev, int expected_rc, int expected_count) assert(kbp->same_screen == FALSE); while (--count > 0) { - deviceValuator *v = (deviceValuator *) & xi[count]; + deviceValuator *v = (deviceValuator *) &xi[count]; assert(v->type == DeviceValuator); assert(v->num_valuators <= 6); @@ -964,6 +964,19 @@ test_pad_to_int32(int i) assert(expected_bytes == pad_to_int32(i)); } +static void +test_padding_for_int32(int i) +{ + static const int padlength[4] = { 0, 3, 2, 1 }; + int expected_bytes = (((i + 3) / 4) * 4) - i; + + assert(padding_for_int32(i) >= 0); + assert(padding_for_int32(i) <= 3); + assert(padding_for_int32(i) == expected_bytes); + assert(padding_for_int32(i) == padlength[i & 3]); + assert((padding_for_int32(i) + i) == pad_to_int32(i)); +} + static void include_byte_padding_macros(void) { @@ -996,12 +1009,12 @@ include_byte_padding_macros(void) test_bytes_to_int32(INT_MAX - 4); test_bytes_to_int32(INT_MAX - 3); - printf("Testing pad_to_int32\n"); + printf("Testing pad_to_int32()\n"); - test_pad_to_int32(0); test_pad_to_int32(0); test_pad_to_int32(1); test_pad_to_int32(2); + test_pad_to_int32(3); test_pad_to_int32(7); test_pad_to_int32(8); test_pad_to_int32(0xFF); @@ -1012,6 +1025,23 @@ include_byte_padding_macros(void) test_pad_to_int32(0x1000000); test_pad_to_int32(INT_MAX - 4); test_pad_to_int32(INT_MAX - 3); + + printf("Testing padding_for_int32()\n"); + + test_padding_for_int32(0); + test_padding_for_int32(1); + test_padding_for_int32(2); + test_padding_for_int32(3); + test_padding_for_int32(7); + test_padding_for_int32(8); + test_padding_for_int32(0xFF); + test_padding_for_int32(0x100); + test_padding_for_int32(0xFFFF); + test_padding_for_int32(0x10000); + test_padding_for_int32(0xFFFFFF); + test_padding_for_int32(0x1000000); + test_padding_for_int32(INT_MAX - 4); + test_padding_for_int32(INT_MAX - 3); } static void diff --git a/xserver/test/list.c b/xserver/test/list.c index 82d232706..f9f54ee4e 100644 --- a/xserver/test/list.c +++ b/xserver/test/list.c @@ -137,7 +137,7 @@ static void test_xorg_list_del(void) { struct parent parent = { 0 }; - struct child child[3]; + struct child child[2]; struct child *c; xorg_list_init(&parent.children); @@ -178,8 +178,8 @@ test_xorg_list_del(void) xorg_list_add(&child[0].node, &parent.children); xorg_list_del(&parent.children); assert(xorg_list_is_empty(&parent.children)); + assert(!xorg_list_is_empty(&child[0].node)); assert(!xorg_list_is_empty(&child[1].node)); - assert(!xorg_list_is_empty(&child[2].node)); } static void diff --git a/xserver/test/os.c b/xserver/test/os.c new file mode 100644 index 000000000..2d005a0d4 --- /dev/null +++ b/xserver/test/os.c @@ -0,0 +1,166 @@ +/** + * Copyright © 2012 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#include +#include "os.h" + +static int last_signal = 0; +static int expect_signal = 0; + +static void sighandler(int signal) +{ + assert(expect_signal); + expect_signal = 0; + if (!last_signal) + raise(signal); + OsBlockSignals(); + OsReleaseSignals(); + last_signal = 1; + expect_signal = 1; +} + +static int +sig_is_blocked(int sig) +{ + sigset_t current; + + sigemptyset(¤t); + assert(sigprocmask(SIG_BLOCK, NULL, ¤t) == 0); + return sigismember(¤t, sig); +} + +static void block_sigio_test(void) +{ +#ifdef SIG_BLOCK + sigset_t current; + + sigemptyset(¤t); + assert(!sig_is_blocked(SIGIO)); + + /* block once */ + OsBlockSIGIO(); + assert(sig_is_blocked(SIGIO)); + OsReleaseSIGIO(); + assert(!sig_is_blocked(SIGIO)); + + /* block twice, nested */ + OsBlockSIGIO(); + assert(sig_is_blocked(SIGIO)); + OsBlockSIGIO(); + assert(sig_is_blocked(SIGIO)); + OsReleaseSIGIO(); + assert(sig_is_blocked(SIGIO)); + OsReleaseSIGIO(); + assert(!sig_is_blocked(SIGIO)); + + /* block all */ + OsBlockSignals(); + assert(sig_is_blocked(SIGIO)); + OsReleaseSignals(); + assert(!sig_is_blocked(SIGIO)); + + /* block all nested */ + OsBlockSignals(); + assert(sig_is_blocked(SIGIO)); + OsBlockSignals(); + assert(sig_is_blocked(SIGIO)); + OsReleaseSignals(); + assert(sig_is_blocked(SIGIO)); + OsReleaseSignals(); + assert(!sig_is_blocked(SIGIO)); + + /* mix the two */ + /* ABBA */ + OsBlockSignals(); + assert(sig_is_blocked(SIGIO)); + OsBlockSIGIO(); + assert(sig_is_blocked(SIGIO)); + OsReleaseSIGIO(); + assert(sig_is_blocked(SIGIO)); + OsReleaseSignals(); + assert(!sig_is_blocked(SIGIO)); + + /* ABAB */ + OsBlockSignals(); + assert(sig_is_blocked(SIGIO)); + OsBlockSIGIO(); + assert(sig_is_blocked(SIGIO)); + OsReleaseSignals(); + assert(sig_is_blocked(SIGIO)); + OsReleaseSIGIO(); + assert(!sig_is_blocked(SIGIO)); + + /* BAAB */ + OsBlockSIGIO(); + assert(sig_is_blocked(SIGIO)); + OsBlockSignals(); + assert(sig_is_blocked(SIGIO)); + OsReleaseSignals(); + assert(sig_is_blocked(SIGIO)); + OsReleaseSIGIO(); + assert(!sig_is_blocked(SIGIO)); + + /* BABA */ + OsBlockSIGIO(); + assert(sig_is_blocked(SIGIO)); + OsBlockSignals(); + assert(sig_is_blocked(SIGIO)); + OsReleaseSIGIO(); + assert(sig_is_blocked(SIGIO)); + OsReleaseSignals(); + assert(!sig_is_blocked(SIGIO)); +#endif +} + +static void block_sigio_test_nested(void) +{ +#ifdef SIG_BLOCK + /* Check for bug releasing SIGIO during SIGIO signal handling. + test case: + raise signal + → in signal handler: + raise signal + OsBlockSignals() + OsReleaseSignals() + tail guard + tail guard must be hit. + */ + void (*old_handler)(int); + old_handler = signal(SIGIO, sighandler); + expect_signal = 1; + assert(raise(SIGIO) == 0); + assert(signal(SIGIO, old_handler) == sighandler); +#endif +} + +int +main(int argc, char **argv) +{ + block_sigio_test(); + block_sigio_test_nested(); + return 0; +} diff --git a/xserver/test/signal-logging.c b/xserver/test/signal-logging.c new file mode 100644 index 000000000..e0eb81006 --- /dev/null +++ b/xserver/test/signal-logging.c @@ -0,0 +1,313 @@ +/** + * Copyright © 2012 Canonical, Ltd. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifdef HAVE_DIX_CONFIG_H +#include +#endif + +#include +#include +#include "assert.h" +#include "misc.h" + +struct number_format_test { + uint64_t number; + char string[21]; + char hex_string[17]; +}; + +struct signed_number_format_test { + int64_t number; + char string[21]; +}; + +struct float_number_format_test { + double number; + char string[21]; +}; + +static Bool +check_signed_number_format_test(long int number) +{ + char string[21]; + char expected[21]; + + sprintf(expected, "%ld", number); + FormatInt64(number, string); + if(strncmp(string, expected, 21) != 0) { + fprintf(stderr, "Failed to convert %jd to decimal string (expected %s but got %s)\n", + number, expected, string); + return FALSE; + } + + return TRUE; +} + +static Bool +check_float_format_test(double number) +{ + char string[21]; + char expected[21]; + + /* we currently always print float as .2f */ + sprintf(expected, "%.2f", number); + + FormatDouble(number, string); + if(strncmp(string, expected, 21) != 0) { + fprintf(stderr, "Failed to convert %f to string (%s vs %s)\n", + number, expected, string); + return FALSE; + } + + return TRUE; +} + +static Bool +check_number_format_test(long unsigned int number) +{ + char string[21]; + char expected[21]; + + sprintf(expected, "%lu", number); + + FormatUInt64(number, string); + if(strncmp(string, expected, 21) != 0) { + fprintf(stderr, "Failed to convert %ju to decimal string (%s vs %s)\n", + number, expected, string); + return FALSE; + } + + sprintf(expected, "%lx", number); + FormatUInt64Hex(number, string); + if(strncmp(string, expected, 17) != 0) { + fprintf(stderr, "Failed to convert %ju to hexadecimal string (%s vs %s)\n", + number, expected, string); + return FALSE; + } + + return TRUE; +} + +/* FIXME: max range stuff */ +double float_tests[] = { 0, 5, 0.1, 0.01, 5.2342, 10.2301, + -1, -2.00, -0.6023, -1203.30 + }; + +static void +number_formatting(void) +{ + int i; + long unsigned int unsigned_tests[] = { 0,/* Zero */ + 5, /* Single digit number */ + 12, /* Two digit decimal number */ + 37, /* Two digit hex number */ + 0xC90B2, /* Large < 32 bit number */ + 0x15D027BF211B37A, /* Large > 32 bit number */ + 0xFFFFFFFFFFFFFFFF, /* Maximum 64-bit number */ + }; + + long int signed_tests[] = { 0,/* Zero */ + 5, /* Single digit number */ + 12, /* Two digit decimal number */ + 37, /* Two digit hex number */ + 0xC90B2, /* Large < 32 bit number */ + 0x15D027BF211B37A, /* Large > 32 bit number */ + 0x7FFFFFFFFFFFFFFF, /* Maximum 64-bit signed number */ + -1, /* Single digit number */ + -12, /* Two digit decimal number */ + -0xC90B2, /* Large < 32 bit number */ + -0x15D027BF211B37A, /* Large > 32 bit number */ + -0x7FFFFFFFFFFFFFFF, /* Maximum 64-bit signed number */ + } ; + + for (i = 0; i < sizeof(unsigned_tests) / sizeof(unsigned_tests[0]); i++) + assert(check_number_format_test(unsigned_tests[i])); + + for (i = 0; i < sizeof(unsigned_tests) / sizeof(signed_tests[0]); i++) + assert(check_signed_number_format_test(signed_tests[i])); + + for (i = 0; i < sizeof(float_tests) / sizeof(float_tests[0]); i++) + assert(check_float_format_test(float_tests[i])); +} + +#pragma GCC diagnostic ignored "-Wformat-security" +static void logging_format(void) +{ + const char *log_file_path = "/tmp/Xorg-logging-test.log"; + const char *str = "%s %d %u %% %p %i"; + char buf[1024]; + int i; + unsigned int ui; + FILE *f; + char read_buf[2048]; + char *logmsg; + uintptr_t ptr; + + /* set up buf to contain ".....end" */ + memset(buf, '.', sizeof(buf)); + strcpy(&buf[sizeof(buf) - 4], "end"); + + LogInit(log_file_path, NULL); + assert(f = fopen(log_file_path, "r")); + +#define read_log_msg(msg) \ + fgets(read_buf, sizeof(read_buf), f); \ + msg = strchr(read_buf, ']') + 2; /* advance past [time.stamp] */ + + /* boring test message */ + LogMessageVerbSigSafe(X_ERROR, -1, "test message\n"); + read_log_msg(logmsg); + assert(strcmp(logmsg, "(EE) test message\n") == 0); + + /* long buf is truncated to "....en\n" */ + LogMessageVerbSigSafe(X_ERROR, -1, buf); + read_log_msg(logmsg); + assert(strcmp(&logmsg[strlen(logmsg) - 3], "en\n") == 0); + + /* same thing, this time as string substitution */ + LogMessageVerbSigSafe(X_ERROR, -1, "%s", buf); + read_log_msg(logmsg); + assert(strcmp(&logmsg[strlen(logmsg) - 3], "en\n") == 0); + + /* strings containing placeholders should just work */ + LogMessageVerbSigSafe(X_ERROR, -1, "%s\n", str); + read_log_msg(logmsg); + assert(strcmp(logmsg, "(EE) %s %d %u %% %p %i\n") == 0); + + /* string substitution */ + LogMessageVerbSigSafe(X_ERROR, -1, "%s\n", "substituted string"); + read_log_msg(logmsg); + assert(strcmp(logmsg, "(EE) substituted string\n") == 0); + + /* Invalid format */ +#warning Ignore compiler warning below "lacks type at end of format". This is intentional. + LogMessageVerbSigSafe(X_ERROR, -1, "%4", 4); + read_log_msg(logmsg); + assert(strcmp(logmsg, "(EE) ") == 0); + LogMessageVerbSigSafe(X_ERROR, -1, "\n"); + fseek(f, 0, SEEK_END); + + /* number substitution */ + ui = 0; + do { + char expected[30]; + sprintf(expected, "(EE) %u\n", ui); + LogMessageVerbSigSafe(X_ERROR, -1, "%u\n", ui); + read_log_msg(logmsg); + assert(strcmp(logmsg, expected) == 0); + if (ui == 0) + ui = 1; + else + ui <<= 1; + } while(ui); + + /* signed number substitution */ + i = 0; + do { + char expected[30]; + sprintf(expected, "(EE) %d\n", i); + LogMessageVerbSigSafe(X_ERROR, -1, "%d\n", i); + read_log_msg(logmsg); + assert(strcmp(logmsg, expected) == 0); + + + sprintf(expected, "(EE) %d\n", i | INT_MIN); + LogMessageVerbSigSafe(X_ERROR, -1, "%d\n", i | INT_MIN); + read_log_msg(logmsg); + assert(strcmp(logmsg, expected) == 0); + + if (i == 0) + i = 1; + else + i <<= 1; + } while(i > INT_MIN); + + /* hex number substitution */ + ui = 0; + do { + char expected[30]; + sprintf(expected, "(EE) %x\n", ui); + LogMessageVerbSigSafe(X_ERROR, -1, "%x\n", ui); + read_log_msg(logmsg); + assert(strcmp(logmsg, expected) == 0); + if (ui == 0) + ui = 1; + else + ui <<= 1; + } while(ui); + + /* pointer substitution */ + /* we print a null-pointer differently to printf */ + LogMessageVerbSigSafe(X_ERROR, -1, "%p\n", NULL); + read_log_msg(logmsg); + assert(strcmp(logmsg, "(EE) 0x0\n") == 0); + + ptr = 1; + do { + char expected[30]; + sprintf(expected, "(EE) %p\n", (void*)ptr); + LogMessageVerbSigSafe(X_ERROR, -1, "%p\n", (void*)ptr); + read_log_msg(logmsg); + assert(strcmp(logmsg, expected) == 0); + ptr <<= 1; + } while(ptr); + + + for (i = 0; i < sizeof(float_tests)/sizeof(float_tests[0]); i++) { + double d = float_tests[i]; + char expected[30]; + sprintf(expected, "(EE) %.2f\n", d); + LogMessageVerbSigSafe(X_ERROR, -1, "%f\n", d); + read_log_msg(logmsg); + assert(strcmp(logmsg, expected) == 0); + + /* test for length modifiers, we just ignore them atm */ + LogMessageVerbSigSafe(X_ERROR, -1, "%.3f\n", d); + read_log_msg(logmsg); + assert(strcmp(logmsg, expected) == 0); + + LogMessageVerbSigSafe(X_ERROR, -1, "%3f\n", d); + read_log_msg(logmsg); + assert(strcmp(logmsg, expected) == 0); + + LogMessageVerbSigSafe(X_ERROR, -1, "%.0f\n", d); + read_log_msg(logmsg); + assert(strcmp(logmsg, expected) == 0); + } + + + LogClose(EXIT_NO_ERROR); + unlink(log_file_path); + +#undef read_log_msg +} +#pragma GCC diagnostic pop "-Wformat-security" + +int +main(int argc, char **argv) +{ + number_formatting(); + logging_format(); + + return 0; +} diff --git a/xserver/test/touch.c b/xserver/test/touch.c index 2ec535b43..df1db11de 100644 --- a/xserver/test/touch.c +++ b/xserver/test/touch.c @@ -40,6 +40,7 @@ touch_grow_queue(void) int i; memset(&dev, 0, sizeof(dev)); + dev.name = "test device"; dev.id = 2; dev.valuator = &val; val.numAxes = 5; @@ -94,6 +95,7 @@ touch_find_ddxid(void) int i; memset(&dev, 0, sizeof(dev)); + dev.name = "test device"; dev.id = 2; dev.valuator = &val; val.numAxes = 5; @@ -162,6 +164,7 @@ touch_begin_ddxtouch(void) int size = 5; memset(&dev, 0, sizeof(dev)); + dev.name = "test device"; dev.id = 2; dev.valuator = &val; val.numAxes = 5; @@ -209,6 +212,7 @@ touch_begin_touch(void) screenInfo.screens[0] = &screen; memset(&dev, 0, sizeof(dev)); + dev.name = "test device"; dev.id = 2; memset(&sprite, 0, sizeof(sprite)); @@ -247,6 +251,7 @@ touch_init(void) screenInfo.screens[0] = &screen; memset(&dev, 0, sizeof(dev)); + dev.name = "test device"; memset(&sprite, 0, sizeof(sprite)); dev.spriteInfo = &sprite; diff --git a/xserver/test/xi2/Makefile.am b/xserver/test/xi2/Makefile.am index 913ba0f8b..9de7abf5d 100644 --- a/xserver/test/xi2/Makefile.am +++ b/xserver/test/xi2/Makefile.am @@ -18,7 +18,7 @@ TESTS_ENVIRONMENT = $(XORG_MALLOC_DEBUG_ENV) AM_CFLAGS = $(DIX_CFLAGS) @XORG_CFLAGS@ INCLUDES = @XORG_INCS@ -TEST_LDADD=../libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) +TEST_LDADD=../libxservertest.la $(XORG_SYS_LIBS) $(XSERVER_SYS_LIBS) $(GLX_SYS_LIBS) COMMON_SOURCES=protocol-common.h protocol-common.c if SPECIAL_DTRACE_OBJECTS diff --git a/xserver/test/xi2/Makefile.in b/xserver/test/xi2/Makefile.in index b87e8e7f3..0ec9f37e3 100644 --- a/xserver/test/xi2/Makefile.in +++ b/xserver/test/xi2/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -93,6 +93,7 @@ am__DEPENDENCIES_1 = @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@am__DEPENDENCIES_3 = ../libxservertest.la \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ $(am__DEPENDENCIES_1) \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ $(am__DEPENDENCIES_1) \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ $(am__DEPENDENCIES_2) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_eventconvert_DEPENDENCIES = $(am__DEPENDENCIES_3) AM_V_lt = $(am__v_lt_@AM_V@) @@ -335,13 +336,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -363,6 +360,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -387,6 +385,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -402,7 +401,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -501,6 +499,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -609,6 +608,7 @@ top_srcdir = @top_srcdir@ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@TEST_LDADD = ../libxservertest.la \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ $(XORG_SYS_LIBS) \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ $(XSERVER_SYS_LIBS) \ +@ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ $(GLX_SYS_LIBS) \ @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@ $(am__append_1) @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@COMMON_SOURCES = protocol-common.h protocol-common.c @ENABLE_UNIT_TESTS_TRUE@@HAVE_LD_WRAP_TRUE@protocol_xiqueryversion_LDADD = $(TEST_LDADD) @@ -646,7 +646,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -671,9 +671,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/test/xi2/protocol-common.c b/xserver/test/xi2/protocol-common.c index 32c056797..e2b0b8ba3 100644 --- a/xserver/test/xi2/protocol-common.c +++ b/xserver/test/xi2/protocol-common.c @@ -30,6 +30,7 @@ #include "exglobals.h" #include "xkbsrv.h" /* for XkbInitPrivates */ #include "xserver-properties.h" +#include "syncsrv.h" #include #include "protocol-common.h" @@ -38,6 +39,7 @@ struct devices devices; ScreenRec screen; WindowRec root; WindowRec window; +static ClientRec server_client; void *userdata; @@ -214,6 +216,11 @@ device_cursor_init(DeviceIntPtr dev, ScreenPtr screen) return TRUE; } +static void +device_cursor_cleanup(DeviceIntPtr dev, ScreenPtr screen) +{ +} + static Bool set_cursor_pos(DeviceIntPtr dev, ScreenPtr screen, int x, int y, Bool event) { @@ -231,6 +238,7 @@ init_simple(void) screen.width = 640; screen.height = 480; screen.DeviceCursorInitialize = device_cursor_init; + screen.DeviceCursorCleanup = device_cursor_cleanup; screen.SetCursorPosition = set_cursor_pos; dixResetPrivates(); @@ -245,6 +253,12 @@ init_simple(void) init_window(&root, NULL, ROOT_WINDOW_ID); init_window(&window, &root, CLIENT_WINDOW_ID); + serverClient = &server_client; + InitClient(serverClient, 0, (pointer) NULL); + if (!InitClientResources(serverClient)) /* for root resources */ + FatalError("couldn't init server resources"); + SyncExtensionInit(); + devices = init_devices(); } diff --git a/xserver/test/xi2/protocol-common.h b/xserver/test/xi2/protocol-common.h index 04a1e8990..f27f248c6 100644 --- a/xserver/test/xi2/protocol-common.h +++ b/xserver/test/xi2/protocol-common.h @@ -33,8 +33,6 @@ #ifndef PROTOCOL_COMMON_H #define PROTOCOL_COMMON_H -extern int BadDevice; - /* Check default values in a reply */ #define reply_check_defaults(rep, len, type) \ { \ @@ -83,7 +81,7 @@ struct devices { int num_devices; int num_master_devices; -} devices; +}; /** * The set of default devices available in all tests if necessary. diff --git a/xserver/test/xi2/protocol-eventconvert.c b/xserver/test/xi2/protocol-eventconvert.c index 1188e8b25..aea380ed5 100644 --- a/xserver/test/xi2/protocol-eventconvert.c +++ b/xserver/test/xi2/protocol-eventconvert.c @@ -338,8 +338,8 @@ test_values_XIDeviceEvent(DeviceEvent *in, xXIDeviceEvent * out, BOOL swap) assert(out->event_x == 0); /* set in FixUpEventFromWindow */ assert(out->event_y == 0); /* set in FixUpEventFromWindow */ - assert(out->root_x == FP1616(in->root_x, in->root_x_frac)); - assert(out->root_y == FP1616(in->root_y, in->root_y_frac)); + assert(out->root_x == double_to_fp1616(in->root_x + in->root_x_frac)); + assert(out->root_y == double_to_fp1616(in->root_y + in->root_y_frac)); buttons = 0; for (i = 0; i < bits_to_bytes(sizeof(in->buttons)); i++) { @@ -694,7 +694,7 @@ test_values_XIDeviceChangedEvent(DeviceChangedEvent *in, assert(k->num_keycodes == in->keys.max_keycode - in->keys.min_keycode + 1); - kc = (uint32_t *) & k[1]; + kc = (uint32_t *) &k[1]; for (j = 0; j < k->num_keycodes; j++) { if (swap) { swapl(&kc[j]); @@ -984,6 +984,221 @@ test_convert_XITouchOwnershipEvent(void) } } +static void +test_XIBarrierEvent(BarrierEvent *in) +{ + xXIBarrierEvent *out, *swapped; + int count; + int rc; + int eventlen; + FP3232 value; + + rc = EventToXI((InternalEvent*)in, (xEvent**)&out, &count); + assert(rc == BadMatch); + + rc = EventToCore((InternalEvent*)in, (xEvent**)&out, &count); + assert(rc == BadMatch); + + rc = EventToXI2((InternalEvent*)in, (xEvent**)&out); + + assert(out->type == GenericEvent); + assert(out->extension == 0); /* IReqCode defaults to 0 */ + assert(out->evtype == GetXI2Type(in->type)); + assert(out->time == in->time); + assert(out->deviceid == in->deviceid); + assert(out->sourceid == in->sourceid); + assert(out->barrier == in->barrierid); + assert(out->flags == in->flags); + assert(out->event == in->window); + assert(out->root == in->root); + assert(out->dtime == in->dt); + assert(out->eventid == in->event_id); + assert(out->root_x == double_to_fp1616(in->root_x)); + assert(out->root_y == double_to_fp1616(in->root_y)); + + value = double_to_fp3232(in->dx); + assert(out->dx.integral == value.integral); + assert(out->dx.frac == value.frac); + value = double_to_fp3232(in->dy); + assert(out->dy.integral == value.integral); + assert(out->dy.frac == value.frac); + + eventlen = sizeof(xEvent) + out->length * 4; + swapped = calloc(1, eventlen); + XI2EventSwap((xGenericEvent *) out, (xGenericEvent *) swapped); + + swaps(&swapped->sequenceNumber); + swapl(&swapped->length); + swaps(&swapped->evtype); + swaps(&swapped->deviceid); + swapl(&swapped->time); + swapl(&swapped->eventid); + swapl(&swapped->root); + swapl(&swapped->event); + swapl(&swapped->barrier); + swapl(&swapped->dtime); + swaps(&swapped->sourceid); + swapl(&swapped->root_x); + swapl(&swapped->root_y); + swapl(&swapped->dx.integral); + swapl(&swapped->dx.frac); + swapl(&swapped->dy.integral); + swapl(&swapped->dy.frac); + + assert(memcmp(swapped, out, eventlen) == 0); + + free(swapped); + free(out); +} + +static void +test_convert_XIBarrierEvent(void) +{ + BarrierEvent in; + + memset(&in, 0, sizeof(in)); + in.header = ET_Internal; + in.type = ET_BarrierHit; + in.length = sizeof(in); + in.time = 0; + in.deviceid = 1; + in.sourceid = 2; + + test_XIBarrierEvent(&in); + + in.deviceid = 1; + while(in.deviceid & 0xFFFF) { + test_XIBarrierEvent(&in); + in.deviceid <<= 1; + } + in.deviceid = 0; + + in.sourceid = 1; + while(in.sourceid & 0xFFFF) { + test_XIBarrierEvent(&in); + in.sourceid <<= 1; + } + in.sourceid = 0; + + in.flags = 1; + while(in.flags) { + test_XIBarrierEvent(&in); + in.flags <<= 1; + } + + in.barrierid = 1; + while(in.barrierid) { + test_XIBarrierEvent(&in); + in.barrierid <<= 1; + } + + in.dt = 1; + while(in.dt) { + test_XIBarrierEvent(&in); + in.dt <<= 1; + } + + in.event_id = 1; + while(in.event_id) { + test_XIBarrierEvent(&in); + in.event_id <<= 1; + } + + in.window = 1; + while(in.window) { + test_XIBarrierEvent(&in); + in.window <<= 1; + } + + in.root = 1; + while(in.root) { + test_XIBarrierEvent(&in); + in.root <<= 1; + } + + /* pseudo-random 16 bit numbers */ + in.root_x = 1; + test_XIBarrierEvent(&in); + in.root_x = 1.3; + test_XIBarrierEvent(&in); + in.root_x = 264.908; + test_XIBarrierEvent(&in); + in.root_x = 35638.292; + test_XIBarrierEvent(&in); + + in.root_x = -1; + test_XIBarrierEvent(&in); + in.root_x = -1.3; + test_XIBarrierEvent(&in); + in.root_x = -264.908; + test_XIBarrierEvent(&in); + in.root_x = -35638.292; + test_XIBarrierEvent(&in); + + in.root_y = 1; + test_XIBarrierEvent(&in); + in.root_y = 1.3; + test_XIBarrierEvent(&in); + in.root_y = 264.908; + test_XIBarrierEvent(&in); + in.root_y = 35638.292; + test_XIBarrierEvent(&in); + + in.root_y = -1; + test_XIBarrierEvent(&in); + in.root_y = -1.3; + test_XIBarrierEvent(&in); + in.root_y = -264.908; + test_XIBarrierEvent(&in); + in.root_y = -35638.292; + test_XIBarrierEvent(&in); + + /* equally pseudo-random 32 bit numbers */ + in.dx = 1; + test_XIBarrierEvent(&in); + in.dx = 1.3; + test_XIBarrierEvent(&in); + in.dx = 264.908; + test_XIBarrierEvent(&in); + in.dx = 35638.292; + test_XIBarrierEvent(&in); + in.dx = 2947813871.2342; + test_XIBarrierEvent(&in); + + in.dx = -1; + test_XIBarrierEvent(&in); + in.dx = -1.3; + test_XIBarrierEvent(&in); + in.dx = -264.908; + test_XIBarrierEvent(&in); + in.dx = -35638.292; + test_XIBarrierEvent(&in); + in.dx = -2947813871.2342; + test_XIBarrierEvent(&in); + + in.dy = 1; + test_XIBarrierEvent(&in); + in.dy = 1.3; + test_XIBarrierEvent(&in); + in.dy = 264.908; + test_XIBarrierEvent(&in); + in.dy = 35638.292; + test_XIBarrierEvent(&in); + in.dy = 2947813871.2342; + test_XIBarrierEvent(&in); + + in.dy = -1; + test_XIBarrierEvent(&in); + in.dy = -1.3; + test_XIBarrierEvent(&in); + in.dy = -264.908; + test_XIBarrierEvent(&in); + in.dy = -35638.292; + test_XIBarrierEvent(&in); + in.dy = -2947813871.2342; + test_XIBarrierEvent(&in); +} + int main(int argc, char **argv) { @@ -992,6 +1207,7 @@ main(int argc, char **argv) test_convert_XIDeviceEvent(); test_convert_XIDeviceChangedEvent(); test_convert_XITouchOwnershipEvent(); + test_convert_XIBarrierEvent(); return 0; } diff --git a/xserver/test/xi2/protocol-xipassivegrabdevice.c b/xserver/test/xi2/protocol-xipassivegrabdevice.c index 53c65bda6..84b386bf3 100644 --- a/xserver/test/xi2/protocol-xipassivegrabdevice.c +++ b/xserver/test/xi2/protocol-xipassivegrabdevice.c @@ -37,6 +37,7 @@ #include "scrnintstr.h" #include "xipassivegrab.h" #include "exevents.h" +#include "exglobals.h" #include "protocol-common.h" @@ -54,7 +55,7 @@ int __wrap_GrabButton(ClientPtr client, DeviceIntPtr dev, GrabParameters *param, enum InputLevel grabtype, GrabMask *mask); static void reply_XIPassiveGrabDevice_data(ClientPtr client, int len, - char *data, void *userdata); + char *data, void *closure); int __wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access) @@ -85,7 +86,7 @@ __wrap_GrabButton(ClientPtr client, DeviceIntPtr dev, } static void -reply_XIPassiveGrabDevice(ClientPtr client, int len, char *data, void *userdata) +reply_XIPassiveGrabDevice(ClientPtr client, int len, char *data, void *closure) { xXIPassiveGrabDeviceReply *rep = (xXIPassiveGrabDeviceReply *) data; @@ -107,7 +108,7 @@ reply_XIPassiveGrabDevice(ClientPtr client, int len, char *data, void *userdata) static void reply_XIPassiveGrabDevice_data(ClientPtr client, int len, char *data, - void *userdata) + void *closure) { int i; diff --git a/xserver/test/xi2/protocol-xiquerydevice.c b/xserver/test/xi2/protocol-xiquerydevice.c index 5e59e8084..c066daa35 100644 --- a/xserver/test/xi2/protocol-xiquerydevice.c +++ b/xserver/test/xi2/protocol-xiquerydevice.c @@ -32,6 +32,7 @@ #include #include "inputstr.h" #include "extinit.h" +#include "exglobals.h" #include "scrnintstr.h" #include "xkbsrv.h" @@ -54,9 +55,9 @@ struct test_data { }; static void reply_XIQueryDevice_data(ClientPtr client, int len, char *data, - void *userdata); + void *closure); static void reply_XIQueryDevice(ClientPtr client, int len, char *data, - void *userdata); + void *closure); /* reply handling for the first bytes that constitute the reply */ static void @@ -86,10 +87,10 @@ reply_XIQueryDevice(ClientPtr client, int len, char *data, void *userdata) /* reply handling for the trailing bytes that constitute the device info */ static void -reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void *userdata) +reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void *closure) { int i, j; - struct test_data *querydata = (struct test_data *) userdata; + struct test_data *querydata = (struct test_data *) closure; DeviceIntPtr dev; xXIDeviceInfo *info = (xXIDeviceInfo *) data; @@ -170,7 +171,7 @@ reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void *userdata) (xkb->max_key_code - xkb->min_key_code + 1)); assert(any->length == (2 + ki->num_keycodes)); - kc = (uint32_t *) & ki[1]; + kc = (uint32_t *) &ki[1]; for (k = 0; k < ki->num_keycodes; k++, kc++) { if (client->swapped) swapl(kc); @@ -222,7 +223,7 @@ reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void *userdata) any->type == XIValuatorClass); if (any->type == XIButtonClass) { - int len; + int l; xXIButtonInfo *bi = (xXIButtonInfo *) any; if (client->swapped) @@ -230,10 +231,9 @@ reply_XIQueryDevice_data(ClientPtr client, int len, char *data, void *userdata) assert(bi->num_buttons == devices.vcp->button->numButtons); - len = - 2 + bi->num_buttons + + l = 2 + bi->num_buttons + bytes_to_int32(bits_to_bytes(bi->num_buttons)); - assert(bi->length == len); + assert(bi->length == l); } else if (any->type == XIValuatorClass) { xXIValuatorInfo *vi = (xXIValuatorInfo *) any; diff --git a/xserver/test/xi2/protocol-xiquerypointer.c b/xserver/test/xi2/protocol-xiquerypointer.c index 4756a6b2e..fc66b6429 100644 --- a/xserver/test/xi2/protocol-xiquerypointer.c +++ b/xserver/test/xi2/protocol-xiquerypointer.c @@ -37,12 +37,13 @@ #include "scrnintstr.h" #include "xiquerypointer.h" #include "exevents.h" +#include "exglobals.h" #include "protocol-common.h" static ClientRec client_request; static void reply_XIQueryPointer_data(ClientPtr client, int len, - char *data, void *userdata); + char *data, void *closure); static struct { DeviceIntPtr dev; @@ -70,7 +71,7 @@ __wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access) } static void -reply_XIQueryPointer(ClientPtr client, int len, char *data, void *userdata) +reply_XIQueryPointer(ClientPtr client, int len, char *data, void *closure) { xXIQueryPointerReply *rep = (xXIQueryPointerReply *) data; SpritePtr sprite; @@ -121,7 +122,7 @@ reply_XIQueryPointer(ClientPtr client, int len, char *data, void *userdata) } static void -reply_XIQueryPointer_data(ClientPtr client, int len, char *data, void *userdata) +reply_XIQueryPointer_data(ClientPtr client, int len, char *data, void *closure) { reply_handler = reply_XIQueryPointer; } diff --git a/xserver/test/xi2/protocol-xiqueryversion.c b/xserver/test/xi2/protocol-xiqueryversion.c index 3d50fa888..aff023754 100644 --- a/xserver/test/xi2/protocol-xiqueryversion.c +++ b/xserver/test/xi2/protocol-xiqueryversion.c @@ -54,13 +54,15 @@ struct test_data { int minor_client; int major_server; int minor_server; + int major_cached; + int minor_cached; }; static void -reply_XIQueryVersion(ClientPtr client, int len, char *data, void *userdata) +reply_XIQueryVersion(ClientPtr client, int len, char *data, void *closure) { xXIQueryVersionReply *rep = (xXIQueryVersionReply *) data; - struct test_data *versions = (struct test_data *) userdata; + struct test_data *versions = (struct test_data *) closure; unsigned int sver, cver, ver; if (client->swapped) { @@ -82,6 +84,24 @@ reply_XIQueryVersion(ClientPtr client, int len, char *data, void *userdata) assert((sver > cver) ? ver == cver : ver == sver); } +static void +reply_XIQueryVersion_multiple(ClientPtr client, int len, char *data, void *closure) +{ + xXIQueryVersionReply *rep = (xXIQueryVersionReply *) data; + struct test_data *versions = (struct test_data *) closure; + + reply_check_defaults(rep, len, XIQueryVersion); + assert(rep->length == 0); + + if (versions->major_cached == -1) { + versions->major_cached = rep->major_version; + versions->minor_cached = rep->minor_version; + } + + assert(versions->major_cached == rep->major_version); + assert(versions->minor_cached == rep->minor_version); +} + /** * Run a single test with server version smaj.smin and client * version cmaj.cmin. Verify that return code is equal to 'error'. @@ -115,6 +135,7 @@ request_XIQueryVersion(int smaj, int smin, int cmaj, int cmin, int error) rc = ProcXIQueryVersion(&client); assert(rc == error); + client = init_client(request.length, &request); client.swapped = TRUE; swaps(&request.length); @@ -172,12 +193,105 @@ test_XIQueryVersion(void) reply_handler = NULL; } + +static void +test_XIQueryVersion_multiple(void) +{ + xXIQueryVersionReq request; + ClientRec client; + struct test_data versions; + int rc; + + request_init(&request, XIQueryVersion); + client = init_client(request.length, &request); + + /* Change the server to support 2.2 */ + XIVersion.major_version = 2; + XIVersion.minor_version = 2; + + reply_handler = reply_XIQueryVersion_multiple; + userdata = (void *) &versions; + + /* run 1 */ + versions.major_cached = -1; + versions.minor_cached = -1; + + /* client is lower than server, noncached */ + request.major_version = 2; + request.minor_version = 1; + rc = ProcXIQueryVersion(&client); + assert(rc == Success); + + /* client is higher than server, cached */ + request.major_version = 2; + request.minor_version = 3; + rc = ProcXIQueryVersion(&client); + assert(rc == Success); + + /* client is equal, cached */ + request.major_version = 2; + request.minor_version = 2; + rc = ProcXIQueryVersion(&client); + assert(rc == Success); + + /* client is low than cached */ + request.major_version = 2; + request.minor_version = 0; + rc = ProcXIQueryVersion(&client); + assert(rc == BadValue); + + /* run 2 */ + client = init_client(request.length, &request); + XIVersion.major_version = 2; + XIVersion.minor_version = 2; + versions.major_cached = -1; + versions.minor_cached = -1; + + request.major_version = 2; + request.minor_version = 2; + rc = ProcXIQueryVersion(&client); + assert(rc == Success); + + request.major_version = 2; + request.minor_version = 3; + rc = ProcXIQueryVersion(&client); + assert(rc == Success); + + request.major_version = 2; + request.minor_version = 1; + rc = ProcXIQueryVersion(&client); + assert(rc == BadValue); + + /* run 3 */ + client = init_client(request.length, &request); + XIVersion.major_version = 2; + XIVersion.minor_version = 2; + versions.major_cached = -1; + versions.minor_cached = -1; + + request.major_version = 2; + request.minor_version = 3; + rc = ProcXIQueryVersion(&client); + assert(rc == Success); + + request.major_version = 2; + request.minor_version = 2; + rc = ProcXIQueryVersion(&client); + assert(rc == Success); + + request.major_version = 2; + request.minor_version = 1; + rc = ProcXIQueryVersion(&client); + assert(rc == BadValue); +} + int main(int argc, char **argv) { init_simple(); test_XIQueryVersion(); + test_XIQueryVersion_multiple(); return 0; } diff --git a/xserver/test/xi2/protocol-xiselectevents.c b/xserver/test/xi2/protocol-xiselectevents.c index 4daba8775..183746f98 100644 --- a/xserver/test/xi2/protocol-xiselectevents.c +++ b/xserver/test/xi2/protocol-xiselectevents.c @@ -55,6 +55,7 @@ #include "windowstr.h" #include "extinit.h" /* for XInputExtensionInit */ #include "scrnintstr.h" +#include "exglobals.h" #include "xiselectev.h" #include "protocol-common.h" @@ -97,7 +98,7 @@ request_XISelectEvent(xXISelectEventsReq * req, int error) xXIEventMask *mask, *next; req->length = (sz_xXISelectEventsReq / 4); - mask = (xXIEventMask *) & req[1]; + mask = (xXIEventMask *) &req[1]; for (i = 0; i < req->num_masks; i++) { req->length += sizeof(xXIEventMask) / 4 + mask->mask_len; mask = (xXIEventMask *) ((char *) &mask[1] + mask->mask_len * 4); @@ -110,7 +111,7 @@ request_XISelectEvent(xXISelectEventsReq * req, int error) client.swapped = TRUE; - mask = (xXIEventMask *) & req[1]; + mask = (xXIEventMask *) &req[1]; for (i = 0; i < req->num_masks; i++) { next = (xXIEventMask *) ((char *) &mask[1] + mask->mask_len * 4); swaps(&mask->deviceid); @@ -155,7 +156,7 @@ request_XISelectEvents_masks(xXISelectEventsReq * req) int nmasks = (XI2LASTEVENT + 7) / 8; unsigned char *bits; - mask = (xXIEventMask *) & req[1]; + mask = (xXIEventMask *) &req[1]; req->win = ROOT_WINDOW_ID; /* if a clients submits more than 100 masks, consider it insane and untested */ @@ -311,7 +312,7 @@ test_XISelectEvents(void) req->num_masks = 1; printf("Triggering bogus mask length error\n"); - mask = (xXIEventMask *) & req[1]; + mask = (xXIEventMask *) &req[1]; mask->deviceid = 0; mask->mask_len = 0xFFFF; request_XISelectEvent(req, BadLength); @@ -319,7 +320,7 @@ test_XISelectEvents(void) /* testing various device ids */ printf("Testing existing device ids.\n"); for (i = 0; i < 6; i++) { - mask = (xXIEventMask *) & req[1]; + mask = (xXIEventMask *) &req[1]; mask->deviceid = i; mask->mask_len = 1; req->win = ROOT_WINDOW_ID; @@ -331,7 +332,7 @@ test_XISelectEvents(void) for (i = 6; i <= 0xFFFF; i++) { req->win = ROOT_WINDOW_ID; req->num_masks = 1; - mask = (xXIEventMask *) & req[1]; + mask = (xXIEventMask *) &req[1]; mask->deviceid = i; mask->mask_len = 1; request_XISelectEvent(req, BadDevice); diff --git a/xserver/test/xi2/protocol-xisetclientpointer.c b/xserver/test/xi2/protocol-xisetclientpointer.c index 51db4ac69..90f1b94c3 100644 --- a/xserver/test/xi2/protocol-xisetclientpointer.c +++ b/xserver/test/xi2/protocol-xisetclientpointer.c @@ -44,6 +44,7 @@ #include "scrnintstr.h" #include "xisetclientpointer.h" #include "exevents.h" +#include "exglobals.h" #include "protocol-common.h" diff --git a/xserver/test/xi2/protocol-xiwarppointer.c b/xserver/test/xi2/protocol-xiwarppointer.c index c279ac413..f7986c1eb 100644 --- a/xserver/test/xi2/protocol-xiwarppointer.c +++ b/xserver/test/xi2/protocol-xiwarppointer.c @@ -37,6 +37,7 @@ #include "scrnintstr.h" #include "xiwarppointer.h" #include "exevents.h" +#include "exglobals.h" #include "protocol-common.h" @@ -67,7 +68,7 @@ __wrap_dixLookupWindow(WindowPtr *win, XID id, ClientPtr client, Mask access) * This function overrides the one in the screen rec. */ static Bool -ScreenSetCursorPosition(DeviceIntPtr dev, ScreenPtr screen, +ScreenSetCursorPosition(DeviceIntPtr dev, ScreenPtr scr, int x, int y, Bool generateEvent) { assert(x == expected_x); diff --git a/xserver/test/xi2/xi2.c b/xserver/test/xi2/xi2.c index 6ee705293..1cdad1dbd 100644 --- a/xserver/test/xi2/xi2.c +++ b/xserver/test/xi2/xi2.c @@ -36,8 +36,14 @@ xi2mask_test(void) XI2Mask *xi2mask = NULL, *mergemask = NULL; unsigned char *mask; DeviceIntRec dev; + DeviceIntRec all_devices, all_master_devices; int i; + all_devices.id = XIAllDevices; + inputInfo.all_devices = &all_devices; + all_master_devices.id = XIAllMasterDevices; + inputInfo.all_master_devices = &all_master_devices; + /* size >= nmasks * 2 for the test cases below */ xi2mask = xi2mask_new_with_size(MAXDEVICES + 2, (MAXDEVICES + 2) * 2); assert(xi2mask); diff --git a/xserver/test/xtest.c b/xserver/test/xtest.c index aeca669d8..e5e5241b7 100644 --- a/xserver/test/xtest.c +++ b/xserver/test/xtest.c @@ -30,8 +30,10 @@ #include "inputstr.h" #include "scrnintstr.h" #include "exevents.h" +#include "extinit.h" #include "xkbsrv.h" #include "xserver-properties.h" +#include "syncsrv.h" /** */ @@ -46,10 +48,16 @@ device_cursor_init(DeviceIntPtr dev, ScreenPtr screen) return TRUE; } +static void +device_cursor_cleanup(DeviceIntPtr dev, ScreenPtr screen) +{ +} + static void xtest_init_devices(void) { ScreenRec screen; + ClientRec server_client; /* random stuff that needs initialization */ memset(&screen, 0, sizeof(screen)); @@ -60,10 +68,14 @@ xtest_init_devices(void) screen.width = 640; screen.height = 480; screen.DeviceCursorInitialize = device_cursor_init; + screen.DeviceCursorCleanup = device_cursor_cleanup; dixResetPrivates(); + serverClient = &server_client; + InitClient(serverClient, 0, (pointer) NULL); + if (!InitClientResources(serverClient)) /* for root resources */ + FatalError("couldn't init server resources"); InitAtoms(); - - XkbInitPrivates(); + SyncExtensionInit(); /* this also inits the xtest devices */ InitCoreDevices(); diff --git a/xserver/xfixes/Makefile.in b/xserver/xfixes/Makefile.in index fcc1f3a3f..16164c81f 100644 --- a/xserver/xfixes/Makefile.in +++ b/xserver/xfixes/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -213,13 +213,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -241,6 +237,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -265,6 +262,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -280,7 +278,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -379,6 +376,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -494,7 +492,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -519,9 +517,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/xserver/xfixes/cursor.c b/xserver/xfixes/cursor.c index 602b9061e..568e717fa 100644 --- a/xserver/xfixes/cursor.c +++ b/xserver/xfixes/cursor.c @@ -56,11 +56,11 @@ #include "windowstr.h" #include "xace.h" #include "list.h" +#include "xibarriers.h" static RESTYPE CursorClientType; static RESTYPE CursorHideCountType; static RESTYPE CursorWindowType; -RESTYPE PointerBarrierType; static CursorPtr CursorCurrent[MAXDEVICES]; static DevPrivateKeyRec CursorScreenPrivateKeyRec; @@ -112,14 +112,6 @@ typedef struct _CursorHideCountRec { XID resource; } CursorHideCountRec; -typedef struct PointerBarrierClient *PointerBarrierClientPtr; - -struct PointerBarrierClient { - ScreenPtr screen; - struct PointerBarrier barrier; - struct xorg_list entry; -}; - /* * Wrap DisplayCursor to catch cursor change events */ @@ -127,9 +119,7 @@ struct PointerBarrierClient { typedef struct _CursorScreen { DisplayCursorProcPtr DisplayCursor; CloseScreenProcPtr CloseScreen; - ConstrainCursorHarderProcPtr ConstrainCursorHarder; CursorHideCountPtr pCursorHideCounts; - struct xorg_list barriers; } CursorScreenRec, *CursorScreenPtr; #define GetCursorScreen(s) ((CursorScreenPtr)dixLookupPrivate(&(s)->devPrivates, CursorScreenPrivateKey)) @@ -172,14 +162,14 @@ CursorDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) CursorCurrent[pDev->id] = pCursor; for (e = cursorEvents; e; e = e->next) { if ((e->eventMask & XFixesDisplayCursorNotifyMask)) { - xXFixesCursorNotifyEvent ev; - - ev.type = XFixesEventBase + XFixesCursorNotify; - ev.subtype = XFixesDisplayCursorNotify; - ev.window = e->pWindow->drawable.id; - ev.cursorSerial = pCursor ? pCursor->serialNumber : 0; - ev.timestamp = currentTime.milliseconds; - ev.name = pCursor ? pCursor->name : None; + xXFixesCursorNotifyEvent ev = { + .type = XFixesEventBase + XFixesCursorNotify, + .subtype = XFixesDisplayCursorNotify, + .window = e->pWindow->drawable.id, + .cursorSerial = pCursor ? pCursor->serialNumber : 0, + .timestamp = currentTime.milliseconds, + .name = pCursor ? pCursor->name : None + }; WriteEventsToClient(e->pClient, 1, (xEvent *) &ev); } } @@ -190,19 +180,17 @@ CursorDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) } static Bool -CursorCloseScreen(int index, ScreenPtr pScreen) +CursorCloseScreen(ScreenPtr pScreen) { CursorScreenPtr cs = GetCursorScreen(pScreen); Bool ret; _X_UNUSED CloseScreenProcPtr close_proc; _X_UNUSED DisplayCursorProcPtr display_proc; - ConstrainCursorHarderProcPtr constrain_proc; Unwrap(cs, pScreen, CloseScreen, close_proc); Unwrap(cs, pScreen, DisplayCursor, display_proc); - Unwrap(cs, pScreen, ConstrainCursorHarder, constrain_proc); deleteCursorHideCountsForScreen(pScreen); - ret = (*pScreen->CloseScreen) (index, pScreen); + ret = (*pScreen->CloseScreen) (pScreen); free(cs); return ret; } @@ -380,7 +368,8 @@ ProcXFixesGetCursorImage(ClientPtr client) width = pCursor->bits->width; height = pCursor->bits->height; npixels = width * height; - rep = malloc(sizeof(xXFixesGetCursorImageReply) + npixels * sizeof(CARD32)); + rep = calloc(sizeof(xXFixesGetCursorImageReply) + npixels * sizeof(CARD32), + 1); if (!rep) return BadAlloc; @@ -409,8 +398,8 @@ ProcXFixesGetCursorImage(ClientPtr client) swapl(&rep->cursorSerial); SwapLongs(image, npixels); } - WriteToClient(client, sizeof(xXFixesGetCursorImageReply) + - (npixels << 2), (char *) rep); + WriteToClient(client, + sizeof(xXFixesGetCursorImageReply) + (npixels << 2), rep); free(rep); return Success; } @@ -473,11 +462,13 @@ ProcXFixesGetCursorName(ClientPtr client) str = ""; len = strlen(str); - reply.type = X_Reply; - reply.length = bytes_to_int32(len); - reply.sequenceNumber = client->sequence; - reply.atom = pCursor->name; - reply.nbytes = len; + reply = (xXFixesGetCursorNameReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(len), + .atom = pCursor->name, + .nbytes = len + }; if (client->swapped) { swaps(&reply.sequenceNumber); swapl(&reply.length); @@ -529,8 +520,8 @@ ProcXFixesGetCursorImageAndName(ClientPtr client) name = pCursor->name ? NameForAtom(pCursor->name) : ""; nbytes = strlen(name); nbytesRound = pad_to_int32(nbytes); - rep = malloc(sizeof(xXFixesGetCursorImageAndNameReply) + - npixels * sizeof(CARD32) + nbytesRound); + rep = calloc(sizeof(xXFixesGetCursorImageAndNameReply) + + npixels * sizeof(CARD32) + nbytesRound, 1); if (!rep) return BadAlloc; @@ -565,7 +556,7 @@ ProcXFixesGetCursorImageAndName(ClientPtr client) SwapLongs(image, npixels); } WriteToClient(client, sizeof(xXFixesGetCursorImageAndNameReply) + - (npixels << 2) + nbytesRound, (char *) rep); + (npixels << 2) + nbytesRound, rep); free(rep); return Success; } @@ -1007,317 +998,28 @@ CursorFreeWindow(pointer data, XID id) return 1; } -static BOOL -barrier_is_horizontal(const struct PointerBarrier *barrier) -{ - return barrier->y1 == barrier->y2; -} - -static BOOL -barrier_is_vertical(const struct PointerBarrier *barrier) -{ - return barrier->x1 == barrier->x2; -} - -/** - * @return The set of barrier movement directions the movement vector - * x1/y1 → x2/y2 represents. - */ -int -barrier_get_direction(int x1, int y1, int x2, int y2) -{ - int direction = 0; - - /* which way are we trying to go */ - if (x2 > x1) - direction |= BarrierPositiveX; - if (x2 < x1) - direction |= BarrierNegativeX; - if (y2 > y1) - direction |= BarrierPositiveY; - if (y2 < y1) - direction |= BarrierNegativeY; - - return direction; -} - -/** - * Test if the barrier may block movement in the direction defined by - * x1/y1 → x2/y2. This function only tests whether the directions could be - * blocked, it does not test if the barrier actually blocks the movement. - * - * @return TRUE if the barrier blocks the direction of movement or FALSE - * otherwise. - */ -BOOL -barrier_is_blocking_direction(const struct PointerBarrier * barrier, - int direction) -{ - /* Barriers define which way is ok, not which way is blocking */ - return (barrier->directions & direction) != direction; -} - -/** - * Test if the movement vector x1/y1 → x2/y2 is intersecting with the - * barrier. A movement vector with the startpoint or endpoint adjacent to - * the barrier itself counts as intersecting. - * - * @param x1 X start coordinate of movement vector - * @param y1 Y start coordinate of movement vector - * @param x2 X end coordinate of movement vector - * @param y2 Y end coordinate of movement vector - * @param[out] distance The distance between the start point and the - * intersection with the barrier (if applicable). - * @return TRUE if the barrier intersects with the given vector - */ -BOOL -barrier_is_blocking(const struct PointerBarrier * barrier, - int x1, int y1, int x2, int y2, double *distance) -{ - BOOL rc = FALSE; - float ua, ub, ud; - int dir = barrier_get_direction(x1, y1, x2, y2); - - /* Algorithm below doesn't handle edge cases well, hence the extra - * checks. */ - if (barrier_is_vertical(barrier)) { - /* handle immediate barrier adjacency, moving away */ - if (dir & BarrierPositiveX && x1 == barrier->x1) - return FALSE; - if (dir & BarrierNegativeX && x1 == (barrier->x1 - 1)) - return FALSE; - /* startpoint adjacent to barrier, moving towards -> block */ - if (x1 == barrier->x1 && y1 >= barrier->y1 && y1 <= barrier->y2) { - *distance = 0; - return TRUE; - } - } - else { - /* handle immediate barrier adjacency, moving away */ - if (dir & BarrierPositiveY && y1 == barrier->y1) - return FALSE; - if (dir & BarrierNegativeY && y1 == (barrier->y1 - 1)) - return FALSE; - /* startpoint adjacent to barrier, moving towards -> block */ - if (y1 == barrier->y1 && x1 >= barrier->x1 && x1 <= barrier->x2) { - *distance = 0; - return TRUE; - } - } - - /* not an edge case, compute distance */ - ua = 0; - ud = (barrier->y2 - barrier->y1) * (x2 - x1) - (barrier->x2 - - barrier->x1) * (y2 - y1); - if (ud != 0) { - ua = ((barrier->x2 - barrier->x1) * (y1 - barrier->y1) - - (barrier->y2 - barrier->y1) * (x1 - barrier->x1)) / ud; - ub = ((x2 - x1) * (y1 - barrier->y1) - - (y2 - y1) * (x1 - barrier->x1)) / ud; - if (ua < 0 || ua > 1 || ub < 0 || ub > 1) - ua = 0; - } - - if (ua > 0 && ua <= 1) { - double ix = barrier->x1 + ua * (barrier->x2 - barrier->x1); - double iy = barrier->y1 + ua * (barrier->y2 - barrier->y1); - - *distance = sqrt(pow(x1 - ix, 2) + pow(y1 - iy, 2)); - rc = TRUE; - } - - return rc; -} - -/** - * Find the nearest barrier that is blocking movement from x1/y1 to x2/y2. - * - * @param dir Only barriers blocking movement in direction dir are checked - * @param x1 X start coordinate of movement vector - * @param y1 Y start coordinate of movement vector - * @param x2 X end coordinate of movement vector - * @param y2 Y end coordinate of movement vector - * @return The barrier nearest to the movement origin that blocks this movement. - */ -static struct PointerBarrier * -barrier_find_nearest(CursorScreenPtr cs, int dir, - int x1, int y1, int x2, int y2) -{ - struct PointerBarrierClient *c; - struct PointerBarrier *nearest = NULL; - double min_distance = INT_MAX; /* can't get higher than that in X anyway */ - - xorg_list_for_each_entry(c, &cs->barriers, entry) { - struct PointerBarrier *b = &c->barrier; - double distance; - - if (!barrier_is_blocking_direction(b, dir)) - continue; - - if (barrier_is_blocking(b, x1, y1, x2, y2, &distance)) { - if (min_distance > distance) { - min_distance = distance; - nearest = b; - } - } - } - - return nearest; -} - -/** - * Clamp to the given barrier given the movement direction specified in dir. - * - * @param barrier The barrier to clamp to - * @param dir The movement direction - * @param[out] x The clamped x coordinate. - * @param[out] y The clamped x coordinate. - */ -void -barrier_clamp_to_barrier(struct PointerBarrier *barrier, int dir, int *x, - int *y) -{ - if (barrier_is_vertical(barrier)) { - if ((dir & BarrierNegativeX) & ~barrier->directions) - *x = barrier->x1; - if ((dir & BarrierPositiveX) & ~barrier->directions) - *x = barrier->x1 - 1; - } - if (barrier_is_horizontal(barrier)) { - if ((dir & BarrierNegativeY) & ~barrier->directions) - *y = barrier->y1; - if ((dir & BarrierPositiveY) & ~barrier->directions) - *y = barrier->y1 - 1; - } -} - -static void -CursorConstrainCursorHarder(DeviceIntPtr dev, ScreenPtr screen, int mode, - int *x, int *y) -{ - CursorScreenPtr cs = GetCursorScreen(screen); - - if (!xorg_list_is_empty(&cs->barriers) && !IsFloating(dev) && - mode == Relative) { - int ox, oy; - int dir; - struct PointerBarrier *nearest = NULL; - - /* where are we coming from */ - miPointerGetPosition(dev, &ox, &oy); - - /* How this works: - * Given the origin and the movement vector, get the nearest barrier - * to the origin that is blocking the movement. - * Clamp to that barrier. - * Then, check from the clamped intersection to the original - * destination, again finding the nearest barrier and clamping. - */ - dir = barrier_get_direction(ox, oy, *x, *y); - - nearest = barrier_find_nearest(cs, dir, ox, oy, *x, *y); - if (nearest) { - barrier_clamp_to_barrier(nearest, dir, x, y); - - if (barrier_is_vertical(nearest)) { - dir &= ~(BarrierNegativeX | BarrierPositiveX); - ox = *x; - } - else if (barrier_is_horizontal(nearest)) { - dir &= ~(BarrierNegativeY | BarrierPositiveY); - oy = *y; - } - - nearest = barrier_find_nearest(cs, dir, ox, oy, *x, *y); - if (nearest) { - barrier_clamp_to_barrier(nearest, dir, x, y); - } - } - } - - if (cs->ConstrainCursorHarder) { - screen->ConstrainCursorHarder = cs->ConstrainCursorHarder; - screen->ConstrainCursorHarder(dev, screen, mode, x, y); - screen->ConstrainCursorHarder = CursorConstrainCursorHarder; - } -} - -static struct PointerBarrierClient * -CreatePointerBarrierClient(ScreenPtr screen, ClientPtr client, - xXFixesCreatePointerBarrierReq * stuff) -{ - CursorScreenPtr cs = GetCursorScreen(screen); - struct PointerBarrierClient *ret = malloc(sizeof(*ret)); - - if (ret) { - ret->screen = screen; - ret->barrier.x1 = min(stuff->x1, stuff->x2); - ret->barrier.x2 = max(stuff->x1, stuff->x2); - ret->barrier.y1 = min(stuff->y1, stuff->y2); - ret->barrier.y2 = max(stuff->y1, stuff->y2); - ret->barrier.directions = stuff->directions & 0x0f; - if (barrier_is_horizontal(&ret->barrier)) - ret->barrier.directions &= ~(BarrierPositiveX | BarrierNegativeX); - if (barrier_is_vertical(&ret->barrier)) - ret->barrier.directions &= ~(BarrierPositiveY | BarrierNegativeY); - xorg_list_add(&ret->entry, &cs->barriers); - } - - return ret; -} - int ProcXFixesCreatePointerBarrier(ClientPtr client) { - int err; - WindowPtr pWin; - struct PointerBarrierClient *barrier; - struct PointerBarrier b; - REQUEST(xXFixesCreatePointerBarrierReq); - REQUEST_SIZE_MATCH(xXFixesCreatePointerBarrierReq); + REQUEST_FIXED_SIZE(xXFixesCreatePointerBarrierReq, pad_to_int32(stuff->num_devices)); LEGAL_NEW_RESOURCE(stuff->barrier, client); - err = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess); - if (err != Success) { - client->errorValue = stuff->window; - return err; - } - - /* This sure does need fixing. */ - if (stuff->num_devices) - return BadImplementation; - - b.x1 = stuff->x1; - b.x2 = stuff->x2; - b.y1 = stuff->y1; - b.y2 = stuff->y2; - - if (!barrier_is_horizontal(&b) && !barrier_is_vertical(&b)) - return BadValue; - - /* no 0-sized barriers */ - if (barrier_is_horizontal(&b) && barrier_is_vertical(&b)) - return BadValue; - - if (!(barrier = CreatePointerBarrierClient(pWin->drawable.pScreen, - client, stuff))) - return BadAlloc; - - if (!AddResource(stuff->barrier, PointerBarrierType, &barrier->barrier)) - return BadAlloc; - - return Success; + return XICreatePointerBarrier(client, stuff); } int SProcXFixesCreatePointerBarrier(ClientPtr client) { REQUEST(xXFixesCreatePointerBarrierReq); + int i; + CARD16 *in_devices = (CARD16 *) &stuff[1]; swaps(&stuff->length); - REQUEST_SIZE_MATCH(xXFixesCreatePointerBarrierReq); + swaps(&stuff->num_devices); + REQUEST_FIXED_SIZE(xXFixesCreatePointerBarrierReq, pad_to_int32(stuff->num_devices)); + swapl(&stuff->barrier); swapl(&stuff->window); swaps(&stuff->x1); @@ -1325,52 +1027,21 @@ SProcXFixesCreatePointerBarrier(ClientPtr client) swaps(&stuff->x2); swaps(&stuff->y2); swapl(&stuff->directions); - return ProcXFixesVector[stuff->xfixesReqType] (client); -} - -static int -CursorFreeBarrier(void *data, XID id) -{ - struct PointerBarrierClient *b = NULL, *barrier; - ScreenPtr screen; - CursorScreenPtr cs; - - barrier = container_of(data, struct PointerBarrierClient, barrier); - - screen = barrier->screen; - cs = GetCursorScreen(screen); - - /* find and unlink from the screen private */ - xorg_list_for_each_entry(b, &cs->barriers, entry) { - if (b == barrier) { - xorg_list_del(&b->entry); - break; - } + for (i = 0; i < stuff->num_devices; i++) { + swaps(in_devices + i); } - free(barrier); - return Success; + return ProcXFixesVector[stuff->xfixesReqType] (client); } int ProcXFixesDestroyPointerBarrier(ClientPtr client) { - int err; - void *barrier; - REQUEST(xXFixesDestroyPointerBarrierReq); REQUEST_SIZE_MATCH(xXFixesDestroyPointerBarrierReq); - err = dixLookupResourceByType((void **) &barrier, stuff->barrier, - PointerBarrierType, client, DixDestroyAccess); - if (err != Success) { - client->errorValue = stuff->barrier; - return err; - } - - FreeResource(stuff->barrier, RT_NONE); - return Success; + return XIDestroyPointerBarrier(client, stuff); } int @@ -1402,10 +1073,8 @@ XFixesCursorInit(void) cs = (CursorScreenPtr) calloc(1, sizeof(CursorScreenRec)); if (!cs) return FALSE; - xorg_list_init(&cs->barriers); Wrap(cs, pScreen, CloseScreen, CursorCloseScreen); Wrap(cs, pScreen, DisplayCursor, CursorDisplayCursor); - Wrap(cs, pScreen, ConstrainCursorHarder, CursorConstrainCursorHarder); cs->pCursorHideCounts = NULL; SetCursorScreen(pScreen, cs); } @@ -1415,9 +1084,6 @@ XFixesCursorInit(void) "XFixesCursorHideCount"); CursorWindowType = CreateNewResourceType(CursorFreeWindow, "XFixesCursorWindow"); - PointerBarrierType = CreateNewResourceType(CursorFreeBarrier, - "XFixesPointerBarrier"); - return CursorClientType && CursorHideCountType && CursorWindowType && - PointerBarrierType; + return CursorClientType && CursorHideCountType && CursorWindowType; } diff --git a/xserver/xfixes/region.c b/xserver/xfixes/region.c index 624109de1..0e9ca443f 100644 --- a/xserver/xfixes/region.c +++ b/xserver/xfixes/region.c @@ -27,7 +27,6 @@ #include "xfixesint.h" #include "scrnintstr.h" #include -extern int RenderErrBase; #include #include @@ -558,7 +557,8 @@ ProcXFixesFetchRegion(ClientPtr client) pBox = RegionRects(pRegion); nBox = RegionNumRects(pRegion); - reply = malloc(sizeof(xXFixesFetchRegionReply) + nBox * sizeof(xRectangle)); + reply = calloc(sizeof(xXFixesFetchRegionReply) + nBox * sizeof(xRectangle), + 1); if (!reply) return BadAlloc; reply->type = X_Reply; @@ -585,7 +585,7 @@ ProcXFixesFetchRegion(ClientPtr client) swaps(&reply->height); SwapShorts((INT16 *) pRect, nBox * 4); } - (void) WriteToClient(client, sizeof(xXFixesFetchRegionReply) + + WriteToClient(client, sizeof(xXFixesFetchRegionReply) + nBox * sizeof(xRectangle), (char *) reply); free(reply); return Success; diff --git a/xserver/xfixes/select.c b/xserver/xfixes/select.c index a896846a7..ee8ed6f68 100644 --- a/xserver/xfixes/select.c +++ b/xserver/xfixes/select.c @@ -77,19 +77,16 @@ XFixesSelectionCallback(CallbackListPtr *callbacks, pointer data, pointer args) } for (e = selectionEvents; e; e = e->next) { if (e->selection == selection->selection && (e->eventMask & eventMask)) { - xXFixesSelectionNotifyEvent ev; - - memset(&ev, 0, sizeof(xXFixesSelectionNotifyEvent)); - ev.type = XFixesEventBase + XFixesSelectionNotify; - ev.subtype = subtype; - ev.window = e->pWindow->drawable.id; - if (subtype == XFixesSetSelectionOwnerNotify) - ev.owner = selection->window; - else - ev.owner = 0; - ev.selection = e->selection; - ev.timestamp = currentTime.milliseconds; - ev.selectionTimestamp = selection->lastTimeChanged.milliseconds; + xXFixesSelectionNotifyEvent ev = { + .type = XFixesEventBase + XFixesSelectionNotify, + .subtype = subtype, + .window = e->pWindow->drawable.id, + .owner = (subtype == XFixesSetSelectionOwnerNotify) ? + selection->window : 0, + .selection = e->selection, + .timestamp = currentTime.milliseconds, + .selectionTimestamp = selection->lastTimeChanged.milliseconds + }; WriteEventsToClient(e->pClient, 1, (xEvent *) &ev); } } diff --git a/xserver/xfixes/xfixes.c b/xserver/xfixes/xfixes.c index f80230fd3..48af9ea6e 100644 --- a/xserver/xfixes/xfixes.c +++ b/xserver/xfixes/xfixes.c @@ -48,6 +48,7 @@ #include "xfixesint.h" #include "protocol-versions.h" +#include "extinit.h" static unsigned char XFixesReqCode; int XFixesEventBase; @@ -61,19 +62,19 @@ static int ProcXFixesQueryVersion(ClientPtr client) { XFixesClientPtr pXFixesClient = GetXFixesClient(client); - xXFixesQueryVersionReply rep; + xXFixesQueryVersionReply rep = { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0 + }; REQUEST(xXFixesQueryVersionReq); REQUEST_SIZE_MATCH(xXFixesQueryVersionReq); - memset(&rep, 0, sizeof(xXFixesQueryVersionReply)); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; if (version_compare(stuff->majorVersion, stuff->minorVersion, SERVER_XFIXES_MAJOR_VERSION, - SERVER_XFIXES_MAJOR_VERSION) < 0) { + SERVER_XFIXES_MINOR_VERSION) < 0) { rep.majorVersion = stuff->majorVersion; rep.minorVersion = stuff->minorVersion; } @@ -90,7 +91,7 @@ ProcXFixesQueryVersion(ClientPtr client) swapl(&rep.majorVersion); swapl(&rep.minorVersion); } - WriteToClient(client, sizeof(xXFixesQueryVersionReply), (char *) &rep); + WriteToClient(client, sizeof(xXFixesQueryVersionReply), &rep); return Success; } diff --git a/xserver/xfixes/xfixes.h b/xserver/xfixes/xfixes.h index 19af09f7d..98828710f 100644 --- a/xserver/xfixes/xfixes.h +++ b/xserver/xfixes/xfixes.h @@ -30,7 +30,6 @@ #include "resource.h" extern _X_EXPORT RESTYPE RegionResType; -extern _X_EXPORT RESTYPE PointerBarrierType; extern _X_EXPORT int XFixesErrorBase; #define VERIFY_REGION(pRegion, rid, client, mode) \ @@ -52,20 +51,6 @@ extern _X_EXPORT int XFixesErrorBase; extern _X_EXPORT RegionPtr XFixesRegionCopy(RegionPtr pRegion); -struct PointerBarrier { - CARD16 x1, x2, y1, y2; - CARD32 directions; -}; - -extern int - barrier_get_direction(int, int, int, int); -extern BOOL -barrier_is_blocking(const struct PointerBarrier *, int, int, int, int, - double *); -extern BOOL barrier_is_blocking_direction(const struct PointerBarrier *, int); -extern void - -barrier_clamp_to_barrier(struct PointerBarrier *barrier, int dir, int *x, - int *y); +#include "xibarriers.h" #endif /* _XFIXES_H_ */ diff --git a/xserver/xfixes/xfixesint.h b/xserver/xfixes/xfixesint.h index 71f88a93d..44e889040 100644 --- a/xserver/xfixes/xfixesint.h +++ b/xserver/xfixes/xfixesint.h @@ -71,11 +71,6 @@ typedef struct _XFixesClient { extern int (*ProcXFixesVector[XFixesNumberRequests]) (ClientPtr); -/* Initialize extension at server startup time */ - -void - XFixesExtensionInit(void); - /* Save set */ int ProcXFixesChangeSaveSet(ClientPtr client); @@ -296,8 +291,10 @@ int SProcXFixesDestroyPointerBarrier(ClientPtr client); /* Xinerama */ +#ifdef PANORAMIX extern int (*PanoramiXSaveXFixesVector[XFixesNumberRequests]) (ClientPtr); void PanoramiXFixesInit(void); void PanoramiXFixesReset(void); +#endif #endif /* _XFIXESINT_H_ */ diff --git a/xserver/xkb/Makefile.am b/xserver/xkb/Makefile.am index fb3ccbf6f..e386ce5a2 100644 --- a/xserver/xkb/Makefile.am +++ b/xserver/xkb/Makefile.am @@ -6,8 +6,7 @@ DDX_SRCS = \ ddxBeep.c \ ddxCtrls.c \ ddxLEDs.c \ - ddxLoad.c \ - ddxList.c + ddxLoad.c DIX_SRCS = \ xkb.c \ diff --git a/xserver/xkb/Makefile.in b/xserver/xkb/Makefile.in index d9ca3136c..a06cbdc7d 100644 --- a/xserver/xkb/Makefile.in +++ b/xserver/xkb/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.12.3 from Makefile.am. +# Makefile.in generated by automake 1.12.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2012 Free Software Foundation, Inc. @@ -75,8 +75,7 @@ CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libxkb_la_LIBADD = -am__objects_1 = ddxBeep.lo ddxCtrls.lo ddxLEDs.lo ddxLoad.lo \ - ddxList.lo +am__objects_1 = ddxBeep.lo ddxCtrls.lo ddxLEDs.lo ddxLoad.lo am__objects_2 = xkb.lo xkbUtils.lo xkbEvents.lo xkbAccessX.lo \ xkbSwap.lo xkbLEDs.lo xkbInit.lo xkbActions.lo xkbPrKeyEv.lo am__objects_3 = maprules.lo xkmread.lo xkbtext.lo xkbfmisc.lo \ @@ -222,13 +221,9 @@ DMXXMUEXAMPLES_DEP_LIBS = @DMXXMUEXAMPLES_DEP_LIBS@ DOXYGEN = @DOXYGEN@ DRI2PROTO_CFLAGS = @DRI2PROTO_CFLAGS@ DRI2PROTO_LIBS = @DRI2PROTO_LIBS@ -DRIPROTO_CFLAGS = @DRIPROTO_CFLAGS@ -DRIPROTO_LIBS = @DRIPROTO_LIBS@ DRIVER_MAN_DIR = @DRIVER_MAN_DIR@ DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@ -DRI_CFLAGS = @DRI_CFLAGS@ DRI_DRIVER_PATH = @DRI_DRIVER_PATH@ -DRI_LIBS = @DRI_LIBS@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ DUMPBIN = @DUMPBIN@ @@ -250,6 +245,7 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ +GLX_SYS_LIBS = @GLX_SYS_LIBS@ GLX_TLS = @GLX_TLS@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -274,6 +270,7 @@ KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ +LD_NO_UNDEFINED_FLAG = @LD_NO_UNDEFINED_FLAG@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ @@ -289,7 +286,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ @@ -388,6 +384,7 @@ XNESTMODULES_LIBS = @XNESTMODULES_LIBS@ XNEST_LIBS = @XNEST_LIBS@ XNEST_SYS_LIBS = @XNEST_SYS_LIBS@ XORG_CFLAGS = @XORG_CFLAGS@ +XORG_DRIVER_LIBS = @XORG_DRIVER_LIBS@ XORG_INCS = @XORG_INCS@ XORG_LIBS = @XORG_LIBS@ XORG_MALLOC_DEBUG_ENV = @XORG_MALLOC_DEBUG_ENV@ @@ -493,8 +490,7 @@ DDX_SRCS = \ ddxBeep.c \ ddxCtrls.c \ ddxLEDs.c \ - ddxLoad.c \ - ddxList.c + ddxLoad.c DIX_SRCS = \ xkb.c \ @@ -531,7 +527,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -556,9 +552,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): @@ -591,7 +587,6 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ddxCtrls.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ddxKillSrv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ddxLEDs.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ddxList.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ddxLoad.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ddxPrivate.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ddxVT.Plo@am__quote@ diff --git a/xserver/xkb/XKBGAlloc.c b/xserver/xkb/XKBGAlloc.c index f7e017682..888078406 100644 --- a/xserver/xkb/XKBGAlloc.c +++ b/xserver/xkb/XKBGAlloc.c @@ -249,51 +249,6 @@ XkbFreeGeomOverlayKeys(XkbOverlayRowPtr row, int first, int count, Bool freeAll) /***====================================================================***/ -static void -_XkbClearOverlayRow(char *row_in) -{ - XkbOverlayRowPtr row = (XkbOverlayRowPtr) row_in; - - if (row->keys != NULL) - XkbFreeGeomOverlayKeys(row, 0, row->num_keys, TRUE); - return; -} - -void -XkbFreeGeomOverlayRows(XkbOverlayPtr overlay, int first, int count, - Bool freeAll) -{ - _XkbFreeGeomNonLeafElems(freeAll, first, count, - &overlay->num_rows, &overlay->sz_rows, - (char **) &overlay->rows, - sizeof(XkbOverlayRowRec), _XkbClearOverlayRow); - return; -} - -/***====================================================================***/ - -static void -_XkbClearOverlay(char *overlay_in) -{ - XkbOverlayPtr overlay = (XkbOverlayPtr) overlay_in; - - if (overlay->rows != NULL) - XkbFreeGeomOverlayRows(overlay, 0, overlay->num_rows, TRUE); - return; -} - -void -XkbFreeGeomOverlays(XkbSectionPtr section, int first, int count, Bool freeAll) -{ - _XkbFreeGeomNonLeafElems(freeAll, first, count, - §ion->num_overlays, §ion->sz_overlays, - (char **) §ion->overlays, - sizeof(XkbOverlayRec), _XkbClearOverlay); - return; -} - -/***====================================================================***/ - void XkbFreeGeomKeys(XkbRowPtr row, int first, int count, Bool freeAll) { @@ -542,90 +497,6 @@ _XkbGeomAlloc(void **old, &(r)->num_keys,&(r)->sz_keys,\ (n),sizeof(XkbOverlayKeyRec)) -Status -XkbAllocGeomProps(XkbGeometryPtr geom, int nProps) -{ - return _XkbAllocProps(geom, nProps); -} - -Status -XkbAllocGeomColors(XkbGeometryPtr geom, int nColors) -{ - return _XkbAllocColors(geom, nColors); -} - -Status -XkbAllocGeomKeyAliases(XkbGeometryPtr geom, int nKeyAliases) -{ - return _XkbAllocKeyAliases(geom, nKeyAliases); -} - -Status -XkbAllocGeomShapes(XkbGeometryPtr geom, int nShapes) -{ - return _XkbAllocShapes(geom, nShapes); -} - -Status -XkbAllocGeomSections(XkbGeometryPtr geom, int nSections) -{ - return _XkbAllocSections(geom, nSections); -} - -Status -XkbAllocGeomOverlays(XkbSectionPtr section, int nOverlays) -{ - return _XkbAllocOverlays(section, nOverlays); -} - -Status -XkbAllocGeomOverlayRows(XkbOverlayPtr overlay, int nRows) -{ - return _XkbAllocOverlayRows(overlay, nRows); -} - -Status -XkbAllocGeomOverlayKeys(XkbOverlayRowPtr row, int nKeys) -{ - return _XkbAllocOverlayKeys(row, nKeys); -} - -Status -XkbAllocGeomDoodads(XkbGeometryPtr geom, int nDoodads) -{ - return _XkbAllocDoodads(geom, nDoodads); -} - -Status -XkbAllocGeomSectionDoodads(XkbSectionPtr section, int nDoodads) -{ - return _XkbAllocDoodads(section, nDoodads); -} - -Status -XkbAllocGeomOutlines(XkbShapePtr shape, int nOL) -{ - return _XkbAllocOutlines(shape, nOL); -} - -Status -XkbAllocGeomRows(XkbSectionPtr section, int nRows) -{ - return _XkbAllocRows(section, nRows); -} - -Status -XkbAllocGeomPoints(XkbOutlinePtr ol, int nPts) -{ - return _XkbAllocPoints(ol, nPts); -} - -Status -XkbAllocGeomKeys(XkbRowPtr row, int nKeys) -{ - return _XkbAllocKeys(row, nKeys); -} - Status XkbAllocGeometry(XkbDescPtr xkb, XkbGeometrySizesPtr sizes) { diff --git a/xserver/xkb/ddxList.c b/xserver/xkb/ddxList.c deleted file mode 100644 index 9b69b2b82..000000000 --- a/xserver/xkb/ddxList.c +++ /dev/null @@ -1,310 +0,0 @@ -/************************************************************ -Copyright (c) 1995 by Silicon Graphics Computer Systems, Inc. - -Permission to use, copy, modify, and distribute this -software and its documentation for any purpose and without -fee is hereby granted, provided that the above copyright -notice appear in all copies and that both that copyright -notice and this permission notice appear in supporting -documentation, and that the name of Silicon Graphics not be -used in advertising or publicity pertaining to distribution -of the software without specific prior written permission. -Silicon Graphics makes no representation about the suitability -of this software for any purpose. It is provided "as is" -without any express or implied warranty. - -SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS -SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON -GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL -DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE -OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH -THE USE OR PERFORMANCE OF THIS SOFTWARE. - -********************************************************/ - -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include "inputstr.h" -#include "scrnintstr.h" -#include "windowstr.h" -#define XKBSRV_NEED_FILE_FUNCS -#include -#include - -#ifdef WIN32 -/* from ddxLoad.c */ -extern const char *Win32TempDir(void); -extern int Win32System(const char *cmdline); - -#undef System -#define System Win32System - -#define W32_tmparg " '%s'" -#define W32_tmpfile ,tmpname -#define W32_tmplen strlen(tmpname)+3 -#else -#define W32_tmparg -#define W32_tmpfile -#define W32_tmplen 0 -#endif - -/***====================================================================***/ - -static const char *componentDirs[_XkbListNumComponents] = { - "keycodes", "types", "compat", "symbols", "geometry" -}; - -/***====================================================================***/ - -static Status -_AddListComponent(XkbSrvListInfoPtr list, - int what, unsigned flags, char *str, ClientPtr client) -{ - int slen, wlen; - unsigned char *wire8; - unsigned short *wire16; - char *tmp; - - if (list->nTotal >= list->maxRtrn) { - list->nTotal++; - return Success; - } - tmp = strchr(str, ')'); - if ((tmp == NULL) && ((tmp = strchr(str, '(')) == NULL)) { - slen = strlen(str); - while ((slen > 0) && isspace(str[slen - 1])) { - slen--; - } - } - else { - slen = (tmp - str + 1); - } - wlen = (((slen + 1) / 2) * 2) + 4; /* four bytes for flags and length, pad to */ - /* 2-byte boundary */ - if ((list->szPool - list->nPool) < wlen) { - if (wlen > 1024) - list->szPool += XkbPaddedSize(wlen * 2); - else - list->szPool += 1024; - list->pool = realloc(list->pool, list->szPool * sizeof(char)); - if (!list->pool) - return BadAlloc; - } - wire16 = (unsigned short *) &list->pool[list->nPool]; - wire8 = (unsigned char *) &wire16[2]; - wire16[0] = flags; - wire16[1] = slen; - memcpy(wire8, str, slen); - if (client->swapped) { - swaps(&wire16[0]); - swaps(&wire16[1]); - } - list->nPool += wlen; - list->nFound[what]++; - list->nTotal++; - return Success; -} - -/***====================================================================***/ -static Status -XkbDDXListComponent(DeviceIntPtr dev, - int what, XkbSrvListInfoPtr list, ClientPtr client) -{ - char *file, *map, *tmp, *buf = NULL; - FILE *in; - Status status; - Bool haveDir; - -#ifdef WIN32 - char tmpname[PATH_MAX]; -#else - int rval; -#endif - - if ((list->pattern[what] == NULL) || (list->pattern[what][0] == '\0')) - return Success; - file = list->pattern[what]; - map = strrchr(file, '('); - if (map != NULL) { - char *tmp; - - map++; - tmp = strrchr(map, ')'); - if ((tmp == NULL) || (tmp[1] != '\0')) { - /* illegal pattern. No error, but no match */ - return Success; - } - } - - in = NULL; - haveDir = TRUE; -#ifdef WIN32 - strcpy(tmpname, Win32TempDir()); - strcat(tmpname, "\\xkb_XXXXXX"); - (void) mktemp(tmpname); -#endif - if (XkbBaseDirectory != NULL) { - if ((list->pattern[what][0] == '*') && (list->pattern[what][1] == '\0')) { - if (asprintf(&buf, "%s/%s.dir", XkbBaseDirectory, - componentDirs[what]) == -1) - buf = NULL; - else - in = fopen(buf, "r"); - } - if (!in) { - haveDir = FALSE; - free(buf); - if (asprintf - (&buf, - "'%s/xkbcomp' '-R%s/%s' -w %ld -l -vlfhpR '%s'" W32_tmparg, - XkbBinDirectory, XkbBaseDirectory, componentDirs[what], - (long) ((xkbDebugFlags < 2) ? 1 : - ((xkbDebugFlags > 10) ? 10 : xkbDebugFlags)), - file W32_tmpfile) == -1) - buf = NULL; - } - } - else { - if ((list->pattern[what][0] == '*') && (list->pattern[what][1] == '\0')) { - if (asprintf(&buf, "%s.dir", componentDirs[what]) == -1) - buf = NULL; - else - in = fopen(buf, "r"); - } - if (!in) { - haveDir = FALSE; - free(buf); - if (asprintf - (&buf, - "xkbcomp -R%s -w %ld -l -vlfhpR '%s'" W32_tmparg, - componentDirs[what], - (long) ((xkbDebugFlags < 2) ? 1 : - ((xkbDebugFlags > 10) ? 10 : xkbDebugFlags)), - file W32_tmpfile) == -1) - buf = NULL; - } - } - status = Success; - if (!haveDir) { -#ifndef WIN32 - in = Popen(buf, "r"); -#else - if (xkbDebugFlags) - DebugF("[xkb] xkbList executes: %s\n", buf); - if (System(buf) < 0) - ErrorF("[xkb] Could not invoke keymap compiler\n"); - else - in = fopen(tmpname, "r"); -#endif - } - if (!in) { - free(buf); -#ifdef WIN32 - unlink(tmpname); -#endif - return BadImplementation; - } - list->nFound[what] = 0; - free(buf); - buf = malloc(PATH_MAX * sizeof(char)); - if (!buf) { - fclose(in); -#ifdef WIN32 - unlink(tmpname); -#endif - return BadAlloc; - } - while ((status == Success) && ((tmp = fgets(buf, PATH_MAX, in)) != NULL)) { - unsigned flags; - register unsigned int i; - - if (*tmp == '#') /* comment, skip it */ - continue; - if (!strncmp(tmp, "Warning:", 8) || !strncmp(tmp, " ", 8)) - /* skip warnings too */ - continue; - flags = 0; - /* each line in the listing is supposed to start with two */ - /* groups of eight characters, which specify the general */ - /* flags and the flags that are specific to the component */ - /* if they're missing, fail with BadImplementation */ - for (i = 0; (i < 8) && (status == Success); i++) { /* read the general flags */ - if (isalpha(*tmp)) - flags |= (1L << i); - else if (*tmp != '-') - status = BadImplementation; - tmp++; - } - if (status != Success) - break; - if (!isspace(*tmp)) { - status = BadImplementation; - break; - } - else - tmp++; - for (i = 0; (i < 8) && (status == Success); i++) { /* read the component flags */ - if (isalpha(*tmp)) - flags |= (1L << (i + 8)); - else if (*tmp != '-') - status = BadImplementation; - tmp++; - } - if (status != Success) - break; - if (isspace(*tmp)) { - while (isspace(*tmp)) { - tmp++; - } - } - else { - status = BadImplementation; - break; - } - status = _AddListComponent(list, what, flags, tmp, client); - } -#ifndef WIN32 - if (haveDir) - fclose(in); - else if ((rval = Pclose(in)) != 0) { - if (xkbDebugFlags) - ErrorF("[xkb] xkbcomp returned exit code %d\n", rval); - } -#else - fclose(in); - unlink(tmpname); -#endif - free(buf); - return status; -} - -/***====================================================================***/ - -/* ARGSUSED */ -Status -XkbDDXList(DeviceIntPtr dev, XkbSrvListInfoPtr list, ClientPtr client) -{ - Status status; - - status = XkbDDXListComponent(dev, _XkbListKeycodes, list, client); - if (status == Success) - status = XkbDDXListComponent(dev, _XkbListTypes, list, client); - if (status == Success) - status = XkbDDXListComponent(dev, _XkbListCompat, list, client); - if (status == Success) - status = XkbDDXListComponent(dev, _XkbListSymbols, list, client); - if (status == Success) - status = XkbDDXListComponent(dev, _XkbListGeometry, list, client); - return status; -} diff --git a/xserver/xkb/ddxLoad.c b/xserver/xkb/ddxLoad.c index cb2dfc31c..d462957f4 100644 --- a/xserver/xkb/ddxLoad.c +++ b/xserver/xkb/ddxLoad.c @@ -68,81 +68,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #define PATHSEPARATOR "/" #endif -#ifdef WIN32 - -#include -const char * -Win32TempDir() -{ - static char buffer[PATH_MAX]; - - if (GetTempPath(sizeof(buffer), buffer)) { - int len; - - buffer[sizeof(buffer) - 1] = 0; - len = strlen(buffer); - if (len > 0) - if (buffer[len - 1] == '\\') - buffer[len - 1] = 0; - return buffer; - } - if (getenv("TEMP") != NULL) - return getenv("TEMP"); - else if (getenv("TMP") != NULL) - return getenv("TEMP"); - else - return "/tmp"; -} - -int -Win32System(const char *cmdline) -{ - STARTUPINFO si; - PROCESS_INFORMATION pi; - DWORD dwExitCode; - char *cmd = strdup(cmdline); - - ZeroMemory(&si, sizeof(si)); - si.cb = sizeof(si); - ZeroMemory(&pi, sizeof(pi)); - - if (!CreateProcess(NULL, cmd, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi)) { - LPVOID buffer; - - if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | - FORMAT_MESSAGE_FROM_SYSTEM | - FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - GetLastError(), - MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) & buffer, 0, NULL)) { - ErrorF("[xkb] Starting '%s' failed!\n", cmdline); - } - else { - ErrorF("[xkb] Starting '%s' failed: %s", cmdline, (char *) buffer); - LocalFree(buffer); - } - - free(cmd); - return -1; - } - /* Wait until child process exits. */ - WaitForSingleObject(pi.hProcess, INFINITE); - - GetExitCodeProcess(pi.hProcess, &dwExitCode); - - /* Close process and thread handles. */ - CloseHandle(pi.hProcess); - CloseHandle(pi.hThread); - free(cmd); - - return dwExitCode; -} - -#undef System -#define System(x) Win32System(x) -#endif - static void OutputDirectory(char *outdir, size_t size) { diff --git a/xserver/xkb/maprules.c b/xserver/xkb/maprules.c index c6900eccb..5462763d1 100644 --- a/xserver/xkb/maprules.c +++ b/xserver/xkb/maprules.c @@ -864,6 +864,7 @@ XkbRF_GetComponents(XkbRF_RulesPtr rules, XkbRF_CheckApplyRules(rules, &mdefs, names, XkbRF_Append); XkbRF_ApplyPartialMatches(rules, names); XkbRF_CheckApplyRules(rules, &mdefs, names, XkbRF_Option); + XkbRF_ApplyPartialMatches(rules, names); if (names->keycodes) names->keycodes = XkbRF_SubstituteVars(names->keycodes, &mdefs); diff --git a/xserver/xkb/xkb.c b/xserver/xkb/xkb.c index 0bec24f63..7e51e4080 100644 --- a/xserver/xkb/xkb.c +++ b/xserver/xkb/xkb.c @@ -36,6 +36,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #define XKBSRV_NEED_FILE_FUNCS #include #include "extnsionst.h" +#include "extinit.h" #include "xace.h" #include "xkb.h" #include "protocol-versions.h" @@ -56,10 +57,10 @@ static RESTYPE RT_XKBCLIENT; #define CHK_DEVICE(dev, id, client, access_mode, lf) {\ int why;\ - int rc = lf(&(dev), id, client, access_mode, &why);\ - if (rc != Success) {\ + int tmprc = lf(&(dev), id, client, access_mode, &why);\ + if (tmprc != Success) {\ client->errorValue = _XkbErrCode2(why, id);\ - return rc;\ + return tmprc;\ }\ } @@ -181,19 +182,20 @@ ProcXkbUseExtension(ClientPtr client) stuff->wantedMinor, SERVER_XKB_MAJOR_VERSION, SERVER_XKB_MINOR_VERSION); } - memset(&rep, 0, sizeof(xkbUseExtensionReply)); - rep.type = X_Reply; - rep.supported = supported; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.serverMajor = SERVER_XKB_MAJOR_VERSION; - rep.serverMinor = SERVER_XKB_MINOR_VERSION; + rep = (xkbUseExtensionReply) { + .type = X_Reply, + .supported = supported, + .sequenceNumber = client->sequence, + .length = 0, + .serverMajor = SERVER_XKB_MAJOR_VERSION, + .serverMinor = SERVER_XKB_MINOR_VERSION + }; if (client->swapped) { swaps(&rep.sequenceNumber); swaps(&rep.serverMajor); swaps(&rep.serverMinor); } - WriteToClient(client, SIZEOF(xkbUseExtensionReply), (char *) &rep); + WriteToClient(client, SIZEOF(xkbUseExtensionReply), &rep); return Success; } @@ -577,26 +579,27 @@ ProcXkbGetState(ClientPtr client) CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); xkb = &dev->key->xkbInfo->state; - memset(&rep, 0, sizeof(xkbGetStateReply)); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.deviceID = dev->id; - rep.mods = XkbStateFieldFromRec(xkb) & 0xff; - rep.baseMods = xkb->base_mods; - rep.lockedMods = xkb->locked_mods; - rep.latchedMods = xkb->latched_mods; - rep.group = xkb->group; - rep.baseGroup = xkb->base_group; - rep.latchedGroup = xkb->latched_group; - rep.lockedGroup = xkb->locked_group; - rep.compatState = xkb->compat_state; - rep.ptrBtnState = xkb->ptr_buttons; + rep = (xkbGetStateReply) { + .type = X_Reply, + .deviceID = dev->id, + .sequenceNumber = client->sequence, + .length = 0, + .mods = XkbStateFieldFromRec(xkb) & 0xff, + .baseMods = xkb->base_mods, + .latchedMods = xkb->latched_mods, + .lockedMods = xkb->locked_mods, + .group = xkb->group, + .lockedGroup = xkb->locked_group, + .baseGroup = xkb->base_group, + .latchedGroup = xkb->latched_group, + .compatState = xkb->compat_state, + .ptrBtnState = xkb->ptr_buttons + }; if (client->swapped) { swaps(&rep.sequenceNumber); swaps(&rep.ptrBtnState); } - WriteToClient(client, SIZEOF(xkbGetStateReply), (char *) &rep); + WriteToClient(client, SIZEOF(xkbGetStateReply), &rep); return Success; } @@ -688,36 +691,38 @@ ProcXkbGetControls(ClientPtr client) CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); xkb = dev->key->xkbInfo->desc->ctrls; - rep.type = X_Reply; - rep.length = bytes_to_int32(SIZEOF(xkbGetControlsReply) - - SIZEOF(xGenericReply)); - rep.sequenceNumber = client->sequence; - rep.deviceID = ((DeviceIntPtr) dev)->id; - rep.numGroups = xkb->num_groups; - rep.groupsWrap = xkb->groups_wrap; - rep.internalMods = xkb->internal.mask; - rep.ignoreLockMods = xkb->ignore_lock.mask; - rep.internalRealMods = xkb->internal.real_mods; - rep.ignoreLockRealMods = xkb->ignore_lock.real_mods; - rep.internalVMods = xkb->internal.vmods; - rep.ignoreLockVMods = xkb->ignore_lock.vmods; - rep.enabledCtrls = xkb->enabled_ctrls; - rep.repeatDelay = xkb->repeat_delay; - rep.repeatInterval = xkb->repeat_interval; - rep.slowKeysDelay = xkb->slow_keys_delay; - rep.debounceDelay = xkb->debounce_delay; - rep.mkDelay = xkb->mk_delay; - rep.mkInterval = xkb->mk_interval; - rep.mkTimeToMax = xkb->mk_time_to_max; - rep.mkMaxSpeed = xkb->mk_max_speed; - rep.mkCurve = xkb->mk_curve; - rep.mkDfltBtn = xkb->mk_dflt_btn; - rep.axTimeout = xkb->ax_timeout; - rep.axtCtrlsMask = xkb->axt_ctrls_mask; - rep.axtCtrlsValues = xkb->axt_ctrls_values; - rep.axtOptsMask = xkb->axt_opts_mask; - rep.axtOptsValues = xkb->axt_opts_values; - rep.axOptions = xkb->ax_options; + rep = (xkbGetControlsReply) { + .type = X_Reply, + .deviceID = ((DeviceIntPtr) dev)->id, + .sequenceNumber = client->sequence, + .length = bytes_to_int32(SIZEOF(xkbGetControlsReply) - + SIZEOF(xGenericReply)), + .mkDfltBtn = xkb->mk_dflt_btn, + .numGroups = xkb->num_groups, + .groupsWrap = xkb->groups_wrap, + .internalMods = xkb->internal.mask, + .ignoreLockMods = xkb->ignore_lock.mask, + .internalRealMods = xkb->internal.real_mods, + .ignoreLockRealMods = xkb->ignore_lock.real_mods, + .internalVMods = xkb->internal.vmods, + .ignoreLockVMods = xkb->ignore_lock.vmods, + .repeatDelay = xkb->repeat_delay, + .repeatInterval = xkb->repeat_interval, + .slowKeysDelay = xkb->slow_keys_delay, + .debounceDelay = xkb->debounce_delay, + .mkDelay = xkb->mk_delay, + .mkInterval = xkb->mk_interval, + .mkTimeToMax = xkb->mk_time_to_max, + .mkMaxSpeed = xkb->mk_max_speed, + .mkCurve = xkb->mk_curve, + .axOptions = xkb->ax_options, + .axTimeout = xkb->ax_timeout, + .axtOptsMask = xkb->axt_opts_mask, + .axtOptsValues = xkb->axt_opts_values, + .axtCtrlsMask = xkb->axt_ctrls_mask, + .axtCtrlsValues = xkb->axt_ctrls_values, + .enabledCtrls = xkb->enabled_ctrls, + }; memcpy(rep.perKeyRepeat, xkb->per_key_repeat, XkbPerKeyBitArraySize); if (client->swapped) { swaps(&rep.sequenceNumber); @@ -741,7 +746,7 @@ ProcXkbGetControls(ClientPtr client) swaps(&rep.axtOptsValues); swaps(&rep.axOptions); } - WriteToClient(client, SIZEOF(xkbGetControlsReply), (char *) &rep); + WriteToClient(client, SIZEOF(xkbGetControlsReply), &rep); return Success; } @@ -1021,22 +1026,22 @@ XkbWriteKeyTypes(XkbDescPtr xkb, buf = (char *) &wire[1]; if (wire->nMapEntries > 0) { - xkbKTMapEntryWireDesc *wire; + xkbKTMapEntryWireDesc *ewire; XkbKTMapEntryPtr entry; - wire = (xkbKTMapEntryWireDesc *) buf; + ewire = (xkbKTMapEntryWireDesc *) buf; entry = type->map; - for (n = 0; n < type->map_count; n++, wire++, entry++) { - wire->active = entry->active; - wire->mask = entry->mods.mask; - wire->level = entry->level; - wire->realMods = entry->mods.real_mods; - wire->virtualMods = entry->mods.vmods; + for (n = 0; n < type->map_count; n++, ewire++, entry++) { + ewire->active = entry->active; + ewire->mask = entry->mods.mask; + ewire->level = entry->level; + ewire->realMods = entry->mods.real_mods; + ewire->virtualMods = entry->mods.vmods; if (client->swapped) { - swaps(&wire->virtualMods); + swaps(&ewire->virtualMods); } } - buf = (char *) wire; + buf = (char *) ewire; if (type->preserve != NULL) { xkbModsWireDesc *pwire; XkbModsPtr preserve; @@ -1433,7 +1438,7 @@ XkbSendMap(ClientPtr client, XkbDescPtr xkb, xkbGetMapReply * rep) swaps(&rep->totalSyms); swaps(&rep->totalActs); } - WriteToClient(client, (i = SIZEOF(xkbGetMapReply)), (char *) rep); + WriteToClient(client, (i = SIZEOF(xkbGetMapReply)), rep); WriteToClient(client, len, start); free((char *) start); return Success; @@ -1459,14 +1464,16 @@ ProcXkbGetMap(ClientPtr client) CHK_MASK_LEGAL(0x03, stuff->partial, XkbAllMapComponentsMask); xkb = dev->key->xkbInfo->desc; - memset(&rep, 0, sizeof(xkbGetMapReply)); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = (SIZEOF(xkbGetMapReply) - SIZEOF(xGenericReply)) >> 2; - rep.deviceID = dev->id; - rep.present = stuff->partial | stuff->full; - rep.minKeyCode = xkb->min_key_code; - rep.maxKeyCode = xkb->max_key_code; + rep = (xkbGetMapReply) { + .type = X_Reply, + .deviceID = dev->id, + .sequenceNumber = client->sequence, + .length = (SIZEOF(xkbGetMapReply) - SIZEOF(xGenericReply)) >> 2, + .present = stuff->partial | stuff->full, + .minKeyCode = xkb->min_key_code, + .maxKeyCode = xkb->max_key_code + }; + if (stuff->full & XkbKeyTypesMask) { rep.firstType = 0; rep.nTypes = xkb->map->num_types; @@ -1643,8 +1650,8 @@ CheckKeyTypes(ClientPtr client, xkbKTSetMapEntryWireDesc *mapWire; xkbModsWireDesc *preWire; - mapWire = (xkbKTSetMapEntryWireDesc *) & wire[1]; - preWire = (xkbModsWireDesc *) & mapWire[wire->nMapEntries]; + mapWire = (xkbKTSetMapEntryWireDesc *) &wire[1]; + preWire = (xkbModsWireDesc *) &mapWire[wire->nMapEntries]; for (n = 0; n < wire->nMapEntries; n++) { if (client->swapped) { swaps(&mapWire[n].virtualMods); @@ -1754,8 +1761,8 @@ CheckKeySyms(ClientPtr client, *errorRtrn = _XkbErrCode3(0x17, i + req->firstKeySym, wire->nSyms); return 0; } - pSyms = (KeySym *) & wire[1]; - wire = (xkbSymMapWireDesc *) & pSyms[wire->nSyms]; + pSyms = (KeySym *) &wire[1]; + wire = (xkbSymMapWireDesc *) &pSyms[wire->nSyms]; } map = &xkb->map->key_sym_map[i]; @@ -2032,7 +2039,7 @@ SetKeyTypes(XkbDescPtr xkb, unsigned tmp; mapWire = (xkbKTSetMapEntryWireDesc *) map; - preWire = (xkbModsWireDesc *) & mapWire[wire->nMapEntries]; + preWire = (xkbModsWireDesc *) &mapWire[wire->nMapEntries]; for (n = 0; n < wire->nMapEntries; n++) { pOld->map[n].active = 1; pOld->map[n].mods.mask = mapWire[n].realMods; @@ -2091,7 +2098,7 @@ SetKeySyms(ClientPtr client, oldMap = &xkb->map->key_sym_map[req->firstKeySym]; for (i = 0; i < req->nKeySyms; i++, oldMap++) { - pSyms = (KeySym *) & wire[1]; + pSyms = (KeySym *) &wire[1]; if (wire->nSyms > 0) { newSyms = XkbResizeKeySyms(xkb, i + req->firstKeySym, wire->nSyms); for (s = 0; s < wire->nSyms; s++) { @@ -2109,7 +2116,7 @@ SetKeySyms(ClientPtr client, oldMap->kt_index[3] = wire->ktIndex[3]; oldMap->group_info = wire->groupInfo; oldMap->width = wire->width; - wire = (xkbSymMapWireDesc *) & pSyms[wire->nSyms]; + wire = (xkbSymMapWireDesc *) &pSyms[wire->nSyms]; } first = req->firstKeySym; last = first + req->nKeySyms - 1; @@ -2401,7 +2408,7 @@ _XkbSetMapChecks(ClientPtr client, DeviceIntPtr dev, xkbSetMapReq * req, } if ((req->present & XkbKeyTypesMask) && - (!CheckKeyTypes(client, xkb, req, (xkbKeyTypeWireDesc **) & values, + (!CheckKeyTypes(client, xkb, req, (xkbKeyTypeWireDesc **) &values, &nTypes, mapWidths))) { client->errorValue = nTypes; return BadValue; @@ -2426,7 +2433,7 @@ _XkbSetMapChecks(ClientPtr client, DeviceIntPtr dev, xkbSetMapReq * req, if ((req->present & XkbKeySymsMask) && (!CheckKeySyms(client, xkb, req, nTypes, mapWidths, symsPerKey, - (xkbSymMapWireDesc **) & values, &error))) { + (xkbSymMapWireDesc **) &values, &error))) { client->errorValue = error; return BadValue; } @@ -2440,7 +2447,7 @@ _XkbSetMapChecks(ClientPtr client, DeviceIntPtr dev, xkbSetMapReq * req, if ((req->present & XkbKeyBehaviorsMask) && (!CheckKeyBehaviors - (xkb, req, (xkbBehaviorWireDesc **) & values, &error))) { + (xkb, req, (xkbBehaviorWireDesc **) &values, &error))) { client->errorValue = error; return BadValue; } @@ -2462,7 +2469,7 @@ _XkbSetMapChecks(ClientPtr client, DeviceIntPtr dev, xkbSetMapReq * req, } if ((req->present & XkbVirtualModMapMask) && (!CheckVirtualModMap - (xkb, req, (xkbVModMapWireDesc **) & values, &error))) { + (xkb, req, (xkbVModMapWireDesc **) &values, &error))) { client->errorValue = error; return BadValue; } @@ -2744,7 +2751,7 @@ XkbSendCompatMap(ClientPtr client, swaps(&rep->nTotalSI); } - WriteToClient(client, SIZEOF(xkbGetCompatMapReply), (char *) rep); + WriteToClient(client, SIZEOF(xkbGetCompatMapReply), rep); if (data) { WriteToClient(client, size, data); free((char *) data); @@ -2771,12 +2778,14 @@ ProcXkbGetCompatMap(ClientPtr client) xkb = dev->key->xkbInfo->desc; compat = xkb->compat; - rep.type = X_Reply; - rep.deviceID = dev->id; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.firstSI = stuff->firstSI; - rep.nSI = stuff->nSI; + rep = (xkbGetCompatMapReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .deviceID = dev->id, + .firstSI = stuff->firstSI, + .nSI = stuff->nSI + }; if (stuff->getAllSI) { rep.firstSI = 0; rep.nSI = compat->num_si; @@ -2894,7 +2903,6 @@ _XkbSetCompatMap(ClientPtr client, DeviceIntPtr dev, } if (req->groups != 0) { - unsigned i, bit; xkbModsWireDesc *wire = (xkbModsWireDesc *) data; for (i = 0, bit = 1; i < XkbNumKbdGroups; i++, bit <<= 1) { @@ -3034,17 +3042,19 @@ ProcXkbGetIndicatorState(ClientPtr client) if (!sli) return BadAlloc; - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.deviceID = dev->id; - rep.state = sli->effectiveState; + rep = (xkbGetIndicatorStateReply) { + .type = X_Reply, + .deviceID = dev->id, + .sequenceNumber = client->sequence, + .length = 0, + .state = sli->effectiveState + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.state); } - WriteToClient(client, SIZEOF(xkbGetIndicatorStateReply), (char *) &rep); + WriteToClient(client, SIZEOF(xkbGetIndicatorStateReply), &rep); return Success; } @@ -3118,9 +3128,9 @@ XkbSendIndicatorMap(ClientPtr client, swapl(&rep->which); swapl(&rep->realIndicators); } - WriteToClient(client, SIZEOF(xkbGetIndicatorMapReply), (char *) rep); + WriteToClient(client, SIZEOF(xkbGetIndicatorMapReply), rep); if (map) { - WriteToClient(client, length, (char *) map); + WriteToClient(client, length, map); free((char *) map); } return Success; @@ -3145,11 +3155,13 @@ ProcXkbGetIndicatorMap(ClientPtr client) xkb = dev->key->xkbInfo->desc; leds = xkb->indicators; - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.deviceID = dev->id; - rep.which = stuff->which; + rep = (xkbGetIndicatorMapReply) { + .type = X_Reply, + .deviceID = dev->id, + .sequenceNumber = client->sequence, + .length = 0, + .which = stuff->which + }; XkbComputeGetIndicatorMapReplySize(leds, &rep); return XkbSendIndicatorMap(client, leds, &rep); } @@ -3300,11 +3312,13 @@ ProcXkbGetNamedIndicator(ClientPtr client) } } - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.deviceID = dev->id; - rep.indicator = stuff->indicator; + rep = (xkbGetNamedIndicatorReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .deviceID = dev->id, + .indicator = stuff->indicator + }; if (map != NULL) { rep.found = TRUE; rep.on = ((sli->effectiveState & (1 << i)) != 0); @@ -3343,7 +3357,7 @@ ProcXkbGetNamedIndicator(ClientPtr client) swapl(&rep.ctrls); } - WriteToClient(client, SIZEOF(xkbGetNamedIndicatorReply), (char *) &rep); + WriteToClient(client, SIZEOF(xkbGetNamedIndicatorReply), &rep); return Success; } @@ -3857,7 +3871,7 @@ XkbSendNames(ClientPtr client, XkbDescPtr xkb, xkbGetNamesReply * rep) ErrorF("[xkb] BOGUS LENGTH in write names, expected %d, got %ld\n", length, (unsigned long) (desc - start)); } - WriteToClient(client, SIZEOF(xkbGetNamesReply), (char *) rep); + WriteToClient(client, SIZEOF(xkbGetNamesReply), rep); WriteToClient(client, length, start); free((char *) start); return Success; @@ -3880,22 +3894,18 @@ ProcXkbGetNames(ClientPtr client) CHK_MASK_LEGAL(0x01, stuff->which, XkbAllNamesMask); xkb = dev->key->xkbInfo->desc; - memset(&rep, 0, sizeof(xkbGetNamesReply)); - rep.type = X_Reply; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.deviceID = dev->id; - rep.which = stuff->which; - rep.nTypes = xkb->map->num_types; - rep.firstKey = xkb->min_key_code; - rep.nKeys = XkbNumKeys(xkb); - if (xkb->names != NULL) { - rep.nKeyAliases = xkb->names->num_key_aliases; - rep.nRadioGroups = xkb->names->num_rg; - } - else { - rep.nKeyAliases = rep.nRadioGroups = 0; - } + rep = (xkbGetNamesReply) { + .type = X_Reply, + .deviceID = dev->id, + .sequenceNumber = client->sequence, + .length = 0, + .which = stuff->which, + .nTypes = xkb->map->num_types, + .firstKey = xkb->min_key_code, + .nKeys = XkbNumKeys(xkb), + .nKeyAliases = xkb->names ? xkb->names->num_key_aliases : 0, + .nRadioGroups = xkb->names ? xkb->names->num_rg : 0 + }; XkbComputeGetNamesReplySize(xkb, &rep); return XkbSendNames(client, xkb, &rep); } @@ -4904,7 +4914,7 @@ XkbSendGeometry(ClientPtr client, swaps(&rep->nDoodads); swaps(&rep->nKeyAliases); } - WriteToClient(client, SIZEOF(xkbGetGeometryReply), (char *) rep); + WriteToClient(client, SIZEOF(xkbGetGeometryReply), rep); if (len > 0) WriteToClient(client, len, start); if (start != NULL) @@ -4933,10 +4943,12 @@ ProcXkbGetGeometry(ClientPtr client) CHK_ATOM_OR_NONE(stuff->name); geom = XkbLookupNamedGeometry(dev, stuff->name, &shouldFree); - rep.type = X_Reply; - rep.deviceID = dev->id; - rep.sequenceNumber = client->sequence; - rep.length = 0; + rep = (xkbGetGeometryReply) { + .type = X_Reply, + .deviceID = dev->id, + .sequenceNumber = client->sequence, + .length = 0 + }; status = XkbComputeGetGeometryReplySize(geom, &rep, stuff->name); if (status != Success) return status; @@ -5085,7 +5097,7 @@ _CheckSetOverlay(char **wire_inout, } CHK_ATOM_ONLY(olWire->name); ol = XkbAddGeomOverlay(section, olWire->name, olWire->nRows); - rWire = (xkbOverlayRowWireDesc *) & olWire[1]; + rWire = (xkbOverlayRowWireDesc *) &olWire[1]; for (r = 0; r < olWire->nRows; r++) { register int k; xkbOverlayKeyWireDesc *kWire; @@ -5097,7 +5109,7 @@ _CheckSetOverlay(char **wire_inout, return BadMatch; } row = XkbAddGeomOverlayRow(ol, rWire->rowUnder, rWire->nKeys); - kWire = (xkbOverlayKeyWireDesc *) & rWire[1]; + kWire = (xkbOverlayKeyWireDesc *) &rWire[1]; for (k = 0; k < rWire->nKeys; k++, kWire++) { if (XkbAddGeomOverlayKey(ol, row, (char *) kWire->over, @@ -5151,7 +5163,7 @@ _CheckSetSections(XkbGeometryPtr geom, section->width = sWire->width; section->height = sWire->height; section->angle = sWire->angle; - rWire = (xkbRowWireDesc *) & sWire[1]; + rWire = (xkbRowWireDesc *) &sWire[1]; for (r = 0; r < sWire->nRows; r++) { register int k; XkbRowPtr row; @@ -5167,7 +5179,7 @@ _CheckSetSections(XkbGeometryPtr geom, row->top = rWire->top; row->left = rWire->left; row->vertical = rWire->vertical; - kWire = (xkbKeyWireDesc *) & rWire[1]; + kWire = (xkbKeyWireDesc *) &rWire[1]; for (k = 0; k < rWire->nKeys; k++) { XkbKeyPtr key; @@ -5189,7 +5201,7 @@ _CheckSetSections(XkbGeometryPtr geom, return BadMatch; } } - rWire = (xkbRowWireDesc *) & kWire[rWire->nKeys]; + rWire = (xkbRowWireDesc *) &kWire[rWire->nKeys]; } wire = (char *) rWire; if (sWire->nDoodads > 0) { @@ -5253,7 +5265,7 @@ _CheckSetShapes(XkbGeometryPtr geom, if (!ol) return BadAlloc; ol->corner_radius = olWire->cornerRadius; - ptWire = (xkbPointWireDesc *) & olWire[1]; + ptWire = (xkbPointWireDesc *) &olWire[1]; for (p = 0, pt = ol->points; p < olWire->nPoints; p++, pt++) { pt->x = ptWire[p].x; pt->y = ptWire[p].y; @@ -5483,10 +5495,6 @@ ProcXkbPerClientFlags(ClientPtr client) CHK_MASK_MATCH(0x02, stuff->change, stuff->value); interest = XkbFindClientResource((DevicePtr) dev, client); - memset(&rep, 0, sizeof(xkbPerClientFlagsReply)); - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; if (stuff->change) { client->xkbClientFlags &= ~stuff->change; client->xkbClientFlags |= stuff->value; @@ -5522,15 +5530,16 @@ ProcXkbPerClientFlags(ClientPtr client) interest->autoCtrlValues |= stuff->autoCtrlValues & affect; } } - rep.supported = XkbPCF_AllFlagsMask; - rep.value = client->xkbClientFlags & XkbPCF_AllFlagsMask; - if (interest) { - rep.autoCtrls = interest->autoCtrls; - rep.autoCtrlValues = interest->autoCtrlValues; - } - else { - rep.autoCtrls = rep.autoCtrlValues = 0; - } + + rep = (xkbPerClientFlagsReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .supported = XkbPCF_AllFlagsMask, + .value = client->xkbClientFlags & XkbPCF_AllFlagsMask, + .autoCtrls = interest ? interest->autoCtrls : 0, + .autoCtrlValues = interest ? interest->autoCtrlValues : 0, + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.supported); @@ -5538,7 +5547,7 @@ ProcXkbPerClientFlags(ClientPtr client) swapl(&rep.autoCtrls); swapl(&rep.autoCtrlValues); } - WriteToClient(client, SIZEOF(xkbPerClientFlagsReply), (char *) &rep); + WriteToClient(client, SIZEOF(xkbPerClientFlagsReply), &rep); return Success; } @@ -5611,9 +5620,9 @@ ProcXkbListComponents(ClientPtr client) DeviceIntPtr dev; xkbListComponentsReply rep; unsigned len; - int status; unsigned char *str; - XkbSrvListInfoRec list; + uint8_t size; + int i; REQUEST(xkbListComponentsReq); REQUEST_AT_LEAST_SIZE(xkbListComponentsReq); @@ -5623,39 +5632,33 @@ ProcXkbListComponents(ClientPtr client) CHK_KBD_DEVICE(dev, stuff->deviceSpec, client, DixGetAttrAccess); - status = Success; + /* The request is followed by six Pascal strings (i.e. size in characters + * followed by a string pattern) describing what the client wants us to + * list. We don't care, but might as well check they haven't got the + * length wrong. */ str = (unsigned char *) &stuff[1]; - memset(&list, 0, sizeof(XkbSrvListInfoRec)); - list.maxRtrn = stuff->maxNames; - list.pattern[_XkbListKeycodes] = GetComponentSpec(&str, FALSE, &status); - list.pattern[_XkbListTypes] = GetComponentSpec(&str, FALSE, &status); - list.pattern[_XkbListCompat] = GetComponentSpec(&str, FALSE, &status); - list.pattern[_XkbListSymbols] = GetComponentSpec(&str, FALSE, &status); - list.pattern[_XkbListGeometry] = GetComponentSpec(&str, FALSE, &status); - if (status != Success) - return status; - len = str - ((unsigned char *) stuff); + for (i = 0; i < 6; i++) { + size = *((uint8_t *)str); + len = (str + size + 1) - ((unsigned char *) stuff); + if ((XkbPaddedSize(len) / 4) > stuff->length) + return BadLength; + str += (size + 1); + } if ((XkbPaddedSize(len) / 4) != stuff->length) return BadLength; - if ((status = XkbDDXList(dev, &list, client)) != Success) { - free(list.pool); - list.pool = NULL; - return status; - } - memset(&rep, 0, sizeof(xkbListComponentsReply)); - rep.type = X_Reply; - rep.deviceID = dev->id; - rep.sequenceNumber = client->sequence; - rep.length = XkbPaddedSize(list.nPool) / 4; - rep.nKeymaps = 0; - rep.nKeycodes = list.nFound[_XkbListKeycodes]; - rep.nTypes = list.nFound[_XkbListTypes]; - rep.nCompatMaps = list.nFound[_XkbListCompat]; - rep.nSymbols = list.nFound[_XkbListSymbols]; - rep.nGeometries = list.nFound[_XkbListGeometry]; - rep.extra = 0; - if (list.nTotal > list.maxRtrn) - rep.extra = (list.nTotal - list.maxRtrn); + rep = (xkbListComponentsReply) { + .type = X_Reply, + .deviceID = dev->id, + .sequenceNumber = client->sequence, + .length = 0, + .nKeymaps = 0, + .nKeycodes = 0, + .nTypes = 0, + .nCompatMaps = 0, + .nSymbols = 0, + .nGeometries = 0, + .extra = 0 + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.length); @@ -5667,12 +5670,7 @@ ProcXkbListComponents(ClientPtr client) swaps(&rep.nGeometries); swaps(&rep.extra); } - WriteToClient(client, SIZEOF(xkbListComponentsReply), (char *) &rep); - if (list.nPool && list.pool) { - WriteToClient(client, XkbPaddedSize(list.nPool), (char *) list.pool); - free(list.pool); - list.pool = NULL; - } + WriteToClient(client, SIZEOF(xkbListComponentsReply), &rep); return Success; } @@ -5939,7 +5937,7 @@ ProcXkbGetKbdByName(ClientPtr client) swaps(&rep.found); swaps(&rep.reported); } - WriteToClient(client, SIZEOF(xkbGetKbdByNameReply), (char *) &rep); + WriteToClient(client, SIZEOF(xkbGetKbdByNameReply), &rep); if (reported & (XkbGBN_SymbolsMask | XkbGBN_TypesMask)) XkbSendMap(client, new, &mrep); if (reported & XkbGBN_CompatMapMask) @@ -6136,7 +6134,7 @@ SendDeviceLedInfo(XkbSrvLedInfoPtr sli, ClientPtr client) swapl(&wire.physIndicators); swapl(&wire.state); } - WriteToClient(client, SIZEOF(xkbDeviceLedsWireDesc), (char *) &wire); + WriteToClient(client, SIZEOF(xkbDeviceLedsWireDesc), &wire); length += SIZEOF(xkbDeviceLedsWireDesc); if (sli->namesPresent | sli->mapsPresent) { register unsigned i, bit; @@ -6150,7 +6148,7 @@ SendDeviceLedInfo(XkbSrvLedInfoPtr sli, ClientPtr client) if (client->swapped) { swapl(&awire); } - WriteToClient(client, 4, (char *) &awire); + WriteToClient(client, 4, &awire); length += 4; } } @@ -6173,7 +6171,7 @@ SendDeviceLedInfo(XkbSrvLedInfoPtr sli, ClientPtr client) swapl(&iwire.ctrls); } WriteToClient(client, SIZEOF(xkbIndicatorMapWireDesc), - (char *) &iwire); + &iwire); length += SIZEOF(xkbIndicatorMapWireDesc); } } @@ -6254,37 +6252,29 @@ ProcXkbGetDeviceInfo(ClientPtr client) wanted &= ~XkbXI_IndicatorsMask; nameLen = XkbSizeCountedString(dev->name); - memset((char *) &rep, 0, SIZEOF(xkbGetDeviceInfoReply)); - rep.type = X_Reply; - rep.deviceID = dev->id; - rep.sequenceNumber = client->sequence; - rep.length = nameLen / 4; - rep.present = wanted; - rep.supported = XkbXI_AllDeviceFeaturesMask; - rep.unsupported = 0; - rep.firstBtnWanted = rep.nBtnsWanted = 0; - rep.firstBtnRtrn = rep.nBtnsRtrn = 0; - if (dev->button) - rep.totalBtns = dev->button->numButtons; - else - rep.totalBtns = 0; - rep.devType = dev->xinput_type; - rep.hasOwnState = (dev->key && dev->key->xkbInfo); - rep.nDeviceLedFBs = 0; - if (dev->kbdfeed) - rep.dfltKbdFB = dev->kbdfeed->ctrl.id; - else - rep.dfltKbdFB = XkbXINone; - if (dev->leds) - rep.dfltLedFB = dev->leds->ctrl.id; - else - rep.dfltLedFB = XkbXINone; + rep = (xkbGetDeviceInfoReply) { + .type = X_Reply, + .deviceID = dev->id, + .sequenceNumber = client->sequence, + .length = nameLen / 4, + .present = wanted, + .supported = XkbXI_AllDeviceFeaturesMask, + .unsupported = 0, + .nDeviceLedFBs = 0, + .firstBtnWanted = 0, + .nBtnsWanted = 0, + .firstBtnRtrn = 0, + .nBtnsRtrn = 0, + .totalBtns = dev->button ? dev->button->numButtons : 0, + .hasOwnState = (dev->key && dev->key->xkbInfo), + .dfltKbdFB = dev->kbdfeed ? dev->kbdfeed->ctrl.id : XkbXINone, + .dfltLedFB = dev->leds ? dev->leds->ctrl.id : XkbXINone, + .devType = dev->xinput_type + }; ledClass = stuff->ledClass; ledID = stuff->ledID; - rep.firstBtnWanted = rep.nBtnsWanted = 0; - rep.firstBtnRtrn = rep.nBtnsRtrn = 0; if (wanted & XkbXI_ButtonActionsMask) { if (stuff->allBtns) { stuff->firstBtn = 0; @@ -6343,7 +6333,7 @@ ProcXkbGetDeviceInfo(ClientPtr client) swaps(&rep.dfltLedFB); swapl(&rep.devType); } - WriteToClient(client, SIZEOF(xkbGetDeviceInfoReply), (char *) &rep); + WriteToClient(client, SIZEOF(xkbGetDeviceInfoReply), &rep); str = malloc(nameLen); if (!str) @@ -6358,8 +6348,8 @@ ProcXkbGetDeviceInfo(ClientPtr client) xkbActionWireDesc *awire; sz = rep.nBtnsRtrn * SIZEOF(xkbActionWireDesc); - awire = (xkbActionWireDesc *) & dev->button->xkb_acts[rep.firstBtnRtrn]; - WriteToClient(client, sz, (char *) awire); + awire = (xkbActionWireDesc *) &dev->button->xkb_acts[rep.firstBtnRtrn]; + WriteToClient(client, sz, awire); length -= sz; } if (nDeviceLedFBs > 0) { @@ -6746,13 +6736,15 @@ ProcXkbSetDebuggingFlags(ClientPtr client) xkbDebugFlags = newFlags; xkbDebugCtrls = newCtrls; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.currentFlags = newFlags; - rep.currentCtrls = newCtrls; - rep.supportedFlags = ~0; - rep.supportedCtrls = ~0; + rep = (xkbSetDebuggingFlagsReply) { + .type = X_Reply, + .sequenceNumber = client->sequence, + .length = 0, + .currentFlags = newFlags, + .currentCtrls = newCtrls, + .supportedFlags = ~0, + .supportedCtrls = ~0 + }; if (client->swapped) { swaps(&rep.sequenceNumber); swapl(&rep.currentFlags); @@ -6760,7 +6752,7 @@ ProcXkbSetDebuggingFlags(ClientPtr client) swapl(&rep.supportedFlags); swapl(&rep.supportedCtrls); } - WriteToClient(client, SIZEOF(xkbSetDebuggingFlagsReply), (char *) &rep); + WriteToClient(client, SIZEOF(xkbSetDebuggingFlagsReply), &rep); return Success; } diff --git a/xserver/xkb/xkb.h b/xserver/xkb/xkb.h index a526356a9..f3a60af6b 100644 --- a/xserver/xkb/xkb.h +++ b/xserver/xkb/xkb.h @@ -27,6 +27,4 @@ extern int ProcXkbGetKbdByName(ClientPtr client); extern int ProcXkbGetDeviceInfo(ClientPtr client); extern int ProcXkbSetDeviceInfo(ClientPtr client); extern int ProcXkbSetDebuggingFlags(ClientPtr client); - -extern void XkbExtensionInit(void); #endif diff --git a/xserver/xkb/xkbAccessX.c b/xserver/xkb/xkbAccessX.c index 765772bad..13051e034 100644 --- a/xserver/xkb/xkbAccessX.c +++ b/xserver/xkb/xkbAccessX.c @@ -281,29 +281,30 @@ AccessXStickyKeysTurnOff(DeviceIntPtr dev, xkbControlsNotify * pCN) static CARD32 AccessXKRGExpire(OsTimerPtr timer, CARD32 now, pointer arg) { - XkbSrvInfoPtr xkbi = ((DeviceIntPtr) arg)->key->xkbInfo; xkbControlsNotify cn; + DeviceIntPtr dev = arg; + XkbSrvInfoPtr xkbi = dev->key->xkbInfo; if (xkbi->krgTimerActive == _KRG_WARN_TIMER) { - XkbDDXAccessXBeep((DeviceIntPtr) arg, _BEEP_SLOW_WARN, - XkbStickyKeysMask); + XkbDDXAccessXBeep(dev, _BEEP_SLOW_WARN, XkbStickyKeysMask); xkbi->krgTimerActive = _KRG_TIMER; return 4000; } xkbi->krgTimerActive = _OFF_TIMER; - cn.keycode = 0; - cn.eventType = 0; + cn.keycode = xkbi->slowKeyEnableKey; + cn.eventType = KeyPress; cn.requestMajor = 0; cn.requestMinor = 0; if (xkbi->desc->ctrls->enabled_ctrls & XkbSlowKeysMask) { - AccessXKRGTurnOff((DeviceIntPtr) arg, &cn); + AccessXKRGTurnOff(dev, &cn); LogMessage(X_INFO, "XKB SlowKeys are disabled.\n"); } else { - AccessXKRGTurnOn((DeviceIntPtr) arg, XkbSlowKeysMask, &cn); + AccessXKRGTurnOn(dev, XkbSlowKeysMask, &cn); LogMessage(X_INFO, "XKB SlowKeys are now enabled. Hold shift to disable.\n"); } + xkbi->slowKeyEnableKey = 0; return 0; } @@ -462,6 +463,7 @@ AccessXFilterPressEvent(DeviceEvent *event, DeviceIntPtr keybd) if (ctrls->enabled_ctrls & XkbAccessXKeysMask) { /* check for magic sequences */ if ((sym[0] == XK_Shift_R) || (sym[0] == XK_Shift_L)) { + xkbi->slowKeyEnableKey = key; if (XkbAX_NeedFeedback(ctrls, XkbAX_SlowWarnFBMask)) { xkbi->krgTimerActive = _KRG_WARN_TIMER; xkbi->krgTimer = TimerSet(xkbi->krgTimer, 0, 4000, @@ -699,7 +701,6 @@ AccessXFilterReleaseEvent(DeviceEvent *event, DeviceIntPtr keybd) /* */ /************************************************************************/ extern int xkbDevicePrivateIndex; -extern void xkbUnwrapProc(DeviceIntPtr, DeviceHandleProc, pointer); void ProcessPointerEvent(InternalEvent *ev, DeviceIntPtr mouse) { @@ -710,7 +711,7 @@ ProcessPointerEvent(InternalEvent *ev, DeviceIntPtr mouse) xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(mouse); DeviceEvent *event = &ev->device_event; - dev = IsFloating(mouse) ? mouse : GetMaster(mouse, MASTER_KEYBOARD); + dev = (IsMaster(mouse) || IsFloating(mouse)) ? mouse : GetMaster(mouse, MASTER_KEYBOARD); if (dev && dev->key) { xkbi = dev->key->xkbInfo; @@ -722,23 +723,27 @@ ProcessPointerEvent(InternalEvent *ev, DeviceIntPtr mouse) changed |= XkbPointerButtonMask; } else if (event->type == ET_ButtonRelease) { - if (xkbi) { - xkbi->lockedPtrButtons &= ~(1 << (event->detail.key & 0x7)); + if (IsMaster(dev)) { + DeviceIntPtr source; + int rc; - if (IsMaster(dev)) { - DeviceIntPtr source; - int rc; + rc = dixLookupDevice(&source, event->sourceid, serverClient, + DixWriteAccess); + if (rc != Success) + ErrorF("[xkb] bad sourceid '%d' on button release event.\n", + event->sourceid); + else if (!IsXTestDevice(source, GetMaster(dev, MASTER_POINTER))) { + DeviceIntPtr xtest_device; - rc = dixLookupDevice(&source, event->sourceid, serverClient, - DixWriteAccess); - if (rc != Success) - ErrorF("[xkb] bad sourceid '%d' on button release event.\n", - event->sourceid); - else if (!IsXTestDevice(source, GetMaster(dev, MASTER_POINTER))) + xtest_device = GetXTestDevice(GetMaster(dev, MASTER_POINTER)); + if (button_is_down(xtest_device, ev->device_event.detail.button, BUTTON_PROCESSED)) XkbFakeDeviceButton(dev, FALSE, event->detail.key); } } + if (xkbi) + xkbi->lockedPtrButtons &= ~(1 << (event->detail.key & 0x7)); + changed |= XkbPointerButtonMask; } diff --git a/xserver/xkb/xkbActions.c b/xserver/xkb/xkbActions.c index 5ec1ed5c6..416de925d 100644 --- a/xserver/xkb/xkbActions.c +++ b/xserver/xkb/xkbActions.c @@ -47,7 +47,6 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. DevPrivateKeyRec xkbDevicePrivateKeyRec; -void XkbFakeDeviceButton(DeviceIntPtr dev, Bool press, int button); static void XkbFakePointerMotion(DeviceIntPtr dev, unsigned flags, int x, int y); @@ -748,6 +747,15 @@ _XkbFilterActionMessage(XkbSrvInfoPtr xkbi, XkbMessageAction *pMsg; DeviceIntPtr kbd; + if ((filter->keycode != 0) && (filter->keycode != keycode)) + return 1; + + /* This can happen if the key repeats, and the state (modifiers or group) + changes meanwhile. */ + if ((filter->keycode == keycode) && pAction && + (pAction->type != XkbSA_ActionMessage)) + return 1; + kbd = xkbi->device; if (filter->keycode == 0) { /* initial press */ pMsg = &pAction->msg; @@ -775,20 +783,27 @@ _XkbFilterActionMessage(XkbSrvInfoPtr xkbi, } else if (filter->keycode == keycode) { pMsg = &filter->upAction.msg; - if (pMsg->flags & XkbSA_MessageOnRelease) { - xkbActionMessage msg; + if (pAction == NULL) { + if (pMsg->flags & XkbSA_MessageOnRelease) { + xkbActionMessage msg; - msg.keycode = keycode; - msg.press = 0; - msg.keyEventFollows = - ((pMsg->flags & XkbSA_MessageGenKeyEvent) != 0); - memcpy((char *) msg.message, (char *) pMsg->message, - XkbActionMessageLength); - XkbSendActionMessage(kbd, &msg); + msg.keycode = keycode; + msg.press = 0; + msg.keyEventFollows = + ((pMsg->flags & XkbSA_MessageGenKeyEvent) != 0); + memcpy((char *) msg.message, (char *) pMsg->message, + XkbActionMessageLength); + XkbSendActionMessage(kbd, &msg); + } + filter->keycode = 0; + filter->active = 0; + return ((pMsg->flags & XkbSA_MessageGenKeyEvent) != 0); + } else if (memcmp(pMsg, pAction, 8) == 0) { + /* Repeat: If we send the same message, avoid multiple messages + on release from piling up. */ + filter->keycode = 0; + filter->active = 0; } - filter->keycode = 0; - filter->active = 0; - return ((pMsg->flags & XkbSA_MessageGenKeyEvent) != 0); } return 1; } @@ -804,15 +819,21 @@ _XkbFilterRedirectKey(XkbSrvInfoPtr xkbi, xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(xkbi->device); ProcessInputProc backupproc; + if ((filter->keycode != 0) && (filter->keycode != keycode)) + return 1; + + /* This can happen if the key repeats, and the state (modifiers or group) + changes meanwhile. */ + if ((filter->keycode == keycode) && pAction && + (pAction->type != XkbSA_RedirectKey)) + return 1; + /* never actually used uninitialised, but gcc isn't smart enough * to work that out. */ memset(&old, 0, sizeof(old)); memset(&old_prev, 0, sizeof(old_prev)); memset(&ev, 0, sizeof(ev)); - if ((filter->keycode != 0) && (filter->keycode != keycode)) - return 1; - GetSpritePosition(xkbi->device, &x, &y); ev.header = ET_Internal; ev.length = sizeof(DeviceEvent); @@ -871,49 +892,60 @@ _XkbFilterRedirectKey(XkbSrvInfoPtr xkbi, xkbi->state = old; xkbi->prev_state = old_prev; } + return 0; } - else if (filter->keycode == keycode) { + else { + /* If it is a key release, or we redirect to another key, release the + previous new_key. Otherwise, repeat. */ + ev.detail.key = filter->upAction.redirect.new_key; + if (pAction == NULL || ev.detail.key != pAction->redirect.new_key) { + ev.type = ET_KeyRelease; + filter->active = 0; + } + else { + ev.type = ET_KeyPress; + ev.key_repeat = TRUE; + } - ev.type = ET_KeyRelease; - ev.detail.key = filter->upAction.redirect.new_key; + mask = XkbSARedirectVModsMask(&filter->upAction.redirect); + mods = XkbSARedirectVMods(&filter->upAction.redirect); + if (mask) + XkbVirtualModsToReal(xkbi->desc, mask, &mask); + if (mods) + XkbVirtualModsToReal(xkbi->desc, mods, &mods); + mask |= filter->upAction.redirect.mods_mask; + mods |= filter->upAction.redirect.mods; - mask = XkbSARedirectVModsMask(&filter->upAction.redirect); - mods = XkbSARedirectVMods(&filter->upAction.redirect); - if (mask) - XkbVirtualModsToReal(xkbi->desc, mask, &mask); - if (mods) - XkbVirtualModsToReal(xkbi->desc, mods, &mods); - mask |= filter->upAction.redirect.mods_mask; - mods |= filter->upAction.redirect.mods; + if (mask || mods) { + old = xkbi->state; + old_prev = xkbi->prev_state; + xkbi->state.base_mods &= ~mask; + xkbi->state.base_mods |= (mods & mask); + xkbi->state.latched_mods &= ~mask; + xkbi->state.latched_mods |= (mods & mask); + xkbi->state.locked_mods &= ~mask; + xkbi->state.locked_mods |= (mods & mask); + XkbComputeDerivedState(xkbi); + xkbi->prev_state = xkbi->state; + } - if (mask || mods) { - old = xkbi->state; - old_prev = xkbi->prev_state; - xkbi->state.base_mods &= ~mask; - xkbi->state.base_mods |= (mods & mask); - xkbi->state.latched_mods &= ~mask; - xkbi->state.latched_mods |= (mods & mask); - xkbi->state.locked_mods &= ~mask; - xkbi->state.locked_mods |= (mods & mask); - XkbComputeDerivedState(xkbi); - xkbi->prev_state = xkbi->state; - } + UNWRAP_PROCESS_INPUT_PROC(xkbi->device, xkbPrivPtr, backupproc); + xkbi->device->public.processInputProc((InternalEvent *) &ev, + xkbi->device); + COND_WRAP_PROCESS_INPUT_PROC(xkbi->device, xkbPrivPtr, backupproc, + xkbUnwrapProc); - UNWRAP_PROCESS_INPUT_PROC(xkbi->device, xkbPrivPtr, backupproc); - xkbi->device->public.processInputProc((InternalEvent *) &ev, - xkbi->device); - COND_WRAP_PROCESS_INPUT_PROC(xkbi->device, xkbPrivPtr, backupproc, - xkbUnwrapProc); + if (mask || mods) { + xkbi->state = old; + xkbi->prev_state = old_prev; + } - if (mask || mods) { - xkbi->state = old; - xkbi->prev_state = old_prev; - } - - filter->keycode = 0; - filter->active = 0; + /* We return 1 in case we have sent a release event because the new_key + has changed. Then, subsequently, we will call this function again + with the same pAction, which will create the press for the new + new_key. */ + return (pAction && ev.detail.key != pAction->redirect.new_key); } - return 0; } static int diff --git a/xserver/xkb/xkbEvents.c b/xserver/xkb/xkbEvents.c index d49e4c1ba..87a4485eb 100644 --- a/xserver/xkb/xkbEvents.c +++ b/xserver/xkb/xkbEvents.c @@ -59,8 +59,6 @@ XkbSendLegacyMapNotify(DeviceIntPtr kbd, CARD16 xkb_event, CARD16 changed, int i; int keymap_changed = 0; int modmap_changed = 0; - xEvent core_mn; - deviceMappingNotify xi_mn; CARD32 time = GetTimeInMillis(); if (xkb_event == XkbNewKeyboardNotify) { @@ -78,11 +76,6 @@ XkbSendLegacyMapNotify(DeviceIntPtr kbd, CARD16 xkb_event, CARD16 changed, if (!keymap_changed && !modmap_changed) return; - core_mn.u.u.type = MappingNotify; - xi_mn.type = DeviceMappingNotify; - xi_mn.deviceid = kbd->id; - xi_mn.time = time; - /* 0 is serverClient. */ for (i = 1; i < currentMaxClients; i++) { if (!clients[i] || clients[i]->clientState != ClientStateRunning) @@ -106,6 +99,7 @@ XkbSendLegacyMapNotify(DeviceIntPtr kbd, CARD16 xkb_event, CARD16 changed, continue; if (keymap_changed) { + xEvent core_mn = { .u.u.type = MappingNotify }; core_mn.u.mappingNotify.request = MappingKeyboard; /* Clip the keycode range to what the client knows about, so it @@ -123,9 +117,12 @@ XkbSendLegacyMapNotify(DeviceIntPtr kbd, CARD16 xkb_event, CARD16 changed, WriteEventsToClient(clients[i], 1, &core_mn); } if (modmap_changed) { - core_mn.u.mappingNotify.request = MappingModifier; - core_mn.u.mappingNotify.firstKeyCode = 0; - core_mn.u.mappingNotify.count = 0; + xEvent core_mn = { + .u.mappingNotify.request = MappingModifier, + .u.mappingNotify.firstKeyCode = 0, + .u.mappingNotify.count = 0 + }; + core_mn.u.u.type = MappingNotify; WriteEventsToClient(clients[i], 1, &core_mn); } } @@ -134,16 +131,26 @@ XkbSendLegacyMapNotify(DeviceIntPtr kbd, CARD16 xkb_event, CARD16 changed, * here? Clients might be upset, but that seems better than the * alternative of stale keymaps. -ds */ if (keymap_changed) { - xi_mn.request = MappingKeyboard; - xi_mn.firstKeyCode = first_key; - xi_mn.count = num_keys; + deviceMappingNotify xi_mn = { + .type = DeviceMappingNotify, + .deviceid = kbd->id, + .request = MappingKeyboard, + .firstKeyCode = first_key, + .count = num_keys, + .time = time + }; SendEventToAllWindows(kbd, DeviceMappingNotifyMask, (xEvent *) &xi_mn, 1); } if (modmap_changed) { - xi_mn.request = MappingModifier; - xi_mn.firstKeyCode = 0; - xi_mn.count = 0; + deviceMappingNotify xi_mn = { + .type = DeviceMappingNotify, + .deviceid = kbd->id, + .request = MappingModifier, + .firstKeyCode = 0, + .count = 0, + .time = time + }; SendEventToAllWindows(kbd, DeviceMappingNotifyMask, (xEvent *) &xi_mn, 1); } @@ -243,7 +250,7 @@ XkbSendStateNotify(DeviceIntPtr kbd, xkbStateNotify * pSN) swaps(&pSN->changed); swaps(&pSN->ptrBtnState); } - WriteToClient(interest->client, sizeof(xEvent), (char *) pSN); + WriteToClient(interest->client, sizeof(xEvent), pSN); } interest = interest->next; } @@ -416,7 +423,7 @@ XkbSendControlsNotify(DeviceIntPtr kbd, xkbControlsNotify * pCN) swapl(&pCN->enabledControlChanges); swapl(&pCN->time); } - WriteToClient(interest->client, sizeof(xEvent), (char *) pCN); + WriteToClient(interest->client, sizeof(xEvent), pCN); } interest = interest->next; } @@ -463,7 +470,7 @@ XkbSendIndicatorNotify(DeviceIntPtr kbd, int xkbType, xkbIndicatorNotify * pEv) swapl(&pEv->changed); swapl(&pEv->state); } - WriteToClient(interest->client, sizeof(xEvent), (char *) pEv); + WriteToClient(interest->client, sizeof(xEvent), pEv); } interest = interest->next; } @@ -550,7 +557,7 @@ XkbHandleBell(BOOL force, swapl(&bn.name); swapl(&bn.window); } - WriteToClient(interest->client, sizeof(xEvent), (char *) &bn); + WriteToClient(interest->client, sizeof(xEvent), &bn); } interest = interest->next; } @@ -594,7 +601,7 @@ XkbSendAccessXNotify(DeviceIntPtr kbd, xkbAccessXNotify * pEv) swaps(&pEv->slowKeysDelay); swaps(&pEv->debounceDelay); } - WriteToClient(interest->client, sizeof(xEvent), (char *) pEv); + WriteToClient(interest->client, sizeof(xEvent), pEv); } interest = interest->next; } @@ -642,7 +649,7 @@ XkbSendNamesNotify(DeviceIntPtr kbd, xkbNamesNotify * pEv) swapl(&pEv->changedIndicators); swaps(&pEv->changedVirtualMods); } - WriteToClient(interest->client, sizeof(xEvent), (char *) pEv); + WriteToClient(interest->client, sizeof(xEvent), pEv); } interest = interest->next; } @@ -689,7 +696,7 @@ XkbSendCompatMapNotify(DeviceIntPtr kbd, xkbCompatMapNotify * pEv) swaps(&pEv->nSI); swaps(&pEv->nTotalSI); } - WriteToClient(interest->client, sizeof(xEvent), (char *) pEv); + WriteToClient(interest->client, sizeof(xEvent), pEv); } interest = interest->next; } @@ -732,7 +739,7 @@ XkbSendActionMessage(DeviceIntPtr kbd, xkbActionMessage * pEv) swaps(&pEv->sequenceNumber); swapl(&pEv->time); } - WriteToClient(interest->client, sizeof(xEvent), (char *) pEv); + WriteToClient(interest->client, sizeof(xEvent), pEv); } interest = interest->next; } @@ -786,7 +793,7 @@ XkbSendExtensionDeviceNotify(DeviceIntPtr dev, swaps(&pEv->reason); swaps(&pEv->supported); } - WriteToClient(interest->client, sizeof(xEvent), (char *) pEv); + WriteToClient(interest->client, sizeof(xEvent), pEv); } interest = interest->next; } diff --git a/xserver/xkb/xkbPrKeyEv.c b/xserver/xkb/xkbPrKeyEv.c index 32411838d..b24fd6cb7 100644 --- a/xserver/xkb/xkbPrKeyEv.c +++ b/xserver/xkb/xkbPrKeyEv.c @@ -104,13 +104,13 @@ XkbProcessKeyboardEvent(DeviceEvent *event, DeviceIntPtr keybd) return; } if (rg->currentDown != 0) { - int key = event->detail.key; + int tmpkey = event->detail.key; event->type = ET_KeyRelease; event->detail.key = rg->currentDown; XkbHandleActions(keybd, keybd, event); event->type = ET_KeyPress; - event->detail.key = key; + event->detail.key = tmpkey; } rg->currentDown = key; } diff --git a/xserver/xkb/xkbUtils.c b/xserver/xkb/xkbUtils.c index c23cd7784..6c6af60f0 100644 --- a/xserver/xkb/xkbUtils.c +++ b/xserver/xkb/xkbUtils.c @@ -642,6 +642,7 @@ XkbComputeCompatState(XkbSrvInfoPtr xkbi) CARD16 grp_mask; XkbStatePtr state = &xkbi->state; XkbCompatMapPtr map; + XkbControlsPtr ctrls; if (!state || !xkbi->desc || !xkbi->desc->ctrls || !xkbi->desc->compat) return; @@ -650,9 +651,14 @@ XkbComputeCompatState(XkbSrvInfoPtr xkbi) grp_mask = map->groups[state->group].mask; state->compat_state = state->mods | grp_mask; state->compat_lookup_mods = state->lookup_mods | grp_mask; + ctrls= xkbi->desc->ctrls; - if (xkbi->desc->ctrls->enabled_ctrls & XkbIgnoreGroupLockMask) - grp_mask = map->groups[state->base_group].mask; + if (ctrls->enabled_ctrls & XkbIgnoreGroupLockMask) { + unsigned char grp = state->base_group+state->latched_group; + if (grp >= ctrls->num_groups) + grp = XkbAdjustGroup(XkbCharToInt(grp), ctrls); + grp_mask = map->groups[grp].mask; + } state->compat_grab_mods = state->grab_mods | grp_mask; return; } diff --git a/xserver/xkb/xkbgeom.h b/xserver/xkb/xkbgeom.h index bef3775db..1999f5c71 100644 --- a/xserver/xkb/xkbgeom.h +++ b/xserver/xkb/xkbgeom.h @@ -41,28 +41,11 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #define XkbAddGeomRow SrvXkbAddGeomRow #define XkbAddGeomSection SrvXkbAddGeomSection #define XkbAddGeomShape SrvXkbAddGeomShape -#define XkbAllocGeomKeyAliases SrvXkbAllocGeomKeyAliases -#define XkbAllocGeomColors SrvXkbAllocGeomColors -#define XkbAllocGeomDoodads SrvXkbAllocGeomDoodads -#define XkbAllocGeomKeys SrvXkbAllocGeomKeys -#define XkbAllocGeomOutlines SrvXkbAllocGeomOutlines -#define XkbAllocGeomPoints SrvXkbAllocGeomPoints -#define XkbAllocGeomProps SrvXkbAllocGeomProps -#define XkbAllocGeomRows SrvXkbAllocGeomRows -#define XkbAllocGeomSectionDoodads SrvXkbAllocGeomSectionDoodads -#define XkbAllocGeomSections SrvXkbAllocGeomSections -#define XkbAllocGeomOverlays SrvXkbAllocGeomOverlays -#define XkbAllocGeomOverlayRows SrvXkbAllocGeomOverlayRows -#define XkbAllocGeomOverlayKeys SrvXkbAllocGeomOverlayKeys -#define XkbAllocGeomShapes SrvXkbAllocGeomShapes #define XkbAllocGeometry SrvXkbAllocGeometry #define XkbFreeGeomKeyAliases SrvXkbFreeGeomKeyAliases #define XkbFreeGeomColors SrvXkbFreeGeomColors #define XkbFreeGeomDoodads SrvXkbFreeGeomDoodads #define XkbFreeGeomProperties SrvXkbFreeGeomProperties -#define XkbFreeGeomOverlayKeys SrvXkbFreeGeomOverlayKeys -#define XkbFreeGeomOverlayRows SrvXkbFreeGeomOverlayRows -#define XkbFreeGeomOverlays SrvXkbFreeGeomOverlays #define XkbFreeGeomKeys SrvXkbFreeGeomKeys #define XkbFreeGeomRows SrvXkbFreeGeomRows #define XkbFreeGeomSections SrvXkbFreeGeomSections diff --git a/xserver/xkb/xkbout.c b/xserver/xkb/xkbout.c index cd1ae0b4e..7bb6ceafe 100644 --- a/xserver/xkb/xkbout.c +++ b/xserver/xkb/xkbout.c @@ -522,7 +522,7 @@ XkbWriteXKBSymbols(FILE * file, for (s = 0; s < XkbKeyGroupWidth(xkb, i, g); s++) { if (s != 0) fprintf(file, ", "); - WriteXKBAction(file, xkb, (XkbAnyAction *) & acts[s]); + WriteXKBAction(file, xkb, (XkbAnyAction *) &acts[s]); } fprintf(file, " ]"); acts += XkbKeyGroupsWidth(xkb, i); diff --git a/xserver/xkb/xkbtext.c b/xserver/xkb/xkbtext.c index f66a08f75..08b129fe6 100644 --- a/xserver/xkb/xkbtext.c +++ b/xserver/xkb/xkbtext.c @@ -6,19 +6,19 @@ fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting - documentation, and that the name of Silicon Graphics not be - used in advertising or publicity pertaining to distribution + documentation, and that the name of Silicon Graphics not be + used in advertising or publicity pertaining to distribution of the software without specific prior written permission. - Silicon Graphics makes no representation about the suitability + Silicon Graphics makes no representation about the suitability of this software for any purpose. It is provided "as is" without any express or implied warranty. - - SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS - SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + + SILICON GRAPHICS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON - GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL - DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + GRAPHICS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL + DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. @@ -144,18 +144,18 @@ char * XkbVModMaskText(XkbDescPtr xkb, unsigned modMask, unsigned mask, unsigned format) { - register int i, bit; - int len; - char *mm, *rtrn; - char *str, buf[BUFFER_SIZE]; +register int i,bit; +int len; +char *mm,*rtrn; +char *str,buf[BUFFER_SIZE]; - if ((modMask == 0) && (mask == 0)) { - rtrn = tbGetBuffer(5); - if (format == XkbCFile) - sprintf(rtrn, "0"); - else - sprintf(rtrn, "none"); - return rtrn; +if ((modMask == 0) && (mask == 0)) { + rtrn = tbGetBuffer(5); + if (format == XkbCFile) + snprintf(rtrn, 5, "0"); + else + snprintf(rtrn, 5, "none"); + return rtrn; } if (modMask != 0) mm = XkbModMaskText(modMask, format); @@ -165,38 +165,36 @@ XkbVModMaskText(XkbDescPtr xkb, str = buf; buf[0] = '\0'; if (mask) { - char *tmp; - - for (i = 0, bit = 1; i < XkbNumVirtualMods; i++, bit <<= 1) { - if (mask & bit) { - tmp = XkbVModIndexText(xkb, i, format); - len = strlen(tmp) + 1 + (str == buf ? 0 : 1); - if (format == XkbCFile) - len += 4; - if ((str - (buf + len)) <= BUFFER_SIZE) { - if (str != buf) { - if (format == XkbCFile) + char *tmp; + for (i = 0, bit = 1; i < XkbNumVirtualMods; i++, bit <<= 1) { + if (mask&bit) { + tmp = XkbVModIndexText(xkb, i, format); + len = strlen(tmp) + 1 + (str == buf ? 0 : 1); + if (format == XkbCFile) + len += 4; + if ((str - (buf + len)) <= BUFFER_SIZE) { + if (str != buf) { + if (format == XkbCFile) *str++ = '|'; - else + else *str++ = '+'; - len--; - } - } - if (format == XkbCFile) - sprintf(str, "%sMask", tmp); - else + len--; + } + } + if (format == XkbCFile) + snprintf(str, BUFFER_SIZE - len, "%sMask", tmp); + else strcpy(str, tmp); - str = &str[len - 1]; - } - } - str = buf; + str = &str[len-1]; + } + } + str = buf; } - else - str = NULL; + else str = NULL; if (mm) - len = strlen(mm); + len = strlen(mm); else - len = 0; + len= 0; if (str) len += strlen(str) + (mm == NULL ? 0 : 1); if (len >= BUFFER_SIZE) @@ -1266,7 +1264,6 @@ XkbBehaviorText(XkbDescPtr xkb, XkbBehavior * behavior, unsigned format) } else if (type == XkbKB_RadioGroup) { int g; - char *tmp; g = ((behavior->data) & (~XkbKB_RGAllowNone)) + 1; if (XkbKB_RGAllowNone & behavior->data) { diff --git a/xserver/xkb/xkmread.c b/xserver/xkb/xkmread.c index 45da965dc..258bb91b5 100644 --- a/xserver/xkb/xkmread.c +++ b/xserver/xkb/xkmread.c @@ -772,8 +772,6 @@ ReadXkmSymbols(FILE * file, XkbDescPtr xkb) memset((char *) typeName, 0, XkbNumKbdGroups * sizeof(Atom)); memset((char *) type, 0, XkbNumKbdGroups * sizeof(XkbKeyTypePtr)); if (wireMap.flags & XkmKeyHasTypes) { - register int g; - for (g = 0; g < XkbNumKbdGroups; g++) { if ((wireMap.flags & (1 << g)) && ((tmp = XkmGetCountedString(file, buf, 100)) > 0)) { diff --git a/xserver/xorg-server.m4 b/xserver/xorg-server.m4 index bdecf6227..18255b91a 100644 --- a/xserver/xorg-server.m4 +++ b/xserver/xorg-server.m4 @@ -23,10 +23,10 @@ dnl other dealings in this Software without prior written authorization dnl from the copyright holders. dnl -# XORG_DRIVER_CHECK_EXT() +# XORG_DRIVER_CHECK_EXT(MACRO, PROTO) # -------------------------- -# Checks for the $1 define in xorg-server.h (from the sdk). If it -# is defined, then add $1 to $REQUIRED_MODULES. +# Checks for the MACRO define in xorg-server.h (from the sdk). If it +# is defined, then add the given PROTO to $REQUIRED_MODULES. AC_DEFUN([XORG_DRIVER_CHECK_EXT],[ AC_REQUIRE([PKG_PROG_PKG_CONFIG]) diff --git a/xserver/xorg-server.pc.in b/xserver/xorg-server.pc.in index a98eca8f9..1de1c6c50 100644 --- a/xserver/xorg-server.pc.in +++ b/xserver/xorg-server.pc.in @@ -17,4 +17,4 @@ Description: Modular X.Org X Server Version: @PACKAGE_VERSION@ Requires.private: @SDK_REQUIRED_MODULES@ Cflags: -I${sdkdir} @symbol_visibility@ -Libs: -L${libdir} +Libs: -L${libdir} @XORG_DRIVER_LIBS@